Skip to content

Instantly share code, notes, and snippets.

diff --git a/gitconfig b/gitconfig
index 6f5bf4d..0f94f5b 100644
--- a/gitconfig
+++ b/gitconfig
@@ -22,7 +22,7 @@
tool = meld
renameLimit = 25000
[push]
- default = upstream
diff --git a/bashrc.local b/bashrc.local
index 1f6827b..a916c23 100644
--- a/bashrc.local
+++ b/bashrc.local
@@ -1,5 +1,5 @@
export [email protected]
-alias ls='ls --color -F'
+alias ls='gls --color -F'
alias grep='egrep --color'
alias gitnp='git --no-pager'
@lakshmankumar12
lakshmankumar12 / color_print.py
Created October 21, 2016 21:32
Quickly print all possible 16-color combo's in a linux terminal
#!/usr/bin/python
from __future__ import print_function
CSI="\x1B["
reset=CSI+"m"
colorsf = { "black" : 30, "red" : 31, "green" : 32, "yellow" : 33, "blue" : 34, "magenta" : 35, "cyan" : 36, "white" : 37}
colorsg = { "black" : 40, "red" : 41, "green" : 42, "yellow" : 43, "blue" : 44, "magenta" : 45, "cyan" : 46, "white" : 47}

Case of Ants

Two Ants

Say A1 and A2 are respectively at a distance a and b away from the end of rods like this

             A1             A2
@lakshmankumar12
lakshmankumar12 / add_key.py
Created April 21, 2016 20:25
Quick script to listen and add others public key (No longer used)
#!/usr/local/bin/python2.7
import socket
import re
def is_valid_key(data):
m = re.search(r'^ssh-rsa \S+ \S+$',data)
if m:
return True
else:
@lakshmankumar12
lakshmankumar12 / inotifyexec.py
Created April 21, 2016 17:07 — forked from wernight/inotifyexec.py
inotifywait helper that executes a command on file change (for Linux, put it in ~/bin/)
#!/usr/bin/env python
"""Use inotify to watch a directory and execute a command on file change.
Watch for any file change below current directory (using inotify via pyinotify)
and execute the given command on file change.
Just using inotify-tools `while inotifywait -r -e close_write .; do something; done`
has many issues which are fixed by this tools:
* If your editor creates a backup before writing the file, it'll trigger multiple times.
* If your directory structure is deep, it'll have to reinitialize inotify after each change.
@lakshmankumar12
lakshmankumar12 / dontclose.js
Created April 9, 2016 16:48
Make a web-page not exit on ctrl-w
window.onbeforeunload = function(){
return 'Are you sure you want to leave?';
};
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index 518a14a3..75a90a09 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -130,12 +130,12 @@ prompt_git() {
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' get-revision true
zstyle ':vcs_info:*' check-for-changes true
- zstyle ':vcs_info:*' stagedstr '✚'
- zstyle ':vcs_info:*' unstagedstr '●'
@lakshmankumar12
lakshmankumar12 / Mosh term Settings
Last active March 24, 2016 16:06 — forked from neshaug/Chrome Secure Shell Settings
Chrome Secure Shell Settings
/*
* http://goo.gl/AKBve
*/
// create a new profile at the bottom of the connect dialog, call it windows and then paste this:
mosh_client_.io.terminal_.prefs_.set('font-family', 'DejaVu Sans Mono for Powerline');
mosh_client_.io.terminal_.prefs_.set('font-size', 12);
// this is the standard settings for a profile
term_.prefs_.set('font-family', 'monospace'); // standard
term_.prefs_.set('font-size', 15); // standard
@lakshmankumar12
lakshmankumar12 / hterm_solarized.js
Created March 20, 2016 18:59 — forked from organisciak/hterm_solarized.js
Solarized for Mosh Chrome
// Solarized for Mosh Chrome
// Mosh does not seem to save profiles, so this sets the default 'mosh' profile.
// To reset, evaluate term_.prefs_.resetAll()
// Run in the JavaScript console of mosh_browser.html, which can be opened
// as explained here:
// https://github.com/rpwoodbu/mosh-chrome/wiki/FAQ#how-can-i-change-the-way-the-terminal-looks-font-color-etc
var htermProfiles = {
// Solarized Dark