Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@neingeist
neingeist / gist:3bae8d937af603492717
Created September 25, 2014 20:03
MATLAB needs eth0 for its licensing system. So create one. (for Fedora 20 etc.)
# MATLAB needs eth0 for its licensing system. So create one:
ip link add eth0 type dummy
ip link set dev eth0 address 00:12:34:56:78:90:xy
@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:

@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 / 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 / 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: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 / 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 / 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 / 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/.*)