Skip to content

Instantly share code, notes, and snippets.

execute pathogen#infect()
" Solarized stuff
let g:solarized_termcolors = 16
let g:solarized_termtrans = 1
" syntax enable
set background=dark
colorscheme solarized
## Make .vim a git repo
mkdir -p ~/.vim && cd ~/.vim && git init
## Pathogen
$ cd ~/.vim
$ git submodule add https://github.com/tpope/vim-pathogen.git bundle/pathogen.vim
$ mkdir -p autoload
$ cd autoload
$ ln -s ../bundle/pathogen.vim/autoload/pathogen.vim .
@waffle2k
waffle2k / extract_ip_address.c
Created June 11, 2014 19:26
Extract an IP address from a string.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// http://stackoverflow.com/a/792645
static
int isValidIp4 (char *str) {
int segs = 0; /* Segment count. */
int chcnt = 0; /* Character count within segment. */
int accum = 0; /* Accumulator for segment. */
@waffle2k
waffle2k / age
Created June 3, 2014 19:37
Display the age of a provided file in seconds
#!/bin/bash
#
# Display age of file in seconds
echo $(($(date +%s)-$(stat -c %Y $1)))
@waffle2k
waffle2k / git-addumulate.pl
Created May 27, 2014 18:32
Find out how much work you or your workmates have done
#!/usr/bin/perl
use strict;
my $author = `git config user.email`;
if ($ARGV[0] =~ /^\S+?\@\S+$/){
$author = shift;
}
my $since = join( " ", @ARGV );
@waffle2k
waffle2k / watch-ps.pl
Created May 13, 2014 18:29
run via "watch watch-ps.pl" to view the process tree of the cron jobs running on a machine...
#!/usr/bin/perl -w
use strict;
my $search = shift || 'CRON';
my $following = 0;
for (`ps auxwwf`){
chomp;
$following++ if /$search/;
#!/bin/bash
## Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com>
## License: GNU General Public License v2, v3
#
# Lockable script boilerplate
### HEADER ###
LOCKFILE="/var/lock/`basename $0`"
##
## Put me in ~/.irssi/scripts, and then execute the following in irssi:
##
## /load perl
## /script load notify
##
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
@waffle2k
waffle2k / flingo-example-install.sh
Created April 10, 2014 15:13
Install Flingo from git source to a package on Debian systems
#!/bin/bash
set -e
cd /tmp
sudo apt-get install devscripts
[ ! -d Flingo ] && git clone https://github.com/petermblair/Flingo.git
cd Flingo
git branch | grep -q dmarc-example || git checkout -b dmarc-example f4f9cb7ed