Skip to content

Instantly share code, notes, and snippets.

@dap
dap / gist:149564
Created July 18, 2009 13:37
Store PHP code in a JPEG
#!/usr/bin/perl
# write_jpg.pl - Store PHP code inside of a JPEG
# Darian Anthony Patrick <[email protected]>
#
# Demonstration of masquerading PHP code inside
# of a file identifiable as JPEG format
use perl5i;
use IO::All;
@dap
dap / gist:149704
Created July 18, 2009 22:07
Store PHP code in a GIF
#!/usr/bin/perl
# write_gif.pl - Store PHP code inside of a GIF
# Darian Anthony Patrick <[email protected]>
#
# Demonstration of masquerading PHP code inside
# of a file identifiable as GIF format
use perl5i;
use IO::All;
@dap
dap / gist:151109
Created July 21, 2009 04:26
Detect PHP in non-php files
#!/usr/bin/perl
# php_watch.pl - Monitor directory for PHP code in non-.php files
# Darian Anthony Patrick <[email protected]>
#
# Uses inotify to monitor a directory for the
# existence of files containing PHP code which
# are not named with a .php file extension
use perl5i;
@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 <[email protected]>
#
# 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
@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: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 / 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: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");
#!/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