Skip to content

Instantly share code, notes, and snippets.

View mbohun's full-sized avatar
🙃
How do you do?

Martin Bohun Hormann mbohun

🙃
How do you do?
  • Canberra, ACT, Australia
View GitHub Profile
@mbohun
mbohun / gist:3549074
Created August 31, 2012 04:28
test_cpp-regexp-boost.cpp
#include <algorithm>
#include <iostream>
#include <iterator>
#include <string>
#include <vector>
#include <boost/regex.hpp>
#include <boost/bind.hpp>
namespace {
@mbohun
mbohun / gist:3549091
Created August 31, 2012 04:31
test_cpp_string_tokenize-00.cpp
#include <iostream>
#include <iterator>
#include <set>
#include <sstream>
#include <string>
namespace {
const std::string text("lonely lovely baboon sat on his ass an he was a very lovely but lonely too most likely the loveliest baboon though his ass wasn't lovely really");
@mbohun
mbohun / gist:3549431
Created August 31, 2012 05:41
rlm_ftress notes 00
echo "#define RLM_FTRESS_VERSION `bzr version-info | egrep 'revno' | awk '{print $2}'`" > version.h
echo "#define RLM_FTRESS_VERSION `bzr version-info | sed -n '/^revno: \(.*\)/s//\1/p'`" > version.h
@mbohun
mbohun / gist:3549615
Created August 31, 2012 06:22
gcc-build-howto.txt
# it is often a 'good idea' / requirement to use the 3-4 latest stable versions of gcc,
# this howto was used/tested with the following versions of gcc:
# - gcc-4.4.x
# - gcc-4.5.x
# - gcc-4.6.x
# - gcc-4.7.x
# get and decompress gcc
#
wget gcc-4.6.3.tar.bz2
tar -jxvf gcc-4.6.3.tar.bz2
@mbohun
mbohun / gist:3606810
Created September 3, 2012 05:02
test_ldap_threads-synchronous.cpp
#ifdef _WIN32
#include <windows.h>
#endif //WIN32
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <time.h>
#include <ctype.h>
@mbohun
mbohun / gist:3606980
Created September 3, 2012 05:36
view-class-with-jad.sh
#!/bin/sh
PROG=`basename "$0"`
USAGE="$PROG class"
OUTPUT_DIR=/tmp
EXT=java
[ $# = 1 ] || {
@mbohun
mbohun / gist:3607275
Created September 3, 2012 06:25
dia_export-diagrams.sh
#!/bin/bash
#
# uses the dia http://live.gnome.org/Dia command line interface to
# re-generate .png diagrams from .dia files in a directory, this way
# - you can get images of diagrams regenerated 'automatically' everytime
# you modify a diagram (.dia file)
# - you do not have to keep your images in sync with diagrams manually
# - you do not need to store .png/.jpg/.svg in repository
# - can be run as a hook, inotify, cronjob
#
@mbohun
mbohun / gist:3791917
Created September 27, 2012 03:01
iptables firewall
#!/bin/sh
#
IPT="/usr/local/sbin/iptables"
SSH_HOSTS_ALLOWED="55.16.23.13/24 222.111.77.0/16 213.123.88.123/24 213.32.99.102/16"
case "$1" in
start)
#/sbin/sysctl -w net.ipv4.ip_forward=1
@mbohun
mbohun / gist:3832048
Created October 4, 2012 07:49
cvssuck cvs2svn howto
# get cvssuck ( http://cvs.m17n.org/~akr/cvssuck )
cvs -d :pserver:[email protected]:/cvs/cvs login
cvs -d :pserver:[email protected]:/cvs/cvs co cvssuck
# it is a ruby script, you might have to modify the path to ruby at the top of
# the script, the script assumes ruby is in /usr/local/bin, on my slackware
# laptop ruby is installed in /usr/bin
# login into the remote cvs server, and suck!
cvs -d :pserver:[email protected]:/cvs/devel login
@mbohun
mbohun / gist:3863187
Created October 10, 2012 04:37
generated dep tree for a group of .so
martin@yobbo:/usr/local/boost_1_51_0/lib$ find -P ./ -type f -name "*.so*" | xargs ldd | grep boost|sed -e "s/://g" -e "s/ => not found//g"
./libboost_context.so.1.51.0
./libboost_program_options.so.1.51.0
./libboost_signals.so.1.51.0
./libboost_regex.so.1.51.0
./libboost_math_tr1l.so.1.51.0
./libboost_graph.so.1.51.0
libboost_regex.so.1.51.0
./libboost_python.so.1.51.0
./libboost_math_c99l.so.1.51.0