Skip to content

Instantly share code, notes, and snippets.

View rwoeber's full-sized avatar

Richard Wöber rwoeber

  • Würzburg, Germany
View GitHub Profile
<HTML>
<HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD>
<BODY>
<H1>Not Found</H1>
The requested document was not found on this server.
<P>
<HR>
<ADDRESS>
@rwoeber
rwoeber / gist:752725
Created December 23, 2010 08:10
generate DHL recipies from orders
require 'iconv'
require 'csv'
UTF8_ISO_CONVERTER = Iconv.new('ISO-8859-1', 'utf-8')
shipping_time = Time.now
ready_to_ship_orders = Order.find(:all, :conditions => Order::State::ATTRIBUTE_CONDITIONS[Order::State::IN_SHIPPING])
@rwoeber
rwoeber / gist:807668
Created February 2, 2011 13:23
zsh-completion for rvm and homebrew
# http://mxcl.github.com/homebrew/
# http://rvm.beginrescueend.com/
ln -s /usr/local/Library/Contributions/brew_zsh_completion.zsh $HOME/.zsh/functions/_brew
ln -s $HOME/.rvm/scripts/zsh/Completion/_rvm $HOME/.zsh/functions/_rvm
@rwoeber
rwoeber / sqlite3.txt
Created March 28, 2011 19:02
Install a 'newer' SQLite3 on debian
# via: http://www.fangiotophia.com/journal/2010/8/31/random-act-of-stupidity-6-debian-rails-3-setup-guide.html
# Open /etc/apt/sources.list and add the following line to the end, then save the file:
deb http://www.backports.org/debian lenny-backports main contrib non-free
# Then, run the following command to make sure the GPG signatures are correct and don't give you warnings when running apt commands:
sudo aptitude update
sudo aptitude install debian-backports-keyring
# Finally, you can install SQLite3:
@rwoeber
rwoeber / Application.java
Created March 29, 2011 10:59
Include svn-revision into ant-build
private static String getApplicationIdentificationString() {
final StringBuilder result = new StringBuilder();
result.append(Application.class.getPackage().getImplementationTitle());
result.append(" ");
result.append(Application.class.getPackage().getImplementationVersion());
return result.toString();
}
@rwoeber
rwoeber / gist:1010044
Created June 6, 2011 10:25
rather minimalistic ipfw rule-script (FreeBSD)
#!/bin/sh
# inspired by 1fbsdguru's stuff at:
# http://www.cyberciti.biz/faq/howto-setup-freebsd-ipfw-firewall/
# do not forget to set right ip!
ip="my.ip.address"
IPF="ipfw -q add"
# Loopback
user1 = Joe User <[email protected]>
user2 = Jane User <[email protected]>
@rwoeber
rwoeber / free.pl
Created June 28, 2011 06:58
freebsd-memory -- List Total System Memory Usage
#!/usr/bin/perl
##
## freebsd-memory -- List Total System Memory Usage
## Copyright (c) 2003-2004 Ralf S. Engelschall <[email protected]>
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
## are met:
## 1. Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.
@rwoeber
rwoeber / local.rw.launchkeep.iterm.plist
Created July 22, 2011 10:53
Mac OS X Launch Agent to start & keep iTerm alive
<?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>user.launchkeep.iterm</string>
<key>KeepAlive</key>
<true/>
<key>Program</key>
<string>/Applications/iTerm.app/Contents/MacOS/iTerm</string>
@rwoeber
rwoeber / airreset.c
Created September 27, 2011 09:53
Rest Airport (DSL) Connection (wait 5sec to get new IP)
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <unistd.h>
int main (int argc, const char * argv[]) {
// insert code here...