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 | |
| show_usage() { | |
| echo "Usage: $0 <config1> <config2> ..." | |
| echo "This script will merge config1, config2, ... into a single config file in current directory" | |
| echo "The merged config file will be named as 'merged-kubeconfig'" | |
| echo "You can copy the merged config file to ~/kube/config to use it as your default kubeconfig" | |
| } | |
| if [ $# -lt 2 ]; then | |
| show_usage |
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 | |
| add_ssh_keys(){ | |
| github_username=$1 | |
| IFS=$' | |
| ' | |
| # Iterate over all keys in the github account | |
| for key in $(curl -sSL github.com/$github_username.keys) | |
| do |
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
| [user] | |
| email = MyMail | |
| name = Mohammad Parvin | |
| [alias] | |
| a = add | |
| b = branch | |
| s = status | |
| c = clone | |
| i = init | |
| p = push |
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 check_status { | |
| # $1 is VPN name | |
| vpnName=$1 | |
| vpnIP=`nmcli connection show $vpnName | grep 'IP4.ADDRESS\[1\]' | awk '{print $2}' | cut -d'/' -f1` | |
| vpnGateway=`nmcli connection show $vpnName | grep IP4.GATEWAY | awk '{print $2}'` | |
| if [ "$vpnGateway" == "--" ] | |
| then | |
| vpnGateway=`echo $vpnIP | sed 's/\.[0-9]\{1,3\}$/\.1/'` |
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 -x | |
| showUsage() { | |
| echo -e "Usage is /scripts/tochpad.sh [OPTIONS]\n\t-e To enable touch pad\n\t-d For Disable touch pad\n\t-h for this Help" | |
| } | |
| if [ "$#" -eq 0 ] | |
| then | |
| showUsage | |
| exit 1 | |
| 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 | |
| install_brctl_in_debian(){ | |
| apt update && apt install -y bridge-utils && \ | |
| } | |
| install_brctl_in_rhell(){ | |
| yum makecache && yum install -y bridge-utils && \ | |
| } |
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 -x | |
| # database credentials | |
| db_user="" | |
| db_pass="" | |
| db_name="" | |
| db_host="" # e.g 127.0.0.1 or localhost | |
| # FTP credentials | |
| ftp_url="" e.g ftp://ftp.example.com |
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 | |
| # Show one line before (-B 1) and one line after (-A 1) matched | |
| # .venv excluded | |
| # Used -n to show line number | |
| # -s for prevent displaying error messages | |
| # -r for recursive, in some versions of grep -r doesn't exists | |
| grep 'TODO' -B 1 -A 1 --color --exclude-dir=.venv -nsr ./ |
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
| events{} | |
| rtmp { | |
| server { | |
| listen 1935; | |
| application live { | |
| live on; | |
| interleave on; | |
| hls on; | |
| hls_path /tmp/hls; |
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
| daemon off; | |
| error_log logs/error.log; | |
| events { | |
| worker_connections 1024; | |
| } | |
| rtmp { | |
| server { | |
| listen 1935; # Listen on standard RTMP port | |
| chunk_size 4000; | |
| application show { |