Skip to content

Instantly share code, notes, and snippets.

View jonasbits's full-sized avatar

Jonas Anton Östman jonasbits

View GitHub Profile
@jonasbits
jonasbits / .main.cpp
Last active October 8, 2019 20:33
Uno or F103RB build files in PlatformIO (subset of files, please read main.cpp and platformio.ini)
#include <Arduino.h>
#if defined ARDUINO_AVR_UNO || defined ARDUINO_AVR_LEONARDO
#include <Arduino_FreeRTOS.h>
#elif defined ARDUINO_NUCLEO_F103RB
#include <STM32FreeRTOS.h>
#elif defined ARDUINO_DISCO_L072CZ_LRWAN1
#include <STM32FreeRTOS.h>
#endif
@jonasbits
jonasbits / config.txt
Created August 21, 2019 09:19
konstpaj umeahackerspace autoplay video on rpi
#Umeå Hackerspace konstpaj self-explanatory configuration file
term=1
xres=1920
yres=1080
# auto=0, analogue=1, hdmi=2
aout=0
vol=0
background="black.ppm"
videofolder="videos"
@jonasbits
jonasbits / dnsseeder.json
Last active December 12, 2019 15:01
dnsseeder.json with values for namecoin
{
"Name": "Namecoin",
"Desc": "Description of Namecoin",
"ID": "0xfeb4bef9",
"Port": 8334,
"Pver": 70001,
"TTL": 600,
"InitialIP": "127.0.0.1",
"DNSName": "dnsseed.nmctest.net",
"Seeder1": "nmc.seed.quisquis.de",
@jonasbits
jonasbits / libserialport example.c
Last active December 17, 2018 12:49 — forked from ntd/libserialport example.c
libserialport example
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <unistd.h> // for sleep function
#include <libserialport.h> // cross platform serial port lib
//#include "protocol.h"
//const char* desired_port = "COM8";
@jonasbits
jonasbits / RegexTest.java
Created October 11, 2017 22:48
Inverse regex to match non .bit urls
//compile with 'javac RegexTest.java'
//run with java RegexTest example.com
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexTest {
public static void main(String[] args) {
//line bellow does not work, must include regex inline instead
@jonasbits
jonasbits / dualshock-research
Created January 11, 2017 00:09 — forked from johndrinkwater/dualshock-research
I’m interested in writing (or helping to spec out the protocol so someone else can write) the linux kernel driver for Sony’s DualShock 4 (PS4’s lovely controller) Currently using the output of HID RAW from a USB connected dualshock 4… For the gyro/touchpad discovery, I’ve just been using some terrible c code to throw numbers on the screen and it…
TADA, it’s `hexdump -v -e '64/1 "%02x" "\n"' < /dev/hidraw3`
No idea what the first byte is… but I’m going to assume its for device ID for the many users that are connected, but it probably has to be set by the connected machine?
01ff777f7f0800aa0000435dfdf1ff14000200c5ff0721150300000000001b000001fc9133a32990880428008000000080000000008000000080000000008000
↑↑↑↑
left stick, value, first field is horz (00 left), second field is vertical (00 top)
017f80ff61080064000059f2fdfffffbff0e00d107081e9bf600000000001b0000018e94b1b00690880428008000000080000000008000000080000000008000
↑↑↑↑
javascript:var s=document.createElement('script');s.setAttribute('src', 'https://github.com/Khan/tota11y/releases/download/0.1.3/tota11y.min.js');document.getElementsByTagName('body')[0].appendChild(s);void(s);
@jonasbits
jonasbits / zsun-microsd.txt
Created November 2, 2016 20:29
Zsun WiFi microSD reader notes
socat - TCP4:10.168.168.1:11880
dd if=/dev/mtdr0 of=/tmp/mtdr0-image bs=4k
md5sum /tmp/mtdr0-image > /tmp/mtdr0-image.md5sum
@jonasbits
jonasbits / Export Notes.AppleScript
Created October 2, 2016 16:44
Export Apple Notes via AppleScript
tell application "TextEdit"
activate
make new document
end tell
tell application "Notes"
if folder "Archive" exists then
set output to ""
repeat with aNote in notes in folder "Archive"
# This file provides a long_running decorator to indicate that a function needs a long amount of time to complete and
# the computer should not enter standby. This file currently only works on Windows and is a no-op on other platforms.
import ctypes
import platform
ES_CONTINUOUS = 0x80000000
ES_SYSTEM_REQUIRED = 0x00000001