@yysu 81 Followers 🕴 Latest Articles 👇 AWS Copilot 深入淺出 教學 👏 45 AWS Copilot 介紹 實際上手 教學 👏 91 職場新鮮人 — 於 AWS Cloud Suppo... 👏 61
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "public_identifier": "yysu", | |
| "profile_pic_url": "https://s3.us-west-000.backblazeb2.com/proxycurl/person/yysu/profile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=0004d7f56a0400b0000000001%2F20250112%2Fus-west-000%2Fs3%2Faws4_request&X-Amz-Date=20250112T014555Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=6c6009d2fe4cf1fb1b883860556a69c04e5b948c24814f9bdbfc891e9d012346", | |
| "background_cover_image_url": null, | |
| "first_name": "\u5f65\u6600", | |
| "last_name": "\u8607", | |
| "full_name": "\u5f65\u6600 \u8607", | |
| "follower_count": 541, | |
| "occupation": "Software Engineer at Fortinet", | |
| "headline": "CKAD/CKA/CKS/AWS All-5 certified DevOps", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fill these variable | |
| CLUSTER_NAME=<cluster-name> | |
| AWS_DEFAULT_REGION=<region> | |
| B64_CLUSTER_CA=$(aws eks describe-cluster \ | |
| --region=${AWS_DEFAULT_REGION} \ | |
| --name=${CLUSTER_NAME} \ | |
| --output=text \ | |
| --query 'cluster.{certificateAuthorityData: certificateAuthority.data}' | base64 --decode) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import sys | |
| import logging | |
| import boto3 | |
| from botocore.exceptions import ClientError | |
| def check_acl(s3_client, bucket, all_public_bucket): | |
| public_URI = 'http://acs.amazonaws.com/groups/global/AllUsers' | |
| try: | |
| acl = s3_client.get_bucket_acl(Bucket=bucket) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from dateutil import rrule | |
| from datetime import date,timedelta | |
| def get_days(array): | |
| new_data_list = [] | |
| start = date(2000, 1, 1) | |
| for index, value in enumerate(array): | |
| this_day = date(int(str(value)[0:4]), int(str(value)[4:6]), int(str(value)[6:])) | |
| new_date = get_working_days(start, this_day) | |
| new_data_list.append(new_date) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| # 第一種 | |
| path = "" | |
| file_path_list = [ os.path.join(root, file_name) for root, dirs, files in os.walk(path) for file_name in files ] | |
| file_name_list = [ file_name for root, dirs, files in os.walk(path) for file_name in files ] | |
| print(file_path_list) | |
| # 第二種 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import os, zipfile | |
| for filename in os.listdir("."): | |
| if filename.endswith(".zip"): | |
| print filename | |
| name = os.path.splitext(os.path.basename(filename))[0] | |
| if not os.path.isdir(name): | |
| try: | |
| zip = zipfile.ZipFile(filename) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Installing VirtualBox | |
| echo "Installing VirtualBox........................" | |
| sudo apt-get install virtualbox | |
| #Installing kubectl https://kubernetes.io/docs/getting-started-guides/kubectl/ | |
| echo "Installing kubectl..........................." | |
| wget https://storage.googleapis.com/kubernetes-release/release/v1.4.4/bin/linux/amd64/kubectl | |
| chmod +x kubectl | |
| sudo mv kubectl /usr/local/bin/kubectl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import zipfile | |
| file_name = ['FUNDH1080D1712200050.zip', 'TWH1130D1712181801.zip'] | |
| for name in file_name: | |
| zip_ref = zipfile.ZipFile(name, 'r') | |
| zip_ref.extractall('./') | |
| zip_ref.close() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from ftplib import FTP | |
| import os, sys, string, datetime, time | |
| import shutil | |
| import socket | |
| def syncupAll(path, ftp): | |
| global update_data_list | |
| # 列出所有目前的文件和目錄 | |
| filelist = os.listdir(path) |
NewerOlder