Skip to content

Instantly share code, notes, and snippets.

View felixhummel's full-sized avatar

Felix Hummel felixhummel

View GitHub Profile
@felixhummel
felixhummel / rake.sh
Created March 29, 2011 12:08 — forked from turadg/rake.sh
# bash completion for rake
#
# some code from on Jonathan Palardy's http://technotales.wordpress.com/2009/09/18/rake-completion-cache/
# and http://pastie.org/217324 found http://ragonrails.com/post/38905212/rake-bash-completion-ftw
#
# For details and discussion
# http://turadg.aleahmad.net/2011/02/bash-completion-for-rake-tasks/
#
# INSTALL
#
@felixhummel
felixhummel / getcert
Created April 11, 2011 22:49
Get a (self-signed) SSL certificate for Ubuntu 10.10
#!/bin/bash
HOSTNAME=$1
TMPFILE=`mktemp`
FNAME=$HOSTNAME.crt
expect_cmd() {
cmd=$1
package=$2
which $cmd &> /dev/null
# load global bash completion
if [[ -f /etc/bash_completion ]]; then
. /etc/bash_completion
fi
# load everything under ~/.bash/
if [[ -d $HOME/.bash/ ]]; then
for f in $HOME/.bash/*; do
source $f
done
@felixhummel
felixhummel / bindings.sh
Created October 16, 2011 08:53
$HOME/.bash/bindings.sh
# how to create new shortcuts:
# run ``cat > /tmp/x``
# type your shortcut
# press enter (creates new line still in cat)
# press C-d to send EOF to cat
# run ``cat -v /tmp/x | sed 's;\^\[;\\e;'``
# paste output here
# ipython style history
bind '"\e[A":history-search-backward'
@felixhummel
felixhummel / build-nginx.sh
Created October 31, 2011 19:41
Build Nginx 1.0.8 on Ubuntu 10.10 with reverse web socket capabilities
# http://www.letseehere.com/reverse-proxy-web-sockets
export VERSION=1.0.8
export PREFIX=/usr/local
export USERNAME=nginx
export GECOS='nginx web server'
filename=nginx-$VERSION.tar.gz
set -x # print commands
@felixhummel
felixhummel / gist:1416996
Created December 1, 2011 14:10
PHP Symfony get absolute path from relative Path
$relativePath = $this->config['foo'];
$pseudoPath = sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . $relativePath;
$absolutePath = realpath($pseudoPath);
if (!$absolutePath) {
throw new Exception("File not found: $pseudoPath");
}
$this->use($absolutePath);
@felixhummel
felixhummel / kubuntu_initial.sh
Last active October 6, 2015 09:38
kubuntu initial
sudo add-apt-repository ppa:chromium-daily/beta
sudo apt-get update
\curl -L https://raw.github.com/felixhummel/x/master/ubuntu_intial.sh | bash
wajig install --yes yakuake chromium-browser firefox
wajig install --yes krusader md5deep okteta krename kdiff3 ark arj bzip2 cpio lha unrar rar rpm unace unzip zip p7zip
wajig install --yes oxygen-cursor-theme-extra k4dirstat
wajig install --yes vlc
@felixhummel
felixhummel / info.php
Created September 7, 2012 18:26
fastcgi nginx php test
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index info.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
@felixhummel
felixhummel / preseed.cfg
Last active December 10, 2015 13:58
preseed.cfg as generated by `debconf-get-selections --installer` more: see https://github.com/felixhummel/ubuntu-12.04.1-server-amd64-vagrant/blob/master/templates/preseed.cfg
# for internal use; can be preseeded
partman-basicfilesystems partman/automount boolean false
# Non-existing physical volume
partman-auto-lvm partman-auto-lvm/no_such_pv error
# Active devices for the RAID array:
# Choices:
partman-md partman-md/raiddevs multiselect
# Use software from the "universe" component?
apt-mirror-setup apt-setup/universe boolean true
#