- All processes require checklists.
- Automate everything, and continuously test your automation.
- Do not reinvent the wheel. Defer to idiomatic or popular solutions.
- Everything fails. Anticipate this and offer degraded service.
- Instrument everything.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### MATPLOTLIBRC FORMAT | |
# This is a sample matplotlib configuration file - you can find a copy | |
# of it on your system in | |
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it | |
# there, please note that it will be overridden in your next install. | |
# If you want to keep a permanent local copy that will not be | |
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux | |
# like systems) and C:\Documents and Settings\yourname\.matplotlib | |
# (win32 systems). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import sys | |
import string | |
def mapper(input=sys.stdin): | |
reader = csv.DictReader(input) | |
for row in reader: #cycle through lines of code | |
print "%s\t%s" % (row["District"], row["Aadhaar generated"]) | |
mapper() |
You can't install Bokeh in a virtualenv without modifying
/home/asim.ihsan/Programming/envs/default/lib/python2.7/site.py
to add
the getsitepackages()
from the Python 2.7 version of the file
in e.g. /usr/lib64/python2.7/site.py
. This is because
virtualenv uses a Python 2.6 version of this file. This is an open
bug:
In your virtualenv site.py
search for addsitepackages()
and
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import datetime | |
import logging | |
import logging.handlers | |
import os | |
import socket | |
import sys | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# status bar | |
set-option -g status-utf8 on | |
set-option -g default-shell /bin/zsh | |
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf | |
set-option -g status-bg colour235 #base02 | |
set-option -g status-fg colour136 #yellow | |
set-option -g status-attr default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.io.OutputStreamWriter; | |
class Foo { | |
public static void main(String[] args) throws IOException, InterruptedException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: /home/ubuntu/.aws_keys | |
export AWS_ACCESS_KEY_ID=XXXXXXXXX | |
export AWS_ACCOUNT_ID=1111111111 | |
export AWS_SECRET_ACCESS_KEY=fFjerT235Fj | |
# subsequently modify /home/ubuntu/.bash_profile and "dot this in" by using: | |
# . /home/ubuntu/.aws_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# haproxyd | |
# Script to start|stop|restart haproxy from /etc/init.d/ | |
# By Gubatron. | |
HAPROXY_CONFIG_PATH=/home/ubuntu/canvas/src/loadbalancer/haproxy.conf | |
HAPROXY_DAEMON=/usr/local/sbin/haproxy | |
test -x $HAPROXY_DAEMON || exit 0 |
OlderNewer