The Best Way To Learn Linux

Dan Craciun posted a nice article on his blog titled What is the best way to learn linux? that got me thinking just what some of the best ways to learn Linux are.  Dan and I agree that reading documentation is one of the best ways to learn Linux in general.

Dan uses the famous quote “give a man a fish and he will have food for one day, teach the same man how to fish and he will have food for his entire life” which really does make sense in relation to learning Linux.  A lot of new Linux users will ask a question on a forum or in an IRC chat room and demand or expect a direct answer.  However, a lot of times what they end up getting is a way to solve their problem, not exactly how to do it.  There is a general consensus among old time and advanced Linux users that it’s important to read documentation and manuals if you want answers.

Here are some of the best ways to learn Linux:

  • Start off on the command line to learn the true way of Linux before you start on the desktop and use GUI tools to do everything for you.  Remember each GUI tool you use is just a front end for command line tools that can accomplish the same thing.
  • Read manuals and ask a lot of questions.  Be sure you’re asking the right questions though. Research before you ask.  Don’t bother to ask questions to something that you could easily find by spending 5 minutes searching Google.
  • Subscribe to Linux blogs and participate in Linux forums.
  • Explore your options by trying different Linux distributions.

Popularity: 7% [?]

If you have a video card capable of running a composition manager like Compiz, you may be interested in running the Avant Window Navigator for Ubuntu.  This document will explain the steps you need to take to install and configure the Avant Window Navigator on Ubuntu 8.04.

The Avant Window Navigator (AWN/Awn) is a dock-like navigation bar for the Linux desktop that positions itself at the bottom of the screen. It can be used to keep track of open windows and behaves like a normal window list. It is very similar to the menu doc in Mac OSX Leopard.

First, you need to make sure you have composition turned on.  In Ubuntu, navigate to the System > Preferences > Appearance > Visual Effects tab.  Make sure that visual effects is enabled.

Enable Compiz in Ubuntu

Now that we know composition is enabled, we can go ahead and install AWN.

Installing Avant Window Navigator

First we need to make sure that you have the backports repository enabled in your /etc/apt/sources.list.  This can be done via the GUI, but I am going to demonstrate how to edit the file from the command line, the true Linux way.

Edit the /etc/apt/sources.list file with a text editor such as vi or nano.

# nano /etc/apt/sources.list

Locate the following lines:

# deb http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse

Uncomment these by removing the pound (#) signs on both lines.  It should now look like this:

deb http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse

Save the file in nano by hitting ^X then Y to accept the changes.

Now that we have allowed apt to search the backports repository, we have to tell apt-get to update the repository list.

# sudo apt-get update

Now we can install Avant Window Navigator:

# sudo apt-get install avant-window-navigator

apt-get will install a few other dependencies, such as awn manager.  Awn Manager is a tool that allows you to configure your dock.

Now that AWN is installed, you should be able to run it by going to:

Applications > Accesories > Avant Window Navigator

You should now see the AWN dock at the bottom of your screen.

Configuring Avant Window Navigator

To configure AWN to your liking, open up the Awn Manager by navigating to System > Preferences > Awn Manager

AWN Manager

You’ll notice that the Awn Manager allows you to configure many aspects of the dock.  From here, you can add applets, launchers, different themes, and modify the apperance and behavior of the dock.  Hint: A nice tip you should know is that you can add apps to the dock by navigating to the Applications menu and simply dragging applications into the dock in real time.

How to get Avant Window Navigator to run at start up

If you want AWN to run during startup, all you have to do is add it to your startup sessions.

Navigate to System > Preferences > Sessions

Under the Startup Programs tab, click +Add and fill out the New Startup Program dialog box:

Add AWN to Startup Programs

Awn should now start up during after your computer boots.

Further AWN Information

To find out more about the Avant Window Navigator visit the AWN Wiki and check out the AWN Frequently Asked Questions.

Popularity: 11% [?]

Quickzi: How To Delete Bash History

If you want to delete your bash history, there are a few options you have.  First you must understand that the history of your bash session is stored into RAM and then written to ~/.bash_history when you log out of the bash session.  So even if you delete the ~/.bash_history file, your current bash session will still be written to history once you log out.

Delete bash history

To delete the bash history for your current session as well as old sessions, you should do two things:

Delete the .bash_history file:

# rm -rf ~/.bash_history

Clear the current history stored in RAM:

# history -c

Stop writing to .bash_history for good

If you don’t want to log any history for good, you can do one of two things; turn it off for all users, or turn off logging history for a single user.

Turn off bash history for all users:

Append “unset HISTFILE” to /etc/profile:

# echo "unset HISTFILE" >> /etc/profile

Turn off bash history for a specific user:

Append “unset HISTFILE” to /home/USER/.bash_profile:

# echo "unset HISTFILE" >> /home/USER/.bash_profile

That’s it! Now you have successfully deleted the bash history and stopped logging to bash history.

Popularity: 34% [?]

Here is a quick tip on how to use sed to replace a line in a text file from the command line, without opening it.

Replace a Line in a File

First, replace the text you want with sed and output it into a temporary file to ensure that it is correct:

# sed -e 's/original-text/new-text/' textFile > newFile

View the newFile and make sure that the line is correctly replaced:

# more newFile

Overwrite the textFile with the newFile:

# mv newFile textFile

Popularity: 3% [?]

Here is a quick tip on how to use sed to add a line into the middle of a text file from the command line, without opening it.

To clarify, let’s say you have a text file that has four lines:

Line1Text
Line2Text
Line3Text
Line4Text

Using sed, you can append a line anywhere you want with a simple command without even knowing the line numbers.

Add a Line into the Middle of a Text File

For this example, lets say we want to append a new line under Line3Text:

# sed '/^Line3Text/a NewLineText' textFile > newFile

You’ll notice that we output the results to a newFile so that we can make sure the new line appended correctly before overwriting the original file.  If you check the newFile, you should see a correct output, then you can overwrite the original textFile.

# mv newFile textFile

Popularity: 4% [?]

The Linux Foundation and kernel developers alike have finally decided to speak out by issuing a statement on closed source drivers, recommending “that hardware manufacturers provide open source kernel modules.”

Here’s the entire statement:

The Linux Foundation recommends that hardware manufacturers provide open source kernel modules. The open source nature of Linux is intrinsic to its success. We encourage manufacturers to work with the kernel community to provide open source kernel modules in order to enable their users and themselves to take advantage of the considerable benefits that Linux makes possible. We agree with the Linux kernel developers that vendors who provide closed-source kernel modules force their customers to give up these key Linux advantages. We urge all vendors to adopt a policy of supporting their customers on Linux with open-source kernel modules.

Background Materials

There is no telling if the hardware manufacturers will take notice and actually adhere to the Linux Foundation’s statement, but at least they will know where the Linux community developers stand.  It’s obvious as to why the hardware companies don’t want to provide open source drivers, in order to remain competitive, but there has to be a tipping point at some point.

Visit the Linux Foundation website for more information.

Popularity: 3% [?]

Screencast Your Linux Desktop

Linuxhaxor.net has a great write up listing 5 different ways to capture a Linux desktop screencast.  The article highlights five screencasting applications for Linux: Istanbul, Wink, Xvidcap, vnc2swf and Recordmydesktop.

Read more here..

Popularity: 2% [?]

MySQL Change Password Tip

I keep getting the question on how to change a mysql root password. Here is a quick tip on how to change the MySQL password from the command line.

# /etc/init.d/mysql stop
# mysqld --skip-grant-tables
# mysqladmin -u root password 'newpass'
# /etc/init.d/mysql start

Change MySQL Password for a standard user

You can also change the mysql password for a standard user using mysqladmin.

# mysqladmin -u username -p oldpass newpass

Popularity: 4% [?]

openSUSE 11.0 Released

Congratulations to the openSUSE team for the release of openSUSE 11.0.

The openSUSE Project is proud to announce the release of openSUSE 11.0 — everything you need to get started with Linux on the desktop and on the server. Promoting the use of Linux everywhere, the openSUSE Project provides free, easy access to the world’s most usable Linux distribution, openSUSE.

The 11.0 release of openSUSE includes more than 200 new features specific to openSUSE, a redesigned installer that makes openSUSE even easier to install, faster package management thanks to major updates in the ZYpp stack, and KDE 4, GNOME 2.22, Compiz Fusion, and much more.

Download openSUSE 11.0

openSUSE is now available for immediate download. The openSUSE 11.0 release brings several new options for installation media, as well as familiar choices:

  • openSUSE 11.0 DVD
  • openSUSE 11.0 KDE 4 32-bit Live CD
  • openSUSE 11.0 GNOME 32-bit Live CD
  • openSUSE 11.0 KDE 4 64-bit Live CD
  • openSUSE 11.0 GNOME 64-bit Live CD

You can download openSUSE 11.0 via HTTP, FTP, BitTorrent, and Metalink from software.openSUSE.org.

You can also purchase a retail box with openSUSE 11.0 that includes 90-day installation support, physical media, and a printed Getting Started guide.

Popularity: 2% [?]

Mark Shuttleworth, the founder of Ubuntu, and Canonical Ltd., recently did an interview with Linux-Magazine Italia and he was kind enough to translate the Italian version to English and post it on his blog.

Here is a great question and answer from the interview:

3) Ok, let’s talk about the latest Ubuntu 8.04. In an interview you said that “Hardy Heron is your most significant release ever”. Well, can you talk about the main improvements of this release?
First, this is an LTS (“Long Term Support”) release that was delivered on a very precise schedule. Six months ago we committed to shipping 8.04 LTS on April 24th, and we did exactly that. As far as I know, nobody has ever shipped an “enterprise class” OS release on a schedule that precise. And not only did we do that, but we have now committed to ship the next LTS in April 2010, it will be 10.04 LTS, and we’ll set the exact date six months in advance like we did with this one. It is thanks to Debian and the free software community that it is possible for us to do this. So 8.04 LTS has proven our ability to deliver not just 18-month-supported releases on time, but also LTS releases on time. We very much hope that other distributions will follow our lead on the LTS cycle with their enterprise releases, because that will make it easier for us all to collaborate, and make all the major Linux distributions better.

Second, there are very significant new developments for Ubuntu itself. On the server, we worked with HP on their Proliant range, and with Dell on their PowerEdge range, to ensure that 8.04 LTS will be compatible with their popular x86 servers. We’re not yet certified, but we are sure that it will “Just Work”. Sun Microsystems has gone further, and has actually certified 8.04 LTS on a range of their x86 servers. This is a major step forward for Ubuntu on the server. We see an amazing amount of usage now for Ubuntu on the server – it’s the most popular server platform for several ISV’s. So it’s important that we work with server vendors, and server solution vendors. We’ve also put a lot of work into the use of KVM and VMWare virtualisation, because we see people building hundreds of virtual appliances on Ubuntu.

On the desktop, we have focused on making it easier to install Ubuntu, especially on a machine which already has Windows, where you can now install Ubuntu into a file on the Windows partition instead of having to resize your Windows partition to make a new partition for Ubuntu. That makes it much easier for people to test out Ubuntu, and hence to get a taste of free software. We have also worked on many of the common things that people want to do with their PC, such as work with photos and music, and started to improve the user experience there.

Read the rest of the interview here.

Popularity: 2% [?]