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
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
user_name=root | |
else | |
user_name=$1 | |
fi | |
IFS=' |
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
[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 | |
ExecReload=/bin/kill -1 -- $MAINPID | |
ExecStop=/bin/kill -9 -- $MAINPID | |
Restart=always |
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
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 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 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 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 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 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 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 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 |
NewerOlder