This file contains 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
""" | |
The script fetches and prints the average CPU utilization for a given AWS RDS instance ID for the past specified months | |
""" | |
from datetime import datetime, timedelta | |
import boto3 | |
# Configuration | |
INSTANCE_ID = '...' |
This file contains 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
""" | |
This script retrieves and displays the top five AWS service costs for each of the past six months. | |
It uses the AWS Cost Explorer API through the AWS CLI to fetch cost data, then processes and | |
sorts this data to find the most significant service costs. The costs are displayed in USD format, | |
showing the service name and the incurred cost over each month's period. | |
Note: AWS CLI must be configured with the appropriate permissions for this script to run successfully. | |
Sample output: |
This file contains 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 re | |
# http://stackoverflow.com/a/13752628/6762004 | |
RE_EMOJI = re.compile('[\U00010000-\U0010ffff]', flags=re.UNICODE) | |
def strip_emoji(text): | |
return RE_EMOJI.sub(r'', text) | |
print(strip_emoji('🙄🤔')) |
This file contains 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/env python3 | |
import base64 | |
""" | |
Simple obfuscation that will obscure things from the very casual observer. | |
It is one of the strongest of the simple ancient ciphers. | |
https://en.wikipedia.org/wiki/Vigenère_cipher | |
""" |
This file contains 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
cd /tmp | |
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib | |
export PATH=/usr/bin:$PATH | |
export LDFLAGS=-L/usr/lib64:/usr/lib | |
export LD_LIBRARY_PATH=/usr/lib64:/usr/lib:/usr/local/lib/ | |
export CPPFLAGS=-I/usr/include | |
sudo yum groupinstall "Development Tools" -y | |
sudo yum install pango-devel.x86_64 giflib-devel libjpeg-devel cairo-devel cairo-gobject-devel libXi-devel cups-libs dbus-glib libXrandr libXcursor libXinerama libXt.{i686,x86_64} -y |
This file contains 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
# Get all keys from the DB | |
redis-cli -n 8 --scan | |
# Get all keys and values from the DB | |
echo 'keys *' | redis-cli -n 8 | sed 's/^/get \"/' | sed 's/$/\" /' | redis-cli -n 8 | jq . |
This file contains 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
AWS_ACCESS_KEY_ID=X AWS_SECRET_ACCESS_KEY=X aws dynamodb list-tables --endpoint-url http://localhost:8000 --region x | |
AWS_ACCESS_KEY_ID=X AWS_SECRET_ACCESS_KEY=X aws dynamodb scan --table-name smpl_auth --endpoint-url http://localhost:8000 --region x |
This file contains 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
# Infinite Loop | |
while true; do echo 'Hit CTRL+C'; sleep 1; done | |
# Video to GIF | |
ffmpeg -i video.mov -ss 00:00:00.000 -pix_fmt rgb8 -r 10 -f gif - | gifsicle --optimize=3 > video.gif |
This file contains 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
# find by name | |
find . -name 'MYTEXT*' | |
# find text in files | |
grep -r "MYTEXT" . | |
# find dir by name | |
find . -name "MYTEXT" -type d | |
# free space |
NewerOlder