Skip to content

Instantly share code, notes, and snippets.

View viegelinsch's full-sized avatar

viegelinsch viegelinsch

  • Germany
View GitHub Profile
@viegelinsch
viegelinsch / colourful_less
Last active August 29, 2015 14:05
colorful less
*cool thing* from http://linux-tips.org/article/78/syntax-highlighting-in-less
apt-get install source-highlight
add this on the bottom of .bashrc
# he: some colour for less
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=' -R '
et voilá ...
@viegelinsch
viegelinsch / etc-default-grub
Last active August 29, 2015 14:05
Ubuntu 14.04 server - reboot (grub) hangs
problem: your server hangs on reboot
symptom: grub shows menu and waits for an input
> /etc/default/grub
contains the lines
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
@viegelinsch
viegelinsch / brew pin
Created September 23, 2014 09:19
prevent homebrew package from being automatically updated
# brew pin [packagename]
brew pin qemu
@viegelinsch
viegelinsch / install_pisense
Created February 20, 2015 15:26
install pisense_ Raspberry Pi Munin monitoring
## Installation of https://github.com/perception101/pisense
sudo su -
mkdir /opt/munin-plugins
wget https://raw.githubusercontent.com/perception101/pisense/master/pisense_ -O /opt/munin-plugins/pisense_
chmod 0755 /opt/munin-plugins/pisense_
ln -s /usr/share/munin/plugins/pisense_ /etc/munin/plugins/pisense_clock
@viegelinsch
viegelinsch / add-ip-to-etc-issue
Created July 13, 2015 16:43
Add current IP to /etc/issue (aka linux login greeting)
#!/bin/sh
# file: /etc/network/if-up.d/add-ip-to-etc-issue
# source: "stolen" somewhere
if [ "$METHOD" = loopback ]; then
exit 0
fi
# Only run from ifup.
if [ "$MODE" != start ]; then
@viegelinsch
viegelinsch / brew-update-notifier.sh
Last active September 29, 2015 14:48 — forked from SimonSimCity/brew-update-notifier.sh
Extended the script, written by @streeter to exclude the pinned formulae in the list of formulas to update.
#!/bin/bash
#
# Notify of Homebrew updates via Notification Center on Mac OS X
#
# Author: Chris Streeter http://www.chrisstreeter.com
# Requires: terminal-notifier. Install with:
# brew install terminal-notifier
TERM_APP='/Applications/Terminal.app'
BREW_EXEC='/usr/local/bin/brew'
# creating a private git repository to use with SparkleShare
cd Documents/
# let's name it "trans"
git init --bare trans
git config --file trans/config receive.denyNonFastForwards true
bash /tmp/add_attributes.sh
less trans/info/attributes
cd ..
chmod --recursive o-rwx Documents
# Add list of files that Git should not compress
EXTENSIONS="jpg jpeg png tiff gif flac mp3 ogg oga avi mov mpg mpeg mkv ogv ogx webm zip gz bz bz2 rpm deb tgz rar ace 7z pak iso dmg"
for EXTENSION in $EXTENSIONS; do
sleep 0.05
echo -ne " -> echo \"*.$EXTENSION -delta\" >> trans/info/attributes \r"
echo "*.$EXTENSION -delta" >> "trans/info/attributes"
sleep 0.05
EXTENSION_UPPERCASE=`echo $EXTENSION | tr '[:lower:]' '[:upper:]'`
echo -ne " -> echo \"*.$EXTENSION_UPPERCASE -delta\" >> trans/info/attributes \r"
echo "*.$EXTENSION_UPPERCASE -delta" >> "trans/info/attributes"
@viegelinsch
viegelinsch / brew_update_force
Last active December 18, 2015 07:49
force "brew update"
taken from: https://github.com/mxcl/homebrew/issues/11448
cd `brew --prefix`
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
sudo git reset --hard origin/master