Software

231 posts in Software

WordPress unable to connect to SQL database

· linux, software, www

Yesterday, three blogs I'm hosting suddenly went offline and alerts went off.

They all had the same error that they couldn't connect to their SQL database, and it seemed that the container recently was auto-updated.

Docker logs also showed (which may or may not have been related):

2024-02-21  7:30:29 97 [Warning] Aborted connection 97 to db: 'unconnected' user: 'unauthenticated' host: '192.168.200.4' (This connection closed normally without authentication)

This was odd. I started the usual troubleshooting:

Software & time-saving

· misc, software

Software is typically sold on the promise of increased convenience or productivity, or both. If we were to believe all the clichéd marketing lingo about time-saving, our lives would now consist largely of uninterrupted leisure time. 

In a recent post, Brett Scott argues persuasively that, far from making our lives easier, technology is making them faster and more discombobulated. To understand how this shift happens, Scott tells us to look at the issue from a systemic perspective: 

DALL-E 3: wow

· software

DALL-E 3 is here. And the future too, or almost at least.

Prompt: generate 3D images of the inside of a house in Singapore. It needs to look modern and minimalistic, with light colours, to show a customer. Focus on the living room.

It still sucks at generating text... Trying to get an 80s style logo for superuser.one...

RPi kernels in Bookworm

· hardware, linux, software

Raspberry Pi recently launched Bookworm, and with that, a new kernel package.

However, due to the massive changes from Bullseye to Bookworm, they are not suggesting a dist-upgrade.

In the past, we have suggested procedures for updating an existing image to the new version, but always with the caveat that we do not recommend it, and you do this at your own risk.

This time, because the changes to the underlying architecture are so significant, we are not suggesting any procedure for upgrading a Bullseye image to Bookworm; any attempt to do this will almost certainly end up with a non-booting desktop and data loss.

IP Changed?

· networking, software

Very simple Python script that tracks one or multiple hosts/domains for IP changes, and prints it in a Matrix room.

# docker logs ipchanged
29-09-2023 - 11:26:35 - Logged in as @turtlebot:matrix.org
29-09-2023 - 11:26:35 - IP address for be.yeri.be is 94.105.123.126
29-09-2023 - 11:26:35 - IP address for sg.yeri.be is 58.96.238.208
29-09-2023 - 11:26:35 - IP address for industry.yeri.be is 78.23.172.72
29-09-2023 - 11:29:36 - IP address for be.yeri.be is 94.105.123.126
29-09-2023 - 11:29:36 - IP address for sg.yeri.be is 58.96.238.208
29-09-2023 - 11:29:36 - IP address for industry.yeri.be is 78.23.172.72

Includes a Docker container to keep it running.

Check websites with LanguageTool for typos

· software, www

This is quick and dirty (and with the help of ChatGPT).

FlatTurtle has a new site, and there's been some fine-tuning here and there that led to a few typos creeping in. I wanted a quick tool to plug in a page, and that would highlight possible mistakes.

I've been a personal (paying) user of LanguageTool for a few years now (European, and less spammy and dodgy than Grammarly)

Script to display Mac battery information

· apple, hardware, software

You can see how this script makes that couple very happy.

Quick and dirty script that shows your Mac battery information (health, cycles, etc). If an Apple keyboard or mouse is connected, it'll also display the battery % of those.

# Battery information
battery() {

	if !ioreg > /dev/null 2>&1; then
		echo "ioreg not found. Exiting."
		return 1
	fi

	_ioreg=`ioreg -l`
	_profile=`system_profiler SPPowerDataType`

	MOUSE=`echo $_ioreg -l | grep -A 10 "Mouse" | grep '"BatteryPercent" =' | sed 's/[^0-9]*//g'`
	TRACKPAD=`echo $_ioreg -l | grep -A 10 "Track" | grep '"BatteryPercent" =' | sed 's/[^0-9]*//g'`
	KEYBOARD=`echo $_ioreg -l | grep -A 10 "Keyboard" | grep '"BatteryPercent" =' | sed 's/[^0-9]*//g'`
	CYCLE=`echo $_profile | grep "Cycle Count" | awk '{print $3}'`

	if [ -n "$MOUSE" ]; then
		echo "Mouse: "$MOUSE"%"
	fi

	if [ -n "$TRACKPAD" ]; then
		echo "Trackpad: "$TRACKPAD"%"
	fi

	if [ -n "$KEYBOARD" ]; then
		echo "Keyboard: "$KEYBOARD"%"
	fi

	if [ -n "$CYCLE" ] && [ "$CYCLE" -ne 0 ]; then
		echo "Mac battery "`echo $_profile | grep "State of Charge" | awk '{print $5}'`"%"
		echo "Charging: "`echo $_profile | grep "Charging" | head -n 1 | awk '{print $2}'`
		echo "Cycles: "$CYCLE
		echo "Condition: "`echo $_profile | grep "Condition" | awk '{print $2}'`
		echo "Health: "`echo $_profile | grep "Maximum Capacity" | awk '{print $3}'`
	fi
}

Outputs something similar to this (no mouse or keyboard connected):

PoC: Betteruptime + Python-kasa

· hardware, linux, networking, software

Content Update

The provided scripts have been updated on 16 Jul 2023. Specifically the SmartStrip part was not working as intended.


I've been a big fan of Betteruptime. I've started using it to monitor all my assets online (websites, DNS, ping, successful script runs) as well as my servers (using heartbeats).

Screenshot of Betteruptime showing a heartbeat that failed for several hours.
Image of a heartbeat that failed for several hours. After 2 hours of no hearbeat, it turned into an incident, and several hours later the heartbeats resumed.

I have a few Raspberry Pi's, and once in a while they hang (not sure why, maybe USB-to-SSD issues or something). Nothing too critical, but annoying.

killwarp

· apple, networking, software

Is your company forcing Cloudflare Warp on you, and are you running on a Mac (with sudo access)?

It probably sucks, spies on you, does MitM attacks, breaks most video conferencing tools, and is generally not very stable... Also... Zero trust!

Add this function to your .bashrc or .zshrc (whichever shell you're using*):

func killwarp() {
	sudo launchctl remove com.cloudflare.1dot1dot1dot1.macos.warp.daemon
	sudo killall Cloudflare\ WARP
}

Open a new shell window (to reload your dot files), and type killwarp.

Don't trust corporates

· software

Especially those at the pinnacle that've lost touch with their customers.

I've blogged about it before.

Here is how platforms die: first, they are good to their users; then they abuse their users to make things better for their business customers; finally, they abuse those business customers to claw back all the value for themselves. Then, they die.

Source: Pluralistic

I've just learned that Amazon Kindle killed the book loaning feature... Something they initially used as a selling point when I got my first Kindle in 2017 (or whenever it was).