Tech Tips
The versatility of the Linux command line is often underestimated. Tasks, such as sophisticated multimedia processing, need not be done with heavy GUIs that will run only on powerful machines.
The simple Linux command line can do it if you have MPlayer and the companion program mencoder installed on your machine.
mencoder is an extremely powerful program that can record analog and digital television, post-process recorded videos, apply various filters and so on. More information is available in the on-line man pages and HTML documentation that comes bundled with the source.
Here, we are faced with a simple task of converting a color movie to black and white. This line will do it for you:
$mencoder color-video.avi -o black-white-video.avi ↪-vf hue=0:0 -oac copy -ovc lavc
If you are interested in trying out various values for hue and saturation, you can invoke MPlayer with:
$mplayer -vf hue color-video.avi
Press and hold the 5 or 7 keys to reduce hue or saturation.
What follows are some very basic tips. For those who already know this information, I apologize if this insults your intelligence. However, I've looked over many a shoulder of very competent Linux users who still don't seem to know about these standard commands and techniques. If you're one of them, you may find this information extremely useful.
cd -
Almost everyone knows you can type cd ~ to get to the current user's home directory. This isn't a function of cd, but it takes advantage of the fact that the tilde is shorthand for your home directory. The command cd - (dash instead of tilde) is a function of cd, however. It takes you to the last directory where you were working before you switched to the current directory. It also prints out the old directory path. I, myself, have known about this command since the dark ages, but I still curse myself for forgetting to use it and typing out a long path name.
Don't Delete That Service Link
Most Linux distributions still use a directory, such as /etc/rc2.d, to store a number of symbolic links to boot startup files. You probably know that the order is determined by the number that follows the capital letter S. For example, S10acpid starts before S11klogd.
I have seen a number of administrators delete these links in order to disable services temporarily to test something. Then, they grumble when they have to figure out what startup number it used to have when they restore the link.
Don't delete the link; simply rename it. For example, rename S25bluetooth to s25bluetooth. The fact that it starts with a lowercase s will stop the bluetooth service from starting at the next boot. When you've determined that you want bluetooth back, simply rename it back to S25bluetooth. Sure, there are GUI programs to disable and enable services, but the command-line method is so simple. And remember, contrary to conventional wisdom, the lazy way to do something is often the best way.
I run lots of Linux distributions. If you do too, here's the way I install and manage them. If you have a better method, by all means, send it to techtips@linuxjournal.com, and if we use it, you will receive $100 for the tip.
Create a single relatively small ext3-formatted boot partition on your drive that you will use as your master boot partition with GRUB as your bootloader. My partition is 100MB, and it's probably overkill.
This /boot partition will generally reside on the first drive on your system, but it doesn't have to. Install your first distribution with this partition. When everything is working, change the line in /etc/fstab that mounts the /boot partition to mount the partition as /mnt/boot instead. Create the mountpoint called /mnt/boot. Mount the boot partition there. For example:
umount /boot mkdir /mnt/boot mount /dev/sda1 /mnt/boot
Then, copy everything from that partition to what is now the local /boot directory for your distribution:
cp -a /mnt/boot/* /boot
At this point, you still should be able to boot the distribution you just installed, even though the kernel files are relocated. But, that won't last. You need to change part of your menu.lst to specify that the boot files now reside on the same partition as the rest of the distribution. For example, if you started with /boot on /dev/sda1 and / on /dev/sda2, modify your menu.lst file to use the new partition to find the kernel. Here's a sample original:
title Some Linux Distro root (hd0,0)
In our example, you'd change it to this:
title Some Linux Distro root (hd0,1)
This next part is a little tricky, and there are several ways to approach it. For example, you simply could make a copy of your grub/menu.lst file. However, I make a copy of the entire grub directory, because there are a variety of ways you can accidentally run into problems otherwise. Here's what I do next:
cd /mnt/boot cp -a grub grub.original
Now, install your next distribution of Linux in a new partition, but specify the same /boot partition you used to install the first distribution. Boot into the new distribution. Repeat the copy process above.
First, edit the /etc/fstab file to change the entry that mounts /boot to mount it as /mnt/boot. Then, do this:
umount /boot mkdir /mnt/boot mount /dev/sda1 /mnt/boot cp -a /mnt/boot/* /boot
Now, edit /mnt/boot/grub.original/menu.lst to include the boot commands for the new distribution. You can find the boot commands for the new distribution in /mnt/boot/grub/menu.lst. Don't forget to fix the root location again too. Assume that your second distribution is on /dev/sdb1 (the first partition of the second drive). In our example, you would change this:
title Second Linux Distro root (hd0,0)
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- Developer Poll
- Dart: a New Web Programming Experience
- May 2013 Issue of Linux Journal: Raspberry Pi
- What's the tweeting protocol?
- Reply to comment | Linux Journal
3 hours 12 min ago - Reply to comment | Linux Journal
3 hours 59 min ago - Web Hosting IQ
5 hours 33 min ago - Thanks for taking the time to
7 hours 10 min ago - Linux is good
9 hours 7 min ago - Reply to comment | Linux Journal
9 hours 25 min ago - Web Hosting IQ
9 hours 55 min ago - Web Hosting IQ
9 hours 55 min ago - Web Hosting IQ
9 hours 56 min ago - Reply to comment | Linux Journal
12 hours 56 min ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.




Comments
hi
i am very interested in linux now.
hi
hi i am starting to learn linux base platform. hope i can understand it