Skip to content

Instantly share code, notes, and snippets.

View goerz's full-sized avatar

Michael Goerz goerz

View GitHub Profile
@goerz
goerz / quinegen.pl
Created August 1, 2010 17:53
quinegen.pl: Make a quine out of any perl program. Inspired by Douglas R. Hofstadter.
#!/usr/bin/perl -w
use strict;
# This program adds a function 'printself' to the end of an existing
# perl program, which prints out the entire program's listing. This
# will make the existing program to be a Quine
# (c)2006 Michael Goerz
# michaelgoerz.net
# This program is free software; you can redistribute it and/or modify
@goerz
goerz / latex_checkascii.pl
Created August 1, 2010 17:43
latex_checkascii.pl: check latex files for non-ascii characters and optionally replaces them with tex-representations
#!/usr/bin/perl -w
use strict;
use utf8;
############################################################################
# Copyright (C) 2008 by Michael Goerz #
# http://www.physik.fu-berlin.de/~mgoerz #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 3 of the License, or #
@goerz
goerz / insomnia
Created September 3, 2009 19:07
insomnia: CLI interface to InsomniaX
#!/usr/bin/perl
use strict;
# Author: Michael Goerz <[email protected]>
# Make sure that $kextfile is owned by root!
my $app = '/Applications/InsomniaX.app';
my $kextfile = "$app/Contents/Resources/Insomnia_r6.kext/";
sub close_insomnia_x{
my $ps_line = `ps -A | grep $app | grep -v grep`;