calendarID from cal.csv can be used at path param in
https://developers.google.com/calendar/v3/reference/calendars/get
https://developers.google.com/calendar/v3/reference/events/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
| #!/bin/bash | |
| # Install docker | |
| apt-get update | |
| apt-get install -y apt-transport-https ca-certificates curl software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| add-apt-repository \ | |
| "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
| $(lsb_release -cs) \ | |
| stable" | |
| apt-get update |
S3 bucket usually don't add any tag when creation, which is difficult for us to check the cost spend by each bucket.
The add_tags.py basically add/update Name tags to align with S3 bucket name and allow us easier to check the bills.
pipenv shell --three
pipenv install boto3
# Copy add_tags.py into local
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 requests | |
| import ipaddress | |
| # Get Cloudflare IP Ranges | |
| # ref: https://www.cloudflare.com/ips/ | |
| def get_cf_ips(): | |
| ips = [] | |
| for urls in [ | |
| "https://www.cloudflare.com/ips-v4", | |
| "https://www.cloudflare.com/ips-v6" |
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
| ## | |
| # Backup.py | |
| # --- | |
| # To dump stories, memberships, labels and releases on Pivotal Tracker projects | |
| # | |
| # Dependency: | |
| # pip install requests | |
| # | |
| # Usage: | |
| # python backup.py --token xxx |
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
| --- | |
| - name: Upgrade ecs services | |
| hosts: xxx | |
| user: ec2-user | |
| tasks: | |
| - yum: | |
| name: "ecs-init" | |
| state: latest | |
| become: true |
find . -name "*staging*" | xargs -I % sh -c 'find % -name log -mtime +30 -exec truncate -s 0 {} \;'
Reference: http://www.vionblog.com/linux-delete-files-older-than-x-days/
$ sudo netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
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
| # Put into .bashrc, source .bashrc, (max. 1000 requests per day) | |
| # Example: | |
| # $ ip2geo 8.8.8.8 | |
| # { | |
| # "ip": "8.8.8.8", | |
| # "hostname": "google-public-dns-a.google.com", | |
| # "city": "Mountain View", | |
| # "region": "California", | |
| # "country": "US", | |
| # "loc": "37.3860,-122.0838", |
NewerOlder