Skip to content

Instantly share code, notes, and snippets.

# front = ./grb/cnc_test-F.Cu.gbr
back = ./grb/cnc_test-B.Cu.gbr
outline = ./grb/cnc_test-Edge.Cuts.gbr
drill = ./grb/cnc_test-PTH.drl
output-dir = ./cnc
# common
metric = yes
metricoutput = yes
zsafe = 5
@cyber-murmel
cyber-murmel / bandcampscrape.md
Last active October 20, 2018 08:30
Using bash and youtube-dl to scrape bandcamp

Usecase

Let's say there is a band on bandcamp you like and you would like to listne to their music even if zou are online. You may already know youtube-dl, but it's tedeous to download all the albums individually.

Code

First let's define a function that returns all the links to every album of one band.

bandcamp_album_links () {
        BAND=$(echo $1 | grep -Po 'https?://\w+\.bandcamp\.com')
        for ALBUM in $(curl -s $BAND/music | grep -Po '/album/[\w-]+')
 do
```
ctrl_interface=/run/wpa_supplicant
### key_mgmt=NONE
network={
ssid="hamburg.freifunk.net"
key_mgmt=NONE
priority=0
}
ctrl_interface=/run/wpa_supplicant
### key_mgmt=NONE
network={
ssid="hamburg.freifunk.net"
key_mgmt=NONE
priority=0
}
@cyber-murmel
cyber-murmel / ice40web.py
Created February 13, 2020 11:41
ice40web.py
# -*- coding: utf-8 -*-
# Copyright 2020 by https://badge.team/
# This file is released under the "CC0 1.0 Universal" license.
# https://creativecommons.org/publicdomain/zero/1.0/legalcode
from machine import Pin, SPI
import wifi, urequests, sys
# Pins
@cyber-murmel
cyber-murmel / ice40.py
Created February 13, 2020 11:42
ice40.py
# -*- coding: utf-8 -*-
# Copyright 2020 by https://badge.team/
# This file is released under the "CC0 1.0 Universal" license.
# https://creativecommons.org/publicdomain/zero/1.0/legalcode
from machine import Pin, SPI
# Pins
pin_reset = Pin(16, Pin.OUT)
@cyber-murmel
cyber-murmel / datamatrix_capacity.py
Created February 17, 2020 14:24
DataMatrix Capacity
# each datamatrix size can fit as many numbers as according to the following dict
# a non-number letter needs double as much space as a number
# an emoji need 16x as much space as a number 😂
size_capacity_maps = {
'square': {
'10x10': 6, '12x12': 10, '14x14': 16, '16x16': 24,
'18x18': 36, '20x20': 44, '22x22': 60, '24x24': 72,
'26x26': 88, '32x32': 124, '36x36': 172, '40x40': 228,
'44x44': 288, '48x48': 348, '52x52': 408, '64x64': 560,
'72x72': 736, '80x80': 912, '88x88': 1152, '96x96': 1392,
@cyber-murmel
cyber-murmel / file_check.md
Created May 17, 2020 14:28
recursive file integrity checking using openssl dgst

Recursive File Integrity Checking using openssl dgst

Checksumming

Use find to iterate trought all subdirectories of the given path (./). openssl dgst -sha256 each file in each directory and add the output to the SHA256 file in the corresponding directory.

find ./ -type d -exec sh -c 'cd "{}"; find ./ -maxdepth 1 -type f -not -name SHA256 -exec openssl dgst -sha256 \{\} + | sort -u | tee SHA256' \;

Checking

@cyber-murmel
cyber-murmel / shell.nix
Created May 31, 2021 20:58 — forked from Mic92/shell.nix
Nix FHS env for OpenWrt
{ pkgs ? import <nixpkgs> {} }:
let
fixWrapper = pkgs.runCommand "fix-wrapper" {} ''
mkdir -p $out/bin
for i in ${pkgs.gcc.cc}/bin/*-gnu-gcc*; do
ln -s ${pkgs.gcc}/bin/gcc $out/bin/$(basename "$i")
done
for i in ${pkgs.gcc.cc}/bin/*-gnu-{g++,c++}*; do
ln -s ${pkgs.gcc}/bin/g++ $out/bin/$(basename "$i")
@cyber-murmel
cyber-murmel / EE & CE Resources.md
Last active May 16, 2022 09:29
a compiliation of useful links on the topic of electrical and computer engineering

EE & CE Resources

:::info This is a compiliation of useful links on the topic of electrical and computer engineering. This isnt' a comprehensive list. Feel free to add links to resources you found useful yourself.

:::

:::info