Skip to content

Instantly share code, notes, and snippets.

View oahong's full-sized avatar
💭
I may be slow to respond.

Hong Hao oahong

💭
I may be slow to respond.
View GitHub Profile
@oahong
oahong / daemon.md
Created July 10, 2017 15:01 — forked from andreif/daemon.md
A simple unix/linux daemon in Python

A simple unix/linux daemon in Python

Source: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

Access: http://web.archive.org/web/20131025230048/http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

by Sander Marechal

I've written a simple Python class for creating daemons on unix/linux systems. It was pieced together for various other examples, mostly corrections to various Python Cookbook articles and a couple of examples posted to the Python mailing lists. It has support for a pidfile to keep track of the process. I hope it's useful to someone.

@oahong
oahong / meh
Created September 22, 2014 08:30
Index: scripts/system/auto_mount.py
===================================================================
--- scripts/system/auto_mount.py (revision 12076)
+++ scripts/system/auto_mount.py (working copy)
@@ -8,6 +8,8 @@
mount_cmd = '/bin/mount -t auto -o rw,utf8,noauto,sync,dirsync,noexec,nodev,noatime %s %s'
autosync_cmd = '/opt/tvu/TVUTransporter/autosyncdisk usbhd-%s'
+copysession_cmd = '/opt/tvu/TVUTransporter/localrecording_lastsession.sh %s'
+umount_cmd = '/bin/umount %s'