Hard things that seem simple ep00001
Why can’t I automatically activate a uv venv after creating it? Surely just run .venv/bin/activate?! Apparently not.

Why can’t I automatically activate a uv venv after creating it? Surely just run .venv/bin/activate?! Apparently not.
great easter egg
update regularly!
finally! so many accidentally-moved files and folders
sometimes a random step from a setup guide from the open source geospatial world has exactly the information you need.
DO NOT DO THIS.
excessive, but impressive.
Modal seems like a winner.
Scan your LAN for loose samba shares
crazy concept!
Solution:
sudo rm -r /etc/pacman.d/gnupg
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman-key --refresh-keys
sudo pacman -Sy gnupg archlinux-keyring
sudo pacman -Sc
Generational loss of a concept! Growing up mostly with phones means less understanding of file/folder structure. Either the OS deliberately tries to hide it from you (mobile OSs grouping files by type), or on computers where people mostly use Downloads folder and Desktop.
What a champion. I was quite worried my laptop was dying.
Always wonder how many of these early Amazon stories are survivorship bias, but they sure are good at going all in on plans
Great little explainers for some important concepts. Learned a lot from /proc one!
This is cooooooooool. Control tabs from the commandline! Search them like searching files! Amazing idea.
Excellent tips. Reading this makes me feel like my security is atrocious
Dammit snap where are my files
I wanted to set up backups for a few computers. Basically mirror a hard drive where I keep some photos and music so I don’t lose em in case of hard drive failure or extreme flooding.
I bought some external drives months ago to do this, had them sitting in a case ready to go, but then got caught up with how mirroring should work, And how to automate them to handle deletions and things properly, but not wipe all the data if a drive has failed. And preferably some kind of archive mode so I can restore things that get accidentally changed or deleted.
But this was already way too complicated and I was stuck in the “doing research on the thing instead of the thing” stage. Stage 1 was instead a manual copy onto the disk. That meant the data is saved to the external and I’ve saved the multiple hours of copying time when it’s eventually automated later.
Good steps:
For backups, starting with a basic cp is fine. Adding a cron job for rsync with a bunch of conditional rules can come later.
TLDR use cmd < file, not cat file | cmd
Wanted to remove a bunch of old/unused binary files that were bloating a repo.
I switch between browsers quite a lot, mostly between firefox and chromium-based ones depending on what I’m doing or my current mood. Because of this I haven’t been able to rely on bookmarks from browser, and prefer somewhere centrol to keep links. Pocket has extensions for most browers, and gives a quite decent overlay UI for saving links and adding tags. The only thing I couldn’t add was notes. I like to add short descriptions or notes and sometimes cross-link things to help remember and find things later.
linksync is a simple script that grabs items from the Pocket API that I’ve tagged with ‘links’, grabs some data from each, and adds a new item in my websites links folder (as a draft). It will then pop up on my computer later. I’ll maybe add a description or some additional tags, then save and publish the site. Eventually would like to automate that as well, but haven’t decided how I want it to work yet. Probably just publish master will be simplest.
Quick recap of making a Pocket app:
last_updated value to only fetch recently added itemsSome additional useful bits in comments (also a lot of ‘just use x’). Actual list has some gems in it: repgrep, podman, mdcat etc
Using dig:
dig +short myip.opendns.com @resolver1.opendns.com
Using curl:
curl https://ipinfo.io/ip
Using JavaScript:
.env files were the thing that made me stop pasting credentials directly in my WIP files.
I often start a long running command and then realise I didn’t start tmux.
probably npm install. Or a long awaited apt update.
I remembered reading something before on “move current command to tmux”.
Went looking for that and found this SO
ctrl z # pause the process
bg # resume it in the background
jobs -l
# get process number
disown PROCESS_NAME
tmux
reptyr pid
cannot test right now as I don’t have repytr installed. More importanntly, I don’t
want to remember that much. That’s a lot of things to type every time.
Why not start tmux automatically when shell starts!
From SO
# warning this <mark>may</mark> now corrupt your Ubuntu logins
if [[ ! $TERM =~ screen ]]; then
exec tmux
fi
BUT, as they go on with:
However, there is a very small risk this can make bash behave in a way that other programs don’t expect, since running bash can possibly cause it to turn into a tmux process, so it might be better to modify how you start your terminal emulator.
This does not sound good. So instead I will start auto-start tmux when launching the terminal emulator.
From Medium post
Navigate to “Preferences > Profiles > PROFILE >Command > Send text at start” and set it to:
tmux ls && read tmux_session && tmux attach -t ${tmux_session:-default} || tmux new -s ${tmux_session:-default}
This caused an error
Failed to execute tmux
PATH=/usr/bin:/bin:/usr/sbin:/sbin
After far too long putting up
with OSX’s crap, I finally cracked a few days ago. The actual install/setup bit was pretty straightforward, there was some screwing around getting HFS+ partition shared between the two (I wanted to share most stuff in home directory). For easiest, jump to the good way
Critical thing here is disable “secure empty trash” in Finder. It was going to take about a week to delete otherwise (I had 1.8M files in there)
Using Disk Utility, wasn’t able to resize partition for some weird reason. Clicking “+” button allowed adding empty space, but it used nearly all available space. Was hoping for smaller linux partition, but this will do for now. Just click and
This is comically easy. Download and run install-refind. Reboot to verify it works if you want, otherwise power through to install
From rEFInd menu, can select USB boot (I had to power-off and boot with USB inserted). Install as normal, when partitioning you probably want to specify you own. Check these options carefully and step 5 should be avoidable.
GRUB will nuke replace rEFInd so for now you can only boot into Linux. Fix that with some help from this guy. This is very likely avoidable
Classic Linux. This just needed an apt-get install dkms - but that needs a network connection. Options are either to download the package directly and copy it on some kind of floppy disk, or tether to a phone over bluetooth (which works out of the box…)
Now we have internet, and want to start sharing those tasty directories. Installed hfsplus package, then mount fails for some reason. Can’t remember the exact error, but I usually assume fsck will fix it. Rebooted to OSX Recovery mode, and tried the black box “repair”. Booted back into Linux and tried mounting again, and everything is ok
Read-only home directory is not so useful for me. Apparently to mount HFS+ as writable, you need to disable journaling as described on ineed.coffee. Boot back into OSX and try disabling with various diskutil commands, but they just through unhelpful errors. Turns out it was Core Storage. This whole time
Great overview of how to fix this from awesometoast.
Two diskutil cs commands later and you can now disable journaling. But first you need to reinstall rEFInd from osx again (just re-run install-refind script).
Reboot, boot into OSX Recovery Mode, open Disk Utility.
Unmount “Macintosh HD”, then Option click on “File” and Click “disable journaling”
From castyour.net
Back in linux, you should now be able to mount properly. May need to set UID to 501 (or whatever Apple user is) and possibly chown the HFS+ mount directory,
Now symlink any needed stuff from /mnt/ Ubuntu docs
Classic linux volume 2 - resuming from sleep always seems to break or misbehave for some reason. In this case suspend was fine straightaway, but when resuming the screen would turn on briedly, then go black. Hooray.
After resuming, the screen is either 100% or 0% - and 0 was the value it chose if the brightness was below about 95%. Solution for a while was just mash the “increase brightness” button until it turns back on. For proper fix, install (mba6x)[https://github.com/patjak/mba6x_bl] and everything is great.
# echo 2 > /sys/module/hid_apple/parameters/fnmodeWhat to do about ctrl/alt/super? The physical ordering of Ctrl/Alt/Super is different to normal layout so there is a lot of jumping.
See all tags.