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 / dropbox.sh
Last active August 29, 2015 13:56
Start dropbox in a shell if it's not running
# 1) install dropbox in a shell using the instructions provided here
# https://www.dropbox.com/install?os=linux
# 2) install the cli script as ~/bin/dropbox
# https://www.dropbox.com/download?dl=packages/dropbox.py
# 3) add the following to your .bash_profile
# start dropbox on login if it's not running
if [ -f ~/bin/dropbox ]; then
~/bin/dropbox running
if [ $? -ne 0 ]; then
# screen compatibility stuff
set-option -g prefix C-a
unbind-key C-b
bind-key a send-prefix
bind-key C-a last-window
bind-key C-d detach-client
bind-key BSpace previous-window
# colors
# http://ytaniike.posterous.com/256-colors-with-tmuxs-colour-numbers
@lepinkainen
lepinkainen / hilma2rss.py
Created October 22, 2014 12:07
Hilma to RSS feed
from bs4 import BeautifulSoup
import urllib3
import json
from datetime import datetime
import PyRSS2Gen
url = "http://www.hankintailmoitukset.fi/fi/notice/search/?_s%5B_sent%5D=1&_s%5Bphrase%5D=&_s%5Bcpv%5D=72-5&_s%5Borganisation%5D=&_s%5Bnuts%5D=&_s%5Bpublished_start%5D=&_s%5Bpublished_end%5D=&_s%5Bform_number%5D%5B%5D=domestic_contract&_s%5Bform_number%5D%5B%5D=contract&_s%5Bform_number%5D%5B%5D=contract_utilities"
http = urllib3.PoolManager()
@lepinkainen
lepinkainen / unrar.py
Created January 14, 2015 10:07
Unrar standard scene releases using 7zip
#!/usr/bin/python
import logging
import os
from glob import glob
import subprocess
logging.basicConfig(level=logging.DEBUG)
def unrar(directory, outdir='.'):
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
Add-Type @"
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32;
namespace Wallpaper
{
public enum Style : int
{
@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"