Skip to content

Instantly share code, notes, and snippets.

View mangatinanda's full-sized avatar
🏠
Working from home

Nanda Kumar mangatinanda

🏠
Working from home
View GitHub Profile
@mangatinanda
mangatinanda / web-servers.md
Created September 26, 2018 12:54 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mangatinanda
mangatinanda / adblock_hosts.sh
Created February 2, 2017 15:06 — forked from Dani3lSun/adblock_hosts.sh
Mac OS X adblock shell script using system hosts file (Block ads system wide)
#!/bin/sh
#
# Mac OSX Adblocker Script for IPv4
# Description: Blocks ads using system hosts file /private/etc/hosts, Ad-Domains would be redirected to 0.0.0.0
# Author: Daniel Hochleitner
# Created: 10.09.2015
# Use: sudo ./adblock_hosts.sh
# Get original hosts file from /private/etc/hosts
@mangatinanda
mangatinanda / gist:b83a648107f202004a49167dd41465af
Created October 18, 2016 09:45 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote