Skip to content

Instantly share code, notes, and snippets.

@simonszu
simonszu / traktclean.rb
Created June 16, 2015 17:49
Removes a whole show from your trakt account as watched, since the old interface didn't have the option for this
#! /usr/bin/env ruby
require 'trakt'
trakt = Trakt.new‚
trakt.apikey = 'apikey'
trakt.username = 'simonszu'
trakt.password = 'password'
#puts client.server.time
#p client.show.episode_unseen("imdb_id" => "tt0364845", "episodes" => {"season" => 1, "episode" => 1})
@simonszu
simonszu / soup-backup.sh
Created June 16, 2015 17:48
Backups the contens of your soup into a directory
#!/bin/sh
# This script saves your soup including enclosures. See below.
if [ "X$1" = "X" ] || [ "X$1" = "X-h" ]; then
echo "
This script saves your soup including enclosures and might kill your cat
(laughing or not.) A little .sh by neingeist (http://nein.gei.st.)
Usage:
@simonszu
simonszu / dir2tumblr.rb
Created June 16, 2015 17:47
Slowly post the content of a directory of images to tumblr
#! /usr/bin/env ruby
require 'tumblr_client'
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
Tumblr.configure do |config|
@simonszu
simonszu / prowl.py
Created June 16, 2015 17:46
Sabnzbd prowl notify interface
#! /usr/bin/python
import sys,urllib
# Get clean NZB name
job_name = sys.argv[3]
# Prowl API settings - http://prowl.weks.net/api.php
# Set Prowl API
API = "0d1946d5026af97087954e84f4d45135d11f7241"
@simonszu
simonszu / ook.rb
Created June 16, 2015 17:45
Attempt to create an Ook/Hut/Brainfuck-Interpreter in Ruby
#! /usr/bin/env ruby
code = "Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut! Hut? Hut. Hut? Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut? Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut? Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut? Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut? Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut? Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut? Hut. Hut? Hut. Hut? Hut. Hut? Hut. Hut? Hut. Hut? Hut. Hut! Hut! Hut? Hut! Hut. Hut? Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut! Hut. Hut. Hut? Hut. Hut. Hut. Hut. Hut. Hut. Hut! Hut. Hut. Hut? Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut! Hut. Hut. Hut? Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut. Hut.
@simonszu
simonszu / wordpress2octopress.rb
Created June 16, 2015 17:44
Converts a Wordpress export file into octopress content
#!/usr/bin/env ruby
# encoding: UTF-8
# Input: WordPress XML export file.
# Outputs: a series of Textile files ready to be included in a Jekyll site,
# and comments.yml which contains all approved comments with metadata which
# can be used for a Disqus import.
# Changes from the original gist: http://gist.github.com/268428
# 1. Handles titles containing special characters. Those have to be YAML escaped
# 2. Use the original permalinks in wordpress.
@simonszu
simonszu / octopress2wordpress.rb
Created June 16, 2015 17:43
Converts octopress content into a wordpress content file
#! /usr/bin/env ruby
require 'nokogiri'
# Parsed results in wordpress.xml
# Change your octopress feed template in source/atom.xml
# Change the limit in {% for post in site.posts limit: to a value higher than your postcount to ensure the creation of the feed of
# ALL your posts
# Add a line "<categories>{{post.categories}}</categories>" in the <entry> Tag.
@simonszu
simonszu / octopress-picasa.rb
Created June 16, 2015 17:42
A picasaweb plugin for octopress
require 'rubygems'
require 'nokogiri'
require 'open-uri'
module Jekyll
class PicasaAlbumTag < Liquid::Tag
def initialize(tag_name, rss_url, token)
super
@rss_url = rss_url
@simonszu
simonszu / newrepo.sh
Created June 16, 2015 17:41
Create a new bare repo in Cgit's path
#! /bin/bash
# This script creates a new bare git repo and adds it to cgit
echo -n "Enter the name and press [ENTER]:"
read name
echo -n "Enter the description and press [ENTER]:"
read description
echo -n "Enter a mail address and press [ENTER]:"
read mail
cd /home/simonszu/repos
@simonszu
simonszu / secure.php
Created June 16, 2015 17:41
A password checker for PHP
<?php
$username = "user";
$password = "password";
if ((!isset($_POST["user"])) && (!isset($_POST["pw"]))){
echo "<form action=\"secure.php\" method=\"post\">";
echo "username: <input type=\"text\" name=\"user\"><br />";
echo "password: <input type=\"password\" name=\"pw\">";
echo "<input type=\"submit\" value=\"Abschicken\">";