Category Archives for Uncategorized

Beer, Math and API’s
Intro
In this blog we will be looking at statistics and information about happy hour prices in Reykjavík, Iceland.
I know the formatting is a bit off, I really should make my blog a bit more modern.
So, let’s just jump right into it.The Reykjavík Grapevine is an Icelandic free alternative magazine written in English. They made an app, called appy hour.
……. a few years ago, seems that they made it in 2012 originally and I just learned about it now
This app has information about happy hours in Iceland, when they start, end, prices and more and when looking for cheap beer it is a great tool, sortable either by closest bar or cheapest happy hour offer.
Me seeing all this interesting data I couldn’t just use the app, I had to explore the data. Didn’t take long to find what server the app is contacting and downloading the JSON containing all the data. I just pulled one local copy to work with, I have no need to query this information, I’ll be using the app when seeking beer in the future.

Iceland and HTTPS
A few weeks back a comment on a programmers group on Facebook left me wondering about how many Icelandic websites really use HTTPS so I did the only logical thing, spent hours and hours finding out.
I wanted to answer 2 questions with this, which I believe I have.
1: What percentage of .is urls are using HTTPS
2: What Cert authorities are they using.
Those not interested in the method can skip “The Code” section and go straight to the graphs and data
The Code
I started by scraping some lists of .is urls and managed to get about 300 urls which I didn’t think was enough. So I ended up paying 5$ or so for a list with 17398 .is urls. Then I got to writing some software to do something with it.

D&D Math, how should I roll ?
For quite some time there has been a discussion in my board game group whether is better:
Scenario A: (The 47 Method)
- Roll 4 * 6 sided dice
- Pick the 3 best dice that were rolled
- This generates a a total from 3 to 18
Perform this task 7 times, pick the 6 best sets.
Scenario B: (The 56 Method)
- Roll 5 * 6 sided dice
- pick the 3 best dice that were rolled
- this generates a total from 3 to 18
perform this task 6 times
The benefits of each one is clear, with scenario A you can remove 1 terribly rolled set but with scenario B you have a better chance of getting good sets but take the risk of getting a terrible set you can’t get rid of.
We are perfectly aware that we could google this but where is the fun in that ?

AI Þing
[Icelandic Post]
Mig hefur lengi langað að gera Alþingi effektískara (í djóki) með því að innleiða gervigreind.
Neural Network sem semur frumvörp, sem kýs um frumvörp og svo kýs nýtt þing og fyrsti partur er tilbúinn. Ég get skrifað frumvörp.
Til að byrja þurfti ég sample texta af frumvörpum, tók stutta stund að búa til dirty scraper í bash sem safnaði saman öllum frumvörpum sem hafa verið skrifuð
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
curl http://www.althingi.is/thingstorf/thingmalalistar-eftir-thingum/lagafrumvorp/?lthing=$thing | sed -n 's/.*href="\([^"]*\).*/\1/p' | grep "thingstorf/thingmalalistar-eftir-thingum/ferill" > $tmp for i in $(cat $tmp);do url="http://www.althingi.is$i" output=$(echo $i | cut -c55- | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]').txt echo "Processing $output" curl "http://www.althingi.is/thingstorf/thingmalalistar-eftir-thingum/ferill/?ltg=146&mnr=150" -H "Host: www.althingi.is" \ -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0" \ -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \ -H "Accept-Language: en-US,en;q=0.5" --compressed \ -H "Referer: http://www.althingi.is/thingstorf/thingmalalistar-eftir-thingum/lagafrumvorp/?lthing=146" \ -H "DNT: 1" -H "Connection: keep-alive" -H "Upgrade-Insecure-Requests: 1" \ -H "If-Modified-Since: Tue, 04 Apr 2017 09:12:36 GMT" > $tmp2 cat $tmp2 | grep "altext/146/s/" | grep frum | sed -n 's/.*href="\([^"]*\).*/\1/p' > $tmp3 varp=$(cat $tmp3) frumvarp="http://www.althingi.is$varp" curl $frumvarp | sed -n '/Frumvarp til laga/,/pgextra2/p' > $tmp4 cat $tmp4 | html2text -utf8 > /home/user/thing/output/$output echo done |
[Er þessi kóði fallegur ? nei ….. En virkar hann ? ójá ]

Custom dancing santa
It’s been way too long since I wrote something here
It’s not that I haven’t been doing strange projects, just haven’t been documenting them well.
But now, the season is upon us and I am writing this Christmas tutorial on how to customize your dancing Santa junk 😀
Dancing Santa’s are much more fun when they play gothic Christmas anthems or dirty parodies, so. Let’s get to the how part
Things used:
Cheap Dancing Santa
DFR0299 (Mp3 Module)
Speaker module (explained better below)
Relay or transistors
Basic stuff everyone with a soldering iron should have

Reprogramming the DT-xEM for use with HID readers
Recently started a new job, large building and every door locked with HID RFID readers and everyone has a RFID keycard around their neck to open the doors.
I already had the Dangerous Things xEM ATA5577 microchip in my left arm (EM400 emulation) but I bought an unwritten ATA5577 chip from cyberize.me.
I did the initial tests on the cyberize chip, still in the packaging and when I got that working I decided to try to write it to my DT chip.
While the standard readers managed to read both chips very well the keypad readers had a very hard time reading the cyberize.me chip, even though it wasn’t even inside me.

Interclock: A subdermal clock concept design.
I’ve had this idea in the back of my head for quite a while now, a small clock, placed under the skin and shows the time by shining light through it. To avoid draining the battery and causing excess heat the time should only be displayed when you tell it to.
I decided to approach the trans-dermal input with a very simple but functional idea, magnetic activation using a reed relay…….Anyone willing to put a clock inside their body, has probably already inserted a magnet into a finger
My RFID procedure
Earlier this year I had 2 RFID chip implanted into my hands, one ATA5577 125KHz and one NFC implant.
It was quite painful but totally worth it, here is the video of the procedures
There was of course a lot of prep work associated with it, marking the correct location, sterilizing and so on that is not shown, this should NEVER be done without proper research and preparation.
.

Using the Raspberry Pi with usb RFID readers
In this post I wanna discusss the possibilities of the Raspberry PI and RFID, and implementing it in a cheap but effective way.
This tutorial assumed you have basic knowledge of the Raspberry Pi
Tools used:
Raspberry Pi 2 (could be any model, doesn’t have to RPI2)
Cheap USB RFID reader I bought of ebay (similiar listing)
Breadboard
1 x 370 Ohm Resistor
1 x 10K ohm Resistor
1 x tactile switch
some cables
host computer
micro sd with raspbian
Codes avaivable in this tutorial:
Perform action on RPI with RFID
Perform action on RPI with RFID with timed secondary task
Perform togglable actions on RPI with RFID