Showing posts with label Tricks. Show all posts
Showing posts with label Tricks. Show all posts

Sunday, March 7, 2010

DHT, PEX and Magnet Links Explained

Recently The Pirate Bay confirmed it would shut down its tracker for good, instead encouraging the use of DHT, PEX and magnet links. This move confounded many BitTorrent enthusiasts, who although wishing to adapt, were confronted with hard to grasp terminology and technology. Time for some explaining.

The Pirate Bay’s recent confirmation that they had closed down their tracker since DHT and Peer Exchange have matured enough to take over, was coupled with the news that they had added Magnet links to the site. This news has achieved its aim of stimulating discussion, but has also revealed that there is much confusion over how these technologies work.

The key thing to understand is that nobody is being forced to use Magnet links or trackerless torrents. While these long-standing technologies may prove to be the future, they will co-exist with tracker-enabled torrenting for quite some time. For now, nobody will be forced to immediately change their existing downloading habits, although it may be wise to switch to a BitTorrent client that is compatible with these technologies.

In an attempt to clear some of the mystique surrounding DHT, PEX and Magnet links we will walk through all three briefly, hoping to assure those who’ve become confused earlier this week.




DHT

Using DHT instead of trackers is one of the things The Pirate Bay is now trying to encourage, and torrent downloads that rely solely on this technology are often referred to as “trackerless torrents.” DHT is used to find the IP addresses of peers, mostly in addition to a tracker. It is enabled by default in clients such as uTorrent and Vuze and millions of people are already using it without knowing.

DHT’s function is to find peers who are downloading the same files, but without communicating with a central BitTorrent tracker such as that previously operated by The Pirate Bay.

DHT is by no means a new technology. A version debuted in the BitTorrent client Azureus in May 2005 and an alternative but incompatible version was added to Mainline BitTorrent a month later. There is, however, a plugin available for Azureus Vuze which allows it access to the Mainline DHT network used by uTorrent and other clients.


Peer Exchange (“PEX”)

Peer Exchange is yet another means of finding IP addresses. Rather than acting like a tracker, it leverages the knowledge of peers you are connected to, by asking them in turn for the addresses of peers they are connected to. Although it requires a “kick start”, PEX will often uncover more genuine peers than DHT or a tracker.


Magnet links

Traditionally, .torrent files are downloaded from torrent sites. A torrent client then calculates a torrent hash (a kind of fingerprint) based on the files it relates to, and seeks the addresses of peers from a tracker (or the DHT network) before connecting to those peers and downloading the desired content.

Sites can save on bandwidth by calculating torrent hashes themselves and allowing them to be downloaded instead of .torrent files. Given the torrent hash – passed as a parameter within a Magnet link – clients immediately seek the addresses of peers and connect to them to download first the torrent file, and then the desired content.

It is worth noting that BitTorrent can not ditch the .torrent format entirely and rely solely on Magnet links. The .torrent files hold crucial information that is needed to start the downloading process, and this information has to be available in the swarm.

Pirate Bay links cf. Mininova links: When the Magnet link specification first came out, in January last year it called for a particular format (“base32 encoded”). The links that EZTV, Mininova and ShareReactor have displayed for some time all conform to that original specification. In May of last year the specification was changed, in favor of “hex encoding”, and that is the format of the links being displayed by The Pirate Bay. Torrent clients should accept either format.


Compatible Clients

All the main torrent clients: uTorrent 1.8.5, Vuze 4.3.0.2, BitTorrent 6.3, BitComet 1.16, and Transmission 1.76 (and others) support Peer Exchange and DHT (via a plugin in the case of Vuze). Neither BitComet nor Transmission yet support Magnet links but Transmission is planning to include Magnet link support in the upcoming 1.8 release. Bearing in mind that no site, including The Pirate Bay, has yet abandoned support for traditional torrent files, there is plenty of time for support to be added.

We hope that this article has cleared some of the smoke that was generated by The Pirate Bay’s announcements earlier this week. There is no need to panic, cry or be angry, and it’s not a problem if you’re still confused after reading this article. Torrents will still be available and aside from some extra downloading options thanks to sites that add Magnet links, nothing drastic will change in the near future.

Read more!

Sunday, December 14, 2008

Most Common Mistakes made by Linux Administrators

This article will help you avoid those mistakes by laying out the most typical Linux missteps.

Installing applications from various types

This might not seem like such a bad idea at first. You are running Ubuntu so you know the package management system uses .deb packages. But there are a number of applications that you find only in source form. No big deal right? They install, they work. Why shouldn’t you? Simple, your package management system can’t keep track of what you have installed if it’s installed from source. So what happens when package A (that you installed from source) depends upon package B (that was installed from a .deb binary) and package B is upgraded from the update manager? Package A might still work or it might not. But if both package A and B are installed from .debs, the chances of them both working are far higher. Also, updating packages is much easier when all packages are from the same binary type.

Neglecting updates

Okay, this one doesn’t point out Linux as much as it does poor administration skills. But many admins get Linux up and running and think they have to do nothing more. It’s solid, it’s secure, it works. Well, new updates can patch new exploits. Keeping up with your updates can make the difference between a compromised system and a secure one. And just because you can rest on the security of Linux doesn’t mean you should. For security, for new features, for stability — the same reasons we have all grown accustomed to updating with Windows — you should always keep up with your Linux updates.

Poor root password choice

Okay, repeat after me: “The root password is the key to the kingdom.” So why would you make the key to the kingdom simple to crack? Sure, make your standard user password something you can easily remember and/or type. But that root password — you know, the one that’s protecting your enterprise database server — give that a much higher difficulty level. Make that password one you might have to store, encrypted, on a USB key, requiring you to slide that USB key into the machine, mount it, decrypt the password, and use it.

Avoiding the command line

No one wants to have to memorize a bunch of commands. And for the most part, the GUI takes care of a vast majority of them. But there are times when the command line is easier, faster, more secure, and more reliable. Avoiding the command line should be considered a cardinal sin of Linux administration. You should at least have a solid understanding of how the command line works and a small arsenal of commands you can use without having to RTFM. With a small selection of command-line tools on top of the GUI tools, you should be ready for just about anything.

Not keeping a working kernel installed

Let’s face it, you don’t need 12 kernels installed on one machine. But you do need to update your kernel, and the update process doesn’t delete previous kernels. What do you do? You keep at least the most recently working kernel at all times. Let’s say you have 2.6.22 as your current working kernel and 2.6.20 as your backup. If you update to 2.6.26 and all is working well, you can remove 2.6.20. If you use an rpm-based system, you can use this method to remove the old kernels: rpm -qa | grep -i kernel followed by rpm-e kernel-{VERSION}.

Not backing up critical configuration files

How many times have you upgraded X11 only to find the new version fubar’d your xorg.conf file to the point where you can no longer use X? It used to happen to me a lot when I was new to Linux. But now, anytime X is going to be updated I always back up /etc/X11/xorg.conf in case the upgrade goes bad. Sure, an X update tries to back up xorg.conf, but it does so within the /etc/X11 directory. And even though this often works seamlessly, you are better off keeping that backup under your own control. I always back up xorg.conf to the /root directory so I know only the root user can even access it. Better safe than sorry. This applies to other critical backups, such as Samba, Apache, and MySQL, too.

Booting a server to X

When a machine is a dedicated server, you might want to have X installed so some administration tasks are easier. But this doesn’t mean you should have that server boot to X. This will waste precious memory and CPU cycles. Instead, stop the boot process at runlevel 3 so you are left at the command line. Not only will this leave all of your resources to the servers, it will also keep prying eyes out of your machine (unless they know the command line and passwords to log in). To log into X, you will simply have to log in and run the command startx to bring up your desktop.

Not understanding permissions

Permissions can make your life really easy, but if done poorly, can make life really easy for hackers. The simplest way to handle permissions is using the rwx method. Here’s what they mean: r=read, w=write, x=execute. Say you want a user to be able to read a file but not write to a file. To do this, you would issue chmod u+r,u-wx filename. What often happens is that a new user sees an error saying they do not have permission to use a file, so they hit the file with something akin to chmod 777 filename to avoid the problem. But this can actually cause more problems because it gives the file executable privileges. Remember this: 777 gives a file rwx permissions to all users (root, group, and other), 666 gives the file rw privileges to all users, 555 gives the file rx permissions to all users, 444 gives r privileges to all users, 333 gives wx privileges to all users, 222 gives w privileges to all users, 111 gives x privileges to all users, and 000 gives no privileges to all users.

Logging in as root user

I can’t stress this enough. Do NOT log in as root. If you need root privileges to execute or configure an application, su to root in a standard user account. Why is logging in as root bad? Well, when you log on as a standard user, all running X applications still have access only to the system limited to that user. If you log in as root, X has all root permissions. This can cause two problems: 1) if you make a big mistake via a GUI, that mistake can be catastrophic to the system and 2) with X running as root that makes your system more vulnerable.

Ignoring log files
There is a reason /var/log exists. It is a single location for all log files. This makes it simple to remember where you first need to look when there is a problem. Possible security issue? Check /var/log/secure. One of the very first places I look is /var/log/messages. This log file is the common log file where all generic errors and such are logged to. In this file you will get messages about networking, media changes, etc. When administering a machine you can always use a third-party application such as logwatch that can create various reports for you based on your /var/log

Read more!

Monday, December 8, 2008

Tried and Tested method to Recover Damaged CD / DVD

Well, there are many methods that can be used to recover damaged CDs but to recover DVDs is somewhat tougher, I have come across many software which claim to do the same but when I tried them, none of them was able to achieve the desired result.

So after banging my head for some time, I have come across one method that worked for me. I am just going to explain and then hope that maybe it would work for you too.

The tool I am going to use here is called CD Check. Well its a paid tool but you I happen to have copy which you can download here.

Whats better is that this tool is just 1.5 MB. Download and install.

This is how it looks


All you need to do is, click on check, once it checks the DVD, you can go ahead and click on Recover Button

You'll see something similar to below


Just specify an output folder and click continue, you should be good to go.

Please let me know if it worked

Read more!

Thursday, December 4, 2008

Minimize removable media headaches in Linux

For many new Linux users, removable media can be a deal-breaker. Anyone coming over from Windows knows you simply insert the CD, use it, and eject it. With Linux, it isn't always that simple. In fact, with Linux, removable media has always held a completely different philosophy.
In the old days of UNIX, removable media was seen in the same light as the PC itself -- multi-user. So when you inserted some form of media (usually a floppy disk, back then), it had to be mounted to a mount point (such as /mnt/floppy) and was then made available to all users on the system. Because of this, the removable media synchronization wasn't "on demand." It typically worked by caching the data until the media was unmounted. Upon unmounting the media, the data was written and the media could be removed.

Linux has caught up to the needs of today's user and, in many cases, the media mounting/unmounting is automatic. But not every situation is the same. Here are some tips that should make your Linux life with removable media better.


Use the right desktop
The right desktop can make your job so much easier. The newest releases of both KDE and GNOME offer systems that check for the insertion of removable media. When a CD is inserted, you will be greeted with a window asking what you would like to do with the media. You can even set that action you choose as the default action to take upon insertion of that type of media. Those desktops also have applets that reside in the panel (or desktop icons) that allow you to easily mount and unmount the media with a click of the mouse. No more entering commands like mount /dev/cdrom /media/cdrom.


Get to know /etc/fstab

Because I generally stick with more old-school desktops (such as Enlightenment DR16), I often still have to mount my removable media. So instead of having to issue the full command mount /dev/sda1 /media/mp3 to mount my MP3 player, I will add a line to my /etc/fstab file that will do two things: Point the device to the correct mount point and make sure the mount point is both readable and writable by the user. The fstab entry will look something like this:

/dev/sda1 /media/ipod vfat users,exec,noauto,managed 0 0

Now when you need to mount the device, enter mount /media/ipod. Just remember to unmount the device before you remove it.


Use udev to make your life easier
Let's build upon using fstab to simplify mount of removable media. Let's say you have an entry in your /etc/fstab file for your iPod pointing it from /dev/sda1 to /media/ipod. Now let's say you plug in another USB device or reboot. The problem is that entry in your fstab file may or may not be valid now because /dev/sda1 might be used by something else. To avoid this, make use of the udev system. You're going to tell udev to always make sure that device shows up with the same filename. Enter a line in the /etc/udev/rules.d/00.rules file that looks like:

## iPod
BUS="scsi", SYSFS{model}="iPod*", NAME="ipod"

Of course, your entry in /etc/fstab will have to change to reflect the above. So now /etc/fstab will look like:

/dev/ipod /media/ipod vfat users,exec,noauto,managed 0 0


Use menu entries for mount/umount
Back in the day, when I used AfterStep, I always had a submenu that included an entry for mounting and unmounting both the floppy and the CD-ROM. This made life much easier because I no longer had to open up a command line and enter the mount and umount commands to use the device. Granted, the window manager you use will determine how this is employed. For example, in Enlightenment, I can create two entries in the user_apps.menu file that look like:

"mount iPod" NULL exec "mount /media/ipod"
"umount iPod" NULL exec "umount /media/ipod"

Now on the Enlightenment menu, I will see two entries: mount iPod and umount iPod. With the device connected all I have to do is click the mount entry. To remove the device I only need to click the umount entry.


Be safe with your removable hard drives
One time, I left a USB drive plugged into a machine I was re-installing the operating system on. I wasn't paying enough attention and wound up with an operating system spanning both my internal drive and my removable drive. Yes, this was a big mistake and no, it has never happened since. Why? Because anytime I install an OS on a machine with a removable drive, that removable drive is removed during installation. It's not a problem, because upon first boot, I plug the drive back in and it is always automatically recognized and mounted. Of course, I will make an entry in /etc/fstab that will automatically mount the drive on boot.


Never forget to use the dmesg command
When you plug in a device or insert removable media, the dmesg command will give you the status of the system. For example, when I insert an iPod into a Mandriva 2008 machine I run the dmesg command and see:

usb 1-4: new high speed USB device using ehci_hcd and address 2
usb 1-4: configuration #1 chosen from 3 choices
usb 1-4: USB disconnect, address 2
usb 1-4: new high speed USB device using ehci_hcd and address 3
usb 1-4: configuration #1 chosen from 2 choices
Initializing USB Mass Storage driver...
scsi2 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
scsi 2:0:0:0: Direct-Access Apple iPod 1.62 PQ: 0 ANSI: 0
sd 2:0:0:0: [sdb] 58605120 512-byte hardware sectors (30006 MB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 68 00 00 08
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sd 2:0:0:0: [sdb] 58605120 512-byte hardware sectors (30006 MB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 68 00 00 08
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sdb: sdb1 sdb2
sd 2:0:0:0: [sdb] Attached SCSI removable disk
sd 2:0:0:0: Attached scsi generic sg1 type 0
usb-storage: device scan complete

From this, I know the device is being seen at /dev/sdb. Without knowing this, I would have a hard time guessing where the device has been mapped to.


Don't forget the eject command
Most people don't know that there's a command to eject CDs from the CD drive. Naturally, this isn't an issue for those who have tray CD drives. But for those with slot-loading CD drives, eject will save you from pulling your hair out. After you have used and unmounted your CD drive, open up a terminal and enter the eject command, and your CD will pop out. To simplify the process, make a menu entry for the command.


Remember that the mount command tells all
If you're unsure what devices are mounted on your system, issue the mount command to see a listing of everything currently mounted on your machine. The output looks like:

/dev/sda1 on / type ext3 (rw)
none on /proc type proc (rw)
/dev/sda6 on /home type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /sys/fs/fuse/connections type fusectl (rw)

From this output, I can see that I have no removable media mounted on the machine. So I know it's safe to unplug anything removable. Had there been an entry for, say, my iPod, I would know not to remove the device without unmounting it. Of course, on modern systems (using one of the major desktops), this will be made clear with the icon or the removable device applet on the panel. But this command will be helpful (along with dmesg) in debugging removable media issues.

Reformat your iPod to a Windows format
If you've tried to add songs on a Mac-formatted iPod on Linux, you've probably discovered that it's not possible without jumping through hoops even programmers don't want to jump through. Format your iPod in Windows format, and you won't have any problems using your iPod with Amarok, Banshee, or gtkpod.


Allow others to connect to your removable media
In my office, I have a removable drive mounted to /media/music that contains my entire music collection. I allow others to listen to that music via samba by including it as a share. I like doing this far better than allowing users to have access to my internal drive because 1) it keeps anyone from trashing the drive containing my OS and 2) it allows me to keep sensitive data physically separated from shared data. This approach doesn't have to be used for music, either. It's a great way to share interoffice files or have a single repository for backups. Once the drive is full, remove it and store it. Just add a new removable drive for the new backup.

Simpler, easier
Not only is today's Linux not nearly as challenged with removable media as it once was, it's really quite flexible and user friendly. With the help of these tips, you should now see how you can expand your Linux experience to include various ways to employ removable media.

Read more!

Monday, June 2, 2008

Cut down on Linux command-line typing with these 10 handy bash aliases

The Linux desktop has come a long, long way, but there are still times when I have to use the command line. (I am a hardcore user, after all.) But even though I'm used to typing, spending hours upon hours with my fingers at the keyboard, I still grow tired of typing the same commands over and over. To reduce that tedium, I always add aliases to my .bashrc file

What is an alias?
An alias is basically a shortcut for a command you place in your ~/.bashrc file. Aliases cut down on typing and can save you from having to look up a command

Aliases are set up near the bottom of the of the .bashrc file. You'll see a commented-out section that indicates where you should put them. The format of an alias is:

Alias NICKNAME='full command here'

The keyword alias must be used. The nickname is what you will type at the command line. Make this nickname easy to remember. The = sign must also be used. After the = sign, you enter the full command, including flags and switches, enclosed in single quotes. Once you are done, save the .bashrc file and open up a new terminal. I always find it best to leave the original terminal window open in case there are problems. In the new terminal, type the alias nickname and the command will run.

Following list of aliases to help make a command-line experience a bit easier

1. The ssh alias
This one should be a no-brainer for those of you who frequently secure shell into particular boxes. For this I add an alias like so:

alias server_name='ssh -v -l USERNAME IP ADDRESS'

Just change server_name to a memorable name for the server. Then, change USERNAME and IP ADDRESS to suit your needs.


2. The ls aliases
Some distributions don't include some of the handier ls commands. Generally, I like to see full listings instead of just filenames. For that I always include this alias:

alias ll='ls -l'

Another handy ls alias is this:

alias la='ls -a'


3. The rm safety net
I can't tell you how many times I have "rm'd" a file I shouldn't have "rm'd". To avoid this, I add this alias:

alias rm='rm -i'

Adding the '-i' flag it forces rm into interactive mode, which asks whether you're sure you want to remove a file


4. A more useful df command
This handy tool tells you how much space you have left on a drive. Only thing is, if you run the command by itself it replies in 1K blocks. Most people would prefer to see this in terms of MB. To make that happen, add this alias:

alias df='df -h'

Now, every time you run the df command, the information will be returned in a human-readable format


5. The nonstandard Firefox
Many times, I install Firefox in strange directories (or have more than one version of Firefox installed for testing purposes). For this, I will add an alias to start the correct Firefox. Say, for example, I have the beta of the newest, upcoming Firefox release installed, as well as the current stable Firefox. They are both installed in my home directory in different subdirectories. I will then add two aliases like so:

alias ff1='/home/jlwallen/firefox/firefox'
alias ff2='/home/jlwallen/firefoxb3/firefox'

Now I can start the stable firefox with ff1 or the beta with ff2


6. The bookmark alias
Speaking of Firefox, let's create an alias to open up it to a specific URL:

alias ffg='/home/jlwallen/firefox/firefox http://www.google.com'

This alias will open Firefox directly to the Google site


7. The constant editing of a file
There are certain files that I am constantly editing. For instance, when I used Enlightenment E16 (I now use E17), I was frequently editing the menu file ~/e16/menus/user_apps. Instead of constantly opening up a terminal and entering nano ~/.e16/menus/user_apps, I used an alias that allowed me to type emenu and start editing. I used this alias:

alias emenu='aterm nano -e ~/.e16/menus/user_apps'

Now, I just enter the command emenu (or I can enter that in the run command dialog) to open up this file in an editor


8. The apt-get update
There are numerous ways to use an alias to help you with apt-get. One of my favorite is to add this alias:

alias update='sudo apt-get update'

I only need to enter update and will be prompted for the sudo password. You can modify this to suit your frequent apt-get needs


9. The rpm batch install
I like to do a lot of batch installing with rpm. I will typically dump a bunch of rpm files into an empty directory (created for this specific purpose) and run the command rpm -ivh ~/RPM/*rpm. Of course, an alias makes this even easier:

alias brpm='rpm -ivh ~/RPM/*rpm'

You have to create the ~/RPM directory and enter the root password for this to work


10. The long, arduous path
There are some paths that I often change to that seem to take eons to type. When I was working on the Afterstep window manager, I had to constantly change to the ~/GNUstep/Library/AfterStep/start to edit menus. After a while, you get tired of typing cd ~/GNUstep/Library/AfterStep/start just to get to the directory. So I added an alias like so:

alias astart='cd ~/GNUstep/Library/AfterStep/start'

Naturally, you can change that to fit your needs. This will save you a lot of typing


So there you have it: a few simple bash aliases that will ease the load on your fingers. You can modify them to suit you, and they'll give you a good start on creating your own handy bash aliases

Read more!

Friday, May 30, 2008

10 ways to secure your Linux desktop

A Linux desktop is far more secure than most others. But this level of security doesn't necessarily involve typical security-focused software or techniques. Sometimes, the easiest means to security are those measures that are the easiest to forget. Let's take a look at 10 things you can do to secure a Linux desktop.
Note that we're talking about the desktop, not a server. Linux server security is another beast all together -- one that would confuse the average desktop user.


1. Locking the screen and logging out is important
Most people forget that the Linux desktop is a multi-user environment. Because of this, you can log out of your desktop and others can log in. Not only does that mean that others could be using your desktop, it also means you can (and should) log out when you're finished working. Of course, logging out is not your only option. If you are the only user on your system, you can lock your screen instead. Locking your screen simply means that a password will be required to get back into the desktop. The difference here is that you can leave applications running and lock the desktop. When you unlock the desktop, those same programs will still be running. Safe and secure.

2. Hiding files and folders is a quick fix
In Linux-land, files and folders are hidden by adding a "." before the name. So the file test will appear in a file browser, whereas .test will not. Most people don't know that running the command ls -a will show hidden files and folders. So if you have folders or files you don't want your co-workers to see, simply add the dot to the beginning of the file or folder name. You can do this from the command line like so: mv test .test

3. A good password is a must
Your password on a Linux PC is your golden key. If you give that password out, or if you use a weak password, your golden key could become everyone's golden key. And if you're using a distribution like Ubuntu, that password will give users much more access than, say, on Fedora. To that end, make sure your password is strong. There are many password generators you can use such as Automated Password Generator

4. Installing file-sharing applications is a slippery slope
I know many Linux users are prone to file sharing. If you want to run that risk at home, that's your call. But when at work, you not only open yourself (or your company) up to lawsuits, you open your desktop machine up to other users who might have access to sensitive data on your work PC. So as a rule, do not install file-sharing tools.

5. Updating your machine regularly is a smart thing
Linux isn't Windows. With Windows, you get security updates when Microsoft releases them (which could be many months away). With Linux, a security update can come minutes or hours after the security flaw is detected. With both KDE and GNOME, there are update applets for the Panel. I always recommend having them up and running so you know when updates are made available. Don't put off security updates. There is a reason they come out.

6. Installing virus protection is actually useful in Linux
Believe it or not, virus protection in Linux has its place. Of course, the chances of a virus causing problems on YOUR Linux machine are slim to none. But those e-mails you forward to others' Windows machines could cause problems. With a good virus protection, like ClamAV, you can ensure that e-mail going out of your machine doesn't contain anything nasty that could come back to haunt you (or your company)

7. SELinux is there for a reason
SELinux (Security-Enhanced Linux) was created by NSA. What SELinux does is help lock down access control to applications. And it does it very well. Sure, SELinux can sometimes be a pain. In some cases, it might take a hit out of your system performance. Or you might find some applications a struggle to install. But the security comfort you gain using SELinux (or Apparmor) far outweighs the negatives. During the Fedora installation, you get the chance to enable SELinux

8. Creating /home in a separate partition is safer
The default Linux installation places your /home directory right in the root of your system. Sure, this is fine, but

  1. It's standard, so anyone gaining access to your machine knows right where your data is and
  2. If your machine goes down for good, your data might be gone.
To solve this problem, you can place /home on a different hard drive or partition all together (making it a partition in and of itself). This is not a task for the weak of heart, but it is one worth employing if you're uber-concerned about your data

9. Using a nonstandard desktop is worth its weight in gold
Not only do the alternative desktops (Enlightenment, Blackbox, Fluxbox, etc.) give you a whole new look and feel for your PC, they offer simple security from prying eyes you may never have thought of. I have deployed Fluxbox on kiosk machines when I wanted a machine that could do one thing: Browse the network. How do you do that? Simple. Create a single mouse menu (or desktop icon) for the application you want to use. Unless the user knows how to get back to the command line (by logging out or hitting Ctrl-Alt-F*, where * is a desktop other than the one you are using), they will not be able to start up any application other than the one offered. Since most users have no idea how to move around in these desktops anyway, they aren't going to have the slightest idea how to get to your files. Simple pseudo-security

10 Stopping services is best
This is a desktop machine. It's not a server. So why are you running services like httpd, ftpd, and sshd? You shouldn't need them and they only pose a security risk (unless you know how to lock them down.) So don't run them. Check your /etc/inetd.conf file and make sure that all unnecessary services are commented out


You might find these suggestions to be pure common sense -- but maybe you'll see a means of security you never thought of before. And if you're a new Linux user, these tips are a great place to start to ensure that your Linux experience is a good one.

Read more!

Thursday, December 13, 2007

Configuring a Samba Server

If you deploy a Linux-based machine to serve up files in a Windows network, you’re not going to get very far without the help of Samba. Samba is an Open source software suite that offers seamless file and print services to SMB/CIFS clients.

Basically, Samba can fool a Windows machine into thinking a Linux machine is a Windows machine. A bit of trickery yes, but it gets the job done.

Before YaST, the real trick was getting Samba to actually work. Configuring Samba required hand-editing the smb.conf file; this could be a nightmare. Now you can point-andclick your way to getting Samba running, because the good people at Novell and SuSE have worked hard to bring the Linux administrator the YaST (Yet another Setup Tool) to help. This tool makes setting up a plethora of system settings as simple as it gets. Here’s how it works.

What does Samba do?
Before we move on, let’s make sure we all know what Samba does. Samba’s magic happens thanks to a protocol suite known as the Common Internet File Sharing (or CIFS) at port 3020. At the heart of this protocol suite is the Server Message Block (SMB) protocol.

Samba is simply the open source implementation of the CIFS protocol suite. Samba allows Linux servers and workstations to talk to any Windows workstation, all the way
back to Windows 95.

Configuring Samba

To configure a Samba Server in SuSe Linux, you’ll use the YaST tool. To do so, go to the Control Center. Select Administrator Settings from the Common Tasks section to open the YaST Admin Tool. Next, select Network Services to reveal a listing of the various Network Services that can be configured from within YaST. Press the Samba Server button and you’ll see YaST’s Samba GUI.

The first thing you have to do is enter the domain to be configured. The drop-down is a bit misleading. The default, TUX-NET, is the only option available. Simply erase that option and enter your domain. Once you have applied this, press Next to take care of the final phase of initial setup.

If your server is to house all of the Samba log-in information, set it as the PDC.

This final phase requires you to decide if your Samba server will act as a Primary Domain Controller. Make your selection and press Next.

Once you press Next, you can’t come back to this portion of the setup without aborting the installation altogether. So make your choices wisely.

After you press Next, you are in the primary Samba configuration.

If you click Abort, the Samba GUI will go away.

The first configuration is the Samba startup status. You can either configure Samba to start at boot or to be manually started. I highly recommend you have Samba start at boot. It will slow your boot time down a fraction of a second, but it will lessen the tasks you must handle once the server is up and running.

Once you have Samba’s boot configuration taken care of, open up the firewall for Samba. Select the Open Port In Firewall check box. If your machine has more than one network interface, press the Firewall details button to apply the firewall changes to the correct interface.

The next step is to configure the proper Samba shares. Press the Shares tab, to reveal this configuration.

You can enable or disable a feature simply by clicking the Toggle Status button.

The Shares tab allows you to configure every aspect of the Samba shares. You can go beyond just enabling or disabling each share, of course. By highlighting a share and pressing the Edit button, you can further customize each share configuration.

Let’s take a look at configuring the users share. Highlight that share and press Edit. A new window reveals five pre-configured options.

Obviously, the default settings will not work for most, and there are a lot of possible options to add. Let’s take a look at the default options and what they are:

  • Read Only: Tells Samba if the configured shares are read only. The default is set to No. If users need only to be able to read data from the shares, highlight the option,press Edit, select the read only check box, and press OK. The share is now set to read only.
  • Comment: What users see after logging in. This could be a description of the server serving the shares.
  • Path: The directory that Samba will share out to the users.
  • Inherit ACLS: Means that all files within a parent folder will inherit the ACL(Access Control List) of the parent folder. That’s it for the default users options.
Obviously, there are quite a few more options to be added.

If you press the Add button, a small window will appear with a drop-down list. That drop down list contains 124 other options to add and configure. Once you find the option you want to add, select it and press OK. Some of the new options will have another configuration window to edit before the option is added. Say, for instance, you want to add admin users. Click the drop-down and highlight admin users.
124 options to choose from.

Press OK and the second window will open to enter the admin username.

When you press OK, you’ll be taken back to the initial shares screen, but the admin user will be listed among the options. After you have completed the configuration of this section, press OK to move on.

Another option in the Shares tab is to enable to users to share their home directory. This is important: If you enable this feature, every user’s home directory will be made available. If this server is used frequently by users, then privacy can become an issue. If you decide to use this feature, make sure your users are made aware of it.

Finally, the Identity tab, shown in Figure E on page 14, allows you to further specify the identity and role of the Samba server.

Your Workgroup or Domain name should already be correct from the initial configuration.

Two of the three configuration options should be familiar from earlier configurations. The final of the three, NetBIOS name is just the name the machine will be seen as on the shared network. If you want the server to be seen as “Department X” then enter Department X in this option.
You may also undertake some advanced settings from this tab. From the Advanced Settings drop-down, you can select either Expert Global Settings or User Authentication Settings. The Expert Global Settings, allow you to fine-tune settings for printing, security, and log-in.

When you press the Edit button, the majority of the options in the Global Settings configurations are text-field entries.

If you’re familiar with hand-editing smb.conf files, you’ll recognize a number of the configurations. One of the most important configurations you’ll make here is the security option. This is how your users will authenticate to your Samba server. There are five possible settings:
  • ADS: Where Samba acts as a Domain member of an Active Directory.
  • Domain: Where Samba relies on a Windows NT Primary (or Backup) Domain Controller to authenticate users.
  • Server: Where the Samba server passes the buck of authentication to another
  • Samba server.
  • Share: Where users only have to enter password if they try to enter a specific shared directory.
  • User: Where users are required to enter their username/password on a per Samba server basis.
The other Advanced Settings tab, User Authentication Sources, is simply a way for you to define where Samba finds the resource file to authenticate users. There are four different types:
  • smbpasswd File
  • LDAP
  • TDB Database
  • MySQL Database
Obviously, this configuration will depend completely on your network setup. The default option is smbpasswd File. If you press the Edit button (with that option highlighted), you can then enter the location of the password file used.

Make the connection

With all of these options complete, you are ready to complete the configuration by pressing the Finish button. This will save all of your configurations and start the Samba services. If your configuration is successful, you can now log into your Samba server from your Windows machines. Just connect to the Linux server from the Windows workstation in Explorer using the standard \\servername syntax.

Read more!

Tuesday, December 11, 2007

Configuring Linux using a GUI

Many hardcore Linux users would shudder at the thought of configuring Linux network services using a GUI. A solid argument could be made that a GUI has no place being on a server in the first place. Servers are just supposed to sit quietly in the corner and do their job by themselves without user interaction. GUIs, by definition, are designed to make user interaction easier. A GUI adds needless overhead to a machine that’s not supposed to be interacting with users from its own console. Therefore, you should keep a GUI off of the server and configure services to run from a command line.

Although it’s practically sacrilegious, using a GUI for configuring servers can make sense in some cases. Primarily, using a GUI can help network administrators who aren’t familiar with Linux learn to set up network services faster. Many network administrators come from a Windows background, where practically everything is point-and-click. Although they need to earn new tools, the old Windows skills can more easily be translated to Linux through GUI tools.

Even for seasoned Linux users, trying to figure out the locations, layouts, and choices of configuration files that need to be maintained can be a chore. Some services can use three or four different .conf files. A slight error in the file can cause the service to fail. If the error was overlooked, a lot of time can be lost to troubleshooting. GUI tools that automatically find and populate the corresponding .conf files can end confusion and decrease the chance of errors.

GUI configuration options
Linux gives you several options when it comes to GUI-based network administration. Since the distribution we’ve chosen to use in this series revolves around SuSE 10.2, the major GUI configuration tool you’ll use is YaST. Other distributions have their own tools, but YaST is very well-organized, with an easy-to-follow arrangement.

YaST does a lot, but it doesn’t do it all. For those services YaST can’t control, we’re going to use Webmin, an add-on tool which allows you to control Linux services from inside of a Web browser. This means you have to learn how to use another tool, but it’s still easier than doing configurations from the command line.

A quick look around YaST
Although it is contrary to what many Linux admins would advise, I’m going to log into my SuSE 10.2 machine as root for this setup. I don’t do this often, but it saves me from having to enter the root password each time I perform an administration task.
Once you are done setting up these services, log out.

The first thing you’ll want to do is to select the Computer menu

The new GNOME 2.16 menu is quite a change from the usual cascading menu.

From the menu, select Control Center.
The Control Center is grouped in both Groups and Common Tasks.

From the Common Tasks section, select Administrator Settings to open the YaST
Admin Tool. You’ll see a screen similar to the figure below

It should be obvious that Network Services is your next destination.

Select Network Services to reveal a listing of the various Network Services that can
be configured from within YaST.
A nice collection of GUI tools to help you configure your Linux server.

Working with Webmin
There are a number of ways to go about the installation of Webmin, but the easiest and most consistent method of installing Webmin is from source. To get the source tarball, go to sourceforge site for the latest release. Once you have that file downloaded, you are going to untar the archive with the command tar xvzf webmin-1.310.tar.gz.

Now cd into the newly created webmin-1.310 directory. Inside this directory is the setup script to install Webmin. From within this directory, run the command ./setup.sh /var/www/html/webmin (where /var/www/html/webmin is the directory you wish to install
Webmin into).
Note: The /var/www/html/webmin directory does not have to exist, because the Webmin setup script will create it for you.

While the installation script is running, it is going to ask you the following:
  • Webmin configuration directory
  • The location at which Webmin will store logs
  • Path to Perl
  • Your server OS (Webmin tries to detect this)
  • The port Webmin will run on (defaults to 10,000)
  • The username and password to log in to Webmin
  • Your server’s hostname (Webmin tries to detect this)
  • SSL usage; should only prompt if Perl’s SSL libraries are installed (this author has not run Webmin under SSL)
  • Whether you want Webmin to start with system boot (highly recommended)
An interesting gotcha: During installation on Fedora Core 6, I was only asked for the installation directory. I was not prompted for a password, server hostname, server OS, port number, path to Perl, or SSL usage. Initially, it caused many an eyebrow lift when I logged into the site without an admin password.

I tried using the root username and password for my system; it worked. I attribute
this to Webmin being previously installed (but not run) via RPM. After the installation
script completed, it informed me:
Webmin has been installed and started successfully. Use your web browser to go to
http://localhost.localdomain:10000/
and login with the name and password you entered previously.
Because Webmin uses SSL for encryption only, the certificate it uses is not signed by one of the recognized CAs such as Verisign. When you first connect to the Webmin server, your browser will ask you if you want to accept the certificate presented, as it does not recognize the CA. Say yes.
The directory from the previous version of Webmin /usr/libexec/webmin Can now be safely deleted to free up disk space, assuming that all third-party modules have been copied to the new version.


The last section of the presented information was a good hint as to why I was not given the chance to set up an admin.
Now that Webmin is installed, it’s time to take a peek around and see what it has to offer.

Logging in
As stated above, you may have to log in with your root username and password.
Once logged in, you will be greeted with the Webmin main page.

Webmin’s main administration page.

From there, the first place to visit is the Webmin Configuration screen.

Here you can configure Webmin options.

Security configurations
From within the Webmin configuration screen, there are a number of items you will want to set up. Obviously, security for such a tool is high on the list. Select the IP Access Control link to set up a list of allowed or denied hosts; this prevents password guessing. You may have set up a rigid password that’s a mixture of alpha and numeric characters (as well as upper and lower case), but eventually someone’s going to crack it.

To add one more layer of security, set up this list so you allow only specific IP addresses to access the tool. Make sure you include any known safe IP address that will be needing access to the Webmin interface. All other hosts are denied.

Along this same line of security, select the Trusted Referrers link. From here, you can configure Webmin’s referrer-checking support, which ensures that malicious links from other sites cannot trick your browser into doing dangerous things with Webmin. In this section, there is a text area where you can enter trusted sites, a radio selection, and a check box. The radio selection allows you to choose to Enable Referrer Checking, and the check box allows you to select to Trust Links From Unknown Referrers.

From everything I’ve read and experienced, the default configuration for Webmin is pretty secure. For those working with mission-critical servers, however, it might befit you to uncheck the Trust Links From Unknown Referrers box, and configure some trusted Web sites.

The next step in securing Webmin is enabling the system to use SSL tunnels; this will allow remote login without passing unencrypted passwords across the ether. However, there are steps that must be taken before this feature can be used. First, OpenSSL must be installed; on many newer distributions, this is already taken care of. If not, then download the most recent OpenSSL from rpmfind and run the command (as root) rpm -ivhopenssl-XXX.rpm (where XXX is the release number).

With OpenSSL installed, you must install the Net::SSLeay Perl module. Download this module from the Net::SSLeay site, untar the archive with the command tar xvzf Net_SSLeay.pm-XXX.tar.gz (where XXX is the release number), change into the newly created Net::SSLeay directory, run the command perl Makefile.PL, and run the command make install.

To test the installation, run the command:perl -e ‘use Net::SSLeay’. If no errors are reported, you are good to go.

Select the SSL Encryption link from within the Webmin Configuration page, and you should see the following text, indicating SSL is working properly:
The host on which Webmin is running appears to have the SSLeay Perl module installed.

The first thing you want to verify is whether Enable SSL If Available? is checked. If it is, then you should now be able to log in to your Webmin site with the URL https://localhost.localdomain:10000/.

Your Webmin login is now encrypted.

Webmin users
Creating Webmin users is a very important task and should not be taken lightly. It’s necessary to grant users access to various aspects of your Webmin server (especially if your company’s server farm can not be administered by one person alone).

However, as in any good UNIX environment, users should be created and maintained wisely. To make this an easier task, I suggest creating groups to suit your needs. Say, for example, you have an IT team that needs access to the Webmin interface. From the Webmin main menu, select Webmin Users. Inside this page, Webmin Groups can be administered. Select Create New Webmin Group to create a new group.

From the list of options, select which modules the IT group needs to have access to, and press Save. Now, go to the Create Webmin User section, and create a new user. During this configuration, select the IT group from the Member Of Group list. There are some nice configuration options here, such as allowing users access to the site only on given days and times. Once you Save, the user will be created, and the user will inherit all of the options from the IT group.

Read more!

Thursday, December 6, 2007

Tweaks, tricks, and hacks to make Windows Vista faster

Every operating system could stand some tweaking. No matter how many developers you throw at an OS as complicated as Windows Vista, power users will always find something they can modify or hack to make it run faster, or better, or just differently. Here are just a few of the Windows Vista tweaks, tricks, and hacks discovered so far.

1. Add the Run command to the Start Menu

Beginning way back with the release of Windows 1.0, Microsoft has been all about the GUI interface (more or less effectively). But sometimes you just want to run a program without having to navigate the GUI maze of menus and folders. Windows Vista, by default, does not include the Run command on the Start Menu. This was a common and favorite feature of Windows XP.

To add the Run command back to the Vista Start Menu, follow these steps:

  1. Right click the Taskbar in an open area
  2. Click on Properties
Click on the Start Menu tab (See Figure)

Taskbar and Start Menu Properties

3. Click the Customize button to get to the Customize Start Menu

Scroll down the list until you find the Run command checkbox and check it (See Figure).

4. Click OK and the Run command will now appear on the Start Menu.

Customize Start Menu

2. Disable the Welcome Center and Sidebar

The Windows Vista default setting is to show the Welcome Center on startup. While the Welcome Center is mildly interesting the first time you see it, you will quickly tire of it appearing every time you boot your Vista PC. This behavior is easily changed by unchecking the Run a Startup button located at the bottom of the Welcome Center as shown in Figure.

Welcome Center

Similarly, the Vista Sidebar is also on by default. While some users will find the Sidebar and its widgets useful, many will desire the desktop real estate and underlying resources for other more productive uses. You can turn the Sidebar off by:
  1. Right clicking the Windows Sidebar icon in the system tray
  2. Click Properties
  3. Uncheck the Start Sidebar when Windows starts checkbox (See Figure)
  4. Click OK

Windows Sidebar Properties

3: Change the Product Key

A Windows Vista installation disk essentially has all of the various editions of Vista included on that one disk. Which version gets installed is dependent on what product key you enter during the installation process. At some point you may want to upgrade your current version to a version with more bells and whistles, which would require a new Product Key.

Or you may want to Activate your Windows Vista under a different Product Key for some reason. The easiest way to change your Product Key is through the System applet in the Control Panel.

System applet

Under the Windows Activation section there is a link: Change Product Key. Clicking that link brings up the screen shown in Figure where you can enter in a different Product Key.

Windows Activation

4: Start Windows Explorer at somewhere other than documents


While Windows Vista has desktop search that will theoretically allow you the option of merely typing in a location on your hard disk to get an Explorer view, some users will undoubtedly prefer to use Windows Explorer. By default, Windows Explorer in Vista shows you the files located in the user Documents folder. Follow these steps to have Windows Explorer start in a different folder:

1. Copy the Windows Explorer shortcut, usually found in the Start Menu under Accessories, to the Desktop.
2. Right click the shortcut and click properties.

3. Click on the Shortcut tab to get the window shown in Figure.

Windows Explorer Properties

4. Change the Target filed to the desired location.

For example, to have Windows Explorer start at C:\ type in"
C:\Windows\explorer.exe /n, /e, c:\

5. Click OK

5: Privacy tweak

As a convenience, Windows Vista by default saves and displays a list of recently opened files and programs on the Start Menu. Ostensibly, this is supposed to make it easier to find a file or program. However, many users would prefer that information to remain hidden. Here is how to turn it off:

1. Right click the Taskbar and click Properties on the resulting menu
2. Click the Start Menu tab
Uncheck the checkboxes under Privacy (See Figure)
3. Click OK

Privacy settings

6: Smaller icons on Start Menu

The icons located on the Windows Vista Start Menu default to large.

Large icons

For many users, the personal preference will be for those icons to be much smaller. Here is how:

1. Right click the Taskbar and click on Properties
2. Click the Start Menu tab
3. Click the Customize button
4. Scroll down to the bottom of the list
5. Uncheck the Use large icons checkbox
6. Click OK twice

No more large icons

7. Add Internet Explorer to the Vista Desktop


For some reason known only to the Windows Vista development team, there is no easy option to add the Windows Explorer icon to the Vista Desktop. You can add Computer, Recycle Bin, and the Control Panel --- perhaps someone can explain that to us. In the meantime, if you want to add Internet Explorer you can do it with a Registry hack. Before editing the Windows Registry it is always advisable to make a backup of the Registry file.

1. Click the Start button
2. Open the Run dialog box (or type regedit in to the search box on the Start Menu)
3. Type in regedit and press Enter
4. Navigate to the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel
5. Create a new DWORD 32-bit by right clicking in the key area
6. Copy this as the key name including the brackets:
{871C5380-42A0-1069-A2EA-08002B30309D}
7. Close regedit
8. Right click on the Desktop and click the Refresh menu entry --- Internet Explorer should now appear.

Regedit Internet Explorer
8: Change Security Center notifications

One of the most often leveled criticisms of Windows has been its lack of security. To overcome that perception Microsoft had programmed Vista to complain loudly and often if it discovers your malware, firewall or virus protection software is off or requires maintenance. For many users, the constant badgering to update your virus definitions is more annoying then effective. To calm Vista down a bit you can change the way you are notified of potential lax security.

Open the control panel and click the Windows Security Center.

Windows Security Center

Click the link Change the way Security Center alerts me to reach the dialog box
Choose you preference for notification

Chose your preference

9: Set Folder options

One of the first things experienced users change when they get a new Windows computer is change the Folder View options to a preferred setting. Windows Vista is no exception to this rule.

1. Open the Control Panel and click on the Folder Options icon
2. Click on the View tab

Folder options

3. Check or uncheck your folder preferences --- some suggestions:
  • Check show hidden files and folders
  • Uncheck Hide extensions for known file types
  • Uncheck protected operating system files

10: Adjust power settings

By default, Windows Vista sets the power options to what it calls a "Balanced" plan. While for many users this plan will be adequate, there are many who will want to make adjustments. For laptop users specifically, settings can vary greatly when operating on battery power versus plugged into an outlet. To adjust power settings:

Open the Control Panel and then click the Power Options icon

Power Options

Click on the Change Plan Settings under one of the default plans to make changes

Power settings

For additional fine tuning click Change advanced power settings

Advanced power settings

11: Reduce Desktop Icons

By default, the Windows Vista Aero GUI uses what it classifies as "Medium" icons on the Desktop. Medium in this case is really quite large. (There is also a Large icon setting, but we won't go there.) To bring the icons back to a less eye-popping size:

1. Right click on the Desktop
2. Choose the View menu item
3. Change to Classic Icons

Classic

12 Add another time zone

For many of us working away from home offices at satellite offices, home or on the road, knowing the time across various time zones can be a necessary evil. Windows Vista will allow you to keep time in two additional time zones to the machine time.

1. Right click on the time display located in Taskbar System Tray
2. Select the Adjust Date/Time menu item
3. Click on the Additional Clocks tab

Add clocks
4. Choose a time zone
5. Click the checkbox next to Show this clock
6. Click OK

Now when you mouse over the time in the Taskbar System Tray you will get the time in your chosen time zones.

Read more!

Wednesday, December 5, 2007

How to Overcome multimedia hurdles in Linux

For many, one of the biggest hurdles preventing them from adopting Linux is the difficulties that arise when it comes to dealing with multimedia. In most cases, the Linux multimedia experience is still not like Windows or OS X, where you can click on a file and the player just opens and plays the video or audio clip. In the Linux world, you need to ensure the proper software is installed. When everything is in the right place, the magic will happen.

What's the problem?
Unfortunately, getting the magic to happen isn't always as simple as we'd like it to be, but it's not impossible. In some instances with certain players, getting files such as WMV files is quite simple. In others, however, it can be a nightmare. However, even the nightmare has come a long way from the days of trying to get Windows Media Player to work with Wine. Now it's as simple as getting MPlayer or Totem to work with the correct codecs (devices that enable either the encoding or decoding of a digital signal). It is with these codecs that Linux is given the ability to play audio and video files; they are not typically installed by default, so the codecs enable Linux to play files that were historically only playable with the Windows Media Player (or another Windows equivalent).

Before we get into codecs, I'll introduce the major players in the Linux multimedia party.

MPlayer

MPlayer (Graphic Minimalistic Player) is one of the more popular -- but not the best -- media players for Linux. MPlayer has been around for a while; near the beginning of its existence, it looked as if it was destined to be the standard for Linux multimedia.

However, something happened along the way, and the bugs started flying on an apocalyptic scale. Like all good open source applications, the bugs were squashed; but unfortunately by this time, better players had popped up on the market (more on these later). MPlayer isn't worthless; I still use MPlayer for many files. For me, it's been easier to resolve many problems with MPlayer than with other applications.

Installing MPlayer is simple: on a yum-based system, run the command (as root) yum install gmplayer; on an apt-get based system, run the command apt-get install gmplayer. Once MPlayer is installed, you can run the player either from the Sound And Video menu (GNOME start menu), or from the KDE Multimedia entry in the start menu. Once the player is open, you'll see something similar to Figure

The out-of-the-box MPlayer GUI is certainly user friendly.

There's very little to explain about MPlayer that the average user won't be able to figure out. There are, however, some things to note. First, ensure that you're using the correct audio and video drivers. Figure shows the configuration screen for the video drivers.

You'll configure everything you need for MPlayer from this window.

The video driver you use must work with the drivers installed for your video card. If you don't have a gl-compatible video card (or a lower-end card) and you select a gl-based driver, your machine could come to a screeching halt. If you're not sure which driver you're using, take a look at your xorg.conf file (as root) and check the "Device" section; this will look similar to:

Section "Device"

Identifier "Videocard0"

Driver "nvidia"

Option "HWcursor" "false"

The line to look for is the Driver line. In my case, I'm obviously using the nvidia driver. Another thing to notice in the xorg.conf file is the presence of the glx -- or GLCore --modules in the Modules section. If there are no lines in the Modules section to load the gl-related modules, then using a gl-based driver would be a bad idea. Instead, stick with the safer xv default.

A configuration in MPlayer that always bothers me is that the video window shows even when there's nothing playing, leaving an extra window open. From within the Misc tab of the MPlayer configuration window, you can deselect this option. Another small issue: When you change a configuration, you have to restart MPlayer for the configuration to save.

VLC
VLC (VideoLan Client) is quickly becoming one of the most popular Linux video playback applications. (Note: Of all the multimedia applications I have used, VLC is by far the best.) VLC is a cross-platform system; there are binaries for Linux, Windows, and OS X. VLC supports a huge amount of file formats; probably the most of any player, no matter the platform.

Installing VLC is as simple as any other applications. With a yum-based distribution, run the command yum install vlc and with an apt-based distribution run the command apt-get install vlc. Both package managers will pick up the dependencies and install the system.

Running VLC can be done from either from the command line by running the command vlc or from the KDE Multimedia menu or from the GNOME Sound And Video menu. When you run VLC, you'll only see a small window, shown in Figure, from which you do everything.

To open a file, press the button that would normally serve as the Eject button.

A nice feature with VLC is that the equalizer actually works and works real time. To open the equalizer, press the Equalizer button on the main VLC window, as shown in Figure.

The EQ button is easy to miss.

Once the EQ is open, you first have to enable it by pressing the Equalizer Status button. You'll see this in Figure.

You know it's on if the buttons are glowing blue.

Simply move the sliders associated with the frequency you want to change.

VLC is also outstanding at playing music. You can create playlists by opening the playlist window, adding files, and saving the playlist (you can also do this with video). VLC can also serve as a DVD player as well.

XMMS

For a long time, XMMS reigned as the king of MP3 players on Linux. Known as Winamp on the Windows platform, this player was (and is) an outstanding means for playing various file formats.

However, once the MP3 file format became restricted, no Linux distribution would ship with MP3 support included. So if you want to play MP3 files on your Linux distribution, you'll have to roll in support for it. To do this for XMMS, follow the subsequent steps.

With a yum-based distribution (as root), run the commands:

yum install xmms-mp3

This should get the matching xmms-mp3 file for your already-installed XMMS installation. If it complains that the files aren't the same, remove it with yum remove xmms, and then run the command:

yum install xmms xmms-mp3

You should now be good to go.

With apt-get, you should be able to do this with the command:

apt-get

install xmms xmms-mp3

The XMMS application should be self-explanatory.

Totem
Totem is the default multimedia player with any GNOME-based distribution; this is an issue for many, since Totem seems to wince at playing nearly anything. Even with all the codecs in place, Totem can not play popular file formats, such as WMV files. That's too bad, because Totem is actually quite a good player. However, with the installation of a simple plug-in, you can at least get Totem to play MP3 files. To do this, issue (as root) the command:

yum install gstreamer-plugins-ugly

or

apt-get install gstreamer-plugins-ugly

I've only managed to get Totem to read WMV files on an Ubuntu 7.10 installation. By installing the codecs as you would for any of the players, it works, but only on Ubuntu. I have had no luck with Fedora.

Codecs
There are a number of files that need to be installed for this method; after all, we're installing files to help support different file formats for numerous players. However, this process has been made simple by standardization.

In order to get the necessary codecs, visit the MPlayer site and download the binary codec package. The file will be in a BZ2 format, so you'll have to run the following command:

bunzip2 essential-XXX.tar.bz2

where XXX is the actual release number.

Now unpack the file with:

tar xvf essential-XXX.tar

where XXX is the actual release number.

Now cd into the newly created directory and, as root, issue the command:

cp * /usr/lib/codecs/

Now your multimedia players will support the once-dreaded WMV format in Linux.

What about Firefox?
Getting multimedia support in Firefox really isn't difficult. If you visit the Common Plugins for Firefox page, you'll see all the necessary plug-ins (along with installation documentation).

Command-line players
I would be remiss if I didn't at least mention that there are numerous command-line players for multimedia. Let's visit the short list:
  1. mplayer: The command-line version of MPlayer (the GUI command is actually gmplayer). To open a media file with this command, simply run mplayer FILE_NAME. If the file is a video, a new window will open with only the video playing. If the file is an audio file, no other window will open. This command is helpful if you need it to be executed in the background by another application.
  2. mpg123: This application is quite useful; it can play as well as convert audio files. If you want to create a playable CD from a collection of MP3 files, you can issue the command mpg123 -w FILENAME.wav FILENAME.mp3, and the resulting WAV file is ready for you.
  3. play: The play command allows you to play WAV and MIDI files in the background. Like mplayer, play is useful for running sounds in the background. I have used play in conjunction with Procmail to play various sounds for different incoming email, which is very handy.

At one time, it was thought that Linux would take a sideline to any other OS when multimedia is concerned, but times have changed: Linux is now a real player in the multimedia sector. Of course, that is not to say there aren't pitfalls: many times, I've come across a site that won't support Linux (even though the file format they stream is supported in Linux, i.e., abc.com).

I remember a time that getting all the necessary multimedia support up and running was a real chore. Now, out of the box, it's all there for you (with the exception of MP3 support, but that's another issue altogether).

If your issue with Linux is multimedia, it should be obvious that it's no longer a problem, so don't think twice about giving Linux a try.

Read more!