Skip to content

Instantly share code, notes, and snippets.

View felixhummel's full-sized avatar

Felix Hummel felixhummel

View GitHub Profile
@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
#!/bin/bash
vmname=$1
vboxmanage controlvm $vmname poweroff
vboxmanage unregistervm $vmname --delete
@felixhummel
felixhummel / vboxhostname
Created October 29, 2015 12:46
/usr/local/bin/vboxhostname
#!/bin/bash
# If you set the something stupid that's not a valid hostname, then it's your
# own fault. :P
set -euo pipefail
echo 'Ran vboxhostname' > /tmp/x
echo '----------------' >> /tmp/x
VBoxControl guestproperty get hostname 2>&1 >> /tmp/x
vboxhostname=$(VBoxControl guestproperty get hostname | grep Value | awk '{ print $2 }')
echo "Got $vboxhostname" >> /tmp/x
@felixhummel
felixhummel / vboxhostname.conf
Created October 29, 2015 12:47
/etc/init/vboxhostname.conf
description "Set Hostname from virtualbox 'hostname' property"
start on (starting network-interface
or starting network-manager
or starting networking)
task
exec /usr/local/bin/vboxhostname
@felixhummel
felixhummel / labbox
Last active October 29, 2015 13:07
~/bin/labbox
#!/bin/bash
set -euo pipefail
vmname=$1
PROXY=dns
DOMAIN=lab
vboxmanage clonevm node --snapshot cleanup --options link --name $vmname --register
vboxmanage guestproperty set $vmname hostname $vmname
@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
#
@felixhummel
felixhummel / sources.list
Created January 11, 2013 20:57
12.04.1 server default sources.list germay
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://de.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ precise main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ precise-updates main restricted
@felixhummel
felixhummel / helper
Created April 11, 2013 11:58
startssl class1 helper
#!/bin/bash
[[ -z $2 ]] && echo "Usage: $0 POSTMASTER_EMAIL FULL_DOMAIN_NAME" && exit 1
postmaster_email=$1
full_domain_name=$2
req_file=${full_domain_name}/req
key_file=${full_domain_name}/key
crt_file=${full_domain_name}/crt
chain=${full_domain_name}/chain