Skip to content

Instantly share code, notes, and snippets.

View dmukhg's full-sized avatar

Dipanjan Mukherjee dmukhg

  • Bangalore, India
View GitHub Profile
@dmukhg
dmukhg / gist:634244
Created October 19, 2010 14:05
.*shrc
# ===================== Mark functions =======================
# calling mark, sets up a file ~/.mark_dir containing
# the value of the current directory
# hence forth, any terminal you open will be directed to this
# directory
function m(){
printf `pwd` > ~/.mark_dir
echo 'Directory Marked'
}
@dmukhg
dmukhg / auth.xml
Created November 7, 2011 20:21
uidai authentication xml
<?xml version="1.0" encoding="UTF-8"?>
<Auth uid="999999990019" tid="public" ac="public" sa="public" ver="1.5" lk="MKg8njN6O+QRUmYF+TrbBUCqlrCnbN/Ns6hYbnnaOk99e5UGNhhE/xQ=" txn="ilXwVcqzpZNSBMHG5W5/+y/FcfOPAoA7SYHVRNtNIx8=&#10;">
<Skey ci="20150922">w7Ze8431BC0g5d/v4vJhH/38ZukDDfau5RrTaWV8hxdr1StjdD/WNSadThrO
VE/yuDXL3i0piCNM7sbVnEdDPE+gobEAdwSlwob8ypYeNNh5b6SIIE7hKkJF
BGbMy/8Cbcp9llqLH2zRaP78NM9LcRfoXjz02TOfx35RJdBGhzh5OESdiz60
Mp7yJ5PbQdgAYqKvK0iW3z7kItuc6GduZiZCoiRiRSAX4nglYBi5vLV+DNuF
0OaefJV5hAu4o4qqhBFkF7IoWP58t2w5Lju0vrR+WquMW9AZl4BnBqHpCdpN
FTgQbfhWNL9axfeIqB4ctz2QZOENwnIjBCMR+hyJFQ==
</Skey>
<Uses pi="n" pa="n" pfa="n" bio="y" bt="FMR" pin="n" otp="n"/>
@dmukhg
dmukhg / .zshrc
Created March 29, 2012 07:32 — forked from DHowett/.zshrc
Shell Bookmarks for ZSH
# Instructions
# << command >> : << what it does >>
# l : lists all bookmarks
# s <name> : save current directory as <name>
# g <name> : go to bookmark <name>
# d <name> : delete bookmark <name>
function _uh { [[ -z $DEV ]]; return $? }
@dmukhg
dmukhg / bootstrap.py
Created August 1, 2012 19:58
Bootstrapping script for django web-applications using 12 Factor principles http://dmulog.in/2012/08/01/12factor-django.html
#!/usr/bin/env python
"""
- Create a virtualenv in the directory containing this file.
- Activate the above virtualenv
- Install the dependencies for the app, as declared in
requirements.txt
"""
import os
@dmukhg
dmukhg / settings.py
Created August 4, 2012 19:32
Parsing settings from envvars.
DEBUG = bool(os.environ.get('DJ_DEBUG'))
DATABASE_ENGINE = str(os.environ.get('DJ_DATABASE_ENGINE'))
@dmukhg
dmukhg / planner.sh
Last active December 11, 2015 01:48
Debian style init script for a django web-application running on a gunicorn server via its own virtualenv.
#! /bin/sh
### BEGIN INIT INFO
# Provides: planner
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the planner web app on a gunicorn server
# Description: starts the planner web app using start-stop-daemon
@dmukhg
dmukhg / chromoxy.py
Created April 10, 2013 04:04
Set proxy environment variables and execute google-chrome based on a dict of proxy servers.
#!/usr/bin/python
import sys
import os
import subprocess
proxies = {
'150': 'http://10.3.100.150:8080/',
'211': 'http://10.3.100.211:8080/',
'212': 'http://10.3.100.212:8080/',
@dmukhg
dmukhg / sync-hosts-file.sh
Created October 11, 2015 13:35
Appends a /etc/hosts style file onto your existing /etc/hosts file after backing it up
#!/bin/bash
# USAGE
# $> sudo ./sync-hosts-file
# Run this command in a directory where you have a hosts.append file
# which has hosts in the /etc/hosts style.
if [ "$(id -u)" != "0" ]; then
echo "You need to be root to execute this script"
exit 1
var SomeService = require('./SomeService');
var config = require('config');
var winstonConfig = require('winston-config');
winstonConfig.fromJson(config.get('logging'), function (err, winston) {
// Handle error
var logger = winston.loggers.get('protocol');
logger.info('Started application');
}
var config = require('config');
var winstonConfig = require('winston-config');
winstonConfig.fromJson(config.get('logging'), function (err, winston) {
// Handle error
var SomeService = require('./SomeService');
var logger = winston.loggers.get('protocol');
logger.info('Started application');