Skip to content

Instantly share code, notes, and snippets.


James Nzomo mrmoje

View GitHub Profile
mrmoje /
Created Mar 14, 2017
A sample PyPy vs CPython wager script
from __future__ import print_function
import cProfile
import random
import string
from datetime import datetime
def find_duplicates(seq):
mrmoje /
Created Feb 21, 2017
nuke directories by date threshold
#example:- nuke all files created before jan 1 2017,
touch -t 201701010000 /tmp/2017-Jan-01-0000
find `pwd` -maxdepth 1 -type d ! -newer /tmp/2017-Jan-01-0000 -exec rm -rf "{}" \
mrmoje /
Created Nov 28, 2016 — forked from creationix/
gikfun esp8266 kit

Amazon has a really good deal on an ESP8266 board in stock with prime.

There are no instructions with it so I bought one and between probing with my multimeter and trying different things, I was able to get nodemcu running.

Yellow jumper seems to toggle between flash mode and at mode, closed is flash mode.

three pins labeled gnd, tx, tr are for uart and are what you should plug in. tx-tx,rx-rx,gnd-gnd.

You can leave power dangling

View unlock rsa key
openssl rsa -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa_new
View sed in files
find /path/to/files/dir -type f -exec sed -i 's/regexp/replacement/g' {} \;
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
mrmoje / multi service restart loop with upstart
Created May 28, 2014
multi service restart loop with upstart
View multi service restart loop with upstart
#e.g for #OpenStack nova
for i in $( ls /etc/init/nova* | xargs -n 1 basename | sed 's/.conf//g' ); do sudo service $i restart; done