AWS 㨠GCP 㨠Azure ã®ã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªï¼Pythonï¼ã®ããã¥ã¡ã³ãã®ããã
æ¯åè¿·åã«ãªãã®ã§ã¾ã¨ãã¨ãã¾ãã
AWS
æ¦è¦
ã®ä¸ã«ãé«ã¬ãã«ã® Resource 㨠ä½ã¬ãã«ã® Client ãããã¾ãã
ãã¹ã¦ã®ãµã¼ãã¹ã§ Resource ãå®è£
ããã¦ããããã§ã¯ãªãã®ã§ãçµ±ä¸æ§ãæ±ãã¦å人çã«ã¯ Client ã使ã£ã¦ãã¾ããã§ããResource 㯠Collection ã® all()ï¼ec2.instances.all()ï¼ã filter() ãå¼ã¶ã¨ã¤ãã¬ã¼ã¿ãè¿ã£ã¦ãã¦ãããã for ã§åãã°ããã®ã§ãã¡ãã¡ paginator ã®å¦çãæ¸ããªãã¦ããã®ã¯ä¾¿å©ã§ããã
Resource
- ãªãã¡ã¬ã³ã¹
- https://boto3.amazonaws.com/v1/documentation/api/latest/index.html#api-reference
- 使ããããµã¼ãã¹ãæ¢ãã¦ããã®ä¸ã«
Resourcesã®ãªã³ã¯ãããã°å®è£ ããã¦ãã¾ããããã«ãªããã°å®è£ ããã¦ã¾ããããã¨ãããã¨ãªã®ã§Clientã使ãã¾ãããã - ã¤ã³ã¹ã¿ã³ã¹ãªã©ã®ä¸è¦§ãå¾ãã¨ãã«ä½¿ã Collection ã®ããã¥ã¡ã³ãã¯ã
Resourcesã®ãªã³ã¯ã®å ã®Service Resourceã®ãªã³ã¯ã®å ã«ããã¾ãã
- 使ããããµã¼ãã¹ãæ¢ãã¦ããã®ä¸ã«
- https://boto3.amazonaws.com/v1/documentation/api/latest/index.html#api-reference
- ãµã³ãã«ã³ã¼ã
- Resource ã Action ã®ãã¼ã¸ã«ã³ã¼ãçãæ²è¼ããã¦ããã®ã§ããããåèã«ããã¨ããã§ãã
Client
- ãªãã¡ã¬ã³ã¹
- https://boto3.amazonaws.com/v1/documentation/api/latest/index.html#api-reference
- 使ããããµã¼ãã¹ãæ¢ãã¦ããã®ä¸ã®
Clientã®ãªã³ã¯ããªãã¡ã¬ã³ã¹ã§ãã
- 使ããããµã¼ãã¹ãæ¢ãã¦ããã®ä¸ã®
- https://boto3.amazonaws.com/v1/documentation/api/latest/index.html#api-reference
- ãµã³ãã«ã³ã¼ã
- Client ããã®ã¡ã½ããã®ãã¼ã¸ã«ã³ã¼ãçãæ²è¼ããã¦ããã®ã§ããããåèã«ããã¨ããã§ãã
tips
ããããã®ã¢ã«ã¦ã³ãã§ãªã«ãããã
ããããã®ã¢ã«ã¦ã³ãã§ãªã«ããããã¨ãã«ãããããã®ã¢ã«ã¦ã³ãã®ã¯ã¬ãã³ã·ã£ã«ãç¨æããã®ã¯ããã¸ããªã®ã§ãOrganizations ãå°å ¥ãã¦ããã®ãåæã§ãããassume role ã使ãã¨ããã§ãã
ãããªæãã®ãç¨æãã¦ã
def assumed_session( *, management_session: boto3.session.Session, assumed_account_id: str, role_name='OrganizationAccountAccessRole', ) -> boto3.session.Session: res = management_session.client('sts').assume_role( RoleArn=f"arn:aws:iam::{assumed_account_id}:role/{role_name}", RoleSessionName=f"{assumed_account_id}@{role_name}"[:64], ) return boto3.session.Session( aws_access_key_id=res['Credentials']['AccessKeyId'], aws_secret_access_key=res['Credentials']['SecretAccessKey'], aws_session_token=res['Credentials']['SessionToken'], )
管çã¢ã«ã¦ã³ãã®ã»ãã·ã§ã³ã¨ã¡ã³ãã¼ã¢ã«ã¦ã³ãã® ID ãæ¸¡ãã¨ãã¡ã³ãã¼ã¢ã«ã¦ã³ãã®ã»ãã·ã§ã³ãè¿ãã®ã§ãããã使ã£ã¦ Resource ã Client ãä½ã£ã¦å¦çãã¾ãã
ããã«ãä»»æã®é¢æ°ãåã㦠concurrent.futures.ThreadPoolExecutor ã使ã£ã¦ä¸¦åå®è¡ãã便å©é¢æ°ãç¨æãã¦ããã¨ããããæãã¾ãã
- è¤æ°ã®ã¢ã«ã¦ã³ãã® IAM ã¦ã¼ã¶ã¼ã®æ å ±ãå¾ãã¹ã¯ãªãã
GCP
æ¦è¦
- https://github.com/googleapis/google-cloud-python (
google.cloud) - https://github.com/googleapis/google-api-python-client (
googleapiclient)
ã® 2 種é¡ãããã¾ãã
https://cloud.google.com/apis/docs/client-libraries-explained ã«ä¾ãã°ã
ä¸é¨ã® Google Cloud APIs ã§ã¯ãè¨èªã«ãã£ã¦ã¯ Cloud ã¯ã©ã¤ã¢ã³ã ã©ã¤ãã©ãªãå©ç¨ã§ãã¾ããããããã® API ã®ããããã使ç¨ããéã«å¸æããè¨èªã® Cloud ã¯ã©ã¤ã¢ã³ã ã©ã¤ãã©ãªãåå¨ããªãå ´åã¯ã以åã®ã¹ã¿ã¤ã«ã®ã¯ã©ã¤ã¢ã³ã ã©ã¤ãã©ãªï¼Google API ã¯ã©ã¤ã¢ã³ã ã©ã¤ãã©ãªï¼ãå¼ãç¶ã使ç¨ã§ãã¾ãã
ã¨ã®ãã¨ãªã®ã§ã使ããããµã¼ãã¹ãé«ã¬ãã«ã® google-cloud-python ã§å®è£ ããã¦ããã°ããããããã§ãªããã°ä½ã¬ãã«ã® google-api-python-client ã使ãã¨ããããã§ãã
ããæï¼ä»ã¯æ¹åããã¦ãããç¥ãã¾ããï¼ãgoogle-cloud-python ãæå³ããéãã«åããªãã¦ããã£ããã¨ãããã®ã§ãèªå㯠google-api-python-client ã使ãããã«ãã¦ãã¾ãã
google-cloud-python
- ã¬ãã¸ããª
- ãªãã¡ã¬ã³ã¹
- https://cloud.google.com/python/docs/reference?hl=en
- æ¬æã«å©ç¨å¯è½ãªãµã¼ãã¹ã®ãªã³ã¯ã並ãã§ã¾ãããæ¥æ¬èªçã¯ç½ ã§ããEnglish ã«åãæ¿ãã¾ãããã
- 2024-05-08 æç¹ã®æ¥æ¬èªçã¯ãå©ç¨å¯è½ãªãµã¼ãã¹ããã¹ã¦åæããã¦ãããããªã³ã¯å ã«é£ãã§ãå 容ãèããã¼ã¸ï¼google-cloud-python ã®ãªãã¡ã¬ã³ã¹ãã¼ã¸ã§ã¯ãªããAPI ã®èª¬æã®ä¸ã®ã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªã®ä¸ç¯ï¼ã表示ããã¡ããã¾ãã
- ãããã¯ãæ¬æã§ã¯ãªãå·¦æ±ã®ä¸è¦§ãã使ããããµã¼ãã¹ãè¦ã¤ãã¦ã OK ã§ãã
- æ¬æã«å©ç¨å¯è½ãªãµã¼ãã¹ã®ãªã³ã¯ã並ãã§ã¾ãããæ¥æ¬èªçã¯ç½ ã§ããEnglish ã«åãæ¿ãã¾ãããã
- https://cloud.google.com/python/docs/reference?hl=en
- ãµã³ãã«ã³ã¼ã
- https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-SERVICENAME/samples/ ã«ããã¾ãã
- google-cloud-python åãµã¼ãã¹ã® Overview ã® Code samples and snippets ãã辿ãããã®ãããã¾ãã
google-api-python-client
- ã¬ãã¸ããª
- ãªãã¡ã¬ã³ã¹
- https://github.com/googleapis/google-api-python-client/blob/main/docs/dyn/index.md
- 使ããããµã¼ãã¹ãè¦ã¤ãã¦ãã ããã
- ãªã³ã¯å ã®ãã¼ã¸ã¯ããããæ®ºé¢¨æ¯ãªã®ã§ãå¾è¿°ã® API ãã®ãã®ã®ãªãã¡ã¬ã³ã¹ããããã¦èªãã ã»ããããã¨æãã¾ãã
- 使ããããµã¼ãã¹ãè¦ã¤ãã¦ãã ããã
- https://github.com/googleapis/google-api-python-client/blob/main/docs/dyn/index.md
- ãµã³ãã«ã³ã¼ã
- https://github.com/googleapis/google-api-python-client/tree/main/samples
- Pagination
- https://github.com/googleapis/google-api-python-client/blob/main/docs/pagination.md
- ã¤ã³ã¹ã¿ã³ã¹ã®ä¸è¦§ã¨ããçµæãããããããå ´åã«ããããã«ã¼ããåãã¦ãã¹ã¦ã®çµæãå¾ãã¢ã¬ã§ãã
- ã¨ãã«ãhttps://github.com/googleapis/google-api-python-client/tree/main/docs ã¯ããããã人ã®ã¬ããããæããããããã¥ã¡ã³ãã§ãããå 容çã«ãä¸èªãã¦ãããã»ããããã§ãã
API
- ãªãã¡ã¬ã³ã¹
- https://developers.google.com/apis-explorer
- ããããé£ã¹ã¾ãã
- https://developers.google.com/apis-explorer
tips
update ã¯ä¸¸ãã¨ç½®ãæãã®å ´åãå¤ãã®ã§æ³¨æãã¾ããã
update ã¡ã½ããã¯ãã¼ãã¶ã¾ããã¨ç·å ¥ãæ¿ãã®å ´åãå¤ãã§ããããã¥ã¡ã³ãã«æ³¨ææ¸ããããã¯ãã§ãããè¦è½ã¨ãã¦é¨åæ´æ°ã®ã¤ããã§ä¸é¨ã®ãã©ã¡ã¼ã¿ã ãæ·»ã㦠update ããã¨ãæå®ããªãã£ããã©ã¡ã¼ã¿ã®å¤ãæ¶ãã¡ãããã¨ãããã®ã§æ³¨æãã¾ãããã
å¤ãã® API ã§ã¯é¨åæ´æ°ã® patch ã¡ã½ãããæä¾ããã¦ããã®ã§ããã使ãããã¾ãç¾å¨ã®å¤ãå¾ãå¾ãä¸é¨ã®å¤ã夿´ãã¦ãã¹ã¦ update ã¡ã½ããã«æ·»ããããã¾ãããã
gcloud ã® credentials ãæåãã
API ã¢ã¯ã»ã¹ã«å¿
è¦ãª credentials ã¯è²ã
ãªæ¹æ³ã§ç¨æã§ãã¾ãããäºã gcloud auth login ãã¦çæããã credentials ãæåãããã¨ãã§ãã¾ãã
#!/usr/bin/env python3 import json import os import sqlite3 import sys import google.auth.transport.requests import google.oauth2.credentials def credentials_from_gcloud() -> google.oauth2.credentials.Credentials: """gcloud ã® credentials ãæåãã""" con = sqlite3.connect(os.path.expanduser('~/.config/gcloud/credentials.db')) con.row_factory = sqlite3.Row rows = con.execute(''' SELECT * FROM credentials WHERE account_id LIKE "%@gmail.com" -- é©å½ã«å¤ãã¦ä½¿ã£ã¦ãã ããã ''').fetchall() assert len(rows) == 1 cred_data = json.loads(rows[0]['value']) cred = google.oauth2.credentials.Credentials( 'gcloud', client_id=cred_data['client_id'], client_secret=cred_data['client_secret'], token_uri=cred_data['token_uri'], refresh_token=cred_data['refresh_token'], ) try: cred.refresh(google.auth.transport.requests.Request()) except google.auth.exceptions.RefreshError as e: print('æéåãã¦ãã¿ããã ãã gcloud auth login ãã¦ããã', file=sys.stderr) raise e return cred credentials = credentials_from_gcloud()
ããã¸ã§ã¯ãã®ä¸è¦§ãå¾ãæ¹æ³
Resource Manager API ã® projects.list ã§ããã¸ã§ã¯ãã®ä¸è¦§ãå¾ããã¨ãã§ãã¾ãã
ããGoogle Workspaceï¼æ§ GSuiteï¼ãå©ç¨ãã¦ãã¦çµç¹ãªã½ã¼ã¹ãåå¨ããå ´åãä½ãèããã« projects.list ããã¨ãã³ãã ããæ°ã®ããã¸ã§ã¯ããè¿ã£ã¦ããããããã¾ããã
ããã¯ãApps Script ããã¸ã§ã¯ãã使ãããã¨åæã« GCP ã®ããã¸ã§ã¯ãã使ãããããã çµç¹/system-gsuite/apps-script/ ã®ãã©ã«ãã®ä¸ã«é
ç½®ãããããã§ãã
ãªã®ã§ããªã½ã¼ã¹ã®ç®¡ç ã§ apps-script ãã©ã«ãã® IDï¼æ°åã§ãï¼ã調ã¹ã¦ããã®ãã©ã«ã ID ã親ã¨ããããã¸ã§ã¯ãã¯é¤å¤ããããã«ããã°ããã§ãã
import googleapiclient.discovery projects: list[dict] = [] # é¤å¤ãã apps-script ãã©ã«ãã® ID apps_script_folder_id = '999999999999' crm_client = googleapiclient.discovery.build( 'cloudresourcemanager', 'v3', credentials=credentials, ) projects_r = crm_client.projects() request = projects_r.list( filter=f"NOT parent.id={apps_script_folder_id}" ) while request is not None: response = request.execute() projects.extend(response['projects']) request = projects_r.list_next(request, response) for project in projects: print(project['projectId'])
ã¾ããè«æ±å ã¢ã«ã¦ã³ãã«ãªã³ã¯ããã¦ããããã¸ã§ã¯ãã®ä¸è¦§ï¼ï¼é課éã®éè¯ããã¸ã§ã¯ãã¯é¤å¤ãããï¼ãªããCloud Billing API ã® billingAccounts.projects.list ã使ãã®ãããã¨æãã¾ãã
gcloud ãã¢ã¯ã»ã¹ãã¦ãã API ãç¥ããã
--verbosity=debug ãæå®ãã㨠API ã®ã¨ã³ããã¤ã³ãã表示ããã¾ãã
ä¾ãã°ãgcloud alpha services quota list ãã¢ã¯ã»ã¹ãã¦ãã API ãç¥ãããæã¯ããã®ããã«å®è¡ããã¨ã
$ gcloud --verbosity=debug alpha services quota list --service='bigquery.googleapis.com' --consumer='projects/oreno-project'` DEBUG: Running [gcloud.alpha.services.quota.list] with arguments: [--consumer: "projects/oreno-project", --service: "bigquery.googleapis.com", --verbosity: "debug"] DEBUG: Starting new HTTPS connection (1): serviceusage.googleapis.com:443 DEBUG: https://serviceusage.googleapis.com:443 "GET /v1beta1/projects/oreno-project/services/bigquery.googleapis.com/consumerQuotaMetrics?alt=json HTTP/1.1" 200 None ...
ã¨åºåãããService Usage API ã® v1beta1 ã® services.consumerQuotaMetrics ã«ã¢ã¯ã»ã¹ãã¦ãããã¨ããããã¾ãã
Azure
æ¦è¦
ãµã¼ãã¹ãã¨ã«ããã±ã¼ã¸ãåããã¦ãã¦ãã¡ãããããããããã¾ãã
Python API ãã©ã¦ã¶ã¼ ã§æ¢ãã§ãããã
API
tips
ãµã³ãã«ã³ã¼ã
azure-sdk-for-python ã® sdk/*/*/generated_samples/ ã«ããã®ã§åèã«ããã¨ããã§ãã
ã¯ã¬ãã³ã·ã£ã«
az login ã§ãã°ã¤ã³ããç¶æ
ãªã azure.identity.DefaultAzureCredential() ã§å¾ãããã
åºæ¬å½¢
ä¾ãã° Subscriptions ã ã¨ãããªæãã
# XxxClient ã¯ãAPI ãªãã¡ã¬ã³ã¹ã® Management / azure.mgmt.subscription / Overview ãè¦ã㨠XxxClient ã®ä¸è¦§ãããã subscription_client = azure.mgmt.subscription.SubscriptionClient(credential=DefaultAzureCredential()) # subscriptions ã¨ãã¯ãAPI ãªãã¡ã¬ã³ã¹ã® Management / azure.mgmt.subscription / XxxClient ã® Variables ã«ä¸è¦§ãããã # get ã list ã¨ãã®ã¡ã½ããã¯ãAPI ãªãã¡ã¬ã³ã¹ã® Management / azure.mgmt.subscription / operations / XxxOperations ã«ä¸è¦§ãããã res = subscription_client.subscriptions.get(subscription_id='xxx') # çµæï¼ã®è¦ç´ ï¼ã¯ as_dict() ã§ dict ã«å¤æã§ããã£ã½ã print(res.as_dict())
API ãã¼ã¸ã§ã³ã®æå®
çµè«ããè¨ãã¨ãAPI ãã¼ã¸ã§ã³ã®æå®ã¯ããªãã
ãµã¼ãã¹ã«ãã£ã¦ã¯è¤æ°ã®ãã¼ã¸ã§ã³ã®å®è£ ããã£ããããã
ä¾ãã° azure.mgmt.resource.ResourceManagementClient ã ã¨ãããããã ã
ææ°ãã¼ã¸ã§ã³ã ã使ãã°ããããã§ã¯ãªãããã¼ã¸ã§ã³ã«ãã£ã¦å®è£ ããã¦ãããã®ã墿¸ãããµã¼ãã¹ãããï¼
ãã¼ã¸ã§ã³ã®æå®ã¯ XxxClient ã® api_version ã§æå®ã§ããã®ã§ãå¿
è¦ãªãµã¼ãã¹ã«å¿ãã¦ããã§ç´°ãããã¼ã¸ã§ã³æå®â¦ããå¿
è¦ã¯ãªãã¦ããã¼ã¸ã§ã³æå®ããªããã° ããæãã«ææ°ã®ãã¼ã¸ã§ã³ã使ã£ã¦ãããã¿ãããå°ãªãã¨ã 2025-05 æç¹ã®ããã±ã¼ã¸ã§ã¯ã
使ç¨ãã¦ãã API ãã¼ã¸ã§ã³ã®ç¢ºèªã¯ logging.basicConfig(level=logging.DEBUG) ããã¨ãªã¯ã¨ã¹ããã URL ã表示ããããã§ãããã§ç¢ºèªããã®ãæã£åãæ©ãã
Graph API
AD ã°ã«ã¼ãã¨ã㯠Graph API ã使ãã¿ããã
- https://learn.microsoft.com/ja-jp/graph/overview
- https://github.com/microsoftgraph/msgraph-sdk-python
docs/ã®ä¸ã«ã¡ãã£ã¨ãµã³ãã«ã³ã¼ããããã
ã¼ãã®ããããããããããã® /etc/apt/sources.list
ãã
# /etc/apt/sources.list deb mirror+file:/etc/apt/mirrors.txt jammy main restricted universe multiverse deb-src mirror+file:/etc/apt/mirrors.txt jammy main restricted universe multiverse deb mirror+file:/etc/apt/mirrors.txt jammy-updates main restricted universe multiverse deb-src mirror+file:/etc/apt/mirrors.txt jammy-updates main restricted universe multiverse deb http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse deb-src http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse
# /etc/apt/mirrors.txt # http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu/ priority:1 # http://asia-northeast1.gce.archive.ubuntu.com/ubuntu/ priority:1 https://ftp.udx.icscoe.jp/Linux/ubuntu/ priority:2 https://linux.yz.yamagata-u.ac.jp/ubuntu/ priority:3 http://archive.ubuntu.com/ubuntu/
ã§ãã
ããã§ã
ftp.udx.icscoe.jpã«ã¢ã¯ã»ã¹ãã¦æåãããããã§ OK- 失æããã
linux.yz.yamagata-u.ac.jpã«ã¢ã¯ã»ã¹ãã¦æåãããããã§ OK - æ´ã«å¤±æãããæå¾ã®ç ¦ã®
http://archive.ubuntu.com/ubuntu/ã«ã¢ã¯ã»ã¹ãã
ãªåä½ã«ãªãã¾ãã
EC2 ã GCE ãªåãã¯ããªã¼ã¸ã§ã³ãé©å®å¤æ´ãã¦ï¼ã¾ãã«ããã³ã±ãï¼REGION.ec2.archive.ubuntu.com ã REGION.gce.archive.ubuntu.com/ubuntu/ ã®ã³ã¡ã³ããå¤ãã¦æåã«è©¦è¡ããã¨ããã§ãããã
/etc/apt/mirrors.txt ã«ã¤ãã¦è©³ãã説æããã¨ã
priorityã®å¤ãå°ããé ã«è©¦è¡ãã¦ã失æãããæ¬¡ã®ã試è¡ããpriorityã®å¤ããªãã®ã¯æå¾ã«è©¦è¡ããpriorityã®å¤ãåããã®å士ããããã¯priorityã®å¤ããªããã®å士ã¯ãã®ä¸ããã©ã³ãã ã§é¸ã°ãã失æããããã®ä¸ããã¾ãã©ã³ãã ã§é¸ãã§è©¦è¡ãç¹°ãè¿ã- URL ã¨
priorityã®éã¯ã¿ãã§åºåãï¼ ã¹ãã¼ã¹ã§ã¯ãã¡ï¼ï¼- ä»åã®è¶ çµ¶ãããããã¤ã³ãã§ãï¼ï¼
cat -T /etc/apt/mirrors.txtã§^Iã¨ãªã£ã¦ããã確èªãã¾ããã
- ãã®æ©è½ã使ããã®ã¯
apt1.6 以ä¸ã§ãbionic ã®ã 1.6.x ãªã®ã§ bionic ããå¤ãã¨ä½¿ããªãããã§ã
詳細㯠apt-transport-mirror(1) ãåç §ãã¦ãã ããã
å ¬å¼ã® apt repos ã®ãã©ã¼ã®ä¸è¦§ã¯ããã«ããã®ã§ãã好ã¿ã®ãé¸ãã§ã¿ã¦ãã ããã
ã¨ãã«ãçéã® ICSCoE ã以åã¯æ²è¼ããã¦ããè¨æ¶ãªãã§ãããå ¬å¼ãã©ã¼ããå¤ãã¡ãã£ãããããï¼
ãããããã® 2
do-release-upgrade ããã¨ãã¯äºåã«å
ã® source.list ã«æ»ãã¾ãããã
do-release-upgrade ã®éç¨ã§ source.list ã®ä¸ã®ã³ã¼ããã¼ã ãæ¸ãæããã®ã§ãããå°ãªãã¨ã bionic â focal ã®ã¨ãã¯mirror+file: ã®è¡ã bionic ã®ã¾ã¾ã§ã¨ã©ã¼çµäºãã¡ããã¾ããã
Ruby ã® net-ssh ã§ OpenSSH 8.8 以ä¸ã®ãµã¼ãã¼ã«ã¢ã¯ã»ã¹ã§ããªãä»¶
Ubuntu 22.04 LTS (Jammy) ã® OpenSSH 8.9 㪠sshd ã«å¯¾ãã¦ãOpenSSH 7.2 以éã® ssh ã§ã¯ã¢ã¯ã»ã¹ã§ãããã© Ruby ã® net-ssh ã§ã¯ã¢ã¯ã»ã¹ã§ããªãä»¶ã
çç±ã¯ä»¥ä¸ã®éãã
- OpenSSH 8.8 ã§
ssh-rsaç½²åãç¡å¹åããã rsaéµã¯ssh-rsaç½²åã®ä»ã«ãrsa-sha2-256ãrsa-sha2-512ã§ãç½²åå¯è½- å®è£
ã«ãã£ã¦ã¯ããã´ã·ã¨ã¼ã·ã§ã³æã«å©ç¨å¯è½ã¨ãããã°ã
rsa-sha2-256ãrsa-sha2-512ç½²åã使ã- OpenSSH 㯠7.2 以éã§å¯¾å¿ãã¦ãã
- Ruby ã®
net-sshã¯ç¾æç¹ã®ææ°ãªãªã¼ã¹ç 6.1.0 ã§ã¯æªå¯¾å¿
- å¾ã£ã¦ã
- OpenSSH 7.2 以éã®
sshã¯rsa-sha2-512ç½²åã使ã£ã¦æ¥ç¶å¯è½ - Ruby ã®
net-sshã¯ssh-rsaç½²åã使ãã®ã§æ¥ç¶å¤±æ
- OpenSSH 7.2 以éã®
詳ãã説æã¯ããã¼ã©ãããã®ãOpenSSHãSHA-1ã使ç¨ããRSAç½²åã廿¢ãBacklogã®Gitã§çºçããåé¡ã¨è§£æ±ºã«ãããã¾ã§ã®éã®ããã¨ãããããªã³ã¯ããã¦ãããµã¤ããåç §ããããã
Ruby ã® net-ssh ã§æ¥ç¶ããã«ã¯ã
- HEAD ã使ãããããã¯å¯¾å¿çããªãªã¼ã¹ãããã®ãå¾
ã¤
- https://github.com/net-ssh/net-ssh/pull/838 ã§å¯¾å¿æ¸ã¿
rsa以å¤ã®éµã使ã- æå
ã®ç°å¢ã§ã¯
ecdsaéµãªã追å gem ãªãã§æ¥ç¶ã§ããecdsaéµã«ã¯ æ¸å¿µç¹ããã ãããªã®ã§ãè¦ç¢ºèª
ed25519éµã¯è¿½å gem ãå¿ è¦ãªæ¨¡æ§ https://github.com/net-ssh/net-ssh
- æå
ã®ç°å¢ã§ã¯
ããããSwitchããè¿ããã人ã¸
å¹´æ«ã«åããæ°ãã Switch ããè¿ããã人ãå¤ããã¨æãã¾ãããããªäººã¸ãã¹ã ã¼ãºã«ä½¿ãå§ããããããã«ãå§ãã®æºåäºé ãã¾ã¨ãã¦ã¿ã¾ããã
ï¼ä»¥åãææã«æç¨¿ãããã¤ã® 2021 å¹´çã§ãï¼
SDã«ã¼ã
ãã¦ã³ãã¼ãã½ããã®ä¿åå ã«å¿ è¦ãªã®ã§è²·ã£ã¨ãã¾ããããæ¬ä½å èµã®ã¯ææ© EL ã¢ãã«ã 64GBãç¡å°ã¨ Lite ã 32GB ãªãã§ãã£ã¨ããéã«ãã£ã±ãã«ãªãã¾ãã
microSDXC ã® 128GB 以ä¸ãªããããã§ãªããã¨ã
ç²æªåãæ´ã¾ãããªãããã«ãä¿¡é ¼ã§ãã販路ã§ä¿¡é ¼ã§ããã¡ã¼ã«ã¼ã®ãè³¼å ¥ãã¾ããããï¼å人çã«ã¯ SanDisk ã Transcendï¼
ã¡ãªã¿ã«ã½ããã®å®¹éã¯ãããªæã:
- ãã¬ã¯ã¤: 14.4GB
- Xenoblade DE: 13.6GB
- ã¹ãã©2: 6.1GB
- ãã¤æ£®: 6.6GB
ãã³ãã³ãã¼ã¢ã«ã¦ã³ã
Switchå ã®ãã¦ã¼ã¶ã¼ãã«ããã³ãã³ãã¼ã¢ã«ã¦ã³ããã飿ºãããã¨ãã¤ã³ãæºã¾ã£ãããã³ãã³ãã¼eã·ã§ããã§ã½ããè²·ãããã§ãã¾ãã
ã®ã§ãããã³ãã³ãã¼ã¢ã«ã¦ã³ããã¯äºãä½ã£ã¦ãããæ¹ãã¹ã ã¼ãºã«å§ãããããã¨ã
Switch ãç¡ãã¦ã PC or ã¹ããã§ããããã¢ã«ã¦ã³ãä½ãã¾ãã
ã¡ãªãNintendo Switch Online ã«ã¯ããã³ãã³ãã¼ã¢ã«ã¦ã³ããã¯å¿ é ã§ãã
åã©ãã¢ã«ã¦ã³ã
0 æ³ãã 17 æ³ã¾ã§ã®ã¢ã«ã¦ã³ãã¯ãåã©ãã¢ã«ã¦ã³ããã¨ãã¦ç»é²ã§ãã¦ããã¿ã¾ããè¨å®ãã§å種å¶éãå ãããã¨ãã§ãã¾ãã
ä¸åº¦ãåã©ãã¢ã«ã¦ã³ããã«ãã㨠13 æ³ä»¥ä¸ã«ãªãã¾ã§ãä¸è¬ã¢ã«ã¦ã³ããã«ãããã¨ãã§ãã¾ãããããã¤ãã£ä½¿ãã²ã¼ã ãåã©ãããããªãéãã¯ã¾ããåã©ãã¢ã«ã¦ã³ããã§ããããããªããã¨æãã¾ãã
Nintendo Switch Online
Nintendo Switch Online ã¯å ¥ãã®ããå§ããã¾ãã
ãªã³ã©ã¤ã³ãã¬ã¤ã ããããªãã¦ãã»ã¼ããã¼ã¿ãé ããï¼ã»ã¼ããã¼ã¿ã®ããã¯ã¢ããï¼ãã§ããã®ã§ã
300æéã®ãã¤ã©ã«ã®æãåºãå¹ã£é£ãã ãç«ã¡ç´ãã¾ããããï¼
ãã ãã»ã¼ããã¼ã¿ãé ããã«å¯¾å¿ãã¦ãªãã²ã¼ã ãããã®ã§æ°ãã¤ãã¦ãã ããâ¦
ãã¨ã¯ãæã®ãã¡ãã³ã³ãã¹ã¼ãã¡ãã®ã²ã¼ã ãéã¹ãããã«ãªãã¾ãï¼
å人ã 㨠2,400 å/å¹´ããã¡ããªã¼ãã©ã³ï¼æå¤§ 8 ã¢ã«ã¦ã³ãï¼ã 㨠4,500 å/å¹´ã§ãã
NINTENDO 64 好ããªãã10 æä¸æ¬ã«è¿½å äºå®ã®ã追å ããã¯ããè¦ãã§ãã¯ã
Proã³ã³
å¿ è¦ã«ãªã£ããã§ãï½
ã²ã¼ã ã¯ãã¦ã³ãã¼ãçï¼ããã±ã¼ã¸çï¼
ã²ã¼ã ã«ã¼ããå ¥ãæ¿ããã®ãå°å³ã«ããã©ãã®ã§ãã¦ã³ãã¼ãçããå§ããã¾ãã
ããããã±ã¼ã¸çã®ã¡ãªãããããã®ã§ç¶æ³æ¬¡ç¬¬ã§ã
- 飽ããã売ãé£ã°ããã
- Switchãè¤æ°å°ãã£ã¦ã¦ã両æ¹ã§ãã¬ã¤ãããï¼é£æºãã¦ããã³ãã³ãã¼ã¢ã«ã¦ã³ããå¥ã®å ´åï¼
- ããã¤ãããã¶æ¬ä½ãæ©è½ã§æ¡ä»¶ä»ãã§ç·©åå¯è½
- ä¸å¤ã§å®ãè²·ããã
- ãè³å³ãããï¼ã²ã¼ã ã«ã¼ãã¯èããã¨å³ããã¾ããä¸å¤ã®å ´åã¯æµæããã¾ããâ¦ï¼
æ¶²æ¶ä¿è·ãã£ã«ã
æã¡éã³æã«ããºãã¤ãããã¤ã¤ãªã®ã§èªåã¯è²¼ã£ã¦ã¾ãã
ãã£ãªã³ã°ã±ã¼ã¹
æã¡éã¶ã¨ãã«ã¯ãã£ãæ¹ããããããã
ã«ãã³ã«æ¾ãè¾¼ãã§æ¶²æ¶ã«å·ãã¤ãããã¹ãã£ãã¯ãããã«ããéã£ããããã¨æ²ããã®ã§ãããã°ããªãã½ããã±ã¼ã¹æã£ã¦ã¾ãã
ãã¨ãã±ã¼ã¹ã«å ¥ãã¦ãå ¥ããªãã¦ããæã¡éã¶ã¨ãã¯é»æºãªãã«ããæ¹ããããï¼ ã«ãã³ã®ä¸ã§ãã¹ãã£ãã¯ã«ä½ãã触ããã¨ã¹ãªã¼ãããè¦ãã¦ãã°ãããã¦ã¾ãã¹ãªã¼ããã¦ããç¹°ãè¿ãã¦ããã¦ãããï¼ï¼ã£ã¦ã¨ãã«ããããªã¼ãå°½ãã¦ãã¨æ²ããã®ã§ãï¼çµé¨è ï¼
goã®tviewã使ãæã¯ã
FAQ
ã«ãæ¸ãã¦ãããã©ã export LC_CTYPE="en_US.UTF-8" ãã¾ãããã
ãããªãã¨ãæ ç·ãã¬ãã¬ãã«ãªã£ããè¡é ã®1æåãæ¸ããããã¡ããã¾ãã
ãããã¯ããããªæãã§ç°å¢å¤æ°ãã»ãããã¦åå®è¡ããã®ã§ããããã¨ã
func init() { // https://github.com/rivo/tview/wiki/FAQ#why-do-my-borders-look-weird if os.Getenv("LC_CTYPE") != "en_US.UTF-8" { os.Setenv("LC_CTYPE", "en_US.UTF-8") env := os.Environ() if err := syscall.Exec(os.Args[0], os.Args, env); err != nil { panic(err) } } }
å é¨NLBã«ãããã±ããã®æ¸ãæãã®ã¾ã¨ã
ããããã°ãå é¨ NLB æ§æã£ã¦ã©ããã£ã¦åä¸ã»ã°ã¡ã³ãã®ã¯ã©ã¤ã¢ã³ãã«ãã±ãããè¿ã£ã¦ãã¦ããã ãï¼ ãªã¢ã«ãµã¼ãã¼ããã¿ãã¨ãã«ããã±ããã®éä¿¡å ãã¯ã©ã¤ã¢ã³ãã®ã«ãªã DSR ã ã¨ããã¨è¿ããã®ã¯ããããã ãã©ãVIP (NLBã®IPã¢ãã¬ã¹) å®ã®ãã±ãããåããè¨å®ãã¦ãªãã¦ãåãã¦ãããNAT (DNAT) åã ã¨ããã¨ï¼ã¯ã©ã¤ã¢ã³ããåä¸ã»ã°ã¡ã³ãã«ããã®ã§ï¼æ»ãã®ãã±ããã NAT ãã NLB ãçµç±ããªããã§ã¯ã©ã¤ã¢ã³ãã«ç ´æ£ãããã ãããï¼ï¼ï¼ ã¨ãµã¨çåãæã£ãã®ã§èª¿ã¹ã¦ã¿ãçµæã§ãã
調ã¹ãã¨ããããªã¢ã«ãµã¼ãã¼ã«å±ããã±ããã¯ãããªæãã§ãã:
- ã¿ã¼ã²ãããã¤ã³ã¹ã¿ã³ã¹IDã§æå®ããå ´å
- ã¿ã¼ã²ãããIPã¢ãã¬ã¹ã§æå®ããå ´å
ã¾ã¨ããã¨:
- å é¨ NLB 㯠NATå ã® L4LB
- dstã¯ãªã¢ã«ãµã¼ãã¼ã®MACã¢ãã¬ã¹ãIPã¢ãã¬ã¹ã«æ¸ãæããããï¼DNATï¼
- srcã®MACã¢ãã¬ã¹ã¯NLBã®MACã¢ãã¬ã¹ã«æ¸ãæãããã
- ãªã¢ã«ãµã¼ãã¼ããã®æ»ãã®ãã±ãããå¿ ãNLBãçµç±ããããã«ãããªã£ã¦ãã¨æãã
- DNATã®ã¿ã ã¨ãsrcã¯ã¯ã©ã¤ã¢ã³ãã®MACãIPã«ãªãã®ã§ããªã¢ã«ãµã¼ãã¼ã¯NLBãçµç±ããã«ç´æ¥ã¯ã©ã¤ã¢ã³ãã«æ»ãã®ãã±ãããéä¿¡ãã¡ãã£ã¦ãã¯ã©ã¤ã¢ã³ãã¯éã£ãã®ã¨éãã¨ãããããã±ãããè¿ã£ã¦æ¥ããã¨ã«ãªãã®ã§ç ´æ£ãã¡ãã
- ã¿ã¼ã²ããã¿ã¤ãã§éãã®ã¯ãsrcã®IPã¢ãã¬ã¹ã®ã¿
- ã¿ã¼ã²ãããã¤ã³ã¹ã¿ã³ã¹IDã§æå®ããã¨ãã®æ³¨æç¹
- ãªã¢ã«ãµã¼ãã¼ãå é¨NLBã«ã¢ã¯ã»ã¹ããã¨ãã¿ã¤ã ã¢ã¦ãã«ãªã
- ref: Network Load Balancer ã®ãã©ãã«ã·ã¥ã¼ãã£ã³ã° ã®ãã¿ã¼ã²ãããããã®ãã¼ããã©ã³ãµã¼ã¸ã®ãªã¯ã¨ã¹ããæ¥ç¶ã¿ã¤ã ã¢ã¦ãã«ãªãã
- NLBã«éã£ããã±ããããèªåèªèº«ããã®ãã±ããã«ãªã£ã¦å±ãã®ã§ç ´æ£ããã¡ããããã¢ãã³åé¡
ãªæãã§ããããªãã»ã©ã¼
è¯ããå¹´ãï¼
MySQLã§çãã¹ã¯ã¼ãããauthentication_stringãå¾ãæ¹æ³
SELECT PASSWORD('mypass');
ã§ mysql.user ã® authentication_string ã«æ ¼ç´ãããã®ãå¾ããããã§ãããMySQL 8ãã PASSWORD() 颿°ããªããªã£ãã®ã§ã©ãããã°ãããã¨ããã¨ã
SELECT CONCAT('*', UPPER(SHA1(UNHEX(SHA1('mypass')))));
ããããã°ããã§ãã
ã¨ã @yoku0825 ããã«æãã¦ãããã¾ããï¼