Skip to content

Instantly share code, notes, and snippets.

@deeshank
deeshank / current_timestamp.py
Created October 31, 2018 18:21
Python Current Timestamp w/ TimeZone
## Credits: https://julien.danjou.info/python-and-timezones/
import datetime
import pytz
utc_now = datetime.datetime.now(tz=pytz.utc)
print utcnow().isoformat()
# '2015-06-15T14:45:21.982600+00:00'
@deeshank
deeshank / inputrc.sh
Last active August 20, 2018 16:56
SetupInputrc
curl https://gist.githubusercontent.com/deeshank/f121eabaf572f935493e594cf669cdf5/raw/b6b99867cc218f1737aced458d02c9525185ddd4/gistfile1.txt -- output ~/.inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
ip = [1, 3, 10, 8, 5, 9, 2, 6, 4]
ip = [99, 56, 5, 30, 1, 0, 2, 16]
n = 5
stop = False
sav_idx = -1
@deeshank
deeshank / .gitsh
Last active April 19, 2018 18:14
Git Bash one liners
# Assuming we have .gitconfig setup
# Refer here - https://gist.github.com/deeshank/279d1a77678282b2be18fd3bc4bd1bc7
# git aliases
alias g='git'
alias gb='git gh'
alias pr='git pr'
alias gpush='git pb'
alias co='git co'
alias st='git st'
@deeshank
deeshank / .bash_profile
Created August 24, 2017 20:34
Docker Scripts
# Stop all docker containers
alias docker_stop='docker stop $(docker ps -a -q)'
# Start all docker containers
alias docker_start='docker start $(docker ps -a -q)'
# Delete all docker containers
alias docker_rm='docker rm -f $(docker ps -a -q)'
# Destroy all local docker images (this is equivalent to vagrant destroy)
# If you do this, run make docker-launch-base-image to get back a fresh copy
alias docker_rmi='docker rmi $(docker images -a -q)'
@deeshank
deeshank / .gitconfig
Last active April 19, 2018 18:11
GIT Aliases
# This is Git's per-user configuration file.
[user]
name = Deepak
email = shanky.cs@gmail.com
[alias]
#show aliases
la = "!git config -l | grep alias | cut -c 7-"
co = checkout
@deeshank
deeshank / nodejs
Created June 16, 2016 06:17
setup stable nodejs
mkdir ~/tmp
cd ~/tmp
git clone https://github.com/tj/n
cd n
make install
@deeshank
deeshank / gist:363795307d2aff50fe4f
Created May 21, 2015 14:07
Initialize script for Ubuntu 14.10
sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev -y
sudo apt-get install linux-headers-`uname -r` dkms -y
sudo apt-get install android-tools-adb android-tools-fastboot -y
sudo apt-get install gparted -y
sudo apt-get install unp -y
sudo apt-get install gtk2-engines-pixbuf -y
sudo apt-get install apache2 libapache2-mod-perl2 perl-debug libapache2-mod-perl2-dev libapache2-request-perl libdatetime-perl -y