tech

Tech tedbits

Tech tedbits

Here are a few things I’ve struggled with this week. Javascript addEventListener I tried to implement a simple accordion using some code I found at w3schools but couldn’t get it to work (within WordPress) I had to resort to using jQuery and finally got the desired result using the following code:

I suspect the issue was either a JS conflict OR the DOM not loading fully when trying to add the EventListener. Note the above script needs to be at the end of the file, after the HTML for the button and panel. HTML table line-height This is something…

BSV into cold storage

BSV into cold storage

Recently my digital exchange announced they were leaving the building. Shame, great platform and customer service. Well done, folks! Sadly, everything ends! BX to stop services at month’s end Move fires price slump on exchange The price of the cryptocurrency traded on bx.in.th fell by 3.6% as of press time on Monday and slumped below 200,000 baht per Bitcoin at one point. If you ignore the two hours it took me to realise what I thought was a thumb drive was actually an empty micro SD card reader, then yeah it all went pretty smoothly. What a stupid mistake! There…

FFS MySQL

FFS MySQL

I recently lost 2 hours of my life trying to change a MySQL root password. F.F.S !! If you search the interwebs, you’ll find the pundits recommending something like the following:

For some reason, the mysqld_safe script wouldn’t run in the background even though the ampersand was definitely present. Control never returned to the foreground and I then tried connecting to the MySQL server in another shell and perform the password reset yet it didn’t work – the result being that the password was reset to a blank password. Not good. [Ed – Not a blank password – the…

Blog – meet PHP 7.3

Blog – meet PHP 7.3

Given I’ve recently been doing a lot of server-based stuff on the work front, I decided to share some love with this here blog by upgrading PHP to version 7.3. It really does seem to make a difference, performance-wise. Even though I’ve handled a few PHP 7.3 upgrades now, everyone is a little different, it seems. Here’s what happened this time: First, I added the repository reference

apt-get update failed, reporting a key error. I managed to get that one sorted using sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C then ran apt-get update again. All good! Then I tried installing PHP 7.3 using sudo apt install php7.3 php7.3-common php7.3-cli No…

Hello HTTPS

Hello HTTPS

Well, that was a bit of a shit-show and is the reason why I’d been putting it off for so long. Hey look, I got the green padlock! In summary: Grabbed an SSL cert using certbot, that all went smoothly. DNS issues are what caused a major headache. I had been using Cloudflare for ‘flexible SSL’ whatever the fuck that means, and the DNS propagations took a long time to flow through from namecheap. To add additional crap, DNS caches on my local machine seemed particularly hard to clear (Ubuntu 14.04 aka trusty). They even persisted through a reboot. Pesky…

Upgrading to PHP 7.3 to improve WordPress TTFB

Upgrading to PHP 7.3 to improve WordPress TTFB

This is the hottest summer in Bangkok I can remember having sweated through. So I’m happy to be spending a Sunday afternoon in my air-conditioned home office working through various issues on my main client site in an effort to improve the dreaded Time-To-First-Byte (TTFB) issue. Thinking about it logically, WordPress is the issue here. Given the client’s site is on a VPN and ‘unmanaged’ (that means I manage it) I don’t have to content with troubleshooting the stack – although one of the first tasks I need to undertake today is to upgrade PHP to version 7.3 Firstly it’s…

List active WordPress plugins

List active WordPress plugins

Another win this week. I’ve needed this for some time – a way to list currently active plugins on a WordPress site. I cobbled the following PHP script together from fragments found on the web. You’ll need to edit the IP address at the top of the script. While there are other ways to lock down this script, this is my preferred method.

Here’s the output: (truncated) Click to enlarge Groovy! References Function Reference/get plugins CSS for table styling wprecipes.com -code inspiration

Finally – timestamps in h2o logfile

Finally – timestamps in h2o logfile

This has been bugging the shit out of me for ages and I found a solution today using the ts utility from moreutils. Here’s the error log directive in h2o.conf:

Now I have output which is much more usable. Take a look!

Printing woes – a wise warning on inkjet printers

Printing woes – a wise warning on inkjet printers

I should have listened to the sales guy when he told me you need to use this printer regularly. I didn’t and now my Epson L355 (link to manual) only ‘prints’ blank pages – the print head(s) are well and truly blocked. Just getting the PC talking to the printer was an ordeal. I had previously built a Win 10 VM on Oracle’s Virtualbox and since there are no Linux admin apps for the Epson, I was forced to connect it to a Windows PC to test it out. One thing about Virtualbox – USB don’t work ‘out of the…

The sun sets on Shashin

The sun sets on Shashin

It appears the popular Shashin WordPress plugin is no more. Although its developer Mike Toppa stopped supporting the plugin a number of years ago, it has now been pulled from the WP plugin repository and usage documentation seems to have disappeared. No surprise really, as Google has been slowly but surely killing the integration with Picasa after launching Google Photos (Google acquired Picasa in 2004). I’ve blogged about Picasa pain before. https://www.craigamos.rocks/picasa-pain-persisits/ https://www.craigamos.rocks/google-photos/ Additionally, the Picasa desktop application no longer works. Where does that leave the existing user base? The plugin still works for existing Google albums, at least. You…

1 of 6
123456