Skip to content

Instantly share code, notes, and snippets.

James Nzomo mrmoje

Block or report user

Report or block mrmoje

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mrmoje
mrmoje / 5m.py
Created Mar 14, 2017
A sample PyPy vs CPython wager script
View 5m.py
from __future__ import print_function
import cProfile
import random
import string
from datetime import datetime
def find_duplicates(seq):
"""
@mrmoje
mrmoje / nuke_by_date_threshold.sh
Created Feb 21, 2017
nuke directories by date threshold
View nuke_by_date_threshold.sh
#credit:- http://stackoverflow.com/questions/33091013/delete-files-older-than-specific-date-in-linux
#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
mrmoje / a-notes.md
Created Nov 28, 2016 — forked from creationix/a-notes.md
gikfun esp8266 kit
View a-notes.md

Amazon has a really good deal on an ESP8266 board in stock with prime. http://www.amazon.com/Gikfun-ESP8266-ESP-12-Industrial-version/dp/B00RK1W7R6

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' {} \;
View reflect.py
#!/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
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
You can’t perform that action at this time.