Skip to content

Instantly share code, notes, and snippets.

@Juul
Juul / saa-2n_compile.md
Created June 15, 2022 06:50
Compile firmware for NanoVNA V2 Plus clone SAA-2N

The SAA-2N is a knockoff/clone of the NanoVNA V2 Plus and you should NOT buy one.

Order an official one from https://nanorfe.com/nanovna-v2.html

However, if one for some reason falls into your hands, it might be unobvious how to find a firmware that compiles for it. I'm not sure if there are mutliple sub-versions of the SAA-2N but this one has a 4" screen.

sudo apt install gcc-arm-none-eabi  python3-serial
git clone -recursive https://github.com/nanovna-v2/NanoVNA2-firmware
@Juul
Juul / hard_drive_ssd_smart_test.md
Last active June 12, 2022 09:17
How to use S.M.A.R.T. to test and wipe harddrives and SSDs

With smartctl you can talk to the hd/ssd's built-in firmware, get detailed status info and ask it to execute tests.

First:

sudo apt install smartmontools

To do a quick health test (which can report OK even if the drive is having issues):

@Juul
Juul / openwrt_digitalocean_ddns.md
Last active March 21, 2022 08:48
How to use ddns on OpenWRT using Digital Ocean's API and skibish's daemon

Digital Ocean has an API that, among other things, allows DNS changes.

A github user called skibish maintains a small daemon written in go that implements DDNS using this API.

This guide shows you how to make this work on OpenWRT.

DNS records

Let's say you want the subdomain home.example.org to point to your home router. You can either use Digital Ocean's DNS servers for the entire example.org domain or you can add the following records to your existing DNS server to let Digital Ocean only handle the subdomain:

@Juul
Juul / wds_bridge_notes.md
Last active January 2, 2026 14:17
4-address mode aka WDS for OpenWRT

To turn a router into a bridge between wifi and ethernet, with the router being a wifi client/station, you need 4-address mode aka Wireless Distributions System or WDS.

This does not necessarily work between vendors so make sure your AP and client use chips from the same manufacturer.

It seems that enabling WDS on an AP's wifi interface does not prevent non-WDS clients from connecting normally, at least in my limited experience.

On the AP you simply add option wds '1' to the relevant wifi-iface section. E.g:

config wifi-iface 'default_radio0'
@Juul
Juul / anamorphic_desqueeze_photos.sh
Created October 16, 2021 08:45
Anamorphic desqueeze photos
#!/bin/bash
# It appears my anamorphic lens is closer to 140% than the 133% is says on the label
# TODO Have an argument to force orientation since the identify command seems to not always work
echo "Creating directory: desqueezed/"
mkdir -p desqueezed
for f in `find -maxdepth 1 -iname "*.jpg" -o -iname "*.jpeg"`; do
@Juul
Juul / filmic_pro_galaxy_s7_non-stock_android.md
Last active October 16, 2021 06:39
Filmic pro on Galaxy S7 on non-stock Android

I have an old Galaxy S7 (herolte) that I wanted to use for filming. Looking for a rom with a maintained and fairly modern Android I found pixelexperience.

I found both the built-in camera app and the OpenCamera app from F-droid somewhat lacking. Don't get my wrong, OpenCamera is a great piece of software, I just wanted some more "pro" features like real-time anamorphic demorphing and such.

While I try to avoid proprietary software in my day to day I decided to give Filmic Pro a try to see if it could turn this old device into a useful camera.

This guide was written based on Filmic Pro version 6.9.1

Unfortunately Filmic fails to launch getting stuck at the splash screen after asking for various permissions. Looking at adb logcat output it was clear that it was looking for the file scamera_sdk_util.jar in the /system/framework and not finding it.

@Juul
Juul / home_assistant_zwave_august_pro_lock_guide.md
Created October 16, 2021 05:32
Guide to using an August Smart Lock Pro using only open source software and Z-Wave (after one-time setup)

This is a quick guide for how to set up an August Smart Lock Pro for use with Home Assistant using only locally hosted open source software.

This is a nice solution if you already have a deadbolt with a manual key-less toggle on the inside of the door since installation takes about two minutes and you don't loose the manual toggle capability even if the batteries die.

The initial setup process if full of badness (identity verification, cloud bullshit and location data) but after the one-time setup it will run locally with just z-wave and no proprietary or cloud stuff.

The August lock uses four AA batteries. They recommend non-rechargable batteries (probably due to the discharge curve for AA being better for correlating voltage with battery level and warning users about low battery before it's too late).

Note that you will need a bunch of non-free terrible software for the initial setup and to change certain settings. Specifically you will need an iOS or Android device with bluetooth, internet and in case

@Juul
Juul / anamorphic_desqueeze.sh
Created July 16, 2021 22:55
Anamorphic de-squeeze with ffmpeg
#!/bin/bash
ffmpeg -i $1 -aspect 64:27 -c copy ${1}.fixed.mp4
@Juul
Juul / openwrt_dsa_vlan_config.md
Created April 20, 2021 14:03
Overview of VLAN config on OpenWRT using DSA

This a quick guide to configuring tagged VLAN using DSA on OpenWRT routers with a switch and only a single physical ethernet port.

This was tested on a Xiaomi Redmi AC2100 (MT7621 chipset) running OpenWRT Snapshot from April 19th 2021.

Here's how you make an interface lan3.2 which will send tagged packets on lan port 3. This assumes the lan port 3 interface is called lan3.

config interface 'pub'
        option ifname 'lan3.2'
@Juul
Juul / xiaomi_redmi_ac2100_router_notes.md
Created April 19, 2021 07:20
xiaomi redmi ac2100 router rnotes

Attach router's WAN port to internet (or at least a DHCP server).

Connect to router's wifi (it has no password per default) then go to http://192.168.31.1/ and click through the setup wizard.

When it asks for a password just give it something easy to remember.

Once the setup wizard is done, connect your computer to one of the routers WAN ports and again go to http://192.168.31.1/ and enter the password you set to log in.

I recommend flashing the version 2.0.23 firmware before going any further. I know the exploit works on some newer firmwares but I also know it doesn't work on some 1.x firmwares. Search the web for the filename firmware miwifi_rm2100_all_fb720_2.0.23.bin to find the correct firmware.