Skip to content

Instantly share code, notes, and snippets.

@sehrgut
sehrgut / README.md
Last active November 14, 2023 19:28
Libra Mini VIA and Vial keyboard definitions

Libra Mini (putative) rev. 2 VIA and Vial keyboard definitions

The VIA and Vial keyboard definitions distributed by mysterious Gdrive links have several issues. First, there seems to have been an undocumented hardware revision since the circulating VIA definition was created, in which the productId was changed from 0x4C24 to 0x4C23. As well, the VIA v2 format was trivially updatable to VIA v3 compatibility. The attached files can be used for the putative rev. 2 boards with VIA and Vial respectively.

Board Revisions

  • rev. 1 productId=0x4C24 Likely first, as this revision is in older copies of the VIA definition.
  • rev. 2 productId=0x4C23 Likely second, as this revision is in all known released copies of the Vial definition, later than the earliest VIA definition; and as well represents boards currently shipping from AliExpress.

Troubleshooting

If your board is not detectable with these keyboard definitions, try changing the productId field to 0x4C24 or checking your USB bus to confir

@sehrgut
sehrgut / pbscrub.sh
Created May 16, 2018 04:30
scrub nonprinting characters from the MacOS clipboard in one line
#!/bin/bash
pbpaste | sed 's/[^[:print:]]//g' | pbcopy
@sehrgut
sehrgut / ios-profile-extract.sh
Last active April 17, 2024 20:31
extract embedded provisioning profile data from a .IPA
#!/bin/bash
#todo: nested binary entitlements?
#todo: noclobber
#todo: "in-place" to save in original path
readonly MODE_PLIST=0
readonly MODE_RAW=1
readonly MODE_ENTITLEMENTS=2
@sehrgut
sehrgut / castlebot.user.js
Last active November 6, 2023 21:47
Sandcastle Builder autobot: kitten clicking, and ninja-safe sand clicking
// ==UserScript==
// @name castlebot
// @namespace http://alphahelical.com/
// @version 0.4
// @description Sandcastle Builder autobot: kitten clicking, and ninja-safe sand clicking
// @author sehrgut
// @match http://castle.chirpingmustard.com/castle.html
// @grant GM_info
// @grant unsafeWindow
// @grant GM_log
@sehrgut
sehrgut / mono-symbol.sh
Created September 20, 2016 18:50
retrieves the ASCII method name for a symbol offset in a mono process
#!/bin/bash
PID=$1
OFFSET=$2
sudo lldb -p ${PID} <<< "p (char*)mono_pmip ((void*)0x${OFFSET})"
@sehrgut
sehrgut / showcert.sh
Last active June 5, 2021 00:45
retrieves the SSL certificate from a remote server
#!/bin/bash
VERSTRING="showcert/v0.2a"
OPENSSL="openssl"
VERBOSE=0
HOST=""
PORT=""
SNI=""
@sehrgut
sehrgut / index.js
Last active April 25, 2016 05:24
requirebin sketch
var sprintf = require('printf'),
isLuhn = require('luhn').validate;
var tmpl = '4505530024789%03d';
for (var i=0, n=1; i< 999; i++) {
var ccn = sprintf(tmpl, i);
if (isLuhn(ccn))
console.log(sprintf('%d: %s', n++, ccn));
@sehrgut
sehrgut / list-keychain-identities.sh
Last active May 22, 2016 22:51
show signing certs available in keychain
#!/bin/bash
XSPLIT=~/bin/xsplit
pass=`dd if=/dev/random bs=1 count=256 2>/dev/null | openssl sha1`
(
sudo security export -k "/Library/Keychains/System.keychain" \
-P "$pass" -t identities -f pkcs12 2>/dev/null
security export -k "$HOME/Library/Keychains/login.keychain" \
@sehrgut
sehrgut / xsplit.sh
Last active March 20, 2019 17:33
like xargs for stdin
#!/bin/bash
# todo: keep or discard record separator
# todo: record sep within line?
# todo: line delim param
# todo: print0
# todo: verbose mode showing objects being passed and util being invoked, etc.
VERSTRING='xsplit/v0.2'
@sehrgut
sehrgut / README.md
Last active April 17, 2023 20:10
AdBlock Plus rule to neuter Forbes "AdBlock detection"

Forbes Is Irrelevant

an AdBlock Plus filter list

Installation

  1. Right-click the "ABP" icon in yoru browser toolbar.
  2. Select "Options".
  3. Click the "Add Filter Subscription" button.
  4. Select "Add a different subscription..." from the drop-down menu.
  5. Enter "Forbes Is Irrelevant" for the subscription title, and http://bit.ly/forbes-sucks for the filter list location.
  6. Click the "Add" button.