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 | |
| ACCOUNT_ID=$1 | |
| if [[ -z ${ACCOUNT_ID} || -s ${ACCOUNT_ID} ]]; then | |
| echo "How to use this script?" | |
| echo "./delete_ebs_snapshot.sh <AWS_ACCOUNT_ID>" | |
| exit 1 | |
| fi | |
| if [[ ! $(command -v jq) ]]; then echo "Please install jq"; fi |
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 | |
| function delete_dynamodb() { | |
| echo "Deleting all DynamoDB table in ${region}" | |
| for table in $(aws dynamodb list-tables); do | |
| echo "Deleting ${table} DynamoDB table" | |
| aws dynamodb delete-table --table-name ${table} | |
| done | |
| } | |
| function delete_ecr() { |
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 | |
| set -e | |
| # Copyright (c) 2019 Vinsen Muliadi | |
| # Permission is hereby granted, free of charge, to any person obtaining | |
| # a copy of this software and associated documentation files (the | |
| # "Software"), to deal in the Software without restriction, including | |
| # without limitation the rights to use, copy, modify, merge, publish, | |
| # distribute, sublicense, and/or sell copies of the Software, and to | |
| # permit persons to whom the Software is furnished to do so, subject to |
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
| ### KERNEL TUNING ### | |
| # Increase size of file handles and inode cache | |
| fs.file-max = 2097152 | |
| # Do less swapping | |
| vm.swappiness = 10 | |
| vm.dirty_ratio = 60 | |
| vm.dirty_background_ratio = 2 |
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
| sudo dnf -y install dnf-plugins-core | |
| sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo | |
| sudo dnf install docker-ce | |
| sudo systemctl start docker | |
| sudo systemctl enable docker | |
| sudo groupadd docker && sudo gpasswd -a ${USER} docker && sudo systemctl restart docker | |
| sudo gpasswd -a ${USER} docker && sudo systemctl restart docker |
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 | |
| sudo sed -i 's|#HandleLidSwitch=suspend|HandleLidSwitch=ignore|g' /etc/systemd/logind.conf | |
| read -p "Are you going to restart your computer (y to restart)?" confirmation | |
| if [[ $(echo ${confirmation}) == y || $(echo ${confirmation}) == Y ]]; then | |
| sudo reboot | |
| else echo "DONE" | |
| fi |
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 | |
| import glob | |
| from datetime import datetime | |
| def get_youngest(list_of_file): | |
| list_of_ctime = [] | |
| for ctime in list_of_file: | |
| list_of_ctime.append(ctime['ctime']) |
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 pip | |
| from subprocess import call | |
| packages = [dist.project_name for dist in pip.get_installed_distributions()] | |
| call("pip install --upgrade " + ' '.join(packages), shell=True) |
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 | |
| TC=/sbin/tc | |
| IF=wlp2s0 | |
| U32="$TC filter add dev $IF protocol ip parent 1:0 prio 1 u32" | |
| start() { | |
| $TC qdisc add dev $IF root handle 1: htb default 3 | |
| $TC class add dev $IF parent 1: classid 1:1 htb rate 300kbps ceil 300kbps | |
| $TC class add dev $IF parent 1: classid 1:2 htb rate 200kbps ceil 200kbps | |
| $TC class add dev $IF parent 1: classid 1:3 htb rate 150kbps ceil 150kbps |
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 | |
| wget https://libav.org/releases/libav-12.3.tar.xz | |
| sudo dnf install -y libvorbis yasm freetype zlib bzip2 faac-devel lame-devel speex-devel libvpx libogg libtheora x264 opencore-amr libvpx-devel faac lame speex libvpx-utils | |
| cd libav-12.3/ | |
| ./configure --extra-cflags=-I/opt/local/include --extra-ldflags=-L/opt/local/lib --enable-gpl --enable-version3 --enable-libvpx | |
| make | |
| sudo make install |