Skip to content

Instantly share code, notes, and snippets.

View nealmcb's full-sized avatar

Neal McBurnett nealmcb

View GitHub Profile
@nealmcb
nealmcb / track_session_inhibitors.py
Created July 16, 2012 05:19
Track and print out the apps and clients that are inhibiting Gnome session actions like log out, user switching, suspending or idle/dpms/screensaver, under Linux.
#!/usr/bin/python
"""
Print out the apps and clients that are inhibiting session actions like log out, user switching, suspending or idle.
%InsertOptionParserUsage%
Example:
track_session_inhibitors &
Todo:
@nealmcb
nealmcb / testkernel.py
Created February 24, 2012 05:16
testkernel: automate many linux kernel testing steps - great for a git bisect
#!/usr/bin/env python
"""
The testkernel command does these things to make linux kernel testing easy:
looks in the indicated folder on the web
downloads the .deb files for the kernel of the given type
installs them locally
configures grub2 to reboot to the given kernel on the next reboot
TODO:
Peter Lyons' notes on installing fgdb (Free Geek Database) from the trunk:
git://git.freegeek.org:/git/fgdb.rb
Note that after running into some problems with that, we tried using the one at github which is close to version 1.0.30 of the main project, and that has been working better.
http://wiki.github.com/markstos/fgdb.rb/
But for the record, here is the procedure we tried for the trunk version (about version 1.0.50):
-Installed Ubuntu Server 10.04 amd64 (Lucid)
## Climate analysis R code based on Steve McIntyre's example at
## http://camirror.wordpress.com/2009/11/29/replicating-the-trick-diagram/#more-130
## with some fixes by Neal McBurnett.
## Usage: R --save < replicate_trick.r
## which produces an "Rplots.ps" file
##COMPARE ARCHIVED BRIFFA VERSION TO CLIMATEGATE VERSION#
#1. LOAD BRIFFA (CLIMATEGATE VERSION)
# archive is truncated in 1960: ftp://ftp.ncdc.noaa.gov/pub/data/paleo/treering/reconstructions/n_hem_temp/briffa2001jgr3.txt”
@nealmcb
nealmcb / rankconvert.py
Last active December 5, 2023 03:23
Convert ranked ballots from the CSV format provided by CIVS to BLT
#!/usr/bin/env python
"""Convert ranked ballots from the CSV format provided by CIVS
(http://www.cs.cornell.edu/andru/civs.html) to the BLT format
used by, e.g., OpenSTV (www.openstv.org/).
http://code.google.com/p/stv/wiki/BLTFileFormat
TODO: support the popular "text" format and equal rankings via the "=" delimiter.
%InsertOptionParserUsage%
@nealmcb
nealmcb / pack.rb
Created August 25, 2009 21:37 — forked from vsalbaba/pack.rb
# just playing
def self.pkg(platform, opt)
# short time solution <start>
extension = case platform
when "win32" then
"exe"
when "linux" then
"run"
when "osx" then
"dmg"