Skip to content

Instantly share code, notes, and snippets.

View michel-zimmer's full-sized avatar

Michel Zimmer michel-zimmer

View GitHub Profile
@michel-zimmer
michel-zimmer / .jshintrc
Created September 27, 2014 01:36
.jshintrc for Node.js
{
"camelcase": true,
"curly": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
@michel-zimmer
michel-zimmer / README.md
Last active August 29, 2015 14:06
ipupdater

This is a dummy program and was developed to find a way to get encrypted communication between a server written in PHP and a client written in Node.js. It is far from being optimal and is more like a prove of concept.

To use it you need to create a openssl (private-public) key-pair.

Packages

Core packages

gnome-core xorg

Basic packages

@michel-zimmer
michel-zimmer / homenetwork
Last active August 29, 2015 14:05
/etc/network/if-up.d/homenetwork
#!/bin/sh
# replace _mac_ with a mac adress of an always on network device, like a router
if [ $( /usr/sbin/arp -a | grep -c '_mac_' ) -eq 1 ]; then
cat /etc/hosts.homenetwork > /etc/hosts
else
cat /etc/hosts.publicnetwork > /etc/hosts
fi
cat /etc/hosts.default >> /etc/hosts
@michel-zimmer
michel-zimmer / workspace-labeler.sh
Created August 12, 2014 20:37
Easily set individual names for workspaces in GNOME
#!/bin/sh
TMP=$( mktemp )
echo "$( gsettings 'get' 'org.gnome.desktop.wm.preferences' 'workspace-names' )" > $TMP
editor $TMP
gsettings 'set' 'org.gnome.desktop.wm.preferences' 'workspace-names' "$( cat $TMP )"
@michel-zimmer
michel-zimmer / x__.informatik.uni-bremen.de$who.sh
Last active February 28, 2017 12:29
How many users are logged in to the Linux PCs from the cs department at University of Bremen?
#!/bin/sh
i=1
while [ $i -le 25 ]; do
x=$( printf %02d $i )
printf "x%s: " "${x}"
ssh '-o ConnectTimeout=3' "x$x.informatik.uni-bremen.de" "printf \"%s loadavg: %s\\n\" \"\$( who | grep -v '(unknown)' | wc -l)\" \"\$(cat /proc/loadavg)\""
i=$(( i + 1 ))
done
@michel-zimmer
michel-zimmer / .gitignore
Last active August 29, 2015 14:05
.gitignore for LaTeX
**/*.sublime-workspace
**/*.acn
**/*.acr
**/*.alg
**/*.aux
**/*.bbl
**/*.bcf
**/*.blg
**/*.brf
**/*.dvi