Home Network Project
RSS icon Email icon Home icon
  • sudoers

    Posted on August 31st, 2009 lance No comments

    Where’s my SUDO?

    Installing different flavors of Linux can be fun and exciting at times.  And it can have you scratching your head.

    Take for instance, my first Linux install was Ubuntu.  Of course, this is a nice intro to anyone new to the Linux game, especially with it’s nice graphical interface.  Now when I looked for help on the net, I was directed to use the SUDO command whenever I needed to issue a command requiring Super User abilities.  This was a nice feature and worked as expected.

    Now even though Ubuntu is a derivitive of Debian, it is not exactly the same.  It apparently came packaged with SUDO, whereas when I went to install Debian, it did not.  Shortly after my install, I attempted to install or configure certain things, and I was given the response that the SUDO command was not found.  I thought I had broken something.  But alas, all was not lost.

    Super User

    Super UserOf course, what SUDO does is issues the command that follows as if you were logged in as Super User.  Now, I had to install SUDO, but without SUDO.  Easy enough.  Just log in as Super User with the “su” command.  Of course, the password you setup for the super user is necessary.

    Once in, no SUDO or anything else is needed to use your godlike skills.  Issue the APTITUDE INSTALL SUDO (or apt-get if you prefer) to install SUDO.  Make sure to exit out of super user when you’re done.

    Now that you’ve got SUDO installed, you may still have trouble, this being due to the fact that you are not on the list of privileged users to issue Super User commands at will.  You must add yourself to the /etc/sudoers file.  Oh darn, you can’t do that without SUDO abilities.  Or can you.  Oh yeah, never should have exited out of Super User mode so quickly.  I guess I did tell you to, did I not?  That’s okay, back in, edit the file with your favorite editor and voila, exit out of Super User again.  We’re done now, I promise.

    While you’re in the sudoers file, find the line that reads # User privilege specification and copy/paste the line below that reads root    ALL=(ALL) ALL and then change root to your name.  You can add other users this way as well, however the more you add, the more problems you invite.  It’s best to reserve this privilege only to those you trust.

  • MTR – Network Diagnostic Tool

    Posted on July 11th, 2009 lance No comments

    Traceroute

    You may have used traceroute in a Micrsoft OS or in Linux.  It’s quite simple and can tell you a few things about the connection between you and any other device on the internet.   Just type in traceroute <domain name> and hit enter.  You should see something like the following.

    traceroute to microsoft.com (207.46.232.182), 30 hops max 40 byte packets
    1 192.168.64.64
    (192.168.64.64) 1.210 ms 1.237 ms 1.304 ms
    2 x-xxx-137-216.mtaonline.net (216.137.xxx.x) 37.635 ms 37.693 ms 38.798 ms
    3 6506-1-er-ge3-2.mtaonline.net (216.152.176.205) 40.463 ms 42.126 ms 43.595 ms
    4 7606-1-er-po1.mtaonline.net (216.152.176.157) 45.261 ms 46.985 ms 48.903 ms
    5 197-168-165-209.static.gci.net (209.165.168.197) 51.290 ms 52.718 ms 54.420 ms
    6 209-128-165-209.gci.net (209.165.128.209) 84.047 ms 60.093 ms 61.256 ms
    7 8-128-165-209.gci.net (209.165.128.8) 62.892 ms 64.553 ms 66.021 ms
    8 52-129-165-209.gci.net (209.165.129.52) 67.917 ms 69.604 ms 71.020 ms
    9 217-129-165-209.gci.net (209.165.129.217) 72.445 ms 73.898 ms 75.299 ms
    10 InetSeaSDCsw-1.gci.net (209.165.129.62) 77.711 ms 78.967 ms 80.682 ms
    11 ge-7-3-0-58.wst-64cb-1a.ntwk.msn.net (207.46.46.41) 82.308 ms 83.984 ms 87.674 ms
    12 ge-0-2-0-0.tuk-64cb-1b.ntwk.msn.net (207.46.47.70) 61.504 ms 60.918 ms 61.017 ms
    13 ten2-4.tuk-76c-1b.ntwk.msn.net (207.46.46.23) 63.226 ms 64.564 ms 66.245 ms


    The second column lists the name (or IP) of the next device interface, and then the next column it’s IP address.  This goes on until you hit the destination.  All the while you are given the time it has taken to send the ICMP message to each device and then the return message.  If you notice, the further away the device is, the longer it takes.  But not always, as the last two devices show ~66ms while #11 had ~82ms to ~87ms.

    If you were having problems on the internet and it seemed there were a bottleneck somewhere, this nice little tool can help you identify if one exists.  Perhaps if one of those above was returning ~70ms and then the next device gave you ~250ms.   That’s a noticeable difference, and it could indicate the the link between those two devices has maxed it’s bandwidth at that particular time.   Not that you could do anything about it.

    MTR

    So what if the problem were intermittent, or traceroute did not show any problems because perhaps the chokepoint is experiencing intermittent bursts of data?  Enter MTR, the big brother to tracerouteMTR (or My Trace Route) can show you a constant display of each link and how it’s holding up.  Take a look.

    If you have MTR installed (aptitude install mtr), run it as you would traceroute.  i.e. MTR YAHOO.COM

    My Traceroute

    Click to see full image

    The default display looks much like a regular traceroute display, aside from the data is constantly changing and there’s a few more columns of information.  The data changes due to the fact that it’s constantly getting data for you, no once, but constantly until you quit.

    After the hostname, you are given columns telling you how much packet loss you get.  How many packets were sent.  Then you get to see how the pings are doing.  You get what the last time it took for the response, the average time, the best it’s been to that particular host and the worst time.  You also get a standard deviation.   Not exactly sure on this one yet, but lower seems better.

    As you can see from the example above, once we went from device #4 to  #5, the pings doubled and then from # 5 to #6, the pings doubled again.   The first time it doubled, it’s not too bad because that’s an increase in 30ms whereas the second jump was a good 72+ ms.

    Not that I’m saying here’s a bottleneck, by no means.  However, if anywhere between me and nandomedia.com there would be one, that’s my first suspect.   This trace is pretty simple anyway.  If I were to see much larger numbers then I would be concerned.  Again, not that I can do anything about it, but at least I know it’s not my network, unless the problem was on my network, then I’ll point fingers.

    Click to see full image

    Click to see full image

    Hit the D key.  Here you can change the display.   You get a nice view of the packets as they are returned.  This first view does not offer much, so hit the D key again.   DO IT!!!  You’ll like it.  At least better than this view.

    Click to see full image

    Click to see full image

    Now this is much more informational.  On the bottom of the screen is a scale.  It shows you what each dot, number and letter up above mean.  The period is 7ms and as you can see from my PC to my router, that’s what it should be.  The next hop is to my ISP and there’s 3’s all along there and the other 2 routers at that location.  The 3 is less than 54ms, but since it’s not a 2, it’s greater than 29ms.  You see an ‘a’ and a ‘b’ up there too.  So the return just from my ISP had a ping return over 54ms and one over 120ms just in these 57 pings.

    The display is nice because it scrolls nicely to the left and you can see if there’s just a burp as in the ‘c’ at location #9 or if there’s a serious problem.  And if you need to resize your terminal window, MTR will adjust what it displays with ease.  Above it’s got room to show the last 57 pings, but if I widened it, it would quickly change accordingly.

    So, as traceroute is handy, it’s not constant, it gives a snapshot and things may be fine at that moment.  Ping is okay, but does not provide very much info.   MTR is the all around tool to replace both.

  • apt-get or aptitude

    Posted on May 27th, 2009 lance 1 comment

    Installing Software

    When you install software for windows, there is many ways to go about that.  You can have a CD-ROM with the program and install directly from that.  You can download a zip file, extract the files and install the extracted program.  You can download an installer that will then download the necessary files off the net.

    With Linux, there is also a variety of ways.  One of these is using apt-get or aptitude.  You may have seen on the internet instructions on installing some software within debian or ubuntu where someone gave the command apt-get install <program>.  The alternative is to replace apt-get with aptitude.  What’s the difference?

    From the users point of view, there is no difference.  However confirmed reliable sources have brought out the fact that aptitude will handle dependencies much better.

    To quote IRONWALKER from the linuxquestions.org forum:

    Aptitude is said to deal with dependencies better than apt-get. For example, say you install a package which automatically installs some library packages because it depends on them. When you remove this package with apt-get, it won’t remove the libraries this package installed, although they aren’t used anymore.

    When you install that package with aptitude and remove it with aptitude, aptitude ‘detects’ that those library packages aren’t used anymore and will therefore automatically remove them.

    To sum up, aptitude will clean things up when you remove a program.  It will also check to make sure no other program needs the files it wants to remove before doing so.

    The thing to keep in mind is that if you chose to use one over the other, be consistent.

    Graphical Interface

    Synaptic Package Manager

    Synaptic Package Manager

    For those who are running Gnome desktop interface (or KDE), you can use Synaptic.  This nice program will divide up the available programs into categories for you.  You can even search for whatever type of app you are interested in.

    If you prefer to hang out in the CLI, you can issue aptitude by itself on the command line and get this interface.

    aptitude

    aptitude package manager

    It’s fairly easy and similar to the Synaptic Package Manager.  You can search for applications you’re interested in, you can install packages and uninstall them.  Not only can you navigate using your arrow keys on your keyboard, it also responds to your mouse.  Click on the menu above, or an item to the left to open it up.

    This is one sweet app you should familiarize yourself if you like to move around the CLI, especially if you have a system setup without a GUI.

    Of course, if you know the name of an application, you can just command line it and not enter the package manager.  For instance, you can just enter sudo aptitude install <filename>.  If you are unsure if an app exists, or perhaps it’s name, use aptitude search <filename>.    AND, as if that’s not enough, if you know just part of the name, enter that in.

    The following command yields these results:  aptitude search blend

    p   blender                                                     – Very fast and versatile 3D modeller/renderer
    p   blender-ogrexml                                  – Blender Exporter for Ogre
    p   enblend                                                    – Tool for compositing images
    p   kwin-style-blended                             – a window decoration theme for KDE

    Surprise

    If you do bring up the aptitude package manager and find yourself in need of a little time killer, hit Ctrl-T and then P.

    This works on my Debian system, but on my Ubuntu box it drops me back to the command line with the following message: “Ouch!  Got SIGABRT, dying..”   –  Weird.  I’ll have to figure that out another day.