Skip to content

Instantly share code, notes, and snippets.

View lepinkainen's full-sized avatar
💭
Hmm?

Riku Lindblad lepinkainen

💭
Hmm?
View GitHub Profile
@lepinkainen
lepinkainen / rtorrent.rc
Created April 25, 2010 22:37 — forked from ion1/rtorrent.rc
rtorrent finished events
# http://libtorrent.rakshasa.no/wiki/RTorrentRatioHandling
# Ratio 2.0, close & erase when done - erasing deletes torrents from rtorrent
ratio.enable =
ratio.min.set = 200
ratio.max.set = 0
ratio.upload.set = 0
system.method.set = group.seeding.ratio.command, d.close=, d.erase=
# On completion, move the torrent to the directory from custom1.
@lepinkainen
lepinkainen / gist:6283335
Created August 20, 2013 15:52
tellstick.conf
user = "nobody"
group = "plugdev"
ignoreControllerConfirmation = "false"
device {
id = 1
name = "Desk light"
protocol = "arctech"
model = "selflearning-switch"
parameters {
house = "29478"
#!/usr/bin/env python
from __future__ import with_statement
import os
import re
import shutil
import subprocess
import sys
import tempfile
@lepinkainen
lepinkainen / config,yml
Created October 20, 2013 19:26
Flexget Nyaa.eu discover setup
nyaa-anime:
discover:
what:
- emit_series: yes
from:
- nyaa: anime
preset: [basic, anime, trakt_tv, notify, limit_ratio]
series:
- Kill la Kill:
from_group: horriblesubs
@lepinkainen
lepinkainen / gist:7096456
Last active December 26, 2015 04:49
Have postfix listen only to loopback interface
# Keep postfix running
service { "postfix":
ensure => 'running',
enable => 'true',
}
# Allow connections from localhost only
augeas { "postfix_localhost_only":
context => "/files/etc/postfix/main.cf/",
changes => [
"set inet_interfaces 127.0.0.1",
#/usr/bin/python
# -*- coding: utf-8 -*-
# ascii megaman by HeGeXa
_sini = "\x1b[0m\x1b[44;34m"
_cyan = "\x1b[0m\x1b[46;36m"
_valko = "\x1b[0m\x1b[47;37m"
_kelta = "\x1b[0m\x1b[43;33m"
_musta = "\x1b[0m\x1b[40;30m"
bold = "\x1b[1m"
#!/usr/bin/env python
# link: http://www.emacswiki.org/emacs/PythonMode#toc7
#
# This is a script which runs and parses the output of various Python code
# checking programs to work with flymake. It has lots of issues, one being that
# flymake does not seem to show more than one error message per line of code,
# meaning that an error or warning which is intentionally left unfixed can mask
# an error or warning that would get more attention.
#
# Additionally, the scripts which check python code are either rather anemic,
shrike@lakka:~$ curl asenna.gentoo.fi
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="fi">
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<link media="screen" href="screen.css" type="text/css" rel="stylesheet" />
<link media="all" href="content.css" type="text/css" rel="stylesheet" />
<link media="all" href="form.css" type="text/css" rel="stylesheet" />
<title>Kapsi Internet-käyttäjät ry - Lakka</title>
@lepinkainen
lepinkainen / example.yaml
Created November 21, 2013 14:07
Flexget series quality example
tv-series:
series:
settings:
# HD only preferred
hdgroup:
timeframe: 6 hours
target: sdtv+ 720p
# HD ok, not required
normalgroup:
target: sdtv+ <=720p
@lepinkainen
lepinkainen / while_waiting.py
Created February 11, 2014 17:18
npyscreen while_waiting minimal example - doesn't work
import npyscreen
from datetime import datetime
class DateForm(npyscreen.Form):
def while_waiting(self):
npyscreen.notify_wait("Update")
self.display()
def create(self):
self.add(npyscreen.FixedText, value=datetime.now(), editable=False)