Skip to content

Instantly share code, notes, and snippets.

@skreuzer
skreuzer / named.conf
Created December 9, 2011 22:03
named logging configuration
logging {
channel server_general {
file "/var/log/named/general.log" versions 5 size 5M;
print-time yes;
severity info;
};
channel server_updates {
file "/var/log/named/update.log" versions 5 size 5M;
@skreuzer
skreuzer / connect.c
Created December 24, 2011 17:33
Make socket connection using SOCKS4/5 and HTTP tunnel
/***********************************************************************
* connect.c -- Make socket connection using SOCKS4/5 and HTTP tunnel.
*
* Copyright (c) 2000-2004 Shun-ichi Goto
* Copyright (c) 2002, J. Grant (English Corrections)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
@skreuzer
skreuzer / NaServer.pm
Created August 13, 2012 15:28
Patch to make NaServer.pm work on FreeBSD
--- NaServer.old 2012-02-15 15:56:33.593579000 -0500
+++ NaServer.pm 2012-02-17 10:23:49.242005000 -0500
@@ -26,10 +26,8 @@
use Socket;
use LWP::UserAgent;
use XML::Parser;
-eval "require Net::SSLeay";
-eval "require IO::Select";
+use Data::Dumper;
use NaElement;
@skreuzer
skreuzer / README.md
Last active December 10, 2015 04:38
FreeBSD Port Count by Category

Simple bar chart constructed from a csv file storing the number of ports in each category

#!/usr/local/bin/perl -w

use FreeBSD::Ports;

my @catagories =
(qw/
        accessibility arabic archivers astro audio benchmarks biology
@skreuzer
skreuzer / freebsd.nki
Created January 13, 2013 02:19
FreeBSD related non kitten items for robotfindskitten
It's a red bikeshed
It's a orange bikeshed
It's a yellow bikeshed
It's a green bikeshed
It's a blue bikeshed
It's a purple bikeshed
It's Jordan Hubbard
It's Marshall Kirk McKusick
It's Alfred Perlstein
It's Robert Watson
_cidr2mask()
{
local i mask=""
local full_octets=$(($1 / 8))
local partial_octet=$(($1 % 8))
for((i = 0; i < 4; i += 1))
do
if [ $i -lt $full_octets ]
then
#!/usr/bin/perl
use strict;
use warnings;
sub fisher_yates_shuffle
{
my $array = shift;
my $i = @$array;
while ( --$i )
#!/bin/sh
pw group add -n admin -g 9999
echo vagrant | pw mod user root -h 0
echo vagrant | pw add user vagrant -u 9999 -c "Vagrant User" -k /etc/skel -m -d /home/vagrant -g admin -s /bin/sh -h 0
mkdir /home/vagrant/.ssh
chown vagrant:vagrant /home/vagrant/.ssh
chmod 700 /home/vagrant/.ssh
#!/bin/sh
CLUSTER=$(hostname | cut -d- -f 1)
GRAPHITE_PORT=2003
REFRESH=5
function _usage
{
echo "$0 -g graphite-server [-p graphite-port] [-c cluster-name] [-r polling-interval]"
}
@skreuzer
skreuzer / gist:8230481
Last active January 2, 2016 01:29
Mavericks System Preference Pane Not Working
defaults write NSGlobalDomain NSUseLeopardWindowValues YES
defaults write com.apple.Safari NSUseLeopardWindowValues NO
killall SystemUIServer