Skip to content

Instantly share code, notes, and snippets.

View cstrahan's full-sized avatar

Charles Strahan cstrahan

  • Backtrace
  • Dallas, TX
View GitHub Profile
@cstrahan
cstrahan / kimiko.vil
Created August 10, 2023 00:24
My Kimiko key layout
{"version": 1, "uid": 11836529702412328832, "layout": [[["KC_GRAVE", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5"], ["KC_ESCAPE", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T"], ["KC_TAB", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G"], ["KC_LSHIFT", "KC_Z", "KC_X", "KC_C", "KC_V", "KC_B"], ["KC_LGUI", "KC_LALT", "KC_LCTRL", "MO(1)", "KC_SPACE", "KC_LBRACKET"], ["KC_GRAVE", "KC_0", "KC_9", "KC_8", "KC_7", "KC_6"], ["KC_BSPACE", "KC_P", "KC_O", "KC_I", "KC_U", "KC_Y"], ["KC_QUOTE", "KC_SCOLON", "KC_L", "KC_K", "KC_J", "KC_H"], ["KC_RSHIFT", "KC_SLASH", "KC_DOT", "KC_COMMA", "KC_M", "KC_N"], ["KC_RGUI", "KC_RALT", "KC_RCTRL", "MO(2)", "KC_ENTER", "KC_RBRACKET"]], [["KC_NO", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5"], ["KC_GRAVE", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5"], ["KC_TRNS", "LSFT(KC_1)", "LSFT(KC_2)", "LSFT(KC_3)", "LSFT(KC_4)", "LSFT(KC_5)"], ["KC_TRNS", "KC_EQUAL", "KC_MINUS", "LSFT(KC_EQUAL)", "LSFT(KC_LBRACKET)", "LSFT(KC_RBRACKET)"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_F11", "KC_
@cstrahan
cstrahan / gist:a0d07cbf633263e510cb2716cdf21790
Created October 11, 2022 11:07
Successful Teensy reset
DEBUG probe_rs::config::registry > Searching registry for chip with name MIMXRT1060
DEBUG probe_rs::config::registry > Exact match for chip name: MIMXRT1060
WARN probe_rs::config::target > Using custom sequence for MIMXRT10xx
DEBUG jaylink > libusb 1.0.25.11696
DEBUG jaylink > libusb has capability API: true
DEBUG jaylink > libusb has HID access: true
DEBUG jaylink > libusb has hotplug support: true
DEBUG jaylink > libusb can detach kernel driver: true
DEBUG jaylink > open_usb: device descriptor: DeviceDescriptor {
bLength: 0x12,
@cstrahan
cstrahan / gist:a9dfcf6c96a611aecbf3daeb97341c41
Created October 10, 2022 01:25
Reset with default debug sequence
DEBUG probe_rs::config::registry > Searching registry for chip with name MIMXRT1060
DEBUG probe_rs::config::registry > Exact match for chip name: MIMXRT1060
WARN probe_rs::config::target > Using custom sequence for MIMXRT10xx
DEBUG jaylink > libusb 1.0.25.11696
DEBUG jaylink > libusb has capability API: true
DEBUG jaylink > libusb has HID access: true
DEBUG jaylink > libusb has hotplug support: true
DEBUG jaylink > libusb can detach kernel driver: true
DEBUG jaylink > open_usb: device descriptor: DeviceDescriptor {
bLength: 0x12,
$ RUST_LOG=debug,probe_rs::probe=info ../target/release/probe-rs-cli download --disable-progressbars --chip MIMXRT1060 --protocol jtag ~/src/hello-teensy/target/thumbv7em-none-eabihf/debug/hello-teensy
DEBUG probe_rs::config::registry > Searching registry for chip with name MIMXRT1060
DEBUG probe_rs::config::registry > Exact match for chip name: MIMXRT1060
WARN probe_rs::config::target > Using custom sequence for MIMXRT10xx
DEBUG jaylink > libusb 1.0.25.11696
DEBUG jaylink > libusb has capability API: true
DEBUG jaylink > libusb has HID access: true
DEBUG jaylink > libusb has hotplug support: true
DEBUG jaylink > libusb can detach kernel driver: true
DEBUG jaylink > open_usb: device descriptor: DeviceDescriptor {
wget https://raw.githubusercontent.com/osandov/osandov-linux/58e0c5f1bc7f0866ce7a18bcb67f3eabf4be7868/scripts/btrfs_map_physical.c
gcc -O2 -o btrfs_map_physical btrfs_map_physical.c
sudo mount /dev/mapper/data-root /mnt
sudo btrfs sub create /mnt/@swap
sudo umount /mnt
sudo mkdir /swap
sudo mount -o subvol=@swap /dev/mapper/data-root /swap
sudo touch /swap/swapfile
sudo chmod 600 /swap/swapfile
@cstrahan
cstrahan / HRecursionSchemes.hs
Created November 26, 2018 05:30 — forked from xgrommx/HRecursionSchemes.hs
HRecursionSchemes
{-# LANGUAGE StandaloneDeriving, DataKinds, PolyKinds, GADTs, RankNTypes, TypeOperators, FlexibleContexts, TypeFamilies, KindSignatures #-}
-- http://www.timphilipwilliams.com/posts/2013-01-16-fixing-gadts.html
module HRecursionSchemes where
import Control.Applicative
import Data.Functor.Identity
import Data.Functor.Const
import Text.PrettyPrint.Leijen hiding ((<>))
@cstrahan
cstrahan / IxFix.hs
Created November 26, 2018 05:30 — forked from AndrasKovacs/IxFix.hs
Example for recursion schemes for mutually recursive data
{-# LANGUAGE
UndecidableInstances, RankNTypes, TypeOperators, TypeFamilies,
StandaloneDeriving, DataKinds, PolyKinds, DeriveFunctor, DeriveFoldable,
DeriveTraversable, LambdaCase, PatternSynonyms, TemplateHaskell #-}
import Control.Monad
import Control.Applicative
import Data.Singletons.TH
@cstrahan
cstrahan / setupYubikey.sh
Created August 29, 2018 00:59 — forked from rpardini/setupYubikey.sh
Automated-ish setup of Yubikey for SSH logins (replace ssh-agent with gpg-agent from brew)
#! /bin/bash
set -e
GPGCONF_PATH=$(which gpgconf)
if [[ "$GPGCONF_PATH" != "/usr/local/bin/gpgconf" ]]; then
echo "You don't have gnupg installed from brew, lets install it."
brew install gnupg pinentry-mac ykpers
else
@cstrahan
cstrahan / config-ayufan
Created February 19, 2018 03:30
Kconfig differences between nix and ayufan (for Rock64 kernel)
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 4.4.103-rockchip-ayufan-1 Kernel Configuration
#
CONFIG_ARM64=y
CONFIG_64BIT=y
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
CONFIG_ARCH_MMAP_RND_BITS_MAX=24