Category Archives: Uncategorized

Backdating entries…

I don’t keep this blog up much, but occasionally it’s entertaining to me go back and look at it. With that in mind I used internet magic to retrieve entries I made in previous iterations of this blog from the past decade and add them all here w/ backdates.

I also decided to go back to the WordPress “Twenty Thirteen” theme because I sort of really like it…

Pump Update #1

The Jutai pump failed after just 1 full day… it was a bit overcast so I assumed the lack of pumping was due to lack of sun, but later in the day during strong sun it was still dead. The bird bath I’m using was full of water so it wasn’t a burn out.

I’m now using the pump w/ the rose (2 days and still running); the Juntai pump is headed to that big Amazon warehouse in the sky…

Hello world!

I’ve had these things over the years and they’ve all ended up not used often or trashed. I suspect it’s generally because I don’t have a theme or plan for regular content which leads is to being a random list of thoughts or things I want to keep track of it.

For this iteration that’s the theme: Things I Want To Keep Track Of

July 19th 2023 Edit: Hey, I decided to go back and get trashed stuff and put up all up on display again.

Using SSH to connect a computer on your remote network

So let’s say you expose SSH of your Raspberry Pi to the internet and you’d like to be able to VNC or RDC to a Windows machine on the same network while you’re away.

What you need to do is use SSH to forward your computer’s local port to the port of the remote network computer

Here’s an example:
ssh -L 5900:10.0.1.50:5900 ethanms@ethanms.com

The command above will connect me via SSH to my machine exposed at ethanms.com and use it to forward any requests to my own localhost port 5900 to port 5900 at the remote network address 10.0.1.50.

Assuming that address has a VNC server running I can open VNC viewer on my local machine and try to connect to localhost:5900–it’ll connect me to that remote machine.

This is super useful and doesn’t require you to go through complicated VPN setup, expose a ton of ports to the internet, or use a service that tunnels out and exposes your computer (like Team Viewer or Log Me In)

Converting Mac OS X text/hex files to Windows

Mac OS X produces files with just an LF the end of each line.  Windows produces files with both CR and LF.

I ran into a problem building HEX files with MPLAB X IDE on my Mac, the hex files had just LF’s terminating each line but my downloading process required that I have CR and LF marking EoL.

The internet–and I don’t reference one site because I found this in many places–had the answer as usual.

Here is a short Perl incantation that can replace each LF with a CRLF:

perl -pi -e 's/\r\n|\n|\r/\r\n/g' YOURFILENAMEHERE

I use the above as part of a bash script that automatically converts and uploads my hex files to a server:

#!/bin/bash
fwVer=$(date +%y%m%d%H%M%S)
if [ -n "$1" ]
then
  fwVer=$1
fi
perl -pi -e 's/\r\n|\n|\r/\r\n/g' /my/local/path/myprojectfile.hex
scp /my/path/myfile.hex myuser@my.server.com:/my/remote/path/$fwVer.hex

If I supply an argument when calling the script it will use that name when uploading the file, otherwise it will name the file based on the current time using YYMMDDHHMMSS format which allows the latest files to sort up to the top of a list and gives you some clues about when you built one vs. the other.

A quick note, there is no line break in the scp command, but it may appear that way due to formatting on this page.