Skip to content

Instantly share code, notes, and snippets.

View noqqe's full-sized avatar
😴

Florian Baumann noqqe

😴
View GitHub Profile
@noqqe
noqqe / configuration.nix
Last active September 5, 2015 11:21
NixOS Configuration of nixe.k4cg.org
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
./users.nix
./services/irc.nix
./services/wiki.nix
./services/mailinglist.nix
@noqqe
noqqe / dates.py
Last active August 29, 2015 14:09
python2.7 email.utils.parsedate() seems to be broken O_o
import time
import email.utils
d1='Mon, 18 Nov 2014 14:10:44 +0000'
d2='Sat, 15 Nov 2014 14:10:47 +0000'
d3='Fri, 14 Nov 2014 11:49:18 -0800'
d4=time.strptime("16 11 14", "%d %m %y")
d1e=email.utils.parsedate(d1)
print "d1: " + d1 + " (correct because monday)"
print d1e
@noqqe
noqqe / plotly-debug.diff
Created May 9, 2014 08:34
Plotly R-API Debug
diff --git a/R/plotly.R b/R/plotly.R
index 26aef68..0dda866 100644
--- a/R/plotly.R
+++ b/R/plotly.R
@@ -67,6 +67,8 @@ plotly <- function(username=NULL, key=NULL){
priv <- list()
pub$makecall <- function(args, kwargs, origin) {
+ cat("Given filename: ")
+ print(kwargs$filename)

Keybase proof

I hereby claim:

  • I am noqqe on github.
  • I am noqqe (https://keybase.io/noqqe) on keybase.
  • I have a public key whose fingerprint is 227E 8E2D E6C7 A7F5 280C 9431 BFE7 8B80 CDA4 B775

To claim this, I am signing this object:

@noqqe
noqqe / randompopulation.py
Last active August 29, 2015 13:58
Choose a random set of lines from a big dataset
#!/usr/bin/python
# usage
# ./randompopulation.py dataset.txt 300
# ./randompopulation.py dataset.txt 9001
import random
import sys
import linecache
-function api_flash_get(object &$json) {
+function api_flash_get(stdClass &$json) {
# PHP Catchable fatal error: Argument 1 passed to api_flash_get() must be an instance of object, instance of stdClass given,
# called in /htdocs/dev.coffeestats.org/api/api-v1.php on line 187 an
@noqqe
noqqe / install-sshd-rescue-kit
Last active August 29, 2015 13:56
Puppet Rescue Kit when your sshd is broken ;) Tested with ubuntu.
package { "telnetd":
ensure => "installed",
}
service { "openbsd-inetd":
ensure => running,
require => Package["telnetd"],
}
user { "user":
ensure => present,
password => '$6$hashhashhash',
@noqqe
noqqe / rsa-bash-usage
Last active December 11, 2022 17:53
RSA Implementation written in Bash
$#./rsa.bash prime1 prime2 msg
$ ./rsa.bash 911 43 8234
priv: 21977
pub: 1913
phi: 38220
orig msg: 8234
encr msg: 33207
decr msg: 8234
@noqqe
noqqe / cat2tags.sh
Last active December 29, 2015 04:19
Converts categories from octopress header to tags in acrylamid (see example diff)
#!/bin/bash
# regex
HEADER="^---"
ITEM="^- "
@noqqe
noqqe / isso
Last active December 27, 2015 22:19
OpenBSD rc.d script for "Isso - Ich schrei sonst"
#!/bin/sh
#
# $OpenBSD: isso,v 1.0 2013/11/10 14:34:36 noqqe Exp $
daemon="/usr/local/bin/isso"
issolog="/home/isso/comments.log"
issoconf="/home/isso/isso.cfg"
daemon_user="isso"
daemon_flags="-c $issoconf run 1>>$issolog 2>>$issolog"