Linux Fu: Simple SSH File Sharing

If you have more than one Linux computer, you probably use ssh all the time. It is a great tool, but I’ve always found one thing about it strange. Despite having file transfer capabilities in the form of scp and sftp, there is no way to move a file back or forth between the local and remote hosts without starting a new program on the local machine or logging in from the remote machine back to the local machine.

That last bit is a real problem since you often access a server from behind a firewall or a NAT router with an ephemeral IP address, so it can’t reconnect to you anyway. It would be nice to hit the escape character, select a local or remote file, and teleport it across the  interface, all from inside a single ssh session.

I didn’t quite get to that goal, but I did get pretty close. I’ll show you a script that can automatically mount a remote directory on the local machine. You’ll need sshfs on the local machine, but no changes on the remote machine where you may not be able to install software. With a little more work, and if your client has an ssh server running, you can mount a local directory on the remote machine, too. You won’t need to worry about your IP address or port blocking. If you can log into the remote machine, you are good.

Combined, this got me me very close to my goal. I can be working in a shell on either side and have access to read or write files on the other side. I just have to set it up carefully. Continue reading “Linux Fu: Simple SSH File Sharing”

Weatherproof Pi Looks Up So You Don’t Have To

Skywatching is a fascinating hobby, but does have the rather large drawback of needing to be outside staring at the sky for extended periods of time. Then there’s the weather to contend with, even if you’ve got yourself a nice blanket and it isn’t miserably cold, there might be nothing to see if cloud cover or light pollution is blocking your view.

Highly scientific testing procedure.

To address these issues, [Jason Bowling] decided to put a Raspberry Pi in a weatherproof enclosure and use it as a low-cost sky monitoring device. His setup uses the No-IR camera coupled with a cheap wide-angle lens designed for use with smartphone camera. The whole setup is protected from the elements by a clear acrylic dome intended for a security camera, and a generous helping of gasket material. Some experiments convinced [Jason] to add a light pollution filter to the mix, which helped improve image contrast in his less than ideal viewing area.

The software side is fairly straightforward: 10 second exposures are taken all night long, which can then be stitched together with ffmpeg into a timelapse video. [Jason] was concerned that the constant writing of images to the Pi’s SD card would cause a premature failure, so he set it up to write to a server in the house over SSHFS. Adding a USB flash drive would have accomplished the same thing, but as he wanted to do the image processing on a more powerful machine anyway this saved the trouble of having to retrieve the storage device every morning.

This isn’t the first time [Jason] has used a Pi to peer up into the heavens, and while his previous attempts might not be up to par with commercial offerings, they definitely are very impressive considering the cost of the hardware.

Continue reading “Weatherproof Pi Looks Up So You Don’t Have To”