Skip to content

Instantly share code, notes, and snippets.

@DamianZaremba
DamianZaremba / update_gists.pl
Created August 25, 2011 11:54
Gist update script
#!/usr/bin/perl5.12.4
use JSON;
use LWP::Simple;
use Cwd;
my $data = get "http://gist.github.com/api/v1/json/gists/damianzaremba";
my $json = decode_json($data);
my $gists = $json->{"gists"};
for my $gist (@$gists) {
@DamianZaremba
DamianZaremba / update.pl
Created August 22, 2011 15:55
Cluenet graphviz mapping script C=
#!/usr/bin/env perl
# We want to know if stuff is going to explode in our face
use warnings;
use strict;
# Awesome logging
use Log::Log4perl;
# LWP is an awesome HTTP client
use LWP::UserAgent;
<?php
class Bob{
function hi() {
print "Hi from " . get_class() . "\n";
}
}
class Damian{
function hi() {
print "Hi from " . get_class() . "\n";
#!/usr/bin/env perl
use lib '/home/damianzaremba/software/perlmods/share/perl/5.10.1/';
# We want to know if stuff is going to explode in our face
use warnings;
use strict;
# Awesome logging
use Log::Log4perl;
# Wikipedia client
@DamianZaremba
DamianZaremba / lastfm.php
Created August 17, 2011 12:45
Wordpress last.fm plugin
<?php
/*
Plugin Name: LastFM
Plugin URI:
Description: Displays data from LastFM
Author: damianzaremba
Author URI: http://damianzaremba.co.uk
Version: 1.0
License: GPL3
*/
@DamianZaremba
DamianZaremba / vm_install.sh
Created August 14, 2011 23:05
virt-install wrapper
#!/bin/bash
#
# Little virt-install wrapper to save typing, supports the following:
# centos - Centos network install with optional ks
# fedora - Fedora network install with optional ks
# debian - Debian network install with optional ks
# ubuntu - Ubuntu network instal with option ks
# pxe - Boot a vm and tell it try PXE
#
# Setup:
#!/usr/bin/perl
use warnings;
use strict;
use Net::LDAP;
use Data::Dumper;
my $ldap = Net::LDAP->new("ldap.cluenet.org", timeout => 10);
my $servers = {
abc => {
@DamianZaremba
DamianZaremba / server.py
Created August 2, 2011 22:29
BGPServer written in python - doesn't actually do anything apart from process inotify events right now.
#!/usr/bin/env python3
import argparse
import os
import logging
import sys
import signal
import socket
import pyinotify
'''
@DamianZaremba
DamianZaremba / auto_rejoin.pl
Created July 31, 2011 11:02
Modified irssi auto_rejoin script
# automatically rejoin to channel after kick
# delayed rejoin: Lam 28.10.2001 ([email protected])
# NOTE: I personally don't like this feature, in most channels I'm in it
# will just result as ban. You've probably misunderstood the idea of /KICK
# if you kick/get kicked all the time "just for fun" ...
use Irssi;
use Irssi::Irc;
use strict;
#!/usr/bin/env perl
use strict;
use Net::Twitter::Lite;
use Date::Format;
my $client = Net::Twitter::Lite->new(
consumer_key => "",
consumer_secret => "",
);