This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/dnsmasq.d/dhcp.conf | |
dhcp-range=192.168.1.100,192.168.1.254,12h | |
dhcp-option=3,192.168.1.1 | |
dhcp-option=15,alltech.local | |
dhcp-boot=pxelinux.0 | |
dhcp-match=set:efi-x86_64,option:client-arch,7 | |
dhcp-boot=tag:efi-x86_64,bootx64.efi | |
except-interface=wan0 | |
dhcp-authoritative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
FS= "," | |
} | |
/$^/ { } | |
NF { | |
if(NR == 1) { | |
a[1] = "First Name" | |
a[2] = "Last Name" | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[filter "two_four"] | |
smudge = perl -MPOSIX -pe 's|^( +)|\" \" x floor(length($1)*2)|e' | |
clean = perl -MPOSIX -pe 's|^( +)|\" \" x floor(length($1)/2)|e' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# make sure there were no problems loading the fixtures | |
self::assertNotContains('Exception', $cliCapturedOutput); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modified from http://pullmonkey.com/2008/01/06/convert-a-ruby-hash-into-a-class-object/ | |
class ObjectFromHash | |
def initialize(hash) | |
hash.each do |k,v| | |
# check to see if this value is a hash too | |
if v.class.name == "Hash" | |
v = ObjectFromHash.new(v) | |
end | |
self.instance_variable_set("@#{k}", v) ## create and initialize an instance variable for this key/value pair | |
self.class.send(:define_method, k, proc{self.instance_variable_get("@#{k}")}) ## create the getter that returns the instance variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcregrep -o "http%3A%2F%2Fa\d\.sphotos\.ak[^&]+" index | perl -MURI::Escape -ne 'print uri_unescape($_)' | wget -i - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this line reads the whole file in so we can do multiline substitution | |
:a;N;$!ba; | |
# this gets rid of our 5 line breaks between functions | |
s/\n\n\n\n\n/\n\n/g | |
# this puts curly braces on the same line with the control structures/function definitions to which they belong | |
# be aware that if there is a set of lines like this: | |
# | |
# if(myTest) //here's some documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pageOutput = ""; | |
try | |
{ | |
if(!isset($_GET['page_name']) || empty($_GET['page_name'])) throw(new UserErrorException("This page received an invalid request.")); | |
$database = mysql_db::get(); | |
$pageName = $_GET['page_name']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "fileutils" | |
#this is the file that we will write the chosen sig to | |
tbirdSigFile = "/home/lytithwyn/.thunderbird/r2hddzc6.default/sigs/lytithwyn@gmail.htm" | |
Dir.chdir(Dir.home() + "/sigs") do | |
sigs = Dir.glob("*.htm"); | |
sigFileNumberToUse = rand(sigs.length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <X11/Xlib.h> | |
#include <X11/Xatom.h> | |
#include <assert.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
Display *dpy = XOpenDisplay(NULL); |
NewerOlder