This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Useful helpers for manjaro | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deviceTree: | |
&mikrobus_i2c { | |
status = "okay", | |
spi-max-frequency = `<100000>`, | |
} | |
&mikrobus_spi: | |
status: "okay" | |
click_spi2: spi-device@1 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your key bindings in this file to override the defaults | |
[ | |
{ "key": "meta+f", "command": "actions.find", | |
"when": "editorFocus || editorIsOpen" }, | |
{ "key": "meta+s", "command": "workbench.action.files.save" }, | |
{ "key": "meta+g", "command": "editor.action.nextMatchFindAction", | |
"when": "editorFocus" }, | |
{ "key": "meta+a", "command": "editor.action.selectAll" }, | |
{ "key": "meta+c", "command": "editor.action.clipboardCopyAction" }, | |
{ "key": "meta+x", "command": "editor.action.clipboardCutAction" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo pacman -Syu base-devel --needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## usbreset -- linux program reset a usb port using /dev/ttyUSB<n> file paths | |
# usage: usbreset /dev/ttyUSB0 | |
# Install: | |
# nim c usbreset.nim | |
# sudo cp usbreset /usr/local/bin | |
# Setuid to not need sudo (at your own peril): | |
# sudo chmod 4555 /usr/local/bin/usbreset | |
import os, system, osproc, posix, strutils, re, strformat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
Direction* = enum | |
input | |
output | |
PinConf* = object | |
dir: Direction | |
Port0* = object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> $ valgrind -v --leak-check=yes ./rpcsocket_json [±compiler-1_4_0_failure-test ●] | |
==529377== Memcheck, a memory error detector | |
==529377== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. | |
==529377== Using Valgrind-3.16.1-36d6727e1d-20200622X and LibVEX; rerun with -h for copyright info | |
==529377== Command: ./rpcsocket_json | |
==529377== | |
--529377-- Valgrind options: | |
--529377-- -v | |
--529377-- --leak-check=yes | |
--529377-- Contents of /proc/version: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x4A |> Integer.to_string(2) |> String.pad_leading(8, "0") |> String.pad_leading(10,"0x") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ParseUdhcpd do | |
def find_leases(interface \\ "eth0") do | |
udhcpd_lease_bytes = | |
"/tmp/vintage_net/udhcpd.#{interface}.leases" | |
|> File.read!() | |
<<written_at::signed-integer-64, leases_bytes::bits >> = udhcpd_lease_bytes | |
parse_leases(leases_bytes, []) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo systemctl enable syncthing@`whoami`.service | |
sudo systemctl start syncthing@`whoami`.service | |
systemctl status syncthing@`whoami`.service | |