Skip to content

Instantly share code, notes, and snippets.

View zouppen's full-sized avatar

Joel Lehtonen OH64K zouppen

View GitHub Profile
@zouppen
zouppen / README.md
Last active April 19, 2020 12:03
Tuoreet radioamatöörikutsut irkkiin
@zouppen
zouppen / dpkg-trace
Last active March 21, 2020 07:27
Tool for analyzing Debian package dependencies of a running binary or script
#!/bin/sh -eu
#
# Runs a program, traces it, and finds a Debian packages providing
# those files. This is useful for finding requirements of complex
# shell scripts.
#
# NB! Especially Python likes to scan a lot of unrelated files while
# startup which may result bogus results.
TRACE=`mktemp`
DEPS=`mktemp`
@zouppen
zouppen / IceAccumulation.hs
Last active January 2, 2016 00:45
Calculates how much ice has accumulated in Jyväskylä in last week
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
module IceAccumulation where
import Control.Exception (evaluate)
import Network.Curl.Aeson
import Data.Aeson
import Data.Aeson.Types
import Control.Applicative
import Control.Monad (mzero)
import Data.Time
@zouppen
zouppen / pib32_derive.sh
Created August 3, 2015 19:27
Tool for deriving bitcoin addresses from BIP32 wallet
#!/bin/sh -eu
#
# Extracts addresses using https://github.com/vbuterin/pybitcointools
# from given chain. Arguments: deterministic wallet in xpub format,
# chain number (0 for deposit addresses, 1 for change addresses) and
# number of addresses to generate (starting from 0).
#
# Example: ./pib32_derive.sh xpubXXXXXXXXXXXXX 0 10
chain=`./pybtctool bip32_ckd $1 $2`
@zouppen
zouppen / README.md
Last active August 29, 2015 14:18
Simple tool for plotting The Button statistics using R

The Button statistics

This tool uses R to draw smooth scatter plot of clicking behaviour on The Button of Reddit.

Newest PDF plot ◀ Updates every 15 minutes

Receiving raw traffic via Reddit's WebSocket

@zouppen
zouppen / README.md
Last active August 29, 2015 14:17
Bittiraha status in Invesdor

This uses XSLT processing to display funding status of Bittiraha.fi on console.

@zouppen
zouppen / Notification.hs
Last active August 29, 2015 14:15
Listening to notifications in PostgreSQL
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
module Main where
import Control.Monad (forever)
import Data.ByteString.Char8 (pack)
import Database.PostgreSQL.Simple
import Database.PostgreSQL.Simple.Notification
import System.Environment (getArgs)
main = do
@zouppen
zouppen / README.md
Last active August 29, 2015 14:15
SMS to IRC gateway using Irssi Proxy and Kannel

SMS to IRC gateway

Everybody! Get the feeling of the 90s! Let the dreams come true!

This is a proof of concept for implementing SMS to IRC gateway using Kannel SMS gateway, Irssi Proxy, and an ordinary mobile stick (in my case Huawei E166).

To send message to IRC, just type the following message and send it to the phone number of the gateway:

@zouppen
zouppen / WordSplitter.hs
Created January 29, 2015 21:50
Splits input at word delimeters and outputs a word per line.
-- |Little tool which splits words while you type. Useful when typing
-- live to espeak, for example: runhaskell WordSplitter | espeak
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Attoparsec as A
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import System.IO
@zouppen
zouppen / joululaulututkimus.md
Last active December 9, 2019 11:30
Kolme yötä jouluun – vai onko?

Kolme yötä jouluun on – vai onko?

Maisteri Lehtosen tämänkertainen tutkimus porautuu joulun syvimpään ytimeen, eli joululauluihin. Kaikkihan tuntevat joululaulun Kolme yötä jouluun, joka äänitearkiston perusteella on Petter Hjalmar Ohlsin käsialaa ja jonka ensimmäisenä levylle on laulanut Vuosaaren lastentarhan lapset vuonna 1979. Siinä lauletaan: