AWS: Billing

AWS: Billing AWS アカウントを作ったら最初にやるべきこと ~令和元年版~ AWS アカウントを取得したら速攻でやっておくべき初期設定まとめ AWS アカウント作成時にやるべきこと 無駄なコストを省こう!AWS で消し忘れを防止するためにチェックすべき7つのポイント

2024年4月8日 · 1 分

Terraform: Import

Terrafrom Import ドメイン認証 1 # env $(cat ../.env|xargs) terraform -chdir=prod import 'module.ses.aws_route53_record.domain_identity["yourdomain.com"]' Z01825913VYOI2NNQZL0A__amazonses.yourdomain.com_TXT S3 1 2 3 export RES=module.s3_backup.aws_s3_bucket.this export BUCKET=mybucket-prod env $(cat ../.env|xargs) terraform -chdir=prod import $RES $BUKET

2024年1月7日 · 1 分

redis

Elasic Cache for Redis バージョン 1 2 3 4 5 $ redis-cli --version redis-cli 5.0.7 $ redis-server -v Redis server v=5.0.7 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=66bd629f924ac924 接続: 1 REDIS_URL=redis://mycloud-stage-redis-nc.sigrvp.ng.0001.apne1.cache.amazonaws.com:6379/0 1 2 3 $ export $(cat .env|xargs) $ redis-cli -u $REDIS_URL PING PONG Python redis-py: https://github.com/redis/redis-py django-redis: https://github.com/jazzband/django-redis channels_redis: https://github.com/django/channels_redis クラスターモードへの接続 Cluster Client 1 2 3 4 5 6 7 8 9 import logging from redis.cluster import RedisCluster ENDPOINT = "mycloud-stage-redis-test.sigrvp.clustercfg.apne1.cache.amazonaws.com" logging.basicConfig(level=logging.INFO) redis = RedisCluster(host=ENDPOINT, port="6379") if redis.ping(): logging.info("Connected to Redis") django-redis: ...

2023年7月14日 · 1 分

jupyter: Django

Jupyter: Django 準備 django_extensions , notebookを入れておく settgins.py: 1 INSTALLED_APPS += ['django_extensions'] VSCode VSCodeでJupyterのPythonランタイムを選んでから以下を実行する 環境変数で、DJANGO_ALLOW_ASYNC_UNSAFE=true をセットしておく(.envとか) 1 2 3 4 5 6 import sys, os, django BASE_DIR = "path_ot_manage_py" sys.path.insert(0, BASE_DIR) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings") django.setup() リモートサーバー autossh でポートフォワード PCの 8.8.8.8 -> リモート(EC2とか)の 8.8.8.8 にフォワードする: 1 autossh -M 0 -F .secrets/ssh.ec2.conf server -N -L 8888:localhost:8888 -4 カーネル起動 1 DJANGO_ALLOW_ASYNC_UNSAFE=true python manage.py shell_plus --notebook URLが表示されるので、ブラウザでアクセスする ...

2023年5月5日 · 1 分

macOS: ls: .: Operation not permitted

macOS: ls: .: Operation not permitted このエラーは、macOSのセキュリティ機能によって、ターミナルのコマンドが特定のディレクトリに対して制限されている可能性があります¹²。例えば、DownloadsやDocumentsなどのディレクトリは、プライバシー保護のためにアクセス権が制限されています²。 この場合、システム環境設定から、ターミナルに対してフルディスクアクセスを許可する必要があります¹²。具体的な手順は以下の通りです。 システム環境設定を開きます。 セキュリティとプライバシーを選択します。 プライバシータブをクリックします。 左側のメニューからフルディスクアクセスを選択します。 鍵のアイコンをクリックしてロックを解除します。 パスワードを入力します。 +ボタンをクリックしてターミナルを追加します。 ターミナルを再起動します。 これで、lsコマンドなどが正常に動作するはずです。試してみてください。 ソース: Bing との会話 2023/5/3 (1) macOS の「Operation not permitted」を回避する【du/ls/mv/cp …. https://qiita.com/KEINOS/items/0366f1c281b574a79cfb. (2) ターミナルでコマンド実行時に「Operation not permitted」が出 …. https://qiita.com/Tatsu88/items/f50f850b0c8f4a2c1bf2. (3) unix - ls: Operation not Permitted - Stack Overflow. https://stackoverflow.com/questions/25717501/ls-operation-not-permitted. (4) 突然の「Operation not permitted」-Dockerが採用する …. https://www.creationline.com/lab/46861. 設定 > プライバシーとセキュリティ > フルディスクアクセス

2023年5月2日 · 1 分

AWS CodeWhisperer & IAM Identity Center

AWS CodeWhisperer & IAM Identity Center CodeWhisperer IAM Identity Center: IAM Identity Centerを有効にする ユーザーを追加する ユーザーのメアド認証 パスワードリセットをメアドに送り、パスワード設定してログイン可能にする CodeWhisperer: Codewhiper の利用を開始する CodeWhispererを IAM Identity Centerのアプリケーションに登録する IAM Identity Centerで登録したユーザーを CodeWhispererで使えるようにする VSCode: AWS Toolkit プラグインを入れる CodeWhisperer の利用を開始:Connect using AWS Identity Center で AWS Identity Center URLを入力 (https://x-xxxxxxx.awsapps.com/start) AWS Toolkitにアクセストークンを取得( 認証コードをブラウザに入力して、IAM Identity Centerにログイン) 資料 AWS IAM Identity CenterでIAMアカウントを統一する AWS IAM Identity Center(旧:AWS SSO)を使ってみた Amazon CodeWhisperer を IAM Identity Center に統合させて使ってみた

2023年4月15日 · 1 分

PowerShell

PowerShell 実行権限 WindowsでPowerShellスクリプトの実行セキュリティポリシーを変更する PS C:\WINDOWS\system32> Get-ExecutionPolicy RemoteSigned PS C:\WINDOWS\system32> Set-ExecutionPolicy Unrestricted Set-ExecutionPolicy : Windows PowerShell により実行ポリシーは正常に更新されましたが、設定は範囲がより明確に定義されたポリシーで上書きされました。この上書きにより、シェルで現在有効な実行ポリシー RemoteSigned が保持されます。 実行ポリシーの設定を表示するには、「Get-ExecutionPolicy -List」と入力してください。詳細については、"Get-Help Set-ExecutionPolicy" を参照してください。 発生場所 行:1 文字:1 + Set-ExecutionPolicy Unrestricted + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (:) [Set-ExecutionPolicy], SecurityException + FullyQualifiedErrorId : ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand PS C:\WINDOWS\system32> Get-ExecutionPolicy -List Scope ExecutionPolicy ----- --------------- MachinePolicy Undefined UserPolicy Undefined Process Undefined CurrentUser RemoteSigned LocalMachine Unrestricted How successfully change Execution policy and enable execution of Powershell scripts ...

2015年8月1日 · 1 分

Browser Hijacker

Delta Homes系の対応 WindowsMangerProtect 1 2 3 4 C:\WINDOWS\system32>sc delete WindowsMangerProtect [SC] DeleteService SUCCESS C:\WINDOWS\system32>rmdir /S /Q "C:\ProgramData\WindowsMangerProtect" IHProtect Service 1 2 3 4 5 6 7 8 9 C:\WINDOWS\system32>sc delete "IHProtect Service" [SC] DeleteService SUCCESS C:\WINDOWS\system32>rmdir /S /Q "C:\Program Files (x86)\MiuiTab" C:\Program Files (x86)\MiuiTab\msvcp110.dll - アクセスが拒否されました。 C:\Program Files (x86)\MiuiTab\msvcr110.dll - アクセスが拒否されました。 C:\Program Files (x86)\MiuiTab\ProtectService.exe - アクセスが拒否されました。 C:\WINDOWS\system32>rmdir /S /Q "C:\Program Files (x86)\MiuiTab"

2015年7月22日 · 1 分