Skip to content

Instantly share code, notes, and snippets.

View piyushjoshi's full-sized avatar

Piyush Joshi piyushjoshi

View GitHub Profile
[alias]
lgx = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lgy = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lgz = !"git lg1"
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
sudo du -h /home | grep '[0-9\.]\+G'
ls . | grep "recharge" | sed 's/\(.*\)plan\(.*\)/"mv \1plan\2 \1data\2"/g' | xargs -L 1 -I {} sh -c "{}"^C
rsync:
rsync -chavzP --stats user@server.com:/sourceFolder/ /destinationFolder
@piyushjoshi
piyushjoshi / ie8_pollyfill_Function.bind.js
Created August 8, 2014 08:20
ie8_pollyfill_Function.bind
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
@piyushjoshi
piyushjoshi / ubuntu_init
Last active August 29, 2015 14:04
ubuntu_init
apt-get update
apt-get update apache2
#jdk
tar -xvf jdk-8-linux-x64.tar.gz (64bit)
sudo mkdir -p /usr/lib/jvm
sudo mv ./jdk1.8.0 /usr/lib/jvm/
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0/bin/javaws" 1
http://stackoverflow.com/questions/22004882/angularjs-does-not-work-in-internet-explorer-8
<head>
<meta charset="utf-8">
<title>Sample App</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
</head>
@piyushjoshi
piyushjoshi / jdk_ubuntu
Created July 22, 2014 06:31
jdk_ubuntu
http://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre
@piyushjoshi
piyushjoshi / ssl_conf
Last active August 29, 2015 14:04
ssl
https://help.ubuntu.com/12.04/serverguide/httpd.html
sudo a2ensite default-ssl
sudo service apache2 reload
@piyushjoshi
piyushjoshi / ubuntu_setup
Last active August 29, 2015 14:04
ubuntu_setup
sudo apt-get install libapache2-mod-jk
vim /etc/apache2/workers.properties
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009