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
| source <(kubectl completion zsh) | |
| complete -F __start_kubectl k | |
| alias k='kubectl' | |
| alias kg='kubectl get' | |
| alias kd="k describe" | |
| alias kl="k logs" | |
| alias ke="k edit" | |
| alias kpf="k port-forward" | |
| alias knuke='k delete --grace-period=0 --force pod' | |
| alias ksh='f(){ k exec -it $@ sh ; unset -f f; }; f' |
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
| complete -F __start_kubectl k | |
| alias k='kubectl' | |
| alias kg='kubectl get' | |
| alias kd="k describe" | |
| alias kl="k logs" | |
| alias ke="k edit" | |
| alias kpf="k port-forward" | |
| alias knuke='k delete --grace-period=0 --force pod' | |
| alias ksh='f(){ k exec -it $@ sh ; unset -f f; }; f' | |
| alias kbash='f(){ k exec -it $@ bash ; unset -f f; }; f' |
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
| aws ec2 stop-instances --instance-ids $(aws ec2 describe-instances --filter Name=tag:Name,Values="<Instance-NAME>" | grep -oP '"InstanceId": "\K[^"]+') |
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
| find . -type f -exec sh -c '>{}' \; |
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
| #/etc/nginx/sites-available/tapway.dev | |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| root /home/tapway/tapway-dashboard/src/; | |
| index index.php index.html index.htm; | |
| server_name tapway.dev www.tapway.dev; |
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 chmod +x install.sh | |
| #install essential apps | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| sudo apt-get --assume-yes install git curl nginx | |
| #install php7 | |
| sudo add-apt-repository ppa:ondrej/php |
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
| Resizing | |
| ======== | |
| for f in `find . -name "*.png"`; do convert $f -resize 50% $f; done | |
| Croping | |
| ======== | |
| for f in *.jpg | |
| do | |
| mkdir resized |
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
| Get all server in one big file | |
| mysqldump -u root -ptmppassword --all-databases > /tmp/all-database.sql | |
| Bash script backup mysql databases seperate files | |
| mysql -uroot -proot -e 'show databases' | while read dbname; do mysqldump -uroot -proot "$dbname" > "$dbname".sql; done | |
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 essential apps | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| sudo apt-get --assume-yes install git curl nginx | |
| curl -sL -w "%{http_code}\\n" "127.0.0.1" -o /dev/null | |
| #install HHVM | |
| sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 |
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
| alias nmapall="nmap -sP 192.168.2.1/24" | |
| alias gs='git status && git branch' | |
| alias gsa='git status && git branch -a' | |
| alias gp='git push && git branch' | |
| alias gc='git commit -v -a' | |
| alias gcb='git checkout' | |
| alias gnb='git checkout -b' | |
| alias ga='git add .' | |
| alias gl='git log && git branch' |
NewerOlder