Skip to content

Instantly share code, notes, and snippets.

View momonala's full-sized avatar
🍊

Mohit Nalavadi momonala

🍊
View GitHub Profile
from os import curdir
from os.path import join as pjoin
import sys, datetime, time, glob, os
from systemd import journal
from http.server import BaseHTTPRequestHandler, HTTPServer
class StoreHandler(BaseHTTPRequestHandler):
store_path = pjoin(curdir, 'store')
# in overland the url will be http://yourservername_or_ip:8383/store
anonymous
anonymous / stepper_motor.ino
Created September 24, 2017 19:40
Stepper Motor
int x=800;
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
}
void loop() {
for(int j=0; j<3000; j++) {
@funzoneq
funzoneq / simplehttp.service
Created May 25, 2016 13:24
A systemd file for a python SimpleHTTPServer
[Unit]
Description=Job that runs the python SimpleHTTPServer daemon
Documentation=man:SimpleHTTPServer(1)
[Service]
Type=simple
WorkingDirectory=/tmp/letsencrypt
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 &
ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'`
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n