Skip to content

Instantly share code, notes, and snippets.

@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 December 6, 2023 13:00
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.

@Juul
Juul / gpib_linux_82350.md
Last active November 1, 2024 15:47
Guide for setting up GPIB support in Linux for the HP/Agilent 82350 A and B PCI cards

This is a guide for getting the HP/Agilent 82350 A or B GPIB cards working on Linux.

There are other guides made by other people for a couple of other GPIB adapters here:

Unfortunately the mainline Linux kernel does not have any GPIB support. Even more unfortunate is that neither Ubuntu nor Debian appear to have packages for the kernel modules nor do any third-party apt repos appear to exist that are remotely up to date.

@Juul
Juul / install_mfc-j480dw.md
Last active April 9, 2021 04:24
Install Brother MFC-J480DW on Ubuntu

Download the two .deb packages from Brother's website:

  • mfcj480dwlpr-1.0.0-0.i386.deb
  • mfcj480dwcupswrapper-1.0.0-0.i386.deb

Install them both at the same time: sudo apt install mfcj*.deb

Add a new printer using the GUI and enter the IPP URI manually like: ipp://<ip>:631/ipp

In the Printer Settings -> Printer Options change Media Size to Letter (unless you're using A4 of course).