Skip to content

Instantly share code, notes, and snippets.

@bhargavpanth
bhargavpanth / current_branch.js
Created February 14, 2017 13:44
Working with Git - I find myself switching branches quite often. With constant changes, I end up running versions on other branches and edit on the current.
/*
Avoid all the confusion with this in your entry script
*/
var exec = require('child_process').exec;
var cmd = 'git branch | grep "*"'
exec(cmd, function(error, stdout, stderr) {
console.log("server source : " + stdout);
});
@bhargavpanth
bhargavpanth / local_host.txt
Last active January 10, 2017 19:47
Find all hosts on local network
Find all devices
----------------
for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip>/dev/null;
[ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ;
done
Using nmap
----------