Skip to content

Instantly share code, notes, and snippets.

View taikedz's full-sized avatar

Tai Kedzierski taikedz

View GitHub Profile
@taikedz
taikedz / README.md
Last active September 6, 2023 07:07
pathctl

pathctl

A quick and dirty script for loading/appending to PATH

Oftentimes when I write install scripts i have to go looking for a path and its presence to avoid duplication, parsing the .bashrc and .profile scripts .

This is tedious, and prone to issues.

If we could have a basic utility that already took care of this as a default item in the system, it would be handy.

@taikedz
taikedz / README.md
Last active September 1, 2023 10:36
Install ZIG

Install Zig

A basic script to pull the latest master, or specified version, of zig

bash install-zig.sh # installs master build as 'zig'
bash install-zig.sh 0.11.0 # installs latest build for this version as 'zig-0.11.0'

# This command is always the latest-installed master build
zig --help
@taikedz
taikedz / README.md
Last active August 23, 2023 08:11
Using syncthing

Converterd to an articla: https://dev.to/taikedz/considering-syncthing-at-work-3pin

An interim solution for passing around large files using decentralised means

Syncthing uses end-to-end encryption to send files directly to other devices. If two devices are on the same network, the instances communicate directly with eachother. If not, they send traffic, encrypted, via a relay server (akin to a router).

This solution can be useful for sending large files between workstations, when other means are unavailable.

Security considerations

@taikedz
taikedz / README.md
Last active March 6, 2023 00:00
Little UDP test

UDP test

(Note: taken further in a proper repo: https://github.com/taikedz/udp_test)

This is a quick thing I put together for testing UDP packet sending behaviours.

Interestingly, if a message is delayed by the server and sent after the client times out, the message is still received client side. An actual client would need to proactively manage response validity.

I did try randomly generating multiple identical repsonses from the server, that only caused confusion for this simple client.

@taikedz
taikedz / split_array_str.sh
Created February 15, 2023 12:48
Shell: Array split in quoted string
#!/usr/bin/env bash
QUOTED_ARRAY="-Djava=\"one 'and' two\" -Djavax=\"three four\""
while IFS= read -r -d '' item; do echo "$item"; done < <(xargs printf '%s\0' <<< "$QUOTED_ARRAY")
# Output:
# -Djava=one 'and' two
# -Djavax=three four
@taikedz
taikedz / datatable.py
Last active December 4, 2023 10:56
DataTable
# (C) Tai Kedzierski
# LGPLv3
from collections import OrderedDict
from typing import Any, Union, List
class DataTable(list):
def __init__(self, data:List[List[Any]]):
""" Builds a table, after popping the first line which provides headers
@taikedz
taikedz / install-anbox.sh
Created December 28, 2022 21:42
Anbox installer
#!/usr/bin/env bbrun
# Steps obtained from:
# https://ubuntuhandbook.org/index.php/2021/10/anbox-run-android-apps-ubuntu/
#%include std/out.sh
#%include std/askuser.sh
set -euo pipefail
@taikedz
taikedz / VSCODE_README.md
Last active June 23, 2023 08:32
Visual Stodio Code (VS Code) settings

VS Code Settings Adjustments

Plugins to install

  • pylance
  • git lens

Switch between the terminal and editor

Open the preferences via Ctrl Shift P

@taikedz
taikedz / enable-firefox-scroll-touchscreen.sh
Created November 8, 2022 10:18
Enable firefox touchscreen scrolling
sudo sed -i "s|Exec=|Exec=env MOZ_USE_XINPUT2=1 |g" /usr/share/applications/firefox.desktop
xdg-desktop-menu forceupdate
@taikedz
taikedz / README.md
Last active September 21, 2023 15:35
Genericised setup.py file for re-use

Generic setup.py

Specifically aimed at re-use