Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dap on github.
  • I am dap (https://keybase.io/dap) on keybase.
  • I have a public key whose fingerprint is 5304 CF26 E373 AEEF 6855 07AA 5F3E B709 00D4 11A4

To claim this, I am signing this object:

#!/bin/sh -e
case "$1" in
start)
#VBoxHeadless -s $2 -v off &
VBoxManage startvm --type headless $2
;;
stop)
VBoxManage controlvm $2 poweroff
;;
#!/usr/bin/perl
#
# Updates UID's listed in an .ics file
#
# Written to address the problem of importing calendar entries from an .ics
# into a Google Calendar, deleting them all, then finding that Google Calendar
# will not allow reimporting entries that it's already seen.
#
# This program updates the .ics in place, so make a backup copy first.
#!/usr/local/bin/perl
use strict;
use warnings;
use Getopt::Long; # option parsing
use Capture::Tiny qw/capture/; # output capture
use Date::Format; # date formatting
use Method::Signatures; # "func" syntax
use Sysadm::Install qw/:all/; # utilities for system administration
#!/usr/local/bin/perl
use strict;
use warnings;
use Getopt::Long; # option parsing
use Capture::Tiny qw/capture/; # output capture
use Date::Format; # date formatting
use Method::Signatures; # "func" syntax
use Sysadm::Install qw/:all/; # utilities for system administration
@dap
dap / gist:533200
Created August 18, 2010 02:53
Set process title from Perl
#!/usr/bin/perl
use Sys::Proctitle qw/:all/;
# ps
$0 = "awesome_code";
# top
setproctitle("awesome_code");
@dap
dap / Convert from RCS to Git
Created December 18, 2009 03:15
Convert from RCS to Git
Let's say you have something like:
/home/dap/workspace/awesome_code
Which contains your project files along with RCS:
awesome_code/
RCS/
code.pl
README
@dap
dap / gist:186834
Created September 14, 2009 18:36
Debug segfault on Solaris
How to debug an Apache segfault on Solaris 10
1. Ensure that the /var/core directory exists.
2. $ mdb /usr/local/sbin/httpd
3. At the MDB prompt:
> ::run -X
The "-X" above is actually a parameter to the httpd binary.
@dap
dap / gist:180477
Created September 3, 2009 19:15
Openfire to Prosody How-To
How to get sleekmigrate to work as noted at
http://el-tramo.be/blog/openfire-to-prosody-migration on Ubuntu 8.10:
0. Install python-tlslite from the chromium-daily PPA.
See https://launchpad.net/~chromium-daily/+archive/ppa.
1. Make a place to work:
$ mkdir ~/workspace && cd ~/workspace
@dap
dap / gist:151750
Created July 22, 2009 02:06
En/disable DD-WRT web console
#!/bin/bash
# ddweb.sh - enable/disable DD-WRT web console access
# Darian Anthony Patrick <dap@darianpatrick.com>
#
# Control access to the web management console
# of devices using the DD-WRT firmware by
# enabling/disabling the HTTP & HTTPS access.
#
# Repository: http://gist.github.com/151750