this post was submitted on 04 Dec 2023
16 points (100.0% liked)

NotAwfulTech

364 readers
1 users here now

a community for posting cool tech news you don’t want to sneer at

non-awfulness of tech is not required or else we wouldn’t have any posts

founded 1 year ago
MODERATORS
16
better tools thread (awful.systems)
submitted 11 months ago* (last edited 11 months ago) by [email protected] to c/[email protected]
 

this is in part because it's for (yet another) post I'm working on, but I figured I'd pop some things here and see if others have contributions too. the post will be completed (and include examples, usecases, etc), but, yeah.

I've always taken a fairly strong interest in the tooling I use, for QoL and dtrt reasons usually (but also sometimes tool capability). conversely, I also have things I absolutely loathe using

  1. wireguard. a far better vpn software and protocol than most others (and I have slung tunnels with many a vpn protocol). been using this a few years already, even before the ios app beta came around. good shit, take a look if you haven't before
  2. smallstep cli. it's one of two pieces of Go software I actually like. smallstep is trying to build its own ecosystem of CA tools and solutions (and that's usable in its own right, albeit by default focused to containershit), but the cli is great for what you typically want with certificate handling. compare step certificate inspect file and step certificate inspect --insecure https://totallyreal.froztbyte.net/ to the bullshit you need with openssl. check it out
  3. restic. the other of the two Go-softwares I like. I posted about it here previously
  4. rust cli things! oh damn there's so many, I'm going to put them on their own list below
  5. zsh, extremely lazily configured, with my own little module and scoping system and no oh-my-zsh. fish has been a thing I've seen people be happy about but I'm just an extremely lazy computerer so zsh it stays. zsh's complexity is extremely nonzero and it definitely has sharp edges, but it does work well. sunk cost, I guess. bonus round: race your zsh, check your times:
% hyperfine -m 50 'zsh -i -c echo'
Benchmark 1: zsh -i -c echo
  Time (mean ± σ):      69.1 ms ±   2.8 ms    [User: 35.1 ms, System: 28.6 ms]
  Range (min … max):    67.0 ms …  86.2 ms    50 runs
  1. magic-wormhole. this is a really, really neat little bit of software for just fucking sending files to someone. wormhole send filename one side, wormhole receive the-code-it-gives the other side, bam! it uses SPAKE2 (disclaimer: I did help review that post, it's still good) for session-tied keying, and it's just generally good software
  2. [macos specifically] alfred. I gotta say, I barely use this to its full potential, and even so it is a great bit of assistive stuff. more capable than spotlight, has a variety of extensibility, and generally snappy as hell.
  3. [macos specifically] choosy. I use this to control link-routing and link-opening on my workstation to a fairly wide degree (because a lot of other software irks me, and does the wrong thing by default). this will be a fuller post on its own, too
  4. [macos specifically] little snitch. application-level per-connection highly granular-capable firewalling. with profiles. their site does a decent explanation of it. the first few days of setup tends to be Quite Involved with how many rules you need to add (and you'll probably be surprised at just how many things try to make various kinds of metrics etc connections), but well worth it. one of the ways to make modern software less intolerable. (honorary extra mention: obdev makes a number of handy pieces of mac software, check their site out)
  5. [macos specifically] soundsource. highly capable per-application per-sink audio control software. with the ability to pop in VSTs and AUs at multiple points. extremely helpful for a lot of things (such as perma-muting discord, which never shuts up, even in system dnd mode)

rust tools:

  1. b3sum. file checksum thing, but using blake3. fast!. worth checking out. probably still niche, might catch on eventually
  2. hyperfine. does what it says on the tin. see example use above.
  3. dust. like du, but better, and way faster. oh dear god it is so much faster. I deal with a lot of pets, and this thing is one of the invaluables in dealing with those.
  4. ripgrep. the one on this list that people are most likely to know. grep, but better, and faster.
  5. fd. again, find but better and faster.
  6. tokei. sloccount but not shit. handy for if you quickly want to assess a codebase/repo.
  7. bottom. down the evolutionary chain from top and htop, has more feature modes and a number of neat interactive view functions/helpers

honorary mentions (things I know of but don't use that much):

  1. mrh. not doing as much consulting as I used to, using it less. quickly checks all git(?) repos in a path for uncommitted changes
  2. fzf. still haven't really gotten to integrating it into my usage
  3. just. need to get to using it more.
  4. jql. I ... tend to avoid jq? my "this should be in a program. with safety rails." reflex often kicks in when I see jq things. haven't really explored this
  5. rtx. their tagline is "a better asdf". I like the idea of it because asdf is a miserable little pile of shell scripts and fuck that, but I still haven't really gotten to using it in anger myself. I have my own wrapper methods for keeping pyenv/nvm/etc out of my shell unless needed
  6. pomsky. previously rulex. regex creation tool and language. been using it a little bit. not enough to comment in detail yet
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 11 months ago* (last edited 11 months ago) (1 children)

zsh and ohmyzsh

install powerlevel10k as a theme. Do it now. Thank me later.

https://github.com/romkatv/powerlevel10k#oh-my-zsh

[–] [email protected] 3 points 11 months ago* (last edited 11 months ago) (1 children)

You missed the key indicator on that deliverable

NOT oh-my-zsh

Shit’s janky and slow as hell

[–] [email protected] 2 points 11 months ago (1 children)

but it does free me from having to care about few things which for me is worth these 100ms on startup; anyways: what would you recommend instead?

[–] [email protected] 1 points 11 months ago (2 children)

if it works for you that's great I guess

I hate my computers being slow. I hate slow shells for the same reason as I hate modern js stacks, chrome being everything that chrome is, and FUCKING ELECTRON: all wasteful garbage trading low developer attention ("VELOCITY") for user suffering. fuck that completely.

the core of my zsh setup is really rather simple:

function load_if_exists() {
  [[ -a $1 ]] && source $1
}

function path_if_exists() {
  [[ -a $1 ]] && path=($1 $path)
}

function var_if_exists() {
  [[ -a $1 ]] && export $2=$1
}

use like so:

# nixos
load_if_exists ${HOME}/.nix-profile/etc/profile.d/nix.sh

# python local shit
path_if_exists ${HOME}/.local/bin

# virtualenv
load_if_exists /etc/bash_completion.d/virtualenvwrapper

scope OS-/platform-local things by slapping them under a folder: ${HOME}/.zsh/{macos,linux,...}

I keep things like nvm/pyenv/etc out of my normal shell flow until needed (this could be where I'd use rtx, need to try habit it):

% functions enable_pyenv
enable_pyenv () {
	export PYENV_ROOT="${HOME}/.pyenv"
	path=(${PYENV_ROOT}/bin $path)
	eval "$(pyenv init --path)"
	eval "$(pyenv init -)"
	if which pyenv-virtualenv-init > /dev/null
	then
		eval "$(pyenv virtualenv-init -)"
	fi
	pyenv virtualenvwrapper
}

% functions enable_nvm
enable_nvm () {
	export NVM_DIR="${HOME}/.nvm"
	load_if_exists /usr/local/opt/nvm/nvm.sh
	load_if_exists /usr/local/opt/nvm/etc/bash_completion.d/nvm
	load_if_exists /opt/homebrew/opt/nvm/nvm.sh
	load_if_exists /opt/homebrew/opt/nvm/etc/bash_completion.d/nvm
}

other aliases, functions, etc I load in a very simple fashion. this is among my earliest config, and One Day(tm) I'll enrich this a bit to be more like the other loaders:

source ${HOME}/.zsh/aliaslist   # list of files with aliases
source ${HOME}/.zsh/functionlist    # list of files with functions, broken up by context
source ${HOME}/.zsh/env_scripts/loader    # loader for other things like lscolour, etc etc

that's really about all of the complexity. very, very simple. done so to make inter-host use as painless as possible. it's one of the rules I chose over a decade ago for how I do my computering, and it's served me incredibly well

[–] [email protected] 3 points 11 months ago (1 children)

so i went and tested things, and it seems that oh-my-zsh adds roughtly 200ms to my shell startup, which is not worth optimizing away considering its usefulness. i'm not starting or restarting zsh frequently enough to care for 0.2s – bash is what i'm using for non-interactive shell scripting.

the real slog, as it happens, is the teleport autologger, which takes at least half a sec even for a status check. all other tests, including vpn checks, take less than 0.1s.

(which taught me that (a) hyperfine can be useful, and (b) that stopping using tools that provide affordances is the wrong first reaction. now i'm going to spend half a day to find a not entirely unelegant way to handle teleport session validity without running teleport commands.)

[–] [email protected] 2 points 11 months ago

Fair enough. And yeah hyperfine is great

I spawn easily hundreds of shells a day (think of it as an attention forking model), so that 200ms absolutely grinds for me

On another note: trying out starship.rs (installed today), will feedback about that soon

[–] [email protected] 1 points 11 months ago* (last edited 11 months ago)

lemmy ate my &s, just replace them I guess