Skip to content

Instantly share code, notes, and snippets.

// validate that critical values are set
if (
(mpd_conf_tb.Text == "") || (mpd_exec_tb.Text == "") || (musicdir_set.Text == "") || (playlistdir_set.Text == "") ||
(
LastFM_enable.Checked &&
(
(mpds_exec_tb.Text == "") || (mpds_conf_tb.Text == "") || (lastfm_username.Text == "") || (lastfm_pass.Text == "")
)
)
@foxiepaws
foxiepaws / cgi-bin template
Created December 5, 2012 16:50
new mka2host
ScriptAlias /cgi-bin/ #DIR#/cgi-bin/
<Directory "#DIR#/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
@foxiepaws
foxiepaws / v4.txt
Created December 7, 2012 17:16
My hosts.shit file
This file has been truncated, but you can view the full file.
127.0.0.1 goatse.cx
127.0.0.1 www.goatse.cx
127.0.0.1 oralse.cx
127.0.0.1 www.oralse.cx
127.0.0.1 goatse.ca
127.0.0.1 www.goatse.ca
127.0.0.1 oralse.ca
127.0.0.1 www.oralse.ca
127.0.0.1 goat.cx
127.0.0.1 www.goat.cx
#!/usr/bin/env perl
use vars qw(%c @p $s);use HTML::Template;our %c=(i=>"full/",t=>"thumbs/",p=>
"/home/fox/testg/",T=>"/home/fox/tmpls/");our @p;our $s=HTML::Template->new(
filename=>$c{T}.'single.tmpl');chdir $c{p}.$c{i};@p=<*.jpg>,<*.gif>,<*.png>,
<*.jpeg>;foreach(@p){if(!(-f $c{p}.$c{t}.$_)){system("convert ".$c{p}.$c{i}.$_
." -thumbnail 260x180 ".$c{p}.$c{t}.$_)}}open (G,">".$c{p}."index.html");print
G (sub{my $a=HTML::Template->new(filename=>$c{T}.'index.tmpl');my @b;foreach(
@p){my %d;$d{LINK}="$_.html";$d{THUMB}=$c{t}.$_;push @b,\%d}$a->param(GALLERY
=>\@b);return $a->output})->();close G;my $a=scalar @p;for(my $b=0;$b<$a;$b++){
my($d,$e);if($b==0){$d=$p[$a-1];$e=$p[$b+1]}elsif($b==$a-1){$d=$p[$b-1];$e=$p[0]
@foxiepaws
foxiepaws / filesorts.pl
Last active December 14, 2015 07:49
Sorting files and stuff.
# Filesort
# Takes two Arguments, Requires one
# * $temp - [REQUIRED] Reference to an Array.
# * $opts - [Optional] Sets options
# * dir - Path to directory if not $PWD.
# * sortMode - Override the global sort mode.
# Returns an Array reference that is a sorted array.
# usage: sortFiles(\@temp,{dir => "$mydir",sortMode => "alpha"});
sub sortFiles {
my $temp = shift;
@foxiepaws
foxiepaws / gist:5067005
Created March 1, 2013 19:14
MTR over ATTs network to magrathea, my server on the west coast
trillian (0.0.0.0) Fri Mar 1 14:11:27 2013
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. 192.168.1.1
#!/usr/bin/env perl
#set variables
use vars qw(%c @p $s);
use HTML::Template;
our %c=(i=>"full/",t=>"thumbs/",p=>"/home/fox/testg/",T=>"/home/fox/tmpls/");
our @p;
our $s=HTML::Template->new(filename=>$c{T}.'single.tmpl');
# move to the image directory and glob image formats
chdir $c{p}.$c{i};@p=<*.jpg>,<*.gif>,<*.png>,<*.jpeg>;
def isValidAscii(a):
if (31 < a < 127):
return True
else:
return False
for x in range(32,127):
for y in range (32,127):
if (isValidAscii(x ^ y)):
print "x: '{}' y: '{}' xor: '{}'".format(chr(x), chr(y), chr(x ^ y))
section .data
test: db 'testInG 123', 0Ah
testlen: equ $-test
section .bss
testr: resb 100
section .text
global main
main:
mov esi, 0 ; set the segment pointer to 0, (xor esi,esi would have also been valid)
loop:
@foxiepaws
foxiepaws / bleh.hs
Last active December 14, 2015 18:09
-- basic conversion of lowercase to caps using xor, port of logic from bleh.asm.
-- aka msify because microsoft LOVES caps.
import Data.Bits
import Data.Int
import Data.Char
import Control.Monad
caps :: Char -> Char
caps x =