Skip to content

Instantly share code, notes, and snippets.

View teopeurt's full-sized avatar

Don Onwunumah teopeurt

  • PigStyCoders
  • Global
View GitHub Profile
#!/usr/bin/ruby
#
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
#
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
# versions of OS X. I cannot verify that for sure, and it was tested on
@teopeurt
teopeurt / .emacs.el
Last active September 28, 2015 20:08
emacs config
;; include ALL org files from a directory into the agenda
(setq org-agenda-files (list "~/DIR/file.org"
))
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
;; Headlines
'("^\\(\\**\\)\\(\\* \\)\\(.*\xa\\)" (1 (org-get-level-face 1))
(2 (org-get-level-face 2)) (3 (org-get-level-face 3)))
@teopeurt
teopeurt / BaseActivity.java
Created March 23, 2012 17:34
Suppressing ANR, auto-restarting app. Not recommended for Google Market!
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
public class BaseActivity extends Activity {
@teopeurt
teopeurt / wp-xml-octopress-import.rb
Created May 25, 2012 10:21 — forked from tnmt/wp-xml-octopress-import.rb
Import XML of Wordpress to Octopress
# -*- coding: utf-8 -*-
require 'fileutils'
require 'date'
require 'yaml'
require 'uri'
require 'rexml/document'
include REXML
doc = Document.new File.new(ARGV[0])
@teopeurt
teopeurt / installrrbenv.sh
Created September 13, 2012 09:50
scrip to install rbenv into environment
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
mkdir -p ~/.rbenv/plugins
cd ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git
@teopeurt
teopeurt / KeychainItemWrapper.h
Created October 16, 2012 16:52 — forked from dhoerl/KeychainItemWrapper.h
KeychainItemWrapper ARCified
/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
@teopeurt
teopeurt / quickfix++
Created October 26, 2012 13:22
Homebrew Gist
require 'formula'
class Quickfix < Formula
homepage 'http://www.quickfixengine.org/index.html'
url 'http://downloads.sourceforge.net/project/quickfix/quickfix/1.13.3/quickfix-1.13.3.tar.gz'
md5 '1e569a32107ecfc1de9c15bdcb5dc360'
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
#!/bin/bash
# Description: Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance
# Author: Adam Awan
# Email: [email protected]
# Set the port to forward for Tree.io
TREEIO_PORT="80"
# Create a PostgreSQL Instance
echo "Retrieving adam/pglite PostgreSQL Container..."
sudo aptitude update
sudo aptitude upgrade
sudo apt-get install -y httpie htop zsh git mosh
sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install -y lxd
#!/bin/bash
CONTAINER=$2
HOSTPORT=$1
CONTAINERPORT=$3
container_ip=$(lxc info $CONTAINER | grep 'eth0' | head -n1 | awk '{print $3}')
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport $HOSTPORT -j DNAT \
--to-destination $container_ip:$CONTAINERPORT