Skip to content

Instantly share code, notes, and snippets.

View shroukkhan's full-sized avatar

Shrouk Hasan Khan shroukkhan

  • Softverk / Fingi / Thai-Fi
  • Bangkok
View GitHub Profile
@shroukkhan
shroukkhan / loginShellWithIptables
Created February 14, 2013 07:41
#this script will log you in and then add your publip ip to the allowed list in iptables. #necessary because http is blocked by iptables for security reason
#!/bin/bash
login="root"
pass="PASSWORD"
ip="MY_IP_ADDRESS"
publicip=$(wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//')
sshpass -p $pass ssh $login@$ip "iptables -I INPUT -j ACCEPT -s $publicip"
sshpass -p $pass ssh $login@$ip
#this script will log you in and then add your publip ip to the allowed list in iptables.
#necessary because http is blocked by iptables for security reason
@shroukkhan
shroukkhan / ubuntu add display resolution
Last active August 29, 2015 14:09
ubuntu add display resolution
cvt 1600 900 60
xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
xrandr --addmode VGA1 1600x900_60.00
xrandr --output VGA1 --mode 1600x900_60.00
xrandr --output VGA1 --right-of eDP1
xfwm4 --replace
@shroukkhan
shroukkhan / dual display
Last active August 29, 2015 14:04
Dual Display - Ubuntu
xrandr --output DVI-I-0 --right-of DVI-I-1