Skip to content

Instantly share code, notes, and snippets.

@nattster
nattster / anaconda_jsonserver.log
Created August 26, 2016 08:03
anaconda_jsonserver.log for Anaconda 2.0.1
2016-08-26 14:54:48,274: INFO : client requests: doc
2016-08-26 14:54:48,513: INFO : Incomming connection from ''
2016-08-26 14:54:48,514: INFO : Incomming connection from ''
2016-08-26 14:54:48,516: INFO : client requests: doc
2016-08-26 14:54:48,553: INFO : Incomming connection from ''
2016-08-26 14:54:48,553: INFO : Incomming connection from ''
2016-08-26 14:54:48,556: INFO : client requests: doc
2016-08-26 14:54:48,609: INFO : Incomming connection from ''
2016-08-26 14:54:48,609: INFO : Incomming connection from ''
2016-08-26 14:54:48,617: INFO : client requests: autocomplete
@nattster
nattster / fonts.conf
Created March 1, 2014 09:33
snippets from nattster's blog
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
.fonts.conf
release 6.3.23
================================
LCD optimized 96 dpi
"Sharp'N'Clear" font settings
@nattster
nattster / anti-msn-spam.c
Last active August 29, 2015 13:56
anti-msn-spam
/*
Anti MSN Spam plugin (for pidgin)
Author: Natt Piyapramote <nattster at googlemail dot com>
modified from message-filter.c written by Huy Phan <dachuy@gmail.com>
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@nattster
nattster / catch_sigterm.py
Created June 5, 2013 14:43
When Python process was killed, this code will catch SIGTERM and allow us to do some finalizations.
import signal
import sys
def signal_term_handler(signal, frame):
print 'got SIGTERM'
sys.exit(0)
signal.signal(signal.SIGTERM, signal_term_handler)
@nattster
nattster / missionary-cannibal-haskell.hs
Created December 25, 2011 04:54
Missionaries and Cannibals problem solved in Haskell
--h = number of humans on the left
--g = number of giants on the left
--s = side (left/right)
left = 0
right = 1
valid_state (h, g, s) =
if (h >= 0) && (h <= 3) && (g >= 0) && (g <= 3) --number of people valid?
then not (((g > h) && (h>0)) || ((3-g > 3-h) && (3-h > 0))) --num of giant <= num of human