Skip to content

Instantly share code, notes, and snippets.

@dexterbt1
dexterbt1 / generate_unique_sequence_chars.pl
Created June 4, 2013 04:28
Generate a sequence of unique characters e.g. 3333, 3334 ... YYYX, YYYY
#!/usr/bin/env perl
use strict;
my $chars_str = '3456789ABCDEFGHJKMNPRSTUVWXY';
my @chars = split //, $chars_str;
# a b c d
my $template = [ 0, 0, 0, 0, 0 ];
my $dead_end = 0;
@dexterbt1
dexterbt1 / homebrew.mxcl.lighttpd.plist
Created May 23, 2013 17:22
homebrew lighttpd plist - works in Mountain Lion - place this in /Library/LaunchDaemons/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.lighttpd</string>
<key>ProgramArguments</key>
<array>
@dexterbt1
dexterbt1 / gibson
Created May 19, 2013 13:25
gibson font css
@font-face {
font-family: 'gibsonregular';
src: url('font/gibson-webfont.eot');
src: url('font/gibson-webfont.eot?#iefix') format('embedded-opentype'),
url('font/gibson-webfont.woff') format('woff'),
url('font/gibson-webfont.ttf') format('truetype'),
url('font/gibson-webfont.svg#gibsonregular') format('svg');
font-weight: normal;
font-style: normal;
@dexterbt1
dexterbt1 / signed_client_cli.php
Created April 11, 2013 10:01
Basic CLI wyrls REST API client implemented in PHP.
#!/usr/bin/env php
<?php
# dependencies:
# php curl extension
$usage = "USAGE: {$argv[0]} --client_id=... --privkey=... --url=... --method=... --ctype=... --body=...\n";
$options = getopt('', array('client_id:', 'privkey:', 'url:', 'method:', 'ctype:', 'body:'));
$timeout = 60;
@dexterbt1
dexterbt1 / .vimrc
Last active December 11, 2015 11:38
vim Config
" ==============================================
" Basics
set nocompatible " vi compatibility not a priority
set encoding=utf8
set fileencoding=utf8
set expandtab " foce convert tabs to spaces
set ts=4 " tabs are 4-space aparts
@dexterbt1
dexterbt1 / create_libvirt_lxc_guest.sh
Last active December 11, 2015 09:49
Centos 6.3 script to automate creation of the LXC rootfs and libvirt definition
#!/bin/bash
# vim: set ts=4 sw=4 et nu
set -e
usage="Usage: $0 <name>"
name=$1
if [ -z "$name" ]; then
echo $usage
exit 1;
fi
@dexterbt1
dexterbt1 / coop-push-status.sql
Last active December 11, 2015 03:29
quick overview of the coop push status
select
pcd.push_date, pci.priority, pci.content_automediaid, sum(pcir.started) run_started, sum(pcir.completed) run_completed,
pci.max_runs, stats_base, sum(pcir.stats_billed) stats_billed
from
push_cycle_day pcd inner
join push_cycle_item pci on (pcd.id=pci.push_cycle_day_id)
left outer join push_cycle_item_run pcir on (pci.id=pcir.push_cycle_item_id)
where
pcd.push_date=date(now())
group by pci.id
@dexterbt1
dexterbt1 / gist:1494396
Created December 18, 2011 20:41
dummy bridge for inter-vm VLAN
create a script like this
( mkdir /usr/local/scripts )
/usr/local/scripts/generate_vmbr20.sh
modprobe -o dummy0 dummy1
ifconfig dummy0 up
brctl addbr vmbr20
brctl addif vmbr20 dummy0
ifconfig vmbr20 up
@dexterbt1
dexterbt1 / fatfreecrm-0.9.10.gems.list
Created December 10, 2011 18:17
working gem list for fatfreecrm 0.9.10
abstract (1.0.0)
actionmailer (3.0.7)
actionpack (3.0.7)
activemodel (3.0.7)
activerecord (3.0.7)
activeresource (3.0.7)
activesupport (3.0.7)
acts_as_commentable (3.0.1)
annotate (2.4.0)
archive-tar-minitar (0.5.2)
@dexterbt1
dexterbt1 / svnserve.sh
Created April 6, 2011 13:15
svnserve init script (tested on CentOS/RHEL 5.x)
#!/bin/bash
#
# /etc/init.d/subversion
#
# Starts the Subversion Daemon
#
# chkconfig: 2345 90 10
# description: Subversion Daemon