Skip to content

Instantly share code, notes, and snippets.

View jonasbits's full-sized avatar

Jonas Anton Östman jonasbits

View GitHub Profile
#!/bin/sh
vers=1.00
sha1=/usr/bin/sha1sum # where your sha1 lives
#sha1=/usr/bin/sha1
dbfile="hashcash.sdb"
defbits=20
mins=60; let "hours = 60 * $mins"; let "days = 24 * $hours"
let "weeks = 7 * $days"; let "years = 365 * $days"; let "months = $years / 12"
@jonasbits
jonasbits / HowToOTGFast.md
Created July 12, 2016 20:43 — forked from gbaman/HowToOTGFast.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. Finally, open up the cmdline.txt. Be careful with this file, it is very picky with its formatting! Each parameter is seperated by a single

@jonasbits
jonasbits / runtastic-export-all-activities.md
Created June 12, 2016 14:10
Download all activities from Runtastic.com (as .gpx)

Download all activities from Runtastic 🏃

With this script you can download all your activities from www.runtastic.com in .gpx format. Runtastic removed this feature wich makes it very difficult to change your tracking service, thanks for that.

❗ Only tested in Google Chrome 41.0+

How does it work

Login to your runtastic account and go to the page where all your activities are listed. Then open the developer tools of Chrome with CMD + OPTION + I and go to the console tab. Now copy and paste the following script in the console line and press enter. The usually content should disapear and the downloads should start. I used it to export around 290 activities and it worked fine.

@jonasbits
jonasbits / xcode_6.1.1.dmg.md5
Created April 23, 2016 12:15
xcode_6.1.1.dmg md5 hash
md5
00773faa3ddc9a0b7b94bab8496aa522 xcode_6.1.1.dmg
dmg2img
md5
54888ae7ba8640eef1906f5a5cd4b55e xcode_6.1.1.img
hexdump -C xcode_6.1.1.img | grep --max-count=1 "48 2b 00 04"
@jonasbits
jonasbits / color-diff.txt
Last active April 19, 2016 20:31
Gitian-diff
diff --git a/0.12.0rc1-linux/JeremyRand/namecoin-linux-0.12-build.assert b/0.12.0rc1-linux/JeremyRand/namecoin-linux-0.12-build.assert
index af19a7f..b2ade55 100644
--- a/0.12.0rc1-linux/JeremyRand/namecoin-linux-0.12-build.assert
+++ b/0.12.0rc1-linux/JeremyRand/namecoin-linux-0.12-build.assert
@@ -1,7 +1,7 @@
--- !omap
- out_manifest: |
- abe8b26d8f023e1907316ba8e14a7ea6d53310716ef7cc16dbb8d961321db563 namecoin-0.12.0-linux32.tar.gz
- ed4e35a3cd66d0c132eb5069d4630361280e43f383b6054f34c8ec3619d45912 namecoin-0.12.0-linux64.tar.gz
+ 8452240e294dc4738e6ab917b84eb828f9dd55de29447bedeedbe9c07189d409 namecoin-0.12.0-linux32.tar.gz
@jonasbits
jonasbits / 00-button
Created April 14, 2016 05:24 — forked from jefferyto/00-button
Switching network configurations on a TP-Link TL-MR3020 with OpenWrt (12.09 Attitude Adjustment) using the sliding switch. Based on the sample scripts at: https://forum.openwrt.org/viewtopic.php?pid=172111#p172111 and https://forum.openwrt.org/viewtopic.php?pid=172110#p172110
# based on
# https://dev.openwrt.org/browser/trunk/target/linux/atheros/base-files/etc/hotplug.d/button/00-button
# https://forum.openwrt.org/viewtopic.php?pid=172110#p172110
. /lib/functions.sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
do_button () {
local button
// ==UserScript==
// @name Coop.se not intended - postnummer 41705 - better print
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Jonas Östman
// @match https://www.coop.se/handla-online/varukorg/
// @grant none
// ==/UserScript==
/* jshint -W097 */
@jonasbits
jonasbits / stalkwords.js
Created February 13, 2016 23:52
stalk words for cIRC
NickMentionedNotification.shouldNotify = function(nick, msg) {
var msgToTest;
if (!(nick != null)) {
return false;
}
nick = nick.replace(/_+$/, '');
nick = this._escapeTextForRegex(nick);
msgToTest = this._prepMessageForRegex(msg, nick);
if ( /bitcoin_*([!?.]*|[-:;~\*\u0001]?)(?!\S)/i.test(msgToTest) ) {
return true;
@jonasbits
jonasbits / Remove di.se top bar (Greasemonkey)
Created October 31, 2015 11:29 — forked from lmonilsson/Remove di.se top bar (Greasemonkey)
Greasemonkey script for hiding the top frame on di.se
// ==UserScript==
// @name Remove di.se top frame
// @namespace http://www.di.se
// @include http://www.di.se/*
// @noframes
// @version 1
// @grant none
// ==/UserScript==
var frameset = top.document.getElementsByTagName("frameset")[0];
@jonasbits
jonasbits / hp-smartcard-keyboard.txt
Created March 24, 2015 14:36
try to get the driver working
usb 3-1: new full-speed USB device number 2 using uhci_hcd
3:34:09 PM jonasbits [ 115.652059] usb 3-1: New USB device found, idVendor=03f0, idProduct=1024
3:34:09 PM jonasbits [ 115.652065] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
3:34:09 PM jonasbits [ 115.652070] usb 3-1: Product: HP USB Smart Card Keyboard
3:34:09 PM jonasbits [ 115.652074] usb 3-1: Manufacturer: Hewlett-Packard Company
3:34:09 PM jonasbits [ 115.652077] usb 3-1: SerialNumber: 0817c2aa
3:34:11 PM jonasbits [ 115.664413]
input: Hewlett-Packard Company HP USB Smart Card Keyboard as /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input21