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
[Unit] | |
Description=SSH Tunnel | |
After=network.target | |
[Service] | |
Type=forking | |
EnvironmentFile=/etc/default/ssh_tunnel | |
ExecStart=/usr/bin/ssh -fN -D "$SOCKS_PORT" -i "$SSH_KEY" -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes "$USER"@"$SSH_SERVER" | |
ExecStartPost=/bin/bash -c "/usr/bin/curl --silent --fail --max-time 10 -x socks5h://localhost:$SOCKS_PORT http://ifconfig.me/ip || /bin/kill -9 -- $MAINPID" | |
ExecReload=/bin/kill -1 -- $MAINPID | |
ExecStop=/bin/kill -9 -- $MAINPID |
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
kind: Cluster | |
apiVersion: kind.x-k8s.io/v1alpha4 | |
nodes: | |
- role: control-plane | |
- role: control-plane | |
- role: worker | |
- role: worker | |
- role: worker | |
extraMounts: | |
- hostPath: /mnt/kind |
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 | |
if [ -z $1 ] | |
then | |
echo -e "Usage is: ./main.sh PATH_TO_FILE\nExample: ./main.sh /var/log/nginx/access_log" | |
exit 1 | |
fi | |
file=$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 | |
private_registry="registry.example.com:5000" | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <image_name>" | |
exit 1 | |
fi | |
image_name=$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 | |
if ! [ -x "$(command -v certbot)" ]; then | |
echo 'Error: certbot is not installed.' >&2 | |
exit 1 | |
fi | |
if [ -z "$1" ]; then | |
echo "Usage: $0 domain_name" | |
exit 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 | |
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 |