Skip to content

Instantly share code, notes, and snippets.

@justinschuldt
justinschuldt / karabiner.edn
Last active July 18, 2023 09:59
keyboard layers for MacOS with Karabiner-Elements and GokuRakuJoudo formatting
{
:layers {
; implement caps lock mode
:caps_layer {:key :caps_lock :alone {:key :escape}}
; make tab a layer if/when it is held
:tab_layer {:key :tab :alone {:key :tab}}
:backslash_layer {:key :backslash :alone {:key :backslash}}
}
@justinschuldt
justinschuldt / external-monitor-control.sh
Created December 12, 2021 23:17
Modify external monitor settings like brightness and contrast, from debian
# add the repository to get ddcutil
sudo add-apt-repository ppa:rockowitz/ddcutil
# update
sudo apt-get update
# install ddcutil
sudo apt install ddcutil
# change brightness of the primary montior to 80
sudo ddcutil setvcp 10 80
@justinschuldt
justinschuldt / main.go
Created December 11, 2021 00:22
golang parallel async tasks, sending results to channel, completion tracked by WaitGroup
package main
import (
"fmt"
"sync"
"time"
)
type QueryResult struct {
key string
@justinschuldt
justinschuldt / kint36-i3wm-keys-and-vim-layer.json
Created December 8, 2021 06:45
QMK keymap for a Kinesis Advantage2 running the Stapelberg kint36 controller. This keymap provides OS keys for i3wm, and a layer with VIM controls.
{
"version": 1,
"notes": "For QMK Configurator. You can view this by importing it at <https://config.qmk.fm/#/kinesis/kint36/LAYOUT>. It can also be used directly with QMK's source code",
"documentation": "QMK keymap for a Kinesis Advantage2 running the Stapelberg kint36 controller. This keymap provides OS keys for i3wm, and a layer with VIM controls. Build info: <https://github.com/kinx-project/kint> \n",
"keyboard": "kinesis/kint36",
"keymap": "kint36-updated-layer-toggles",
"layout": "LAYOUT",
"layers": [
[
"KC_ESC",
@justinschuldt
justinschuldt / confg.yaml
Created November 30, 2021 04:04
OctoPrint config for controlling relays via GPIO
system:
actions:
- action: light_on
command: gpio mode 0 out && gpio write 0 0
name: Light ON
- action: light_off
command: gpio mode 0 out && gpio write 0 1
name: Light OFF
- action: divider
- action: rpi_usb_on
@justinschuldt
justinschuldt / main.go
Created November 22, 2021 20:28
Golang add key/value to json file
package main
import (
"encoding/json"
"log"
"os"
"sync"
)
type Exclude struct {
@justinschuldt
justinschuldt / main.go
Created November 22, 2021 20:18
Golang log to file
package main
import (
"os"
"time"
)
func main() {
logFileName := fmt.Sprintf("logs_%v.log", time.Now().String())
@justinschuldt
justinschuldt / main.go
Created November 11, 2021 22:53
golang parallel async tasks, using WaitGroups and Mutex locks
package main
import (
"fmt"
"time"
"sync"
)
type QueryResult struct {
key string
@justinschuldt
justinschuldt / main.go
Created November 11, 2021 22:51
golang parallel async tasks, results via channel
package main
import (
"fmt"
"time"
)
type QueryResult struct {
key string
result string
@justinschuldt
justinschuldt / ubuntu_server-setup.sh
Created May 23, 2020 04:06
Ubuntu Server setup notes
sudo apt update -y;
sudo apt upgrade -y;
# bonjour, find hostnames by "hostname.local"
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan;