Skip to content

Instantly share code, notes, and snippets.

View TomK32's full-sized avatar

Thomas R. Koll TomK32

View GitHub Profile
@TomK32
TomK32 / currency_convert.sh
Last active October 13, 2017 18:55 — forked from hasantayyar/currency_convert.sh
cli currency_convert
# 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';
}
@TomK32
TomK32 / keybase.md
Last active September 19, 2017 21:21

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 April 24, 2017 08:00
move images from aperture lib into a clean directory structure
#!/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]
// 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 December 27, 2022 19:51
create ledger entries for repeating transactions
#!/bin/env ruby
# (C) 2015 Thomas R. Koll, <[email protected]>
# 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 December 16, 2015 11:02
Convert from GnuCash Sqlite format to ledger/hledger format
#!/bin/env ruby
# (C) 2015 Thomas R. Koll, <[email protected]>
# 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 December 10, 2015 08:10
A few lines to extract a downloaded album from bandcamp into nice folders
#!/bin/env ruby
# (C) 2015 Thomas R. Koll, <[email protected]>
# 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|
[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 August 29, 2015 14:13
poor mam's red alert for devlol lolstripe
#!/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