Skip to content

Instantly share code, notes, and snippets.

@jottr
jottr / spon.css
Created December 21, 2012 23:53
Spiegel.de sans uglyness.
#spBothColumnsTeaser {
border: none;
}
#spBoxColumn {
background-color: #ffffff;
}
#spBreadcrumb {
border-style: none;
@jottr
jottr / flac2mp3.sh
Last active December 14, 2015 05:29
Convert FLAC files contained in subfolders into VBR high quality mp3 and delete source files after transcode
find . -type f -iname '*.flac' | while read FILE; do FILENAME="${FILE%.*}"; flac -cd "$FILE" | lame -q 0 --vbr-new -V 0 - "${FILENAME}.mp3" && rm "${FILENAME}.flac"; done
@jottr
jottr / recentcp.sh
Last active December 14, 2015 09:28
Copy folders of a specified age to target dir
recentcp() { find `pwd` -mindepth 1 -maxdepth 1 -type d -mtime "${1}" -exec cp -rn -t "${2}" {} +; }
@jottr
jottr / standalone_python.sh
Created March 3, 2013 18:59
python standalone for android
#! /bin/sh
export EXTERNAL_STORAGE=/mnt/storage
PYTHONPATH=/mnt/storage/com.googlecode.pythonforandroid/extras/python
PYTHONPATH=${PYTHONPATH}:/data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6/lib-dynload
export PYTHONPATH
export TEMP=/mnt/storage/com.googlecode.pythonforandroid/extras/python/tmp
export PYTHON_EGG_CACHE=$TEMP
export PYTHONHOME=/data/data/com.googlecode.pythonforandroid/files/python
export LD_LIBRARY_PATH=/data/data/com.googlecode.pythonforandroid/files/python/lib

Colored log output

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

And every time you need to see your log, just type in

git lg

@jottr
jottr / vagrant_speedup.md
Last active December 20, 2015 02:49
speed up vagrant && virtualbox

Anecdotally, Using NFS with Vagrant / Virtualbox instead of the default Virtualbox shared folder speeds up things drastically. Add the following line in your Vagrantfile to test it out:

config.vm.share_folder "/vagrant", "/vagrant", "./", :nfs => true

Also, tweaking the DNS settings seems to help:

vb.customize ["modifyvm", :id, "--natdnshostresolver1", "off"]
@jottr
jottr / .gitignore
Created December 2, 2013 21:08
Basic gitignore
### Linux ###
.*
!.gitignore
!.git*
*~
### Windows ###
# Windows image file caches
Thumbs.db
#!/bin/bash -e
# install silverstripe + common modules from github
# usage sh install_silverstripe.sh <folder_name> <tag/branch>
# examples:
# sh install_silverstripe.sh some_folder tags/2.4.5
# sh install_silverstripe.sh some_folder master
#set up project base folder
git clone [email protected]:silverstripe/silverstripe-installer.git "$1"
@jottr
jottr / 99-thinklight.rules
Last active January 3, 2016 01:29
Blink thinklight
SUBSYSTEM=="leds", RUN+="/bin/sh /sbin/thinklight_permissions"
@jottr
jottr / containers.md
Last active January 3, 2016 03:19
remove running docker containers.

docker ps -a lists all running containers.

Delete all containers with an exit state of 1

docker ps -a | grep Exit | awk '{print $1}' | xargs docker rm

Remove all containers, ignoring their current state

docker ps -a -q | xargs docker rm

If you observe stale NFS handles - reboot.