Skip to content

Instantly share code, notes, and snippets.

for dir in apparmor apt ConsoleKit cups dist-upgrade fsck gdm installer news ntpstats samba unattended-upgrades ; do
if [ ! -e /var/log/$dir ] ; then
mkdir /var/log/$dir
fi
done
tmpfs /var/log tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
@behrends
behrends / fragment.rb
Created September 7, 2010 22:02 — forked from tenderlove/fragment.rb
umlauts and encoding in nokogiri
require 'rubygems'
require 'nokogiri'
doc = Nokogiri::HTML::Document.new
doc.encoding = 'UTF-8'
# We added a contextual fragment method for the 1.4.2 release. This *might*
# work in 1.4.1. If you want to mess with 1.4.2, build from my github, or
# grab one of our nightly builds:
#
@behrends
behrends / host alias in ssh
Created November 8, 2010 09:06
use shortcut in ssh/scp
vim .ssh/config
Host foo
Hostname foo.bar.de
User joe
--> ssh foo
@behrends
behrends / .irbrc
Created November 8, 2010 11:13
My .irbrc file
require 'rubygems'
require 'wirble'
require 'bond'
Wirble.init
Wirble.colorize
Bond.start
@behrends
behrends / caret key in Gnome
Created November 11, 2010 08:43
Enable proper caret key (^) in Gnome using a keyboard with German layout
set keyboard layout to "Germany Dead grave accurate"
@behrends
behrends / map capslock to escape
Created November 12, 2010 09:47
Linux: map capslock to escape
global setting - edit ~/.Xmodmap and put the following in it:
!! No Caps Lock
clear lock
!! Make Caps_lock an escape key.
keycode 0x42 = Escape
without global setting:
enable during current session:
xmodmap -e "clear lock"
@behrends
behrends / css3 button
Created November 23, 2010 14:11
Gradient button in CSS3
/* from http://addyosmani.com/css3/ and http://jsfiddle.net/9TpHn/17/ */
.tutorial {
font-size: 16px;
font-weight: bold;
border: 1px solid #2356a1;
padding: 20px 25px;
color: #fff;
background-color:blue;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
@behrends
behrends / mysql upgrade failure
Created January 18, 2011 08:48
MySQL upgrade failure resolution on ubuntu
Find your debian-sys-maint password in /etc/mysql/debian.cnf.
Then login to mysql (mysql -u root) and execute
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '<password>' WITH GRANT OPTION;
Replace <password> with your debian-sys-maint password.
@behrends
behrends / gist:818553
Created February 9, 2011 14:25
to be removed
123344