Skip to content

Instantly share code, notes, and snippets.

View ekiara's full-sized avatar
🎯
Focusing

Eric Kiara ekiara

🎯
Focusing
View GitHub Profile
@ekiara
ekiara / gist:9286940
Created March 1, 2014 08:21
Development: A good system:
A good system:
Good Systems are
unattended
bootstrapping
visible
robust
recoverable
safe
pip install pylint pyflakes pep8 mccabe
pip install pylint pyflakes pep8 mccabe
pip install pylint pyflakes pep8 mccabe
@ekiara
ekiara / gist:9287696
Created March 1, 2014 09:50
BASH: find out the disk usage of the directories (only the directories) within your current directory/current working directory,
#BASH: find out the disk usage of the directories (only the directories) within your current directory/current working directory,
for x in `ls -l|grep ^d|awk '{print $8}'`; do echo $x; du -ch ./$x | tail -n 1; done
for x in `ls -l|grep ^d|awk '{print $8}'`; do echo $x; du -ch ./$x | tail -n 1; done
for x in `ls -l|grep ^d|awk '{print $8}'`; do echo $x; du -ch ./$x | tail -n 1; done
@ekiara
ekiara / PIL_Pillow_Fully_Loaded
Created March 4, 2014 08:00
PIL/Pillow Fully Loaded
#PIL/Pillow Fully Loaded
10 pip install Pillow
9 pip uninstall Pillow
8 sudo apt-get install libjpeg-turbo8 libjpeg-turbo8-dev
7 sudo apt-get install libjpeg-dev
6 sudo apt-get install libfreetype6 libfreetype6-dev
5 sudo apt-get install zlib1g zlib1g-dev
4 sudo apt-get install libtiff5
3 sudo apt-get install libwebp4 libwebp-dev
@ekiara
ekiara / gist:9965372
Created April 4, 2014 00:04
Diff Compare All Files in Two Copies of the same Project Directory
for filename in `/usr/bin/find . -iname "*py"`; do echo $filename; /bin/echo $filename | /usr/bin/awk '{print "../../PATH_TO_DUPLICATE_PROJECT_DIRECTORY/"substr($1, 3, 999)}' | /usr/bin/xargs /usr/bin/diff -y -q $filename ; read -n1 -r -p "Press any key to continue..." key; done
for filename in `/usr/bin/find . -iname "*py"`; do echo $filename; /bin/echo $filename | /usr/bin/awk '{print "../../PATH_TO_DUPLICATE_PROJECT_DIRECTORY/"substr($1, 3, 999)}' | /usr/bin/xargs /usr/bin/diff -y -q $filename ; read -n1 -r -p "Press any key to continue..." key; done
for filename in `/usr/bin/find . -iname "*py"`; do echo $filename; /bin/echo $filename | /usr/bin/awk '{print "../../PATH_TO_DUPLICATE_PROJECT_DIRECTORY/"substr($1, 3, 999)}' | /usr/bin/xargs /usr/bin/diff -y -q $filename ; read -n1 -r -p "Press any key to continue..." key; done
@ekiara
ekiara / gist:10246832
Created April 9, 2014 09:28
GZIP ALL THE THINGS
for x in `ls|grep tsv`; do gzip --best --stdout $x >> $x.gz; rm -vf $x 1>> cleanup.log 2>> cleanup.log; done
for x in `ls|grep tsv`; do gzip --best --stdout $x >> $x.gz; rm -vf $x 1>> cleanup.log 2>> cleanup.log; done
for x in `ls|grep tsv`; do gzip --best --stdout $x >> $x.gz; rm -vf $x 1>> cleanup.log 2>> cleanup.log; done
for x in `ls|grep tsv`; do gzip --best --stdout $x >> $x.gz; rm -vf $x 1>> cleanup.log 2>> cleanup.log; done
@ekiara
ekiara / iptables_snippet
Last active August 29, 2015 13:59
iptables snippet
## iptables snippet ##
# Get current iptables list with line numbers
/usr/bin/sudo /sbin/iptables --line-numbers -L
# Add a rule to the INPUT chain, append it to the end
/usr/bin/sudo /sbin/iptables -A INPUT -p tcp --dport 12345 -j ACCEPT
# Insert a rule to the INPUT chain, before the line number 7
/usr/bin/sudo /sbin/iptables -I INPUT 7 -p tcp --dport 12345 -j ACCEPT
@ekiara
ekiara / how_to_do_a_reverse_ssh_tunnel_connection.
Created April 18, 2014 02:34
HOW TO DO A REVERSE SSH TUNNEL CONNECTION
# HOW TO DO A REVERSE SSH TUNNEL CONNECTION
# how_to_do_a_reverse_ssh_tunnel_connection.txt
$ ssh -i ./cloud.key -p [CLOUD_SERVER_SSH_PORT] -R [TUNNEL_PORT]:localhost:[LOCAL_SSH_PORT] user@[CLOUD_SERVER]
$ /usr/bin/ssh -i ./cloud.key -p 22 -R 6543:localhost:22 user@hostname.cloud.vps.provider.net
@ekiara
ekiara / how_to_find_out_which_port_was_used_for_a_reverse_tunnel
Created April 18, 2014 02:36
HOW TO FIND OUT WHICH PORT WAS USED FOR A REVERSE TUNNEL
# HOW TO FIND OUT WHICH PORT WAS USED FOR A REVERSE TUNNEL
# how_to_find_out_which_port_was_used_for_a_reverse_tunnel
#
#
# How to get a list of ports to a specific host that [the host that you are currently logged into] is currently connected to.
#
# Exposition:
#
# So I have a "client's server" [somewhere] that I keep a SSH tunnel running on, this is a persistent SSH reverse
# tunnel to my "vps/cloud server" on one my VPS providers.
@ekiara
ekiara / setup_youtube_dl
Created April 18, 2014 03:32
Youtube DL
mkdir ytdl
cd ytdl/
curl https://yt-dl.org/downloads/{LATEST_VERSION}/youtube-dl -o ytdl
chmod a+x ./ytdl
echo \#\!/bin/bash >> tube
echo ytdl --max-quality MP4 \$1 >> tube
chmod a+x ./tube
mkdir ytdl
cd ytdl/