Updating foscam firmware via API

Foscam just released a new round of firmware updates. The suggested process to deploy firmware updates involves using the web interface. I’m hoping newer models are less of a hassle, but older models require the user to install an .exe and use internet explorer 10 or hope that your browser is old enough to allow you to enable NPAPI.

That pretty much rules out Linux, Mac, and up-to-date browsers on Windows.

But fear not, the devices have an API (for some reason they deleted any references/links to it from their forum, but I found a version here).

The API comes with its own share of odd quirks, but to update the firmware without a browser you can use the following CURL command

curl --output - --connect-timeout 15 --max-time 180 -H 'Expect:' --form 'image=@FOSIPC_A_patch_ver_whatever.bin' --request POST 'http://192.168.0.123/cgi-bin/CGIProxy.fcgi?cmd=fwUpgrade&usr=admin&pwd=password' 

Replace the username and password with an account with admin privileges, the IP with the IP of your device, and the .bin file with the latest patch for your device.

Note: If your admin username or password contain any non alphanumeric characters, you need to Urlencode them. There are multiple ways to do this (perl, python, jq), but I’ll assume you have curl installed and can do
echo -n '$uper$secure' | curl -Gso /dev/null -w %{url_effective} --data-urlencode @- "" | cut -c 3-

Blog cleanup

Today I cleaned the blog up a little. I removed the (hard to read) main menu at the top and moved the relevant topics over to the sidebar into the “More information” box. Makes information easier to find and the top of the page is a bit slimmer.

I also added a new page with an overview of a few of the more interesting public and private (web) services I’m running. This makes it easier for me to update the page when I add or remove a service, and easier for you all to see what I’m running, how to reach it, and what kind of uptime can be expected.

And last but not least I switched out the font to something that is slightly better readable with this layout and color scheme and tweaked the CSS a little bit.

Organizing your Steam library

I’ve had a steam account since 2003, so unsurprisingly I’ve accumulated a bunch of games over time thanks to summer sales, winter sales, humble bundles, …
As a way to give users a means to sort and categorize games, Steam introduced categories a while back. You can add arbitrary categories, and have a game in multiple categories, and categories are synced to your account so they appear on multiple devices. The downside is that you have to set categories for each game manually.

Here is where a nifty tools come in hand: Depressurizer (download)

It provides a user friendly interface for organizing your categories, making it easy to mass categories games. But it’s most useful feature is the ability to auto-categorize games. It can do so via various criteria like genres, Steam flags (e.g. “Single-Player” or “Steam Cloud”), Steam tags, Developer & Publisher info, How Long to Beat times, release year, and/or Steam review user scores.

Once automatically categorized it is easy to find games on your library that are Local co-op, or maybe you are feeling like playing a Dungeon Crawler game today, or just want to browse games you have with an Overwhelmingly Positive rating.

I use a unique prefix for the different auto-categories so it is easy to tell them apart in steam. It also doesn’t mess with existing categories, so it’s easy to manage both categories from depressurizer and your own manual ones.

And this is an example of how the end result looks like
in Steam

 

 

 

 

 

 

 

 

 

A script to diff files/directories on two different servers

Ok,  short one today. This is a straightforward script that simplifies comparing directories on different servers. There is no magic in it, it just rsyncs the directories to a local temp directory and runs diff against them (then deletes the directory afterwards). Mainly intended for config files, I wouldn’t recommend trying to diff gigabytes of binaries with it.