Skip to content

Instantly share code, notes, and snippets.

View git-short-export.py
#!/usr/bin/python3
import subprocess
import shlex
def call(cmd):
print(">>> {}".format(cmd))
return subprocess.check_call(cmd, shell=True)
View git-sync
#!/bin/sh
set -e
#set -x
USB="$PWD"
WORK=$HOME/work
SYNC_TS=.git/sync.timestamp
[ -f .components ] && COMPONENTS="$(cat .components)"
View filter.py
#!/usr/bin/python
import sys
import subprocess
parents = filter(lambda p: p!='-p', sys.stdin.readline().split() )
output = []
for parent in parents:
result=subprocess.check_output(["git", "rev-list", parent] + map(lambda p: "^%s"%p, filter(lambda p: p != parent, parents)))
View test_hrtimer.c
#include <linux/init.h>
#include <linux/module.h>
#include <linux/hrtimer.h>
#include <linux/ktime.h>
#include <linux/kthread.h>
#include <linux/delay.h>
MODULE_LICENSE("Dual BSD/GPL");
#define RX_POLL_PERIOD_MIN_US 800
#define RX_POLL_PERIOD_MAX_US 3000
@gerasiov
gerasiov / webmon.sh
Created Apr 3, 2015
The smallest video monitoring daemon ever
View webmon.sh
#!/bin/sh
DEVICE=/dev/video0
RESOLUTION="width=1024:height=768"
FRAMES_SKIP=3
ROTATE=1
REMOTE_HOST=lvk.cs.msu.su
REMOTE_DIR=public_html/webcam
INTERVAL=300
WORK_DIR=$(mktemp -d)
You can’t perform that action at this time.