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
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
[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.
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
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
// 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(';');
@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"
@SamDecrock
SamDecrock / raw_neopixel_rfduino.ino
Last active February 20, 2017 03:23
Controls a NeoPixel using an RFDuino board with functions that resemble the NeoPixel API
// WS2812_RFduino_Test
// By Thomas Olson
// teo20140220.01
// teo20140719.01 Modified for Arduino 1.5.7
// 20141022.. verified works with Arduino 1.5.8
// No complicated Pixel Library needed.
// Tested with WS2812B 4 pin versions.
// Modified by Sam Decrock to resemble NeoPixel API
const int ws2812pin = 6;