Back to the Basics with Debian

Sometimes, you just have so many problems with the distribution you’re running that you have to wipe it out with a clean slate. I did that this past week and am now using Debian.

With using Debian there comes a feeling of being back to the very basic of Linux distros…much in the same way when you use Arch…it just feels plain, unencumbered, and basic and there is a feeling you get when build something from nothing…you start with a kernel and just enough CLI tools and create your house…then live in it.

It feels good to be stable. It feels good to not have to worry about programs crashing, the net disconnecting, or not being able to install programs.

People like to ride the unstable or testing route with most things out there…as I move forward in my Linux journey, I find myself looking to be less and less cutting edge and more and more stable. Plus, if there is a program out there that needs updating…backports are always a good way to get them.

I’m enjoying my new digs and will look to getting back into the swing of posting enjoyable articles and how-to’s in the upcoming weeks.

Using ‘Alias’ in Linux

There comes a time in every Linux users’ life when you will open the Terminal more often than not because you have realized that it is faster, more efficient and more powerful than GUI (Graphical User Interface).  You’ll have started to learn more and more commands and now feel more comfortable with command prompt.  The command prompt is all about commands – short commands as well as long commands.  If you are like me then you may not like to type the long commands (or even small commands) 🙂

You may be thinking about some way to avoid typing commands over and over. Enter the ‘alias’.

The ‘alias’ tool is a way to make the complicated things simple (and simple things simpler). You can use ‘alias’ instead of long (or even short) commands.  Now let’s see how the ‘alias’ works.

‘alias’ can make difficult and lengthy commands easy. The general format of ‘alias’ is:

alias Any_Word=”Command”

It means you linked an existing command to a (New) Word. This ‘Any_Word’ may contain anything – any alpha-numeric symbol, ‘Any_Word’ as well as ‘Command’ are interchangeable and can be used for the same purpose.

Simple Commands Made Simpler

As an example, ‘ls -l’  is used for listing directory contents in ‘long listing format’. This ‘ls -l’ can be replaced with a simpler alias. You can set the ‘alias’ for ‘ls –l’ as follows:

alias ll=”ls –l”

Now you just have to type ‘ll’ (without quotes) to get ‘long listing format’.

Or if you frequently misspell ‘ls’ as ‘sl’ and don’t want to install ‘sl’ package, then, you can use the following alias:

alias sl=”ls”

Now, whenever you type ‘sl’ in terminal, it will give you same results as ‘ls’.

Now consider even simpler example. To close a Terminal (or logout), you have to type ‘exit’ in Terminal. This ‘exit’ command can be made even simpler by using the following ‘alias’:

alias x="exit"

Now, you only have to type ‘x’ in Terminal to ‘exit’

Other examples of ‘alias’ are:

alias cp="cp -iv"
#make copy operation interactive and verbose
alias rm="rm -iv"
#make remove operation interactive and verbose
alias mv="mv -iv"
#make move operation interactive and verbose

Make Package Management A Bit Simpler

If you use Debian (or its derivatives) then you will be familiar with APT.  It is an excellent package manager.

In Ubuntu, to install software using APT, you have to use the following command:

sudo apt-get install <sofware_name>

It is a long command and consumes a lot of your time and energy 🙂

You can shorten this command by using ‘alias’.  Issue the following command in Terminal:

alias Install=”sudo apt-get install”

You can obviously use your own word instead of ‘Install’.

Now, you just have to type:

Install <software_name>

to install the (same) software. Simple, isn’t it?

You can simplify other aspects of APT. For example, you can use the following ‘alias’:

alias Remove=”sudo apt-get remove”

to uninstall a software.

Some other examples of attaching APT with ‘alias’ are:

alias Update=”sudo apt-get update”
alias Upgrade=”sudo apt-get upgrade”
alias Search=”apt-cache search”
alias Autoremove=”sudo apt-get autoremove”
alias Autoclean=”sudo apt-get autoclean”
alias Purge=”sudo apt-get remove –purge”

and so on…

A Very Interesting ‘alias’ For A Difficult Keyboard Button

On some keyboards, the dot (.) button is at very difficult position and if you have to use it more than once, it becomes even more difficult.  That’s why ‘cd ..’ is the command which I mistype the most.  This complication can be easily removed by using following ‘alias’ (you can use any other word instead of a dot):

alias .=”cd ..”
alias ..=”cd ../..”
alias ...=”cd ../../..”
alias ....=”cd ../../../..”

Using Internet From Terminal

If you regularly use lynx to browse the internet in terminal then you have to type long urls with lynx to visit the web pages.  You can simplify these long urls by using ‘alias’:

alias Google=”lynx http://www.google.com/”
alias Yahoo=”lynx http://www.yahoo.com/”
alias yalb =”lynx http://linux-blog.org/”

and so on…

Now just type Google, Yahoo or yalb to visit the respective web sites.

Simple ‘alias’ For More Complicated Commands

Long commands are not only difficult to remember but also take more time to type; when you have to use them on daily basis, you become frustrated when typing them again and again and again… So, ‘alias’ are more suitable for long and complicated commands.

Let’s consider an example.

To find the top 10 largest files in your system, you can set the following ‘alias’:

alias top10files=”find . -type f -exec ls -sh {} \; | sort -n -r | head -10”

You can even mix different commands with ‘alias’.  For instance, if you regularly use ‘tail’ and direct its output to file to later view that file, you can set a very simple ‘alias’ to do this cumbersome operation in 1 word:

alias Tail=”tail /var/log/messages > hello.txt;cat hello.txt”

Now just enter ‘Tail’ and viola! All is done at once.

You can use any file with tail and direct its output and you can even use ‘nano’ or ‘vi’ to view/edit its output.

Here’s another example… ‘alias’ to connect to a remote server:

alias any_name=”ssh <remote_server_address> -l <username> -p <port>”

You can even create ‘alias’ for your bash scripts, like:

alias clc=”sh /home/user/myscripts/calc.sh”

Now that you have set a few different ‘alias’  you might want to check that which ‘alias’ are set on your system.  To do that, just issue the following command:

alias

and it will list all the set ‘alias’ you have.

To remove an ‘alias’, just issue the ‘unalias’ command, like:

unalias Google

and now typing Google in terminal will do nothing (as it was set with lynx).

To remove all the ‘alias’, issue the following command and all the ‘alias’ are gone:

unalias –a

We have discussed the way of setting the ‘alias’ for different kinds of commands.  But setting ‘alias’ in this way be temporary.  When you reboot you PC, all the ‘alias’ which you have set will be gone.  This does not mean that you have to set all the ‘alias’ every time you boot your PC.  If you have set an ‘alias’ and you liked it so much that you want it to permanently reside in you PC, just add this alias in ‘.bashrc’ file in you home directory. For example, if you want ‘alias’:

Install <software_name>

to permanently reside in your PC then user your favorite text editor and add the following line in your ‘~/.bashrc’ file:

alias Install=”sudo apt-get install”

Now this ‘alias’ will not vanish into thin air when you reboot your PC. Only those ‘alias’  which are listed in ‘~/.bashrc’ file will be permanent.

This guide is just a preview about ‘alias’.  It is just about basic ways of using ‘alias’ to make your life simpler.  ‘GNU alias’ is a tool which can simplify your life immensely.  But unfortunately this tool is not given the attention it deserves.  In short, it is such a powerful tool that if you give it proper time, it can make you forget typing 🙂

Interesting Statistics

Very interesting statistics that I’ve noticed since moving the site to a Linode VPS.

If you take a look at the graphic below, the spike in the middle will probably stick out quite a bit.  Oddly enough, the spike I noticed in CPU percentage used (which is regulated for VPS at Linode) also spiked up disk usage…mainly because I began to swap when cpu/ram use skyrocketed.  All of this happened with Ubuntu 10.04 installed.  CentOS was the first distro I tried but I quickly switched to Ubuntu when I spotted a really nice how-to in the Linode document library.  Oh, and please excuse my horrible gimp skills on the image below…it was a quick and dirty editing of the image:

cpu usage

After switching to Ubuntu, I began receiving alarms for my account due to the high usage of CPU and disk.  I attempted to tweak settings and configuration files for about a week and realized it just wasn’t going to work for me.  I switched to Debian Lenny and the move was a positive as is reflected in these pictures.

disk usage

I was hoping Ubuntu 10.04 would fit for me since it is a long term support (LTS) release.  CentOS is my normal server distribution of choice and I really wanted to branch out and go with something different.  I used a Linode Stackscript for WordPress for CentOS but elected for vanilla installs of Ubuntu and Debian aftwards (I didn’t like NOT knowing what was installed when I first logged in…call me a control freak).

I just found it interesting that Ubuntu 10.04 did so horribly in this instance.  After investigating, I found a couple of likely suspects:

  1. Default Apache install in Ubuntu leaves a lot to be desired..even after tweaking both it and PHP for days I couldn’t get them to lay off the resources.  Even switching to mpm_worker and FastCGI did little to settle things down.
  2. Ubuntu swappiness is bad…it is set at 60 (I use 10 normally) and it swapped every chance it could get…it’s set by default to swap more than it should.
  3. mod_php on Ubuntu is hungry for all your cpu and ram and disk; be warned!

Debian, as the parent distribution of Ubuntu, would most likely suffer from the same problems…except it doesn’t.  Things are working great with it and I’d recommend it for any of your server needs!  Has anyone else seen this oddity with Ubuntu 10.04?  If so, please drop me a comment below.

A Blip on My Posts

Hello everyone!

You may have seen a blip swing by in posting on the site with the default WordPress posting “Hello World” displaying as a new post.  This was due to my recent migration from Site5 shared hosting to a Linode VPS.  During the switchover, the database had not been uploaded yet as I was tweaking the webserver…feedburner detected a change in the RSS when DNS switched and BOOM!  The WordPress default post popped up saying hello.  I thought I had everything planned and timed perfectly but it seems I was off because of how fast DNS switched.

I apologize if this littered your inbox or your RSS reader.  I can promise some GREAT posts coming up.  I’ve been working on a file permissions and user groups posting to help new users out.  I’ve also inherited an older laptop with a PIII that I’ll be installing Salix on soon…I’ve decided to go with LXDE version of Salix 13.  Should be quite fun to see how that performs and report about it.  I’m also investigating Linux command line downloaders that can grab files from the web for you.  So lots of stuff on the horizon.  Once again, apologies for anything odd that may have popped up.

If you’d like to know more about the migration or have Site5 shared or Linode VPS questions, please drop me a line in the comments section.

Boxee is Changing the World

Television and Movies shape reality.

Just look at this medium over the past few decades and you’ll always find a TV series or movie that is a glass reflection of what is happening in the real world.  Movies and TV have the power to elicit strong emotional responses (i.e. The Notebook_or_insert_another_chick_flick_here) , invoke the ire of opposing groups (i.e. Expelled: No Intelligence Allowed), and even inspire people to unite under a common goal.  Anything that powerful and influencing with the reach that moves and TV have is a force to be reckoned with.

Stagnant Development and Stagnant Thinking

When development on something stagnates and no further advancement happens, often times that technology is abandoned.  An example of this is how voice-over-IP is changing how we do phones.  With Skype, Vonage, Google Voice, asterisk, and other amazing services the consumer is innovating while phone companies flounder.  Soon in the future we will see phone companies change to become absorbed by ISPs.  The same is true of Television companies.  With the onslaught of new media on the web and the ability to stream video from point A to point B, conventional media producers are being forced to become innovative to stay relevant.  The problem is that they don’t want to innovate.  They’d rather sit back and let the old way they operate things be the ONLY way they operate things.  A prime example is NBC’s fall from grace; from first to worst with no sign of improvement.  Time and time again they prove that they don’t “get it” at all…even up to NBC CEO Jeff Zucker saying that Boxee is stealing content from Hulu when they play videos…using this logic:  Opera, Safari, Firefox, and any web browser is “stealing” content by visiting Hulu.com and playing videos…because Boxee uses Mozilla Firefox to play Hulu’s content.

When big television finally gets this…they’ll get on board and they’ll be seen less negatively and more positively.  The first Television company to  fully partner with Boxee to offer full episodes will win.  What does winning mean?  It means that the PR exposure will be such a huge shot in the arm that the company will benefit across the board.  It also means that they get rich metrics on what people are watching, how often they watch, and when they are watching…all without even needing a Nielson ratings.  The first company to do this, in my opinion, will be the company all other broadcast corporations will chase.

How Boxee Harnesses the Power of Movies and TV

Boxee tames that reality shaping force for you.  Boxee changes the way you are entertained.  By changing how something is used or consumed, you change all those the thing reaches.  Instead of TV being brought into your home…YOU are bringing TV into your home on your terms.  Studios need to know that to gain control over something you sometimes have to give up control.

Boxee crawls the web for you and brings all television it can find (think CBS, ABC, NBC, Hulu, Netflix, clicker.com, tv.com) into a single interface.  You play your show in Boxee and can even rate it and/or share it.  People can subscribe to your boxee feed and know what you rated a movie or television show and perhaps watch it themselves.  However, the real power of boxee is the single interface.  This gives people the ability to launch a single program that can find TV for them.  The entry barrier to watching TV online is thus lowered.  That means that Boxee is a POWERFUL tool for television and movies…one not being utilized by those markets.

Boxee is taking a cross platform approach to things as well…it’s freely available for Linux, Windows, and Mac platforms.  This allows Boxee to be something EVERYONE can experience.

Boxee IS changing the entire world, one television at a time.  If broadcasting corporations don’t recognize this and work with Boxee…I’m afraid they may be left out in the cold during this change.  What do you think?  Does Boxee have the power to change the world?

If you’d like to know more about getting started using Boxee, please visit

http://www.howcast.com/videos/310743-How-To-Get-Started-With-Boxee

Do Package Managers Spoil Us?

I thought of this interesting question the other day while messing around with Slackware 9.0 which was one of the last versions of Slackware to come on a single disk. The goal was to try to take a Slackware 9.0 install to the most recent stable and it was almost accomplished. Glibc was the largest hassle…and I made it to Slackware 11.0 before something caused things to not boot at all. All things considered, I spent 3 days on trying to get Slackware 9 to current.

Slackware for those of you that don’t know, has no dependency resolving package manager. Previously, a good attempt was made with swaret and that was my first jump into package managers with dependency resolution all together when it came out…but Swaret is no longer being maintained and doesn’t really work well anymore.

Since Slackware has no real dep resolving package manager…it’s one of the last ‘true’ Unix like Linux versions out there. Back in the early to mid nineties…things were exactly like this. If you wanted to update your Linux version…you stepped through it manually and tried to get things to work. What was great about Slackware was making your own Slack packages with source…no dependency resolution but in the process of making the package you’d have all the dependencies eventually installed. In this entire process, you became VERY familiar with your system…how it booted, what run level things occurred at, how cron jobs worked, etc. You were baptized by fire so to speak…you were to sink or swim.

As I said, this got me thinking…do we rely on dependency resolving package managers TOO much? They’re cliché now of course…run of the mill. Back in the 1990’s though rpm was the only true package management system around…and rpm was never designed for internet consumption. The guys who wrote rpm had in mind CD and floppy upgrades. Fast forward to now and we have zypper, pacman, urpmi, deb, and conary…all built with online repositories in mind. Do these managers take the heavy lifting away for new users? Do they spoil them?

Do systems break less with easier resolutions due to package managers? Does it mean that the new user of today won’t be as experienced as the old user of yesterday?

I think it might.

Users in the past had to chip away and reassemble with less documentation and no package manager. This meant that the user of yesterday ripped apart systems and packages to discover how they worked and which cogs fit where.

The user of today follows step by step instructions and the software is given a sane set of defaults by most package developers when said package is installed.

Does this make for lazy users?

I don’t think users are lazy per se…but as previously stated, spoiled ones. And it’s no fault of their own…it’s the direction the software has taken us. Now the questions we need to answer are:

  1. Is this direction the correct direction we should be heading?
  2. Are there better approaches to package management that don’t follow the model we have currently (other than Conary)
  3. Can we come up with a system that doesn’t make new users spoiled?

I think I’m of both worlds…I started off with no package manager but managed to ride the wave of Red Hat 7.2 and above followed by Mand{rake,riva} and PCLinuxOS. I’m both spoiled and unspoiled. I know what it takes to manage a system without a conventional package manager but I also know how much time it can save me to use one. I sometimes find myself wanting less though…less and more. Less time and more hands on gutting the system. I think I’m in the minority though.

How about you, as a reader of this article? Do you think new users are spoiled by conventional package management systems? Do you see solutions or have ideas we can discuss? Is this really just a process we can improve or is there any programming to be done? Please sound off in the comments section!

Creative Commons License
Except where otherwise noted, the content on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.