Skip to content

Instantly share code, notes, and snippets.

View SamDecrock's full-sized avatar
🏠
Working from home

Sam SamDecrock

🏠
Working from home
View GitHub Profile
/**************************************************************************/
/*!
This example attempts to dump the contents of a Mifare Ultralight card
Note that you need the baud rate to be 115200 because we need to print
out the data and read from the card at the same time!
To enable debug message, define DEBUG in PN532/PN532_debug.h
Edited by Sam Decrock to read out Mifare Ultralight cards
region model name litter wifi color dry date pdf
CZ 3626151 Velis Evo Inox 50 EU 45 white Jul 2015 velis-evo-inox-cz-3626151-3626152-3626153.pdf
CZ 3626152 Velis Evo Inox 80 EU 65 white Jul 2015 velis-evo-inox-cz-3626151-3626152-3626153.pdf
CZ 3626153 Velis Evo Inox 100 EU 80 white Jul 2015 velis-evo-inox-cz-3626151-3626152-3626153.pdf
IT 3626145 Velis Evo 50 EU 45 white Jan 2016 velis-evo-it-3626145-3626146-3626147.pdf
IT 3626146 Velis Evo 80 EU 65 white Jan 2016 velis-evo-it-3626145-3626146-3626147.pdf
IT 3626147 Velis Evo 100 EU 85 white Jan 2016 velis-evo-it-3626145-3626146-3626147.pdf
FR 3623376 Velis Evo 45 45 white Nov 2016 velis-evo-fr-3623376-3626154-3626155.pdf
FR 3626154 Velis Evo 65 65 white Nov 2016 velis-evo-fr-3623376-3626154-3626155.pdf
FR 3626155 Velis Evo 80 80 white Nov 2016 velis-evo-fr-3623376-3626154-3626155.pdf
@SamDecrock
SamDecrock / echobuttons1.js
Last active July 26, 2022 20:05
Connecting to an Amazon Echo Button
var btSerial = new (require('bluetooth-serial-port')).BluetoothSerialPort();
var address = '50-dc-e7-a3-0b-e8';
btSerial.findSerialPortChannel(address, function(channel) {
btSerial.connect(address, channel, function() {
console.log('> connected to ' + address);
btSerial.on('data', function(buffer) {
console.log('> receiving ('+buffer.length+' bytes):', buffer);
@SamDecrock
SamDecrock / removeadobe.sh
Created March 25, 2016 12:11
Purge Adobe stuff from your Mac
rm -rf "/Users/Shared/Library/Application Support/Adobe"
rm -rf "/Library/Application Support/regid.1986-12.com.adobe"
rm -rf "/Library/Application Support/Adobe"
rm -rf "/Library/Caches"
rm -rf "~/.adobe"
rm -rf "~/Library/Preferences/Adobe"
rm -rf "~/Library/Preferences/com.adobe.crashreporter.plist"
rm -rf "~/Library/Logs"
rm -rf "~/Library/Caches"
rm -rf "~/Library/Application Support/Adobe"
[Unit]
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=samd
ExecStart=/usr/bin/socat tcp-listen:2022,reuseaddr,fork tcp:168.128.12.244:22
@SamDecrock
SamDecrock / nginx-webradio-forwarding.conf
Created June 10, 2019 08:37
Nginx configuration to forward a web radio
server {
listen 80;
server_name 104.248.213.228 koit.mydomain.com;
access_log /var/log/nginx/koitfm.access.log;
error_log /var/log/nginx/koitfm.error.log;
root /var/www/koitfm/;
location /KOITFM {
resolver 8.8.8.8; # may or may not be necessary.
Location
System configuration (wpe-raspberrypi) System hostame (change the hostname)
System configuration /bin/sh (bash) (use bash instead of sh)
Kernel Linux Kernel Tools gpio
Target packages Show packages that are also provided by busybox
Target packages Audio and video applications bluez-alsa
Target packages Development tools git
Target packages Development tools git-crypt
Target packages Development tools grep
Target packages Development tools make
Operation Location value
ENABLE Target packages Filesystem and flash utilities dosfstools
ENABLE Target packages Filesystem and flash utilities mtools
ENABLE Filesystem images ext2/3/4 root filesystem
SET VALUE Filesystem images ext2/3/4 root filesystem ext2/3/4 variant ext4
DISABLE Filesystem images initial RAM filesystem linked into linux kernel
ENABLE Host utilities genimage
// this one liner starts a TCP server on port 3000 and spits out all the data it receives
// just run `node` from the command line and past the following:
require('net').createServer(function(socket) { socket.on('data', function(data) { console.log(data.toString()) }); }).listen(3000);
@SamDecrock
SamDecrock / csv2json.js
Last active July 9, 2018 14:50
Conversts json (or any other seperated data) to an array of json objects (provided that there's a row with header information)
function csv2jsonObjects (csv) {
var lines = csv.split('\n');
var keys = [];
var json = [];
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
var parts = line.split(';');