This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
update_command='reset; while pgrep -f apt-get; do echo -n "O"; sleep 60; done;aptitude update; aptitude -y -d safe-upgrade --full-resolver; aptitude safe-upgrade --full-resolver; purge-old-kernels ; cat /var/run/reboot-required*' | |
reachable () { | |
netcat -w 1 -z $* | |
} | |
hosts='dirk thomas abrasax orion' | |
sudo wakeonlan -f /etc/wakeonlan/abrasax.wol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
A replacement transport for Python xmlrpc library. | |
Usage: | |
>>> import xmlrpclib | |
>>> from transport import RequestsTransport | |
>>> s = xmlrpclib.ServerProxy('http://yoursite.com/xmlrpc', transport=RequestsTransport()) | |
>>> s.demo.sayHello() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package elpy | |
:config | |
(progn (elpy-enable) | |
(defun elpy-nose-test-spec (module test) | |
(cond (test | |
(format "%s:%s" module test)) | |
(module module) | |
(t ""))) | |
(defun elpy-test-nose-pdb-runner (top file module test) | |
"Test the project using the nose test runner with the --pdb arg. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
stty size|awk '{print "export TERM=screen;export LINES=" $1 ";export \ | |
COLUMNS=" $2 ";stty rows $LINES;stty cols $COLUMNS;reset"}' | |
# /etc/screenrc: | |
# register f '^A:exec .!. pastescreensize.sh^M' | |
# bind + process f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Archiv nur Buxtehuder Tageblatt | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @download https://gist.githubusercontent.com/TauPan/9b723469c2893fbefaff4cbe9845e34e/raw/tageblatt-archiv-buxtehude.js | |
// @description Begrenzt die Archivansicht beim tageblatt.de E-Paper auf Buxtehuder Tageblatt | |
// @author Friedrich Delgado <taupan@gmail.com> | |
// @match http://www.tageblatt.de/index.php?pageid=573 | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# adapted from https://gist.github.com/iMilnb/75d65d88ce649b1f191a | |
import ConfigParser | |
import mechanize | |
import os | |
CONFIG = os.environ.get('SPAMCOP_CONFIG', | |
os.path.expanduser('~/secret/spamcop-config.ini')) | |
config = ConfigParser.SafeConfigParser() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import db | |
import gc | |
# from https://djangosnippets.org/snippets/1949/ | |
def queryset_iterator(queryset, chunksize=1000): | |
''''' | |
Iterate over a Django Queryset ordered by the primary key | |
This method loads a maximum of chunksize (default: 1000) rows in it's | |
memory at the same time while django normally would load all rows in it's | |
memory. Using the iterator() method only causes it to not preload all the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# $Id: mutt2remember.pl,v 1.5 2008/09/27 11:25:41 friedel Exp friedel $ | |
# Variations on a theme given by Russell Adams http://lists.gnu.org/archive/html/emacs-orgmode/2008-09/msg00300.html | |
$ENV{TMPDIR} = $ENV{TMP}; | |
# Install: | |
# ======== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the Shift-PGUP/PGDOWN keys to scroll in screen's copy mode | |
bindkey [5;2~ eval "copy" "stuff \002" | |
bindkey -m [5;2~ stuff \002 | |
bindkey -m [6;2~ stuff \006 | |
bindkey -m ^[[5~ stuff \002 | |
bindkey -m ^[[6~ stuff \006 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; grep-mode is stupid and does its parsing too early | |
(pushnew (lambda (buffer string) | |
(when (eq major-mode 'grep-mode) | |
(grep-mode))) | |
compilation-finish-functions) | |
(defun git-grep () | |
(interactive) | |
(require 'grep) | |
(let ((grep-command "git --no-pager grep -nH -e ") |