Skip to content

Instantly share code, notes, and snippets.

@breunigs
breunigs / measure-net-speed-i3status.bash
Created August 4, 2012 18:59
bash script that measures the network throughput on configured adapters between calls. Intended to be used with i3status/i3bar and similar. Strives to only use bash-builtins.
#!/bin/bash
# Public Domain
# (someone claimed the next lines would be useful for… people. So here goes:
# © 2012 Stefan Breunig
# stefan+measure-net-speed@mathphys.fsk.uni-heidelberg.de)
# append i3status output to the measure-net-speed’s one. the quote and escape
# magic is required to get valid JSON output, which is expected by i3bar (if
# you want colors, that is. Otherwise plain text would be fine). For colors,
# your i3status.conf should contain:
@breunigs
breunigs / kabelbw-rechnungen.rb
Created August 7, 2012 07:04
Script that downloads all invoices in your KabelBW login center. (Read: I’m not going to cope with KabelBW’s cr… issues)
#!/usr/bin/ruby
# encoding: utf-8
# Public Domain
# (someone claimed the next lines would be useful for… people. So here goes:
# © 2012 Stefan Breunig
# stefan+kabelbwrechnungen@mathphys.fsk.uni-heidelberg.de)
USER = "DEIN KABELBW ACCOUNT"
PASS = "DEIN KABELBW PASSWORT"
@breunigs
breunigs / ingress_intel_chat_improvements.user.js
Last active June 30, 2017 21:27
Small improvements to the Ingress Chat at ingress.com/intel. 1. Better distinction between public/faction chat. Prevents accidentally posting to public. 2. Switch to faction chat by default. 3. Ability to hide automated messages (will consume a LOT of CPU though, so beware). 4. Scrolling up in chat issmoother (less “Loading…”) 5. Bits and pieces.
// ==UserScript==
// @name ingress.com/intel chat improvements
// @description Small improvements to the Ingress Chat at ingress.com/intel. 1. Better distinction between public/faction chat. Prevents accidentally posting to public. 2. Switch to faction chat by default. 3. Ability to hide automated messages (will consume a LOT of CPU though, so beware). 4. Scrolling up in chat issmoother (less “Loading…”) 5. Bits and pieces.
// @namespace https://gist.github.com/4415985
// @updateURL https://gist.github.com/raw/4415985/ingress_intel_chat_improvements.user.js
// @downloadURL https://gist.github.com/raw/4415985/ingress_intel_chat_improvements.user.js
// @include http://www.ingress.com/intel*
// @version 8
// ==/UserScript==
@breunigs
breunigs / ingress-classic-gmaps-laf.user.js
Last active December 10, 2015 13:09
Restore Google Maps Classic For Ingress Intel
// ==UserScript==
// @id www.ingress.com-f4dbd255-58ee-4873-988a-b2265a876000@scriptish
// @name Restore Google Maps Classic For Ingress Intel
// @version 3
// @namespace https://gist.github.com/4439073
// @updateURL https://gist.github.com/raw/4439073/ingress-classic-gmaps-laf.user.js
// @downloadURL https://gist.github.com/raw/4439073/ingress-classic-gmaps-laf.user.js
// @description Restores the classical Google Maps style to the Ingress intel map
// @include http://www.ingress.com/intel*
// @run-at document-end
@breunigs
breunigs / show-img-ingress.user.js
Created January 27, 2013 18:31
shows full image when clicking on the truncated thumbnail in portal details on ingress.com/intel
// ==UserScript==
// @name show portal image for ingress.com/intel
// @description Click on an image in the portal details to show it in full
// @namespace https://gist.github.com/4649628
// @updateURL https://gist.github.com/raw/4649628/show-img-ingress.user.js
// @downloadURL https://gist.github.com/raw/4649628/show-img-ingress.user.js
// @include http://www.ingress.com/intel*
// @version 1
// ==/UserScript==
@breunigs
breunigs / git-patch.diff
Last active December 13, 2015 19:08
render portal level using svg
diff --git a/code/boot.js b/code/boot.js
index b27f335..e4a24bb 100644
--- a/code/boot.js
+++ b/code/boot.js
@@ -250,6 +250,7 @@ function boot() {
window.debug.console.overwriteNativeIfRequired();
console.log('loading done, booting');
+ window.extendLeafletWithText();
window.setupStyles();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.css" />
<style>
#content {
position:fixed;
top:30px;
@breunigs
breunigs / display-lyrics-cmus-urxvt.py
Last active December 21, 2015 01:39
displays lyrics of currently playing song. Works in existing shell or opens a new terminal. Keywords: cmus urxvt mutagen
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
if not sys.stdout.isatty() and os.environ.get('iherduleikterms') != 'no':
os.environ['iherduleikterms'] = 'no'
os.system('urxvtcd -title "Lyrics Viewer™" -e sh -c "lyrics-currently-playing | less"')
exit
@breunigs
breunigs / join-avi.bash
Created August 14, 2013 10:28
joins avi files properly so that they may be skipped
#!/bin/bash
echo "The following files will be joined:"
find -maxdepth 1 -iname "*.AVI" -type f | sort
echo ""
echo "Output Filename:"
echo "(may also be an absolute path; omit"
echo "quotation marks unless you want them"
@breunigs
breunigs / desktop-barcode-reader.sh
Created August 14, 2013 10:29
reads barcodes/qrcodes currently visible on the screen
#!/bin/sh
# requires:
# zbar-tools scrot zenity debianutils
scrot "$(tempfile).png" --exec 'zbarimg "$f"; rm "$f"' 2>&1 | zenity --title "Barcode Info" --text-info --width 450 --height 300