Skip to content

Instantly share code, notes, and snippets.

View skyrocknroll's full-sized avatar

Yuvaraj L skyrocknroll

View GitHub Profile
[solarized-dark]
background = #002b36
foreground = #839496
majorLine = #fdf6e3
minorLine = #eee8d5
lineColors = #268bd2,#859900,#dc322f,#d33682,#db4b16,#b58900,#2aa198,#6c71c4
fontName = Sans
fontSize = 10
fontBold = False
fontItalic = False
@skyrocknroll
skyrocknroll / process.md
Last active August 29, 2015 13:57
long running process startup monitoring. supervisord monit forever & pm2 .

Supervisord tried

pip install supervisord ??

apt-get install supervisord ??

added config files

supervisorctl ? : prints all the help.
@skyrocknroll
skyrocknroll / configuration.md
Last active August 29, 2015 13:57
application configuration
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@skyrocknroll
skyrocknroll / profile.md
Last active August 29, 2015 14:02
python profiling

@Maxy's comment on this answer helped me out enough that I think it deserves its own answer: I already had cProfile-generated .pstats files and I didn't want to re-run things with pycallgraph, so I used gprof2dot, and got pretty svgs:

$ sudo apt-get install graphviz
$ git clone https://code.google.com/p/jrfonseca.gprof2dot/ gprof2dot
$ ln -s "$PWD"/gprof2dot/gprof2dot.py ~/bin
$ cd $PROJECT_DIR

$ gprof2dot.py -f pstats profile.pstats | dot -Tsvg -o callgraph.svg

@skyrocknroll
skyrocknroll / git.md
Created June 13, 2014 06:43
git scm branching and best practices
@skyrocknroll
skyrocknroll / remove pyc from git
Last active August 29, 2015 14:02 — forked from fjunior87/remove pyc from git
remove pyc from git
find . -name "*pyc" -exec git rm -f {} \;
/**
* Autowire Quartz Jobs with Spring context dependencies
* @see http://stackoverflow.com/questions/6990767/inject-bean-reference-into-a-quartz-job-in-spring/15211030#15211030
*/
public final class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware {
private transient AutowireCapableBeanFactory beanFactory;
public void setApplicationContext(final ApplicationContext context) {
beanFactory = context.getAutowireCapableBeanFactory();
}
@skyrocknroll
skyrocknroll / tiptop.md
Created July 17, 2014 09:13
performance freak tiptop . it shows the hardware counter cache hit cache misses etc

Download tiptop from here

http://tiptop.gforge.inria.fr/

install the dependencies

apt-get install byacc
apt-cache search lex
apt-get install libncurses5 libxml2
ORIGINAL_JENKINS_SERVER=
ORIGINAL_SERVER_USER=
NEW_JENKINS_SERVER=
NEW_SERVER_USER=
# ON THE ORIGINAL JENKINS SERVER
ssh $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER
cd /var/lib/jenkins/
for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar