Skip to content

Instantly share code, notes, and snippets.

View noqqe's full-sized avatar
😴

Florian Baumann noqqe

😴
View GitHub Profile
@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',
-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 / 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

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 / 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)
@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 / 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
ESC=$(printf "\e")
echo "$ESC[34;47mDATE$ESC[0m"
date
echo ""
echo "$ESC[34;47mUPTIME$ESC[0m"
uptime
echo ""
echo "$ESC[34;47mSTATUS$ESC[0m"
top -l1 -u -o cpu -S | head -n 12
echo " "
#!/bin/bash
# coming-home: configure home-dir with your dotfiles
# Copyright: (C) 2010 Florian Baumann <flo@noqqe.de>
# License: GPL3 <http://gnu.org/licenses/gpl-3.0.txt>
# get dotfiles
dotfiles=$(ls -la | grep -v ^d | awk '{print $8}'| grep -v ^coming-home.bash$ )
mode=${1:-normal}
@noqqe
noqqe / gist:614920
Created October 7, 2010 10:09
.vimrc
" ---------------------------------------------------------------------------
" General
" ---------------------------------------------------------------------------
set nocompatible " essential
set history=1000 " lots of command line history
set cf " error files / jumping
set ffs=unix,dos,mac " support these files
filetype plugin indent on " load filetype plugin
set isk+=_,$,@,%,#,- " none word dividers