## Cognite(MAU=5,000) Show calculations

Cognite(MAU=5,000) Show calculations MAU = 5,000 Unit conversions Percent of monthly users who sign in through SAML or OIDC federation: 10 / 100 = 0.1 Pricing calculations SAML or OIDC federation cost (monthly) 5,000 MAUs x 0.10 SAML or OIDC federation requests = 500.00 SAML or OIDC federation MAU requests 500.00 SAML or OIDC federation MAUs - 50 free SAML or OIDC federation MAU requests per month = 450.00 billable SAML or OIDC federation MAU requests Max (450.00 billable SAML or OIDC federation MAU requests, 0 minimum billable SAML or OIDC federation MAU requests) = 450 total billable SAML or OIDC federation MAU requests 450 MAUs x 0.015 USD = 6.75 USD (SAML or OIDC federation MAU requests) SAML or OIDC federation cost (monthly): 6.75 USD User Pool MAU cost (monthly) 5,000 MAUs - 50000 free MAU requests per month = -45,000.00 billable MAU requests Max (-45000.000000 billable MAU requests, 0 Constant Unit) = 0.00 total billable MAU requests Tiered price for: 0.00 MAUs Total tier cost = 0.00 USD (User Pool MAUs) User Pool MAU cost (monthly): 0.00 USD Advanced security feature cost (monthly) 5,000 MAUs x 1 Advanced security features option enabled = 5,000.00 Advanced security feature MAUs Tiered price for: 5000.00 MAUs 5000 MAUs x 0.0500000000 USD = 250.00 USD Total tier cost = 250.00 USD (ASF MAUs) Advanced security feature cost (monthly): 250 USD Cognito MAU cost (monthly) 250 USD + 6.75 USD = 256.75 USD Cognito MAU cost (monthly): 256.75 USD

2023年5月8日 · 2 分

AWS Connect CCP

AWS Connect: CCP(Contact Control Panel) Contact Control Panel とは、Amazon Connect 問い合わせコントロールパネル (CCP) を使用して問い合わせと通信するための GUI の機能です ²。 エージェントが CCP にアクセスし、問い合わせを処理できるようになる前に、行わなければならない操作がいくつかあります ³。 ご参考になれば幸いです。 ソース: Bing との会話 2023/5/8 (1) 問い合わせコントロールパネルへのアクセスを提供する - Amazon …. https://docs.aws.amazon.com/ja_jp/connect/latest/adminguide/amazon-connect-contact-control-panel.html. (2) Provide access to the Contact Control Panel - Amazon Connect. https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-contact-control-panel.html. (3) 【Amazon Connect】在宅コールセンター向けに CCP(発着信 …. https://qiita.com/duplicate1984/items/3a4d93a2e9bb5fcf54d1. 資料: Amazon Connect とは? 導入前に知っておきたい機能・料金・注意点と事例 Google ログイン AWS Connect に Google ユーザーを紐付けることは可能です。 ただし、紐付ける前に、AWS Cognito 単体で、ユーザ ID のサインアップ(ユーザ登録)・サインイン(ログイン)ができるようにする必要があります ³。 また、外部で認証されたユーザー(ID フェデレーション)へのアクセス権限を付与することもできます ¹。 ご参考になれば幸いです。 ソース: Bing との会話 2023/5/8 ...

2023年5月8日 · 1 分

autossh

autossh autossh は、ssh 接続が切断された場合に自動的に再接続してくれるプログラムです。 autossh を使用すると、ssh サービスを開始し、監視することができます。 プログラムの問題やネットワークの問題が発生した場合、ssh サービスを再起動できます。¹²³ 以下のように使用します。 1 autossh -M 0 -N -f -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -R 8080:localhost:80 user@remote_host この例では、リモートホスト上でポート 8080 を開き、ローカルホストのポート 80 に転送します。⁴ ソース: Bing との会話 2023/5/5 (1) 用 autossh 工具进行端口转发 - 腾讯云开发者社区-腾讯云. https://cloud.tencent.com/developer/article/1836005. (2) autossh 工具进行端口转发 - 简书. https://www.jianshu.com/p/ae2cd8d9a368. (3) 用 autossh 工具进行端口转发 | Escape. https://www.escapelife.site/posts/e6647650.html. (4) ssh 接続を維持し続ける autossh の使い方 – ぺけみさお - xmisao. https://www.xmisao.com/2013/07/16/autossh-how-to.html. (5) CentOS で autossh を systemd service として動かす - Qiita. https://qiita.com/sandopan65/items/e21bdf710ac70f691e21. (6) autossh と ssh ポートフォワードでルータ内のマシンにアクセスする …. https://qiita.com/wf9a5m75/items/a78262532ac4823104f0. ポートフォワード (-L, -R, -D) -L : ローカル -> リモート -R : リモート -> ローカル -D : ダイナミック(SOCKS) -N -N オプションは、ssh 接続を開始して、リモートシェルを実行しないようにします。¹²³ ...

2023年5月5日 · 2 分

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 分

redis

redis Ubuntu 1 sudo apt update && sudo apt install redis-server -y 1 2 $ ps ax | grep redis 1083463 ? Ssl 0:00 /usr/bin/redis-server 127.0.0.1:6379 redis-cli redis-cliコマンドでデータベース1に接続するには、次のように入力します。¹² redis-cli -n 1 このコマンドは、データベース1に接続するためのものです。-nオプションを使用して、データベース番号を指定します。 上記の例では、データベース番号が1であることを示しています。 ソース: Bing との会話 2023/5/5 (1) redis-cliの接続時によく使うコマンド使い方メモ - Qiita. https://qiita.com/a-nishimura/items/54b0d85dbce47685a36f. (2) 【入門】Redis - Qiita. https://qiita.com/wind-up-bird/items/f2d41d08e86789322c71. (3) redis-cliの使い方 - Qiita. https://qiita.com/sawada_masahiko/items/1f60936c421ecab8dfbf. (4) redis-cliでよく使うコマンド20選 - Qiita. https://qiita.com/hatsu/items/a52817364160e0b6bb60. (5) Redisコマンド一覧 - Qiita. https://qiita.com/taiba/items/18016906d80c13e88853. (6) リモート環境にあるRedisに接続する - 箱のプログラミング日記。. https://www.y-hakopro.com/entry/2020/10/31/185235. Django 1 poetry add django-redis settings.py: ...

2023年5月5日 · 1 分

djang-mptt: tree 構造で export する

django-mptt: Tree モデルを エクスポート mptt_tags テンプレートライブラリ の recursetree / endrecursetree タグを使う profiles/templates/profile/workgroup/tree.json: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 {% load mptt_tags %} [ {% recursetree nodes %} { "id": "{{ node.id }}", "code": "{{ node.code|default:''}}", "name": "{{ node.name }}", "path": "{{ node.path }}", "full_name": "{{ node.full_name }}", "data": {}, "children": [{{ children }}] }{% if node.get_next_sibling %},{% endif %} {% endrecursetree %} ] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 from django.template import engines, loader from django.utils.safestring import mark_safe from django.db.models import QuerySet def render(src, request=None, engine_name="django", safe=True, **ctx): text = engines[engine_name].from_string(src).render(ctx, request=request) return safe and mark_safe(text) or text def render_by(name, request=None, safe=True, **ctx): t = loader.get_template(name) text = t.render(ctx, request=request) return safe and mark_safe(text) or text def export_trees(nodes, model_class=None, template_name=None, request=None, safe=True, **ctx): if not model_class and isinstance(nodes, QuerySet): model_class = nodes.model if not template_name and model_class: template_name = f"{model_class._meta.app_label}/{model_class._meta.model_name}/tree.json" if not template_name: return "" return render_by(template_name, request=request, safe=safe, nodes=nodes, **ctx) 1 2 3 4 5 6 7 8 @main.command() @click.argument("path") @click.pass_context def workgroup_export(ctx, path): """ Workgroup Export """ nodes = models.Workgroup.objects.all() print(export_trees(nodes))

2023年5月4日 · 1 分

Django: SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async

Jupyter: Django: SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async このエラーは、asyncコンテキストから同期的なコードを呼び出そうとした場合に発生するエラーです。 async-unsafeなコードを呼び出す場合は、asyncコンテキストからではなく、自分自身の同期関数で書き、それをasgiref.sync.syncを使用して呼び出すように修正する必要があります¹。 ¹: Django: SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async. - Stack Overflow ソース: Bing との会話 2023/5/4 (1) Django: SynchronousOnlyOperation: You cannot call this …. https://stackoverflow.com/questions/61926359/django-synchronousonlyoperation-you-cannot-call-this-from-an-async-context-u. (2) django.core.exceptions.SynchronousOnlyOperation after …. https://github.com/django/channels/issues/1464. (3) python - Django channels Async Websocket throwing Error …. https://stackoverflow.com/questions/63892884/django-channels-async-websocket-throwing-error-while-trying-to-use-database-quer. (4) Django channel occasionally gets error “cannot call this from …. https://stackoverflow.com/questions/69239657/django-channel-occasionally-gets-error-cannot-call-this-from-an-async-context. (5) python - Getting SynchronousOnlyOperation error Even after …. https://stackoverflow.com/questions/63149616/getting-synchronousonlyoperation-error-even-after-using-sync-to-async-in-django. DJANGO_ALLOW_ASYNC_UNSAFE 環境変数を使用することで、非同期コンテキストで SynchronousOnlyOperation エラーが発生した場合に警告を無効にすることができます¹。 ...

2023年5月4日 · 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 分

factory_boy: SubFactory

factory_boy: SubFuctory で ForeignKeyフィールドを初期化する factory_boy はテストデータを簡単に作るためのライブラリです²。ForeignKey フィールドのインスタンスのデフォルトを定義するには、SubFactory を使う方法があります¹⁴。例えば、以下のように書けます。 1 2 3 4 5 6 7 8 class PhoneContactFactory(factory.django.DjangoModelFactory): class Meta: model = models.PhoneContact class CoopFactory(factory.django.DjangoModelFactory): class Meta: model = models.Coop phone = factory.SubFactory(PhoneContactFactory) この場合、CoopFactory を使って Coop インスタンスを作ると、PhoneContactFactory も使って PhoneContact インスタンスを作り、そのインスタンスを Coop の phone フィールドにセットします。 もしくは、SelfAttribute を使う方法もあります⁴。例えば、以下のように書けます。 1 2 3 4 5 6 7 8 class SubtitlesFactory(factory.django.DjangoModelFactory): class Meta: model = models.Subtitles class RecordingFactory(factory.django.DjangoModelFactory): class Meta: model = models.Recording subtitles = factory.SubFactory(SubtitlesFactory, language=factory.SelfAttribute('..language')) この場合、RecordingFactory を使って Recording インスタンスを作るときに language パラメータを指定すると、その値が SubtitlesFactory の language パラメータにも渡されます。 ...

2023年4月30日 · 2 分

DRF: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list

DRF: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list ViewSetの queryset で order_by を明示的に指定すること I see. Django REST framework also supports pagination for large result sets, but you need to specify a default pagination class and a page size in your settings.py file¹. Alternatively, you can set the pagination_class attribute for each viewset individually⁴. However, you still need to order your queryset by some field, otherwise you will get the same warning as before²³. You can use the order_by method on your queryset or the ordering attribute on your viewset¹. For example: ...

2023年4月29日 · 1 分