Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
Working from home

Yrjö Kari-Koskinen ykarikos

🏡
Working from home
  • Tomorrow Tech
  • Helsinki
View GitHub Profile
@ykarikos
ykarikos / renameVideo.pl
Created Jan 28, 2018
Rename video files with a ISO date prefix
View renameVideo.pl
#!/usr/bin/perl -w
# Rename video files with a ISO date prefix, e.g.
# rename from P12345.MOV to 2018-01-30.P12345.MOV
# Tested with MTS, 3GP and MOV files.
#
# (c) 2018 Yrjö Kari-Koskinen <ykk@peruna.fi>
# Licensed with the MIT License
use Image::ExifTool qw(:Public);
@ykarikos
ykarikos / excercise.js
Created May 5, 2017
What does each logging statement print, why?
View excercise.js
// What does each logging statement print, why?
var x = 1;
console.log(x);
if(1) {
var x = 2;
console.log(x);
}
console.log(x);
@ykarikos
ykarikos / denglisch.md
Last active Mar 30, 2017
Denglisch words I hear while living and working in Germany
View denglisch.md

Denglisch words I hear while living and working in Germany

  • gefixed
  • gemerged
  • gerebased
  • gedownloaded
  • terminieren: either to terminate (to kill) or to agree on an appointment (Termin)
  • gerebranded
  • reviewen, "Ich hab' einige gereviewed"
  • beim merge
  • gecherry-picked
@ykarikos
ykarikos / germany.md
Created Jan 6, 2017
Living in Germany
View germany.md

Living in Germany

Here's some remarks I've made while living in Munich, Germany (vs. in Finland). I made a similar list in 2004 in Austria.

Here we go.

Money

  • It's very customary to not be able to pay with a credit card. One needs to carry always cash. Sometimes just the local debit cards are valid, like in Ikea o_O

Traffic

@ykarikos
ykarikos / simp_le-howto.md
Last active Feb 18, 2018
Howto start using Letsencrypt with simp_le
View simp_le-howto.md

Howto start using Letsencrypt with simp_le

What I had:

What I wanted:

  • A Letsencrypt certificate for Apache, Postfix and Dovecot
  • Simple tool for managing certificates that does need root privileges
  • Automatic renewal
@ykarikos
ykarikos / map.clj
Created Jan 3, 2016
Accessing a map
View map.clj
user=> (def mymap {:foo 1 :bar {:subfirst 1.2 :subsecond "foo"}})
#'user/mymap
user=> (:foo mymap)
1
user=> (mymap :bar)
{:subfirst 1.2, :subsecond "foo"}
user=> (-> mymap :bar :subsecond)
"foo"
@ykarikos
ykarikos / gist:0d5cfa0d0ee467808810
Created Sep 17, 2015
Check that NS record match in all zone name servers
View gist:0d5cfa0d0ee467808810
MASTER=a.iana-servers.net.; DOMAIN=example.com.; dig +short -t NS $DOMAIN @$MASTER |sort >/tmp/$MASTER; for h in `cat /tmp/$MASTER`; do echo - Querying $h:; dig +short -t NS $DOMAIN @$h |sort |diff /tmp/$MASTER -; done
View keybase.md

Keybase proof

I hereby claim:

  • I am ykarikos on github.
  • I am ykk (https://keybase.io/ykk) on keybase.
  • I have a public key whose fingerprint is 2E71 56C3 7760 E735 B175 E053 0E4E A201 3B3A BE42

To claim this, I am signing this object:

@ykarikos
ykarikos / gist:f1e6e208789e300f7adc
Created May 30, 2015
Talvikin numeroharjoittelu
View gist:f1e6e208789e300f7adc
(use '[clojure.java.shell :only [sh]])
(defn say [& args] (apply sh "say" args))
(defn say-and-print [n]
(let [n-str (str n)]
(println n-str)
(Thread/sleep 2000)
(say n-str)))
@ykarikos
ykarikos / client repl.clj
Last active Aug 29, 2015
Full duplex Websocket connections with manifold streams and aleph http lib
View client repl.clj
user=> (use 'ws-test)
nil
user=> @state
{}
user=> (connect "localhost")
true
user=> @@connection
<< stream: {:type "splice", :sink {:type "netty", :sink? true, :closed? false}, :source {:pending-puts 0, :drained? false, :buffer-size 0, :permanent? false, :type "manifold", :sink? true, :closed? false, :pending-takes 1, :buffer-capacity 16, :source? true}} >>
user=> (send-message @@connection {:msg "It works!" :count 1})
<< true >>