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 / .gitignore
Last active August 29, 2015 14:05
.gitignore for LaTeX
**/*.sublime-workspace
**/*.acn
**/*.acr
**/*.alg
**/*.aux
**/*.bbl
**/*.bcf
**/*.blg
**/*.brf
**/*.dvi
@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 / 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 / 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

Packages

Core packages

gnome-core xorg

Basic packages

@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.

@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,
<!DOCTYPE html>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="jquery-linedtextarea.js"></script>
<script>
jQuery( function( $ ) {
function send() {
$( "#url" ).prop( "disabled", true );
$( "#send" ).prop( "disabled", true );
$( "#request" ).prop( "disabled", true );
$.ajax( {
@michel-zimmer
michel-zimmer / Table.md
Created March 17, 2015 00:30
License comparison
MIT License Apache License 2.0 GNU General Public License v3.0
Disclose Source Required
License and copyright notice Required Required Required
State Changes Required Required
Commercial Use Permitted Permitted Permitted
Distribution Permitted Permitted Permitted
Modification Permitted Permitted Permitted
Patent Grant Permitted Permitted
Private Use Permitted Permitted Permitted
package hacked.puzzles.story.cyber_attack.match;
import java.util.ArrayList;
public enum Bracket {
CLOSE {
@Override
public String toString() {
return ")";
}