Skip to content

Instantly share code, notes, and snippets.

@neingeist
neingeist / gist:1619725
Created January 16, 2012 08:20
maildrop .mailfilter recipe to add task to taskwarrior via email
#----------------------------------------------------------------------
# add a task to taskwarrior
#----------------------------------------------------------------------
if (/^From:.*VALIDSENDER@EXAMPLE.COM/ && /^To:.*taskwarrior@/)
{
# save a copy
cc "$MAILDIR/.task/"
# extract subject and add task
@neingeist
neingeist / wiki-upload.pl
Created June 30, 2012 17:28
Upload a file to a recent MediaWiki using the API
#!/usr/bin/perl
# Upload a file to a recent MediaWiki using the API.
use strict;
use MediaWiki::API 0.39;
my $wikiuser = $ARGV[0];
my $wikipass = $ARGV[1];
my $file = $ARGV[2];
my $comment = $ARGV[3];
@neingeist
neingeist / spcrc-logcat
Created November 3, 2012 14:15
Simple supercat configuration for Android logcat
# HTML COLOR NAME COL A N T STRING or REGULAR EXPRESSION
#################### ### # # # ################################################################
Red red (^E/.*)
Yellow yel (^W/.*)
@neingeist
neingeist / test-htmlpurifier.php
Created March 16, 2013 13:23
htmlpurifier test
<html><body>
<?php
require_once '../includes/htmlpurifier-4.5.0-lite/library/HTMLPurifier/Bootstrap.php';
spl_autoload_register(array('HTMLPurifier_Bootstrap', 'autoload'));
$config = HTMLPurifier_Config::createDefault();
$config->set('HTML.Allowed', 'p,b,a[href],i,br,img[src]');
$config->set('URI.Base', 'http://www.example.com');
@neingeist
neingeist / check-ptr
Created March 19, 2013 10:10
Check PTR for every IP in the given block.
#!/usr/bin/perl
# Check PTR for every IP in the given block.
use 5.010;
use strict;
use warnings;
use Readonly;
use Net::Netmask;
use Socket;
@neingeist
neingeist / gist:5257647
Last active December 15, 2015 12:08
convert rss to wikitext
<?xml version="1.0"?>
<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
<output method="text" indent="no" />
<template match="/">
<for-each select="//item">
<text>== Title: </text><value-of select="title"/><text> ==&#10;</text>
<for-each select="enclosure">
<text>* </text><value-of select="@url"/><text>&#10;</text>
@neingeist
neingeist / owncloud-news-expire
Created December 4, 2013 18:12
mark old articles in owncloud news as read
#!/bin/sh
# mark old articles in owncloud news as read.
DAYS=14
sqlite3 /var/www/owncloud/data/owncloud.db "update oc_news_items set status=0 where status=2 and pub_date<cast(strftime('%s','now', '-$DAYS days') as integer);"
@neingeist
neingeist / gist:8217088
Created January 2, 2014 09:54
pandoc -f latex -t epub -o applied-crypto-hardening.epub applied-crypto-hardening.tex
$ make epub
pandoc -f latex -t epub -o applied-crypto-hardening.epub applied-crypto-hardening.tex
pandoc:
Error:
"source" (line 2660, column 1):
unexpected end of input
expecting "}", "\\", "\\}", "\\{", "\\\\" or "{"
make: *** [epub] Error 1
@neingeist
neingeist / mandelbrot-openmp.c
Last active August 29, 2015 14:01
just some OpenMP example
#include "SDL.h"
#include <complex.h>
#include <stdbool.h>
/* The maximum iteration count. */
const int max_it = 170;
/* Compute the out-coloring based on the iteration counter. */
Uint32 outcolor(int it) {
return 0x00010001 * ((it * 0xff) / max_it);
@neingeist
neingeist / keybase.md
Created August 4, 2014 19:16
keybase.md

Keybase proof

I hereby claim:

  • I am neingeist on github.
  • I am neingeist (https://keybase.io/neingeist) on keybase.
  • I have a public key whose fingerprint is CB77 0FCD B4AA 5FB0 108F 82B4 DB21 F68B 4A5D BB9F

To claim this, I am signing this object: