Skip to content

Instantly share code, notes, and snippets.

View julianlam's full-sized avatar
🤔
I may be slow to respond.

Julian Lam julianlam

🤔
I may be slow to respond.
View GitHub Profile
@julianlam
julianlam / metadata.json
Last active October 1, 2021 14:35
Configuring a USB printer via a router running Tomato, on Pop!_OS (Windows too!)
{
"timestamp": 1633179600000
}
@julianlam
julianlam / kudos-to-voip-ms.md
Created September 29, 2021 13:10
A heartfelt kudos to the VoIP.ms team #blog

The customer support heroes1 at VoIP.ms have finally declared that their extended period of intermittent downtime is tentatively over 🎉

image

For the last two or three weeks, service has been down due to a random DDoS from as-yet-unknown bad actors. While one can always point the finger and say that VoIP.ms should have been prepared, it is quite difficult and expensive to prepare for something like this.

I have been using VoIP.ms as my carrier of choice for my talk and text, and while this outage has been inconveniencing, I am glad that they are back and all the better for it. The team there kept their customers updated as much as possible, with multiple updates on Twitter. Their service is extremely economical (pay-as-you-go style pricing), and they should be extremely proud of being able to weather the storm and come out a winner.

I was quite dismayed to see many responses to their updates,

@julianlam
julianlam / recovery-from-full-boot-partition.md
Created September 29, 2021 02:46
Recovering from a full `/boot` partition #blog

I was running a system update when I ran into an odd error message that looked unfamiliar:

Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.13.0-7614-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned e
rror exit status 1
Errors were encountered while processing:
@julianlam
julianlam / tp-link-ac600-ac1300-drivers-linux.md
Last active May 25, 2024 12:02
Installing drivers for the TP-Link T2U/T3U Plus (AC600 or AC1300) Wireless Adapter #blog
@julianlam
julianlam / npm-yarn-exploding.md
Last active September 23, 2021 00:36
Got some npm or yarn errors and can't install dependencies anymore? #blog

There are few things more disheartening than when you are in the middle of a task, you run npm install or yarn, and everything goes to pieces – your working directory's node_modules/ are fubar'd, and no amount of running npm install or yarn will make it go away.

Maybe your error looks something like this:

node:events:371
      throw er; // Unhandled 'error' event
      ^

Error: EISDIR: illegal operation on a directory, read
@julianlam
julianlam / laptop-s2idle-to-deep.md
Last active January 2, 2024 17:00
Changing laptop suspend from s2idle to deep sleep #blog

One thing I noticed ever since I bought my second Dell XPS was that the battery life was relatively abysmal when the laptop was asleep. I'd suspend my laptop at work, bring the laptop home, and the next morning I'd be down 25-50% of my battery life! More than once, I'd leave my laptop for a couple days and come back to a completely dead laptop1.

My first inclination was that the laptop was waking up on its own. It does happen occasionally with Linux (which, in an of itself, is pretty concerning2), but in this case, I was reasonably certain it wasn't the case, as evidenced by the battery drop overnight when waking a still-sleeping laptop.

While there are a plethora of articles online about sleep/standby (suspend to RAM) and hibernate (suspend to disk), the root cause was that some hardware configurations support three different modes of sleep: s2idle, shallow, and deep.

According to the [Linux Kernel documentation](https://www.kernel.org/doc/html/v4.15/admin-guide/pm/sleep-states

@julianlam
julianlam / github-gist-blog.md
Last active October 1, 2021 13:22
This blog is built atop of GitHub Gist... #blog

In case you were wondering, this blog is:

I managed to stand up a minimal version of this (sans styling) in a single afternoon1. Here's how it works, and some caveats.

Using Github Gist as a data store

@julianlam
julianlam / meta.json
Last active September 18, 2021 04:14
A decade in the industry; a ten year retrospective #blog
{
"timestamp": "1597527540000"
}
@julianlam
julianlam / spa112-registration-failure.md
Last active September 17, 2021 15:16
Fixing a SPA112 registration failure (Tomato/SPA112/VoIP.ms) #blog

Since replacing my router with an Asus RT-AC68U1, I ran into an odd issue where my VoIP phone no longer registered with my provider VoIP.ms1.

I didn't clue in immediately that it was due to the router (and firmware) change, and I was about to reach out to the support team but decided to check their FAQ2 as it was suggested I do so prior to starting the live chat session.

As it turns out, there is an incompatibility with the Tomato firmware and the Linksys/Cisco SPA1121 I use.

To resolve,

  1. Navigate to your Tomato router at http://192.168.1.1 and log in.
  2. Navigate to Advanced > Conntrack/Netfilter
@julianlam
julianlam / freshtomato-on-asus-routers.md
Last active February 5, 2023 06:27
Installing FreshTomato on an ASUS router using Linux #blog

I recently replaced my Ubiquiti AirCube-AC because I missed the sheer configurability of Tomato. It's been years since I used a router with this installed, but Ubiquiti's UI for the AirCube is fairly hobbled as it is a fairly new product, and as it is meant to be a "set it and forget it" device used more commonly by WISPs in rural areas (among other use cases).

After some light web research I discovered that Tomato by Shibby, a popular fork of the Tomato firmware, had been discontinued, and that he was now advocating FreshTomato, so after a quick donation to thank him for his work, I downloaded the appropriate build of FreshTomato for my router.

My first attempt was simply using the firmware update tool in the router interface, which failed spectacularly1. Some more light web research revealed that this was no longer an allowed way to upload a custom firmware.

So the