Skip to content

Instantly share code, notes, and snippets.

@bldewolf
bldewolf / 10-hog-wild.conf
Created November 6, 2013 23:25
Fontconfig that turns on hinting and subpixel stuff
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="pattern">
<edit mode="append" name="autohint">
<bool>false</bool>
</edit>
</match>
<match target="pattern">
<edit mode="append" name="rgba">
@bldewolf
bldewolf / 70-no-bitmap-helvetica.conf
Created November 6, 2013 22:06
Fontconfig file for avoiding using the terrible bitmap version of Helvetica.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Reject Helvetica bitmap fonts -->
<selectfont>
<rejectfont>
<pattern>
<patelt name="scalable"><bool>false</bool></patelt>
<patelt name="family"><string>Helvetica</string></patelt>
</pattern>
@bldewolf
bldewolf / yourmom.gplot
Last active December 27, 2015 12:49
Plotting time of day vs date example
#!/usr/bin/gnuplot
set term png
set output "yourmom.png"
set terminal png size 600,300
set grid nopolar
# example
# Aug 24 2010,01,21,username
@bldewolf
bldewolf / netdisco-trapd.pl
Last active December 24, 2015 03:19
snmptrapd plugin for Netdisco/Nagios integration
#!/usr/bin/perl
use warnings;
use strict;
use lib '/var/lib/netdisco';
use netdisco qw/:all/;
config("/var/lib/netdisco/netdisco.conf");
@bldewolf
bldewolf / cisco-portchannels.pl
Last active March 29, 2018 09:33
A small Perl script using Net::SNMP to check port channel health on a given Cisco device. Exit values should be Nagios-compatible.
#!/usr/bin/perl
use strict;
use warnings;
use Net::SNMP;
use Getopt::Long;
sub snmp_error {
my $session = shift;
@bldewolf
bldewolf / gist:6243393
Last active December 21, 2015 03:38
Messing around with MBRs
Messing around with MBRs is fun. For example, you can make overlapping
partitions. Well, not with fdisk, of course. You need to make the volume to
clone first, then shuffle it around with dd like so:
dd if=/dev/sda bs=1 skip=446 seek=462 of=/dev/sda count=16
dd if=/dev/sda bs=1 skip=446 seek=478 of=/dev/sda count=16
dd if=/dev/sda bs=1 skip=446 seek=494 of=/dev/sda count=16
Once this is done, kick the kernel to reread the MBR (I usually do this with
fdisk because it amuses me that it will read and save this wacky partition
@bldewolf
bldewolf / calcram.py
Created August 21, 2012 06:37
Pull down a calendar file and merge it into a local one
#!/usr/bin/python
import vobject
import sys
import os
from urllib import urlopen
# Hack for RFC violations
vobject.icalendar.escapableCharList = '\\;,Nn"\'&'
@bldewolf
bldewolf / tracetosmoke.pl
Created June 10, 2011 19:31
traceroute output to smokeping config converter
#!/usr/bin/perl
use strict;
use warnings;
my @s;
my $hop = 0;
while(<>) {
chomp;