Point the Way Home: DDNS with Linode

Guest Blogger: Keith Murray

Earlier this year I switched my web hosting from my long-time account at DreamHost to a fancy new VPS at Linode. I really did enjoy my time with DreamHost, but what I wanted out of my hosting provider had changed somewhat. I was looking for full control of a machine in the cloud. Although DreamHost does offer a VPS option, the pricing options just didn’t compare with what Linode was offering.

I also took the opportunity to move my domain registrations over to Hover, but more on that another time.

With my Linode account managing the DNS for my domains I was able to point a a single subdomain back at the IP of my home network, effectively giving me a nice publicly accessible domain from within my network. This worked well until my ISP changed the IP address I had. Admittedly this doesn’t happen often, but it always seems to occur when I actually need to make use of this remote connection, and with no knowledge of my new public DHCP address it’s pretty useless.

Enter DDNS.

With some modifications to a script I found on GitHub I was able to quckly set up job to check my public IP address and update the DNS records at Linode using the Linode API. I hacked apart the original script and put together my own DDNS update script, suitable for automating.

By scheduling the script to run using a simple crontab entry I can rest assured that every night, while I’m asleep, my server will be connecting to Linode to point the way home.


Keith Murray is a software architect and developer who blogs about technology and science at kdmurray.net. He can also be found on twitter as kdmurray.

Related Posts

Basic Ninja moves for OSX command line users.

When working with the silver bezels of OSX, we sometimes forget that underneath this polished operating system (that seems to favor the non-power user more and more) sits a powerful command line. We found a nice instructional video that shows you some of the neat “Linux Style” command line ninja moves that can help you when you are using the CLI. So come on “command line kid” … Wax on … Wax off ! 

What are YOUR favorite OSX command line shortcuts  ? Tell us in the comments section.

Related Posts

Get the audio from a Youtube video with one command.

By now most (if not all of you) have dabbled a little bit with Linux. Although it might look geeky and complicated at first glance, once you dip your toes into the great lake of open source it becomes a very refreshing computing experience. How do I mean ? Well : I challenge you to the following : Take a Windows Machine OR a Mac and, within 2 minutes FIND and INSTALL a free application that allows you to download a Youtube video and extract the audio to MP3. If you started off your search in Google (or in the Mac App store for that matter) you are starting to realize it is not that easy. There is a ton of ‘supposed’ freeware out there that, after installing it gives you either an app that does not completely work (unless you pay for it) or is just too complicated.  Do you (as a true slider) have a Linux machine handy ? (perhaps a virtual machine or a server ) Then lets fire up the command line and give you a one line command to make that technology work for you.

Introducing “Youtube-dl”

Youtube-dl is a command line application that lets you download Youtube video’s and if you want to, extracts the audio from said video’s. The command is simple. On Ubuntu you can install it by hitting : 

sudo apt-get install youtube-dl

After the installation is complete you need to update the app to the latest version. Also .. a couple of  one liners.

sudo youtube-dl -U

You will get an error that you need to update via the GIT repositories once more. Easy peasy (copy and paste people)

sudo wget http://youtube-dl.org/downloads/2013.05.01/youtube-dl -O /usr/bin/youtube-dl
sudo chmod a+x /usr/bin/youtube-dl

Lets start Downloading.

Now surf to the Youtube video of your choice and copy the url to your clipboard.

Go back to the terminal and type : 

youtube-dl <paste your url here>

Presto ! You will have the youtube video all for you ! What if you want the audio ? 

youtube-dl --extract-audio <paste your url here>

Cross platform compatibility

Youtube-dl is also compatible with Macs and there is an .exe for our Windows friends. But because the command line is so easy I just leave a terminal open to my linux machine (on ANY machine i’m working on) and just copy and paste whatever cat video I would like to keep for prosperity.  And youtube-dl does also support tons of other video sites like Vimeo and more ! 

Links : the Youtube-DL page.  and their howto for Windows and OSX users.

Related Posts

The last item on your current todo list : Install todo.txt

Yes, because, quite frankly, that will be the end of your current todo application. Wether or not you are using a modern day todo list like Wunderlist on your smartphone or you are writing down your items on a running Cheeta (It takes a while but it’s a great workout  ) you might just switch to todo.txt after you read this post.

Why ? Because todo.txt is a slider friendly way of keeping track of things. They offer an an Android version (1,47 $) and an Ios version (1.99) that will give you a nice mobile application, but the kicker of this service is, they also offer a command line interface ! Straight from your favorite command line (if you are using Linux of course) you can manage and update your todo list from anywhere. The command line script can be downloaded for free. 

 

This “compatiblity” is because todo.txt stores your todo list in a textfile, a human readable textfile that can also be opened using just any text editor, AND you can actually read and understand what it says.

Todo.txt is pretty brilliant in its simplicity. I love adding another command line app to our list, but a little disappointed these guys don’t have a free app in the stores. (Like for example Wunderlist). Todo.txt also lacks a web interface (bit of a bummer there) but overall offers their users great value for money. You might want to try it out : Its explained in this video here 

Links : todo.txt

How do YOU keep track of your todo’s ? Tell us in the comments section.

Related Posts

Wordgrinder takes you back to the (productive) days of Wordperfect.

I mentioned a couple of interesting command line suggestions for a good Wordprocessor a while ago in a previous post. But thanks for the research I did for the “Return of the netbook” podcast, I came across Wordgrinder. Unlike most word processing applications from Redmont, Wordgrinder is not infested by a talking paper clip, and its menu bar has not been designed like a hidden Chinese puzzle that only Savants can solve.

Wordgrinder is also a different league from the  text editors like VIM or Emacs, and is not geared towards code manipulation like Nano. Wordgrinder reminds me of .. Wordperfect. Remember the little paper strip secretaries had taped to their keyboards in order to remind them what function key did what ? Wordgrinder is more like that. Hitting the escape key brings you into the menu bar where you can select all the functions you expect from a real Wordprocessor… from the early Nineties.

But in a world swamped with widgets, buttons and distractions, in a universe where every application at least has one dingdong to tweet whenever you even THOUGHT about farting in the elevator .. Wordgrinder is safe haven of simplicity and focus. Run it natively on any Linux system or access it via an SSH connection to your Linux system from your Mac or your Pc.  Sure it isn’t high tech, but it does the job pretty well. For all those times you need to knuckle down .. Wordgrinder is your friend.

Links : Wordgrinder. 

Install it from the command line (On Ubuntu)

sudo apt-get install wordgrinder

Related Posts

Save money and gain focus using the linux command line as a wordprocessor.

For the life of me I cannot remember the link (nor find back the episode) to a Hacker Public Radio podcast episode that inspired me to do this post. The speaker in this little podcast talked about the way we use word processors. He mentioned a study where they compared several groups of students that were working on a paper. One of the groups used the latest version of MS Word, the other one used Libreoffice and another group used Wordperfect (The black and white command line version). When they judged the actual papers afterwards, the QUALITY of the CONTENT was the highest with the students who used … Wordperfect. It turns out, the FEWER distractions we have regarding to layout like ribbons and talking paperclips, the more our brains focus on CONTENT. The talk is highly recommended and whoever finds the link and posts it in the comments section gets extra geek points !

So, why not make our OWN version of Wordperfect using the command line interface on Linux.

Fire up a terminal and start using your favorite text editor like NANO or VIM.

When using Nano just start out by typing

nano yourfilenamehere.txt

Start typing and hit CTRL-X to save. Pretty easy. There are of course a lot more keyboard shortcuts you can use. I have linked to some posts here and here that give you all the fancy features in Nano.

If you are somebody that likes to use VIM (I’m sorry, I don’t use VIM a lot) but I have been told that VIM users are considered the Jedi among command line interface text editor users. (Now THERE is a title) You can learn the ways of the VIM-force here and here 

Spell checking !

Ok, you’ve made your document but, like me, you do tend to make the occasional typo. My excuse is I’m not a native English speaker .. whats yours ?  You can solve the problem by installing ‘ispell’

sudo apt-get install ispell  

Next up just point ispell to your textfile

ispell yourfilename.txt

Diction.

Lets say your spelling is ok, but when you write stuff, you sound like master Yoda. You need diction control

sudo apt-get install diction

and point it at your file  with diction yourfilename.txt

These are just a couple of very basic tools to get things done, but when you really want a distraction free interface, this might just help. I’ve tried this on an old Pentium1 laptop with just a command line linux install … and its a horribly effective experience. There is NO internet to distract you, no tweets, no other apps. Just you and your textfile. Great for focus or for punishing your child and making it DO its homework WITH a computer but without any distractions. 

What is YOUR take on this ? What wordprocessor do YOU use and how to YOU make it work for you ? Tell us, in the Comments section.

Related Posts

The A to Z of Osx command line commands.

With the shiny fancy walled garden that OSX Mountain Lion is today, we sometimes forget what is under the hood. Apple’s minimalistic and well designed interface might be clutter free, but the downside of this “Designer kitchen of computing” is that there are not a lot of hints to what powers lurk beneath its glossy surface. Unlike cluttered Windows (and Linux) programs from days gone by, riddled with cascading menu’s and massive help files, you have to be “in the know’ to  access some of the features.  

So today we have the A to Z of OSX terminal commands for you. Have fun revealing the power of the Unix like heat that beats in your big cat and have fun with THIS A TO Z index of commmand line commands. You can get started with some “basics” , make your Mac talk with the “say” command ,  or read the bible from Apple on the command line.

As a real cross platform slider you of course don’t have to be physically at your machine. You can turn your mac into an SSH server and connect from any other system using the terminal on your Linux machine,  or from another mac. Or from your IOS device, your Android Smartphone or your Windows box.

Related Posts

Keep an eye on your SSH server with this short command.

Setting up and running your own little SSH server is not really hard. Just punch in sudo apt-get install openssh-server on your Ubuntu command line and you’ll have a server that allows you to run remote commands, send over files via SFTP or even forward graphical applications over X-Forwarding.

R2

But when you open up a window to the internet, it might be a good idea to keep an eye on any nosy people who might come knocking. A good tip is NOT to run your server on the default port (22) and poke it up to a random port over 1024 so it won’t  be obvious to any scriptkiddie you are running an SSH server. But just to be safe its nice to keep an eye out too. Every system access is logged in /var/log/auth.log but there is a ton of info in here. But with this one simple command you can not only sort out the messages that talk about your SSH server, you can also “follow along live”

sudo tail -F /var/log/auth.log | grep sshd

The output will generate a cool scrolling textfile with all the failed and approved login attempts, the usernames of who is loggin in and when they connect and disconnect.  The command is simple .. but the output might be just what you need. 

Related Posts

Kc305 : "Running your own home Linux Server".

In this episode we give you some ideas and possibilities when it comes to building your own home Linux server. While putting an old clunker back to good use or using a VM, we give you tips and tricks on using the command line, CLI applications, web based interfaces remote desktop sessions or even terminal servers. Let technology work for you and build your own home linux server with this podcast as your loyal companion.

Shownotes.

Related Posts