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
| for i in $(vagrant global-status | grep running | awk '{ print $1 }'); do vagrant destroy -f $i; 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
| #To create one config file with ovpn certificates one need: | |
| ca ca.crt | |
| # change to | |
| <ca> | |
| -----BEGIN CERTIFICATE----- | |
| ... | |
| -----END CERTIFICATE----- | |
| </ca> | |
| # all keys and crts the same way | |
| # except for |
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
| # list iptables rules | |
| iptables -L -vn | |
| # flush iptables in chain, or everywhere if run without chain name | |
| iptables -F | |
| # change dafault chane rule | |
| iptables -P FORWARD DROP | |
| # append a new rule | |
| iptables -A INPUT -p tcp -s 185.51.156.255 -j ACCEPT | |
| # insert a new rule (here in 12th position) | |
| iptables -I INPUT 12 -s 10.18.129.11/32 -j ACCEPT |
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
| ping 8.8.8.8 -i 0.01 | while read pong; do echo "$(date +%H:%M:%S:%N): $pong"; 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
| brctl addbr br1 | |
| brctl stp br1 off | |
| ip l set dev br1 up | |
| And enable lldp: | |
| echo 16384 > /sys/class/net/br1/bridge/group_fwd_mask |
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
| ## Debian | |
| # /usr/sbin/adduser <username> | |
| # sudo adduser <username> sudo | |
| # chage -d 0 <username> | |
| ## RedHat | |
| # /usr/sbin/adduser -c "Full Name" <username> | |
| # gpasswd -a <username> wheel | |
| # passwd <username> | |
| # chage -d 0 <username> |
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 getpass | |
| PASSWORD = getpass.getpass('Enter password : ') |
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
| man script | |
| To record all new bash sessions: | |
| Add: | |
| test "$(ps -ocommand= -p $PPID | awk '{print $1}')" == 'script' || (script -t 2> $HOME/shell_logs/$(date +"%Y-%m-%d_%H%M%S").timing -f $HOME/shell_logs/$(date +"%Y-%m-%d_%H%M%S").log) | |
| to $HOME/.bashrc | |
| And create directory $HOME/shell_logs/ |
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 modprobe 8021q | |
| lsmod | grep 8021q | |
| ip link add link eth1 name eth1.10 type vlan id 10 | |
| https://dougvitale.wordpress.com/2011/12/21/deprecated-linux-networking-commands-and-their-replacements/ |
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
| # Rename usb0 to eth1 | |
| # in /etc/udev/rules.d/70-persistent-net.rules | |
| KERNEL=="usb0", NAME="eth1" |
NewerOlder