This file contains hidden or 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/python | |
import json | |
class AuthenticationException( Exception ): | |
pass | |
def loginrequired( fn ): | |
def wrapper( *args, **kwargs ): | |
print "args:",args | |
print "kwargs:",kwargs |
This file contains hidden or 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
#!/bin/bash | |
# --- Command line | |
refname="$1" | |
oldrev="$2" | |
newrev="$3" | |
echo "> $refname" | |
echo "> $oldrev" | |
echo "> $newrev" |
This file contains hidden or 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 | |
class Milk | |
def self.cost | |
puts " with Milk" | |
0.2 | |
end | |
end | |
class Sugar |
This file contains hidden or 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
#!/bin/bash | |
# This will create a new repository, with a sample README, and clone it | |
# to a default location | |
PROJNAME=$1 | |
if [ -d /home/git/tmp/$PROJNAME ]; then | |
echo "Project by that name already exists" | |
exit 1 |
This file contains hidden or 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/perl | |
use POSIX qw(setuid getuid); | |
my $w = scalar getpwuid( $< ); | |
if( $w eq 'root' ){ | |
print "Hey, you're root... let's try to become 'abuse'\n"; | |
# become user abuse | |
my ($pwName, $pwCode, $pwUid, $pwGid, $pwQuota, $pwComment, |
This file contains hidden or 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/perl | |
my $input = do { local $/; <>; }; | |
# Strip out the boiler plate... | |
$input =~ s/(\nNOTE:\s+Please respect.*?DOESN'T APPEAR TWICE IN YOUR POST\n)//s; | |
print $input; | |
exit(0); |
This file contains hidden or 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/python | |
import sys | |
from json_decorator import * | |
a = [ None,1,2,3,4,5,"foobar", { 'ya': 'right' },] | |
@jsonify | |
def something(obj): | |
return obj |
This file contains hidden or 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
import json | |
class jsonify( object ): | |
def __init__(self,f): | |
self.f = f | |
def __call__(self, *args, **kwargs ): | |
results = self.f(*args, **kwargs) | |
j = json.dumps( results ) |
This file contains hidden or 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/perl | |
use strict; | |
use lib( "/home/pblair/lp.beta/logparse/lib" ); | |
use File::Glob ':glob'; | |
use RBL::ProcessAggregate; | |
use RBL::Whitelist; | |
my @libs = bsd_glob('/home/pblair/lp.beta/logparse/lib/RBL/ProcessAggregate/*.pm'); | |
s/.*\/(\S+?)\.pm$/$1/ for @libs; | |
eval "require RBL::ProcessAggregate::$_" for @libs; |
This file contains hidden or 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/perl | |
use strict; | |
use IP::Country::Fast; | |
my $reg = IP::Country::Fast->new(); | |
my $input = do { local $/; <>; }; | |
my @ips = $input =~ /(.*?)(?:\/\d+)?\s/sg; | |
my %cc = map { $_ => $reg->inet_atocc($_) } @ips; |