Skip to content

Instantly share code, notes, and snippets.

@wernight
wernight / inotifyexec.py
Last active June 27, 2023 22:47
inotifywait helper that executes a command on file change (for Linux, put it in ~/bin/)
#!/usr/bin/env python
"""Use inotify to watch a directory and execute a command on file change.
Watch for any file change below current directory (using inotify via pyinotify)
and execute the given command on file change.
Just using inotify-tools `while inotifywait -r -e close_write .; do something; done`
has many issues which are fixed by this tools:
* If your editor creates a backup before writing the file, it'll trigger multiple times.
* If your directory structure is deep, it'll have to reinitialize inotify after each change.
@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@wernight
wernight / git-submite
Created October 18, 2012 22:24
'git submit' which pushes to Gerrit matching branch
#!/bin/sh -e
#
# Save this file as ~/bin/git-submit
#
# Usage: git submit [--draft] [remote]
# Example:
# 'git submit' executed on a Git branch tracking origin/master will push to refs/for/master.
#
REMOTE=origin