Categories
Uncategorized

How to setup a home VPN server

VPN is something used to be expensive and business only type of thing, but now some of the routers for your home like Netgear, are also come with VPN functions. 

Why do I need VPN server at home?

Really depends on your situation. For my case, I have my laptop setup at home for development, and I have IP camera setup home. I really don’t want to open up a port to access those services remotely. So VPN is a relatively safe way to access my home network remotely.

Hardware requirement

I have a 

Categories
Linux script Tool

LFTP/sftp automation script

I am currently writing a Linux shell script. The script requires to download some files from a sftp server and then move those files to a backup folder on the same server. Eventually the script will be scheduled as a cron job. Everything works fine for one file, but not multiple files. There is no recursive delete kind of commands can be used. One of the easy ways I found is using LFTP.

The theory is easy, use a lftp command to generate a file list from remote server, and then generate the move command for each file. You can refer back to the origin post from here. For whatever reason, my LFTP version doesn’t support the command mentioned in the post, I end up use another command to achive the same goal. It’s always a good idea to know different ways of doing the same thing and pick which way works for you. Here is the script I used :

recls -1 remote.dir1/ | “sed ‘s/\(.*\)/mv \”\1\” \”remote.dir2\/\”/'” > list && source list && !rm list