Skip to content

Instantly share code, notes, and snippets.

View modsaid's full-sized avatar

Mahmoud Salem modsaid

View GitHub Profile
@modsaid
modsaid / gist:1891303
Created February 23, 2012 07:28
Checking if a process with a certain pid is running
# Sometimes, specially if we are building a monitoring system or an admin UI,
# we need to be able to easily check if a process is running.
# Unfortunately this is not directly available through Process module. so here is a patch to add it
#
# Usage:
# Process.running?(pid)
# Process.memory(pid) # returns the memory usage in KB
module Process
@modsaid
modsaid / git_export
Created February 22, 2012 11:55
Exporting files out of a git repo like svn export
git archive master | tar -x -C /somewhere/else
OR
git archive --format zip --output /full/path/to/zipfile.zip master
Ref: http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export