Home Network Project
RSS icon Email icon Home icon
  • Vanity Plate

    Posted on April 22nd, 2009 lance No comments

    Take a Break

    Okay, I’m going to take a break at this moment from the regularly non-scheduled blogging of Networking and Linux to share something still Linux related.  My new vanity plate.

    I’ve always toyed with the idea of getting a vanity plate, but I did not want something too ordinary or obvious.  I wanted something unique, yet still relevant to something a portion of society could relate to or understand.  I did have a few ideas, but they were taken, such as 127001, which would be the IP address 127.0.0.1 which is the localhost or loopback IP address translating basically to “this device”.

    Well I recieved my plates in the mail yesterday.

    My Vanity Plate

    My Vanity Plate

    SUDO MV.  For those new to Linux, SUDO is the command given to allow superuser (root) privileges to do whatever it is that regular users do not have access to.  It could be configuring system files, to modifying another users files.  It’s the SUPER USER.  The MV is “move”.  So as my car traverses the data bus known as the highway (not informational nor super) it is being moved by the Super User.  Oh yeah!!

    Yes, it’s the little things in life that add up to something big.

    To illustrate the point of SUDO a little more I’ve attached a comic from xkcd that was some of the inspiration for my choice of plates.

    xkcd webcomic sandwich

    And that is how things take place in Linux.  There are times I try to run a command or edit a file and I’m denied.  It is then I need to use SUDO.

    Tip: If you type a long command and are denied due to needing superuser ability, type “sudo !!“.  The double exclamation points insert the last command.  Try it, you’ll like it.

  • Sendmail

    Posted on April 5th, 2009 lance No comments

    Todays lesson is about Mail.

    Sendmail is a standard tool for your e-mail needs.   There’s alot more to it than I am aware of at this point.  Right now, I just need to make sure I can e-mail OUT to the rest of the internet/world.

    To understand a little bit about e-mail and how it all works, you can check this link that briefly explains the purpose and operation of MDAs (Mail Delivery Agents), MTAs (Mail Transfer Agents) and MUAs (Mail User Agents).  This information should come in handy in setting up your own agent.

    Sendmail is an MTA as it can transfer e-mail for you, sending and recieving.  I however just have the need to send mail.  I had problems for a while, then I found a nice simple program called sendEmail.  It was simple enough to run without having to configure anything.   But I could not get sendmail to work for some reason.  My sendEmail program worked, but not sendmail.  Why?

    To figure this out, I had to figure out how the MTA of my local ISP was working.  Talking with my coworkers, I learned that one can telnet directly into an SMTP server and issue commands from there and send out an e-mail directly.  I gave it a try, and everything worked until I got to the point of telling the server who I wanted to e-mail.  It was then I got the response: 550 Recipient Rejected: Relay not allowed.  What was I doing wrong?

    Now I was successful in sending e-mails with sendEmail, so I needed to see what was different.

    WireShark

    It was then that I downloaded WireShark, which I was eventually going to want anyway.  I’ll have to blog about that program another day as well.  But for now, I’ll just say that I was able to capture all data going in and out of my eth1 interface and see what was transpiring.  It was there that I saw a command I was not aware of, AUTH LOGIN followed by encrypted data.  AHA!!  That was the answer.

    It wasn’t so much that I was doing something wrong, it was that my ISPs server was setup for authentication, of which it was not getting  from me.  Another search online yielded this fine set of instructions.  You’ll need to scroll halfway down the page for the heading Using sendmail as a client with AUTH.

    After this setup I was successful in e-mailing myself.

    If you are not interested in telnetting into your SMTP server or using WireShark, you can see what’s going on by using the -v option while using the mail command. Below is a successful example.

    mail -v -sTesting user@yahoo.com Command from terminal

    (blue text is from my box, red from the server)

    user@isp.com… Connecting to [127.0.0.1] via relay…
    220 ubuntu ESMTP Sendmail 8.14.3/8.14.3/Debian-4; Fri, 3 Apr 2009 18:24:08 -0800; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]

    >>> EHLO ubuntu
    250-ubuntu Hello localhost [127.0.0.1], pleased to meet you
    250-ENHANCEDSTATUSCODES
    250-PIPELINING
    250-EXPN
    250-VERB
    250-8BITMIME
    250-SIZE
    250-DSN
    250-ETRN
    250-AUTH DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
    250-DELIVERBY
    250 HELP

    >>> VERB
    250 2.0.0 Verbose mode
    >>> MAIL From:<lance@ubuntu> SIZE=69 AUTH=lance@ubuntu
    250 2.1.0 <lance@ubuntu>… Sender ok
    >>> RCPT To:<user@yahoo.com>
    >>> DATA
    250 2.1.5 <user@yahoo.com>… Recipient ok
    354 Enter mail, end with “.” on a line by itself

    >>> .
    050 <user@isp.com>… Connecting to smtp.local.net via relay…
    050 220 smtp.local.net ESMTP EON-AUTHRELAY2
    050 >>> EHLO ubuntu
    050 250-smtp.local.net
    050 250-PIPELINING
    050 250-SIZE 50000000
    050 250-AUTH PLAIN LOGIN
    050 250-AUTH=LOGIN
    050 250 8BITMIME
    050 >>> AUTH LOGIN
    050 334 <encrypted – text>
    050 >>>
    <encrypted – text>
    050 334
    <encrypted – text>
    050 >>> <encrypted – text>
    050 235 Authentication successful
    050 >>> MAIL From:<lance@ubuntu> SIZE=333 AUTH=<>
    050 250 Sender okay
    050 >>> RCPT To:<user@yahoo.com>
    050 >>> DATA
    050 250 Recipient okay
    050 354 Ready
    050 >>> .
    050 250 Thanks, queued as dm52.49d40e27.c9ac3@dm52
    050 <user@yahoo.com>… Sent (Thanks, queued as dm52.49d40e27.c9ac3@dm52)
    250 2.0.0 n342O8aV020851 Message accepted for delivery
    user@yahoo.com… Sent (n342O8aV020851 Message accepted for delivery)
    Closing connection to [127.0.0.1]

    >>> QUIT
    221 2.0.0 ubuntu closing connection

  • Mt. Redoubt explodes

    Posted on March 30th, 2009 lance No comments

    I live 40 miles north of Anchorage.  Lately Mt. Redoubt has been in a state of emotional turmoil.  She’s been rumbling and acting all angry and scary and such since January.  Every day at work I check into the Alaska Volcano Observatory website to check the status of this menace to society (or our little corner of it).

    I am able to see the latest seismic activity and a 24 hour webicorder which replaces the old drums.  Due to the fact that we’re a communications company for a majority of the state, but mostly for the south central region where Redoubt poses the greatest threat, we keep an eye on her status so we can dispatch appropriate personnel to deal with whatever equipment needs to be dealt with so our customers don’t lose their service.  Especially when the ash flies, that stuff will get into everywhere for weeks or months afterward.

    Well she blew on Sunday, March 22nd @ 10:38pm.  On my shift as well.  The wind blew south and northwest, keeping most of the ash away from most of civilization, with the exception of a couple small towns.  Since then, she’s puffing ash clouds maybe a couple times a day.

    After a few days of watching this, I decided to try out some scripting and my first cron job.

    The Task

    redoubt-webicorderSeeing the RSAM activity on a regular basis, gave me an idea.  Seeing that it was updated regularly, I thought it would be nice to capture that picture at a regular interval and save the filenames in a sequential name basis.  These I could then import into Adobe After Effects to make an animation of the seismic activity.  It was successful, except the video did not turn out as good as I had hoped.  The data is updated every 5 minutes and each line on the graphic is 30 minutes of data, so each updated had quite a bit of data and the video looked somewhat jumpy.

    The Script

    #!/bin/bash/

    y=`date +%Y%m%d%H%M`

    wget http://volcanoes.usgs.gov/avo/webicorders/NCT24hr_heli.png

    mv NCT24hr_heli.png /home/user/redoubt/$y.png

    It took me a little while (being one of my first bash scripts) to figure out why I could not get the variable y to be assigned the format of YYYYMMDDhhmm  (year, month, day, hour, minute).  Then after some scouring the ‘net, I found that I was using regular single quotes, not the other single quotes that never get used.  You know, the one with the tilde (~).  Once I found that and used it, SUCCESS!!

    So, from my script, we’ve got a variable assigned to the current date and time (to the minute) and then the next line downloads the graphic to the current directory.  What directory?  It doesn’t really matter, because we’re just going to move it to it’s own private location where it will be comforted by all it’s other friends.  That’s where the last line comes in.  We move it from the current directory to the new directory and give it a new name as well, one with the variable we created.   So each file will be in succession and named according to whatever date & time it was when it was retrieved.

    Enter the Cron Job

    Next, I had to have this script run automatically, because I did not feel like staying up all night running this every 5 minutes.  This is where the cron job comes into the scene.  I had to read some documentation on crontab to get this working.  Actually it was not too hard to figure out at all.  I just had to create a text file that tells when to run, and what command to run.  Then I get the cron job to read this file and all is well.  :-D Right?  Right!

    So, my text file reads as follows:

    00,05,10,15,20,25,30,35,40,45,50,55 * * * * bash /home/lance/redoubt.scr

    Wow, not so bad, right?  Okay, the easy part is on the right.  Basically it’s going to run the command there.  I want BASH to execute my REDOUBT.SCR script.  But what are all the numbers to the left? This diagram below helped alot.

    *    *    *    *      *       command to be executed
    -     –     -     -      -
    |     |     |     |     |
    |     |     |     |     +—– day of week (0 – 6) (Sunday=0)
    |     |     |     +——- month (1 – 12)
    |     |     +——— day of month (1 – 31)
    |     +———– hour (0 – 23)
    +————- min (0 – 59)

    Starting from the left is the minute to run, the hour, day of the month, month, day of week.  They are separated by spaces.  Now if you see my cron job has commas separating the numbers, that’s due to the fact that I want it to run multiple times during the hour.  If I could not set multiples, then I could only chose one time during the hour to run my cron job.

    This is handy if you want a job to run on the 1st and 16th of each month, or maybe 3 days of the week.  The possibilities are numerous.  I wont say endless, because I know someone will prove me wrong on that one.  :-)

    So to run this cron job, one needs to use crontab.

    You can see what crons are currently running with crontab -l.  You can remove crons with crontab -r.  To set ours, we just used crontab cron.txt.   After that I used the -l option to verify it was running.  After a quick directory listing of the redoubt directory, it verified that my script was working.

    Soon I had a plethora of png files and was able to create a short video. No, I’m not too proud of the video, but I am of successfully creating the script and cron job.

    Next Try

    Okay, so that worked.  Next job was to extract the RSAM images, because they scroll from rightRedoubt RSAM image to left and are updated every 10 minutes and move 1 pixel for each update.  This should provide a smoother video.

    So now I had to change my redoubt.scr file to extract a different image, so I changed:

    wget http://volcanoes.usgs.gov/avo/webicorders/NCT24hr_heli.png
    TO
    wget http://volcanoes.usgs.gov/avo/rsam/REF_EHZ_AV_5avg.png

    And the mv command had to reference the new saved image as well:  mv REF_EHZ_AV_5avg.png /home/lance/redoubt/$y.png

    Then I had to change my cron.txt file to run every 10 minutes:  00,10,20,30,40,50 * * * * bash /home/lance/redoubt.scr

    After a couple of days of capturing, I was able to put it together into a much smoother video.  Each peak on the graph represents an eruption.  The first occurring at 10:38pm local time on the 22nd.

    And so there it goes for my first set of scriptings and cron jobs.  More to come as I have need, or attempt to create more advanced ones.

    techno

  • Technopotomus is born

    Posted on March 17th, 2009 lance No comments

    Why Technopotomus?

    One day I spent countless hours trying to find the right words to describe my domain name.  It was a hard battle, as every time I found a word or combination of words, someone had already owned the domain name.

    I was using a thesaurus to find even lesser used words.  I was scouring the web for ancient artifacts or historical places that could have some relevance to what I wanted my site to be about.   Places like the Walls of Babylon.  As strong as those were for some time, they were breached overnight, therefore I did not want to have that associated with Network Security.

    So as I was trying to work the word Tech/Techno/Compu into the name, even trying to marry one of them with an animal, I was finding that many others had the same idea over the past years and have secured them.

    Although, many were taken, some were not in use.  Some of these had no content, in fact were not really in existence on the web, but they were owned.  Some for a later purpose, but some for profit.  One of them was for sale for $7500.   It wasn’t even all that great of a domain name.  But I suppose if someone chose their business name first and then just HAD to have that name, they can haggle for it.

    I did find another that was setup in 2002 and had not been updated since then.  It actually just had links on it another domain name that had information regarding the wedding and reception of a couple.

    So here we are.  I did get to use one of my preferred suffixes and an animal (or part of one).  Since Technopotomus rolls off the tongue as easily as Hippopotamus does I figured it was a decent choice.

    You may notice it is misspelled, however the correctly spelled domain is . . . yes you guessed it.  Taken!


    Now regarding my  mascot. Technopotomus Mascot If any of you are familiar with Linux, you’ll notice  resemblance to the mascot of that OS, Tux.  It is no coincidence.  Since I was going to be discussing a lot of Linux material here, I figured I’d give my technopotomus a familiar feel.