Skip to content

Instantly share code, notes, and snippets.

Thomas R. Koll TomK32

Block or report user

Report or block TomK32

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@TomK32
TomK32 / currency_convert.sh
Last active Oct 13, 2017 — forked from hasantayyar/currency_convert.sh
cli currency_convert
View currency_convert.sh
# seen on https://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know/answer/Jostein-Austvik-Jacobsen?__snids__=1567875257&__nsrc__=4
# usage currency_convert 14.99 eur usd
# output 14.9900 EUR = 16.7019 USD
currency_convert() {
wget -qO- "http://finance.google.com/finance/converter?a=$1&from=$2&to=$3" | sed '/res/!d;s/<[^>]*>//g';
}
View keybase.md

Keybase proof

I hereby claim:

  • I am TomK32 on github.
  • I am tomk32 (https://keybase.io/tomk32) on keybase.
  • I have a public key whose fingerprint is CC94 B007 90F2 EA56 9D0C F838 974B BA72 BF22 A024

To claim this, I am signing this object:

@TomK32
TomK32 / extract-from-aperture.rb
Created Apr 24, 2017
move images from aperture lib into a clean directory structure
View extract-from-aperture.rb
#!/bin/env ruby
require 'pp'
require 'fileutils'
# Intended for users who don't use aperture anymore (I moved back to linux)
# and need to rescue their photo library somehow.
# Takes two argument, source and target directory
@source = ARGV[0]
View simplestesp8266clock.ino
// simplestesp8266clock.ino
//
// Libraries needed:
// Time.h & TimeLib.h: https://github.com/PaulStoffregen/Time
// Timezone.h: https://github.com/JChristensen/Timezone
// SSD1306.h & SSD1306Wire.h: https://github.com/squix78/esp8266-oled-ssd1306
// NTPClient.h: https://github.com/arduino-libraries/NTPClient
// ESP8266WiFi.h & WifiUDP.h: https://github.com/ekstrand/ESP8266wifi
//
// 128x64 OLED pinout:
@TomK32
TomK32 / ledger-envelope-generator.rb
Last active Dec 21, 2015
create ledger entries for repeating transactions
View ledger-envelope-generator.rb
#!/bin/env ruby
# (C) 2015 Thomas R. Koll, <info@ananasblau.com>
# licensed under WTFPL
#
# This script generates entries for the ledger format.
# Think of it as an envelope generator
require 'highline'
require 'date'
require 'active_support/core_ext/date/calculations'
@TomK32
TomK32 / gnucashsqlite2ledger.rb
Created Dec 16, 2015
Convert from GnuCash Sqlite format to ledger/hledger format
View gnucashsqlite2ledger.rb
#!/bin/env ruby
# (C) 2015 Thomas R. Koll, <info@ananasblau.com>
# Licensed under WTFPL
# In GnuCash save your file as sqlite3 and pass the filename as argument to this script
# The script only requires active_record to be installed
require 'active_record'
ActiveRecord::Base.establish_connection(
@TomK32
TomK32 / bandcamp-extractor.rb
Last active Dec 10, 2015
A few lines to extract a downloaded album from bandcamp into nice folders
View bandcamp-extractor.rb
#!/bin/env ruby
# (C) 2015 Thomas R. Koll, <info@ananasblau.com>
# licensed under WTFPL http://www.wtfpl.net/
# Usage: Download gist, put it into your bin directory, chmod it to executable and simply pass the zip files as argument
# the export command is optionally, you might want to change it in the script
# export bandcamp_target_dir='/data/music/'; bandcamp-extractor.rb ~/Downloads/bandcamp/*zip
target_dir = ENV['bandcamp_target_dir'] || '/data/music'
ARGV.each do |filename|
View gist:c31808f9d199b475eb53
[Warning] Invalid CSS property declaration at: / (css.css, line 25)
[Warning] Invalid CSS property declaration at: / (css.css, line 68)
[Warning] Invalid CSS property declaration at: / (css.css, line 97)
[Warning] Invalid CSS property declaration at: / (css.css, line 114)
[Warning] Invalid CSS property declaration at: / (css.css, line 125)
[Warning] Invalid CSS property declaration at: / (css.css, line 126)
[Warning] Invalid CSS property declaration at: / (css.css, line 134)
[Warning] Invalid CSS property declaration at: / (css.css, line 143)
[Warning] Invalid CSS property declaration at: / (css.css, line 159)
[Warning] Invalid CSS property declaration at: / (css.css, line 161)
@TomK32
TomK32 / gist:c310dae6af77e2d8e39a
Last active Aug 29, 2015
poor mam's red alert for devlol lolstripe
View gist:c310dae6af77e2d8e39a
#!/bin/bash
cmd='mosquitto_pub -h 192.168.7.2 -t led';
times=$1 || 10;
for i in `seq 1 $times`
do
$cmd -m RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
echo 'DANGER!'
sleep 1
$cmd -m X
sleep 1
You can’t perform that action at this time.