Skip to content

Instantly share code, notes, and snippets.

View cmur2's full-sized avatar

Christian Nicolai cmur2

View GitHub Profile
@groupdock
groupdock / ejabberd_
Created June 16, 2010 13:15
ejabberd munin plugin
#!/bin/bash
#
# Updated/Modified by Luc Castera (2010-06-14). Intellum Inc.
# (http://www.intellum.com)
#
# Munin plugin for ejabberd2.
#
# Written by Lasse Karstensen <lkarsten@hyse.org> 2007-05-27.
# Based on ejabberd-plugin by Christian Dröge <Christian@draugr.de>
#
@paulirish
paulirish / utmstrip.user.js
Last active April 11, 2024 07:53
userscript: Drop the UTM params from a URL when the page loads
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.2
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http*://*
// ==/UserScript==
@nickman
nickman / install.sh
Created May 20, 2011 13:16
Graphite Server Install Script for Ubuntu
#!/bin/bash
#######################################
# Graphite Install
# Run with sudo for best results
#
#######################################
if [[ "$(/usr/bin/whoami)" != "root" ]]; then
echo "This script must be run as root or using sudo.Script aborted."
exit 1
@olivergondza
olivergondza / d.jsf
Created June 17, 2011 21:28
JOE syntax highlight file for D programming language
# JOE syntax highlight file for D programming language
=Idle
=Bad bold red
=Comment green
=Constant cyan
=Escape bold cyan
=Type bold
=Keyword bold
=Brace magenta
@torgeir
torgeir / Makefile
Created June 23, 2011 18:40
A Scala Makefile
SRC = scala
SOURCES = $(shell ls $(SRC)/*.scala)
S = scala
SC = scalac
TARGET = target
CP = $(TARGET):scalatest.jar
SPEC = scala.RomanSpec
compile: $(SOURCES:.scala=.class)
@kirbysayshi
kirbysayshi / mass-aggregation-change.sh
Created November 23, 2011 17:14
quick examples of how to change many many wsp (graphite/whisper) files settings
for f in $(find $1 -iname "*.wsp"); do
if [ -a $f ];
then /opt/graphite/bin/whisper-set-aggregation-method.py $f max;
fi;
done
@abstraktor
abstraktor / string.rb
Created February 3, 2012 12:35
rotX with ruby
# when you guessed a letter
# rotate("ammi://zbmanu.vhf/tulmktdmhk", "h".ord - "a".ord)
def rotate(str, num)
str.chars.map{|c| (c.ord<97) ? c: ((c.ord+num - 97)%26 + 97).chr}.join("")
end
@KartikTalwar
KartikTalwar / Documentation.md
Last active May 9, 2024 12:59
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@rodneyrehm
rodneyrehm / anti-keygrabber.user.js
Last active July 5, 2022 01:31
GreaseMonkey: Prevent Web Applications From Grabbing Certain HotKeys
// ==UserScript==
// @name anti key-grabber
// @description Prevent web apps from capturing and muting vital keyboard shortcuts
// @grant none
// @version 1.1
// ==/UserScript==
(function(){
var isMac = unsafeWindow.navigator.oscpu.toLowerCase().contains("mac os x");
unsafeWindow.document.addEventListener('keydown', function(e) {
if (e.keyCode === 116) {
@hubgit
hubgit / README.md
Last active May 2, 2024 10:55
Remove metadata from a PDF file, using exiftool and qpdf. Note that embedded objects may still contain metadata.

Anonymising PDFs

PDF metadata

Metadata in PDF files can be stored in at least two places:

  • the Info Dictionary, a limited set of key/value pairs
  • XMP packets, which contain RDF statements expressed as XML

PDF files