Skip to content

Instantly share code, notes, and snippets.

@DirkR
DirkR / cloudSettings
Last active Nov 21, 2020
vscode_settings
View cloudSettings
{"lastUpload":"2020-11-21T21:26:03.236Z","extensionVersion":"v3.4.3"}
@DirkR
DirkR / new_post
Created Apr 18, 2015
This shell function "new_post" generates the file structure for a blog post in textbundle format (see http://textbundle.org/spec/). Append the code fragment at the end of yout `~/.bashrc` or `~/.zshrc`.
View new_post
# append at the end of yout ~/.bashrc or ~/.zshrc
new_post() {
local title="$*"
if [ -z $title ]; then
echo "No title given. Usage: new_post \"My post title\""
return
fi
local date=$(date "+%Y-%m-%d")
local slug=$(echo $title | tr -cd "[:alnum:][:blank:]" | tr -s '[:blank:]' '-' | tr "[:upper:]" "[:lower:]" )
View keybase.md

Keybase proof

I hereby claim:

  • I am dirkr on github.
  • I am dirkr (https://keybase.io/dirkr) on keybase.
  • I have a public key whose fingerprint is 8F49 81B7 66BD 7D6D B9EA 8902 CA8D E2B2 2327 C422

To claim this, I am signing this object:

@DirkR
DirkR / update_blog.sh
Created Mar 10, 2014
Update a python-powered static site blog based on (external) request.
View update_blog.sh
#!/bin/sh
# (C) 2014 Dirk Ruediger
# Licensed under Do-with-it-wht-you-want license.
#
# Update a static site blog based on (external) request.
# This script works for python-powered blogs (pip, virtualenv, pelican, ...),
# but can adopted to other platforms easily.
#
# This script scans the project folder for a file '.dirty'.
# If this file is found, then it checks, if the requerements
@DirkR
DirkR / testsuite_succeed.xml
Last active Dec 25, 2015
This is a jUnit XML results file that should succeed in Jenkins.
View testsuite_succeed.xml
<?xml version="1.0" encoding="utf-8"?>
<testsuite errors="0" failures="0" name="testsuite" skips="0" tests="9" time="0.142">
<testcase classname="tests.test_config" name="test_configuration" time="0.00542116165161"/>
<testcase classname="tests.test_config" name="test_old_style_configuration" time="0.00733280181885">
<system-out>WARNING: removed legacy setting &apos;shows&apos; for show &apos;nachtradio&apos; of station &apos;dlf&apos; in configuration file.
WARNING: removed legacy setting &apos;shows&apos; for show &apos;weather&apos; of station &apos;dlf&apos; in configuration file.
WARNING: removed legacy setting &apos;shows&apos; for show &apos;news&apos; of station &apos;wdr2&apos; in configuration file.
WARNING: Saved a updated version of config file as &apos;/private/var/folders/yj/yq8mj5g125q7632t201jnj1m0000gn/T/pytest-29/test_old_style_configuration0/capturadiorc.oldstyle.new&apos;.
</system-out>
</testcase>
@DirkR
DirkR / README.md
Last active Dec 21, 2015
Postprocess a junit results xml file and reformat the failure and exception messages for usage in vim The script takes a logfile, a folder containing *.xml files as arguments or can get piped the output of another program as input.
View README.md
@DirkR
DirkR / drushbackup.sh
Created Nov 19, 2012
Script tu run Drupal's "drush bb" to scheduled backup location and remove old Backups
View drushbackup.sh
#!/bin/sh
#
# backup_migrate is a powerful module to create backups of a drupal database.
# It also has a tight drush integration and supports cron-based scheduled
# backups as well as removal out outdated backups. But you cannot define a
# eliable time frame when to run the backup. So it's possible that the
# scheduled backup runs at highnoon and sets your website into maintenance
# mode for a few seconds. That's where this script jumps in.
#
# This script runs drush on a set of drupal installations (defined in
@DirkR
DirkR / findhttperrors.py
Created Feb 23, 2012
List all 403/404/500 error messages from an apache log
View findhttperrors.py
#!/usr/bin/env python2.7
import apachelog, sys, os, re, datetime, time
# Format copied and pasted from Apache conf - use raw string + single quotes
format = r'%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"'
# The return dictionary from the parse method depends on the input format.
# For the above example, the returned dictionary would look like;
#
@DirkR
DirkR / duplyreport.pl
Created Mar 25, 2011
dyplyreport.pl - a duply syslog wrapper. This script runs duply (a duplicity backup wrapper), filters all the bias and writes all important information into syslog.
View duplyreport.pl
#!/usr/bin/env perl
# vi: sw=2 ts=2 et
# (C) 2011 Dirk Ruediger <dirk@niebegeg.net>
# Feel free do hack or adopt it!
#
# A syslog wrapper for duply. It runs duply, filers "bias" out and
# writes all important and unexpected messages to syslog.
#
# usage:
# Like duply. all arguments are passed to duply