Skip to content

Instantly share code, notes, and snippets.

@patterns
patterns / beagleboneblack.txt
Created February 25, 2017 12:53
Build Bitcoin full node on BeagleBone Black
#!/bin/sh
# Download latest Debian image for microSD from https://beagleboard.org/latest-images
# List drives before inserting microSD
df -h
# Insert microSD, then Look for the newly listed SD drive (disk2s1)
df -h
# Unmount the microSD
@attacus
attacus / riot-matrix-workshop.md
Last active February 8, 2026 08:44
Create your own encrypted chat server with Riot and Matrix

This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

@ravikp7
ravikp7 / output
Created June 4, 2017 05:32
Schemapack encoding doesn't work for array of more than 9 objects.
ravi@ravi-Lenovo-G50-45:~/beagle-js$ node serializer-test.js
undefined:3
var ref1=json;var ref2=ref1['a'];var ref3=ref2[0];var ref4=ref2[1];var ref5=ref2[10];var ref6=ref2[2];var ref7=ref2[3];var ref8=re
f2[4];var ref9=ref2[5];var ref10=ref2[6];var ref11=ref2[7];var ref12=ref2[8];var byteC=0;byteC+=1;byteC+=1;byteC+=bag.dynamicByteC
ounts['string'](ref5['pad']);byteC+=1;byteC+=1;byteC+=1;byteC+=1;byteC+=1;byteC+=1;byteC+=1;byteC+=bag.getVarUIntByteLength(ref2.l
ength);for (var j2=10;j2<ref2.length;j2++) { var ref13xn=ref2[j2];byteC+=1;}var wBuffer=bag.allocUnsafe(byteC);bag.byteOffset=0;if
(typeof(ref3['a']) !== 'number'||ref3['a']<0||ref3['a']>255){bag.throwTypeError(ref3['a'],'number',0,255,'uint8');}bag.byteOffset
= wBuffer.writeUInt8(ref3['a'], bag.byteOffset, true);if (typeof(ref4['b']) !== 'number'||ref4['b']<0||ref4['b']>255){bag.throwTy
peError(ref4['b'],'number',0,255,'uint8');}bag.byteOffset = wBuffer.writeUInt8(ref4['b'], bag.byteOffset, true);if (typeof(ref5['p
ad']) !== 'string'){bag.throwTypeE
@walchko
walchko / mjpeg2.py
Last active August 21, 2022 23:31
a better mjpeg streamer in python using opencv 3.x
#!/usr/bin/env python3
# MIT License
# (c) 2017 Kevin J. Walchko
#
# Updated 16 Mar 2020: Python 3.7.5 Ubuntu 19.10
# Desktop, wired interface is enp2s0
# Raspberry Pi: wlan0
# Ideally, this should be fixed, it is hard coded right now
@jadonk
jadonk / grove-probe
Last active October 27, 2020 16:42
#!/usr/bin/env perl
my $devices = `i2cdetect -y -r 2`;
#print $devices;
my @lines = split /\n/, $devices;
foreach my $line ( @lines ) {
next if $line =~ /^\s/; # skip lines starting with whitespace
$line =~ s/\d\d\:\s*//; # remove 2 digit indexes
#print $line , "\n";
my @entries = split /\s/, $line;
foreach my $entry ( @entries ) {
@Papierkorb
Papierkorb / 000_HOWTO.md
Last active May 25, 2024 08:25
Dynamic library in Crystal

Writing a dynamic library in Crystal, and calling it from C

  • Download all files.
  • Build the Crystal part:
crystal build --release --cross-compile --prelude ./no_main library.cr
              ^ You can leave this out
                        ^ We want to link ourselves!
 ^ Use our custom prelude!
@pdp7
pdp7 / BB-SPIDEV1-00A0.dts
Last active January 8, 2023 16:59
src/arm/BB-SPIDEV1-00A0.dts modify to add tinydrm st7735r for Adafruit 1.8" TFT LCD connected to BeagleBone Black running 4.16.0-rc2-bone3 kernel. More info: https://groups.google.com/d/msg/beagleboard/GuMQIP_XCW0/b3lxbx_8AwAJ
/*
* Copyright (C) 2013 CircuitCo
*
* Virtual cape for SPI1 on connector pins P9.29 P9.31 P9.30 P9.28
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
@aursu
aursu / modem.py
Last active September 30, 2025 23:27
ModemManager interface via Python 3 (Dbus, Modems, SMS)
#!/usr/bin/python3
# script created for reading SMS messages from 3G modem connected to PC
# 1) it looks for modem
# 2) reads all SMS messages from modem
# 3) prints all found SMS messages to stdout only if total messages count
# greater than SMS_STORE_COUNT (default is 3)
# 4) save all but SMS_STORE_COUNT messages to txt files and
# delete them from modem
@JasonLS
JasonLS / 7segment.c
Created August 28, 2018 20:09
C code to use baconbits two 7 segment displays
#include <stdio.h>
#include <unistd.h>
int main() {
FILE * spidev = fopen("/dev/spidev2.1", "wb");
//Left 7 Segment
fwrite("\x40\x00\xc0", 1, 3, spidev);//"0's" are on, "1's" are off
//Right 7 Segment
fwrite("\x40\x01\xc0", 1, 3, spidev);
//You should see the segments look like zeroes.
@pwntr
pwntr / EAGLE.desktop
Created February 11, 2019 09:20
Proper EAGLE PCB E-CAD desktop launcher for Ubuntu/GNOME
# copy this file to ~/.local/share/applications/. Change installation paths below to fit your setup.
[Desktop Entry]
Version=9.3.0
Type=Application
Terminal=false
Name=EAGLE
Comment=PCB design: schematic capture, board layout, and autorouter
# paths need to be absolute, no ~ allowed within this file