Instantly share code, notes, and snippets.

View nacl_sdk
# Tried folling instructins here: https://developer.chrome.com/native-client/sdk/download
# But I got, "Host storage.googleapis.com returned an invalid certificate"
# I tried the cert at: (as per the second, better sounding answer here:
# https://stackoverflow.com/questions/49804248/install-chrome-native-client-nacl)
https://github.com/Kagami/nacl_sdk/blob/master/sdk_tools/cacerts.txt
# Then the even better sounding:
https://github.com/Kagami/nacl_sdk/blob/update-cacerts/sdk_tools/cacerts.txt
# Eventually disabled sig checking as per the first answer
View get_some_fonts.sh
#!/bin/bash
FONT_PATH=/home/m/.fonts/
# -- Jost --
# https://github.com/indestructible-type/Jost/tree/master/Finished%20OpenType
# `('${$$('table a.js-navigation-open').map(a => a.href).join("' \\\n'")}')`
PATHS=('https://github.com/indestructible-type/Jost/blob/master/Finished%20OpenType/Jost-100-Hairline.otf' \
'https://github.com/indestructible-type/Jost/blob/master/Finished%20OpenType/Jost-100-HairlineItalic.otf' \
'https://github.com/indestructible-type/Jost/blob/master/Finished%20OpenType/Jost-200-Thin.otf' \
View embed_wikipedia_midis.js
// ==UserScript==
// @name Wikipedia: embed midi
// @namespace mqScripts
// @match *://*.wikipedia.org/*
// @grant none
// @require https://code.jquery.com/jquery-3.3.1.slim.min.js
// ==/UserScript==
// Requires that your browser knows what to do with midi audio tags.
// eg MIDI Player https://chrome.google.com/webstore/detail/midi-player/khppfbnjbaampmeeiocjhcodkklkcfjf
//
View install node
# Sketchy (TODO, uwrap this)
sudo curl -sL https://deb.nodesource.com/setup_11.x | sudo bash -
sudo apt update
sudo apt install nodejs
View 00212308.html
<table cellpadding="0" cellspacing="0" border="0" id="x:1533160306.2:mkr:contentTbl" style="table-layout:fixed;width:100%;" mkr="contentTbl"><tbody id="x:1533160306.3:mkr:headingArea" mkr="headingArea"><tr id="x:1533160306.9:mkr:header" class="ig_ElectricBlueHeader igg_ElectricBlueHeader" mkr="header"><td><div style="overflow:hidden;"><table id="x:1533160306.10:mkr:headerContent.hdn" cellpadding="0" border="0" style="table-layout: fixed; visibility: inherit; margin-left: 0px; width: 1020px;" cellspacing="0" mkr="headerContent.hdn"><tbody><tr id="x:1533160306.11:mkr:columnHeaderRow" mkr="columnHeaderRow"><th id="x:1533160306.12:adr:0:idx:0:key:RowNumber:hdr:1:skp:" class="igg_ElectricBlueHeaderCaption" style="width: 40px;" title="" skp="" hdr="1" key="RowNumber" idx="0" adr="0">#</th><th id="x:1533160306.12:adr:1:idx:1:key:ImageUrl:hdr:1:skp:" class="igg_ElectricBlueHeaderCaption smallCell igede12b8d" style="width: 0px;" title="" skp="" hdr="1" key="ImageUrl" idx="1" adr="1">Image</th><th id="x:1533160306.12:a
View openwrt_rescue.ttl
# Good stuff here: https://wiki.openwrt.org/toh/tp-link/tl-wdr4300
# (p3,5,7,9 on JTAG are GPIOs?)
J1: 1,2,3 (not 4) -> raspi: 10,8,6
minicom -D /dev/ttyAMA0 -b 115200
type: 'tpl<enter>' when uboot is preparing to load
# server should be 192.168.1.100
# see that with printenv
View list_foreign_packages.sh
#!/bin/bash
PACKAGE_LIST="dpkg-query -W -f='${binary:Package}\n'" # List all debs
#PACKAGE_LIST=apt-mark showmanual # List only requested/manually installed debs
# Unknown origin debs get 100.
#PRIORITY=100
# I have some preferences to set some repos to other priorities in (100-200)
PRIORITY="1.."
$PACKAGE_LIST | \
xargs apt-cache policy | \
grep -B 4 " \*\*\*.*${PRIORITY}$" | \
View Cura end.gcode
M104 S0 ;extruder heater off
G91 ;relative positioning
G1 E-1 F300 ;retract the filament ... to release some of the pressure.
G1 Z+5 E-1 F{travel_speed} ;move Z up a bit and retract filament /just/ a little more.
G90 ;absolute positioning
G0 X0 Y110 ; Present the result!
M84 ;steppers off
M106 S0 ; Fan off.
View Pi ⟷ Mini UART connection.md

MP Select Mini

The serial cable (that ordinarily connects to the LCD controller) has four wires: Red, White, Green, Black.

  • Red ➙ Ground
  • White ➙ TX USART1 - pin 42
  • Green ➙ RX USART1 - pin 43
  • Black ➙ +3.3V (yup, they're backwards)

†: on the STM32 processor

View authorize_crd.sh
#!/bin/sh
# This assumes the package is installed.
# wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
# sudo apt install ./chrome-remote-desktop_current_amd64.deb
# # And maybe
# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# sudo apt install ./google-chrome-stable_current_amd64.deb
# # Fix the likely missing dependencies.
# sudo apt --fix-broken install