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 / desktop.boxstarter
Last active January 23, 2016 13:21
Boxstarter script
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
# Development
cinst -y powershell
cinst -y githubforwindows
cinst -y python3
cinst -y git.commandline
cinst -y sublimetext3
# Media
@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='.'):
@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()
# 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

Keybase proof

I hereby claim:

  • I am lepinkainen on github.
  • I am shrike (https://keybase.io/shrike) on keybase.
  • I have a public key ASCUYSPOHC7kW_eWi6QDcKZQs6j0s64G6Tvt6FMxzDMIJwo

To claim this, I am signing this object:

@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
@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)
@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
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>
#!/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,