Archive for the ‘tech’ Category

Linux on late-2010 Mac Mini

Got given one of those exquisitely made late-2010 Mac Mini that is too old to do any modern computing (read, no modern browser available at all now). MacOS runs with seconds-wait between every mouse click – but fair enough, it is a Core 2 Duo with just 2GB of RAM.

Had good experience with LXLE distro on some older PCs – early i5s with 4GB of RAM – so I thought what’s to lose? Well, it turns out, a few more steps, u-turns and Googling required than the PCs!

Here are the steps:

1. Boot into MacOS Recovery and use Disk Utility

Despite blogs and comments saying pretty much “just boot up the Linux USB and off you go” – it failed consistently every try. A comment on Reddit offered the help needed (sorry, can’t find that post now!)

  • Boot up Mac Mini whilst holding the Option key
  • Select Recovery drive
  • Click on Disk Utility
  • Delete existing MacOS partition (yes, this is a clean install, not a dual boot)
  • Create new partition and set as FAT

2. Boot into LXLE installation USB without any network

  • Boot up Mac Mini whilst holding the Option Key
  • Select USB
  • Follow the instructions to install LXLE, but DO NOT enable network (having the internet and downloading updated packages invariably hangs the installation)

3. Detective work with GRUB

  • Upon reboot once the installation completes, it was rather dejecting to see a GRUB command prompt instead of the usual cursor-based menu.
  • https://www.linuxfoundation.org/blog/blog/classic-sysadmin-how-to-rescue-a-non-booting-grub-2-on-linux came to the rescue
  • As outlined in the above article, a bit of detective work is required, but here’s the commands that worked for me:
  • grub> ls
  • (hd0), (hd1), (hd2), (hd0, gpt2), (hd0 gpt1)
  • grub> ls (hd0,gpt2)
  • [this is where I found all the typical linux directories like bin/ boot/ etc]
  • grub> set root=(hd0,gpt2)
  • grub> linux /boot/vmlinuz-5.something-something-generic root=/dev/sda2
  • grub> initrd /boot/initrd.img-5.something-something-generic
  • grub> boot
  • That booted into LXLE after a bit of sweaty waiting and praying!
  • Then make sure you run ‘update-grub’ then ‘grub-install /dev/sda’ to make auto-booting permanent.

4. Enable IPv6 at the router

  • Not sure why, but whenever I did an ‘sudo apt-get update’ or using the GUI package manager, all the package URLs from ppa.launchpad.net just don’t resolve and therefore fails.
  • Tried different ways of fixing this to no avail, until chancing upon an unreferenced comment somewhere that PPA Launchpad won’t resolve IPv4 anymore – which can’t be confirmed anywhere on the actual website (or perhaps I was too frazzle to see it).
  • Having exhausted my understanding of the package system and my Googling abilities, I decided to enable IPv6 on my router – hoping that nothing breaks for the rest of the network.
  • Luckily, setting ‘IPv6 Connection type’ to [Native] (as I’m on PPPoE for the WAN) on my ASUS router did the trick – nothing (so far) broke on my network and PPA Launchpad served packages now.
  • https://www.asus.com/au/support/faq/113990/

5. Update packages – it will take a bit of time as 650MB of data is downloaded and installed.

6. Running Hardware Detect

  • Hardware detect identified a Nvidia driver that I can use instead of the generic driver.
  • I thought, surely a specific driver would be better – but the fonts on the menu and everywhere in the GUI became MASSIVE.
  • Need to adjust DPI
  • editing or creating /usr/share/lightdm/lightdm.conf/50xserver-command.conf and adding the command xerver-command=X -core -dpi 150
  • http://blog.mlindgren.ca/entry/2015/02/21/configuring-dpi-in-lubuntu-slash-lxde/

UPDATE: Unfortuately, LXLE broke after an update. By that I mean, sound no longer works (that is, cannot detect the HDMI audio device, nor the headphone jack), and wifi as well (i.e. no hardware detected).

7. To boot into USB again to try another distro (Antix 23) wasn’t straightforward. The previous installation of grub doesn’t display the grub menu, but goes directly into LXLE. So, to reinstate grub menu, I had to follow various grub modifications like

https://medium.com/@leijerry888/get-grub-menu-back-after-installing-ubuntu-20-04-alongside-windows-dab5de5afc37

https://askubuntu.com/questions/16042/how-to-get-to-the-grub-menu-at-boot-time

What worked in the end was setting GRUB_CMDLINE_LINUX_DEFAULT=true

Then pressing ‘c’ to get into the CLI

Then following the advice on https://szymonkrajewski.pl/how-to-boot-system-from-usb-using-grub/ to boot into the Antix 23 live-cd USB drive.

8. Once Antix installed, had to follow Step 3 again to set grub up properly. This time, for some reason, the grub menu comes up automatically – rather than as before where it boot straight to LXLE.

Google Workplace IMAP & SMTP intricacies

Google Workplace (the paid version of Google/Gmail) has so many settings that one really needs to study it to set it up well.

Although, I do have a sneaking suspicion that some things may not be spelt out (at least not well) on purpose to foster some vendor lock in.

What not to do: try to get Thunderbird to access a Google Workplace account when you are in a hurry.

  1. Thunderbird can’t access Google; Thunderbird indicates that the password is wrong.
  2. Despite numerous re-types and checking that the password is inputted correctly, the connection just refuses to work.
  3. But I’ve enabled IMAP from the User’s Gmail account!!! I don’t understand!!!
  4. Happen to notice a single Security Alert email in the inbox using the Gmail interface.
  5. That’s strange – falls inside the time period I’ve been tearing my hair out with Thunderbird – yet only one alert despite numerous attempts.
  6. So, a search reveals that Google considers any non-Google, non-OAuth applications (like Thunderbird) as a ‘Less Secure Application’ … interesting classification given all the SSL advances in client-side mail applications.
  7. Ah, one can allow ‘Less Secure Application’ in the Google Workplace administration console.
  8. Wait, still doesn’t work.
  9. Go back to the the Google Workplace administration console. Read the wording again and realise – allowing this at the administration console level only allows each user to have their individual choice.
  10. Armed with this glimmer of hope, the User’s Account (not Gmail setting) reveals the option to allow ‘Less Secure Application’.
  11. Finally, Thunderbird connects and inbox fills – along with tears of joy.

mac annoyances

The new M1 Apple Silicone seems to be a game changer for productive use of laptops. Windows still offer better value proposition if limited to office-type work; there are sub-$1000 laptops that are lightweight yet sufficiently endowed to handle any such workload. However, if any video work is required, it seems that the M1 offers a level of performance that can only be matched with an external GPU on a PC, thereby increasing the cost and also at an expense to battery life. This is why the M1 is the front runner to be my next laptop.

However, a few MacOS annoyances that hopefully have solutions/workarounds:

  1. I hate how the Dock works in MacOS. It is so much easier to get an immediate visual summary of what applications are open – which I want to access at a given time – on Window’s Taskbar. MacOS has always had the strange paradigm of “close” not equaling “quit” – so the Dock could indicate that an application is “open” but what that really means is the application is “not quit” yet its corresponding window does not exists in the desktop view.
  2. I don’t know why you can’t Cut files and folders in Finder. The option is there in the Edit menu just greyed out. So to move a file, you have to Copy from the source directory, go to the destination directory to Paste, and then go back to the source directory to move the file to Trash. Why not just enable Cut? Absolutely stupid.
  3. Snapping of windows is not built in. Nor is automatic resizing of Finder window. If you are unfortunate enough to drag-and-drop (because there is no Cut-and-Paste!) a file into a far corner of the Finder window that isn’t within the viewing area the next time Finder is opened – you’d have a heart attack that the file has disappeared but its just sitting out of view waiting for you to scroll horizontally to see it. Absolute time waster.

Need to find some solutions to these.

Mega Soundboard

It is hard to understand why PowerPoint never implemented this, but if you ever had to play a sound or music during a presentation, you had to peg the start of the audio to a particular slide, and once the audio starts there’s no easy way to stop.

Completely cumbersome if, say, the first time you teach some children to sing along a set of slides. You can’t skip forward to show a slide without activating the music; you can’t go back to the first slide without restarting the music; you can’t stop the music if you realise the kids need a bit more time to follow.

Mega Soundboard is the easiest and best answer to this problem. Its taken a long time for me to find this; none of the other soundboards, or hotkey solutions, or full featured media players (e.g. VLC, fubar2000) does this as simply and as elegantly as Tom4nt’s Mega Soundboard: you setup your selection of audio files, assign each a hotkey (which are global), and you just press the hotkey to play the desired audio without the program needing to be in focus (i.e. you need PowerPoint to be in focus to control the slides).

A start/stop global hotkey can be assigned as well to stop the audio at will.

Voila! Its open source to boot as well!

Upgrade to PHP 7.4 broke Moodle 3.3

Well, I thought, let’s go the other way then: upgrade Moodle first and then backtrack to PHP.

But Moodle 3.3 can’t go straight to 3.9 (which is the LTS I’m hoping to get it to) – 3.3 can only go as far as 3.5 – and Moodle and PHP documentation doesn’t say whether 3.5 will work with the existing PHP 7.0; time to take a gamble …

… and it paid off. Following these steps Moodle was upgraded to 3.5 and it worked with PHP 7.0

Then the upgrade to PHP 7.4 went smoothly.

Upgrade Debian 8 (Wheezy) to 9 (Stretch)

Upgrade of my Debian 8 server was long overdue; however, went headlong into it and ran into problems the first time round (i.e. MariaDB wouldn’t start properly. So I restored the server back to 8 (thanks Vultr for snapshots!) and tried again. This is what worked the second time round:

  1. Shutdown MySQL/MariaDB before attempting to upgrade Debian (a step I noticed after the failed first attempt; Section “Upgrading to MariaDB 10.1 from MySQL 5.5” of MariaDB’s documentation “Moving from MySQL to MariaDB in Debian 9”).
  2. Follow Steps 2 to 5 of phoenixNap’s guide– it had the easiest sources.list edits for switching to Debian 9 repositories.

As the primary function of this server is to serve PHP applications, it was also an opportune to upgrade the PHP version as WordPress will soon require at least version 7.2.

  1. Follow Steps 1 to 3 of Computing for Geeks guide – this will upgrade PHP to version 7.4
  2. Follow Section “Activating New PHP Version in Apache” in JiyuuLife’s guide for the quickest way for Apache to use the new 7.4 instead of the previous version (7.0 for Debian 8).

Led down the garden path

I want to Airplay a YouTube video to an Apple TV. According to this official support document from Google/YouTube:

As a reminder, if you’re casting from a mobile device, make sure to download the YouTube app. Casting from youtube.com in a mobile web browser is not currently supported.

https://support.google.com/youtube/answer/7640706?hl=en

So, downloaded the YouTube app, can’t find an Airplay icon anywhere. Some users claim its now subsumed under the Cast icon – no luck there for me either.

Turns out, playing the YouTube video directly from Safari shows up the Airplay icon.

*Sigh.

motorola razr

I must say, the form factor of the new Motorola Razr has me tempted to go back to Android. I love the pocketable design and with retro cool to boot! I do hope it was the ThinkPad team that Lenovo deployed to consult on the hinge design.

But its not even in the realm of possibility with that $1500 price tag …

WordPress stack

My new found favourite (free) stack for WordPress frontend work – and a little bit of backend tinkering are:

What is interesting is that Elementor and Ultimate Addons for Gutenberg is aiming to do the same thing – provide ready made widgets to drag and drop into the layout. However, I think its best to keep each page/post using one or the other; and both have widgets that are useful and not found in the other.

For the backend, I’ve been using Code Snippets for a long time. But recent discovery of PODS has revolutionised how I create, extend and change Custom Post Types and Custom Fields. It was simple to extend the Post type to have a Custom Field of Date, and easily display it in an Ultimate Addons Post Grid using a Hook in Code Snippets.

Integromat

Shout out to Integromat, an online service that connects other web services together, using a visual paradigm. Great customer service, even for the free tier.

After working out a few kinks, I’m now able to pipe custom fields from a Woocommerce order into a Airtable base, with relative ease.