Red Hat, and their community effort, Fedora, are more or less enterprise-oriented. That being said, it's only natural they offer enterprise-specific tools that don't quite make sense on other desktop oriented operating systems. In the enterprise environment, where the system administrator has to manage lots of machines and installations, one tool that helps a lot is one that facilitates automated installations on several computers, using the same options for each of them. Instead of installing each system separately, the administrator just boots the installation media, tells the system where to find the options for installation and comes back after an hour to check on the system. It's a tremendous advantage in terms of time and effort, especially when dealing with lots of systems. Just like HP-UX offers Ignite or OpenSUSE offers AutoYAST, Red Hat/Fedora offers Kickstart. You will learn what that is, how to get the best of it and how to use the newly created Kickstart file. We assume basic knowledge of Linux and we recommend you try this in a virtual machine first before going into production.
Beginning work with Kickstart
We want to make a few practical points before diving into the article, so you know what's available and how/when to use it. First of all, we assume you have a Fedora installation (or Red Hat, but we tested this on our Fedora 16 box), up-to-date and ready to use. You will see, if you look in root's home folder, that you have a file there called anaconda-ks.cfg. That's the Kickstart file generated by Anaconda when (or, better said, after) you installed your system. It contains your options like partitioning or package selection. We recommend you use your favorite text editor to browse it in order to get familiar with the syntax, which isn't complicated at all.
Second, Fedora offers an utility named system-config-kickstart, which is a small GUI program that takes you through each and every part of the install options and, after you're done, offers you the possibility to save the file to be used as you wish.
Now, it's obvious that, at least for starters, you'll be better off using this utility instead of manually writing ks files. However, there are some drawbacks. We usually recommend the use of the command-line, because it's bound to work without X, without local access (think about a long-distance connection with ssh - you wouldn't want to use X there), and, in the end, you will learn something new and cool that will help you a great deal when dealing with Red Hat-based systems. So, we recommend starting with the GUI and slowly migrating to a text editor and the Fedora documentation for writing your own Kickstart files. We'll focus on the latter approach for the rest of the article, for reasons exposed above, but we'll start with the GUI-generated ks.cfg and go from there.
Read more ...
If you think that you can do Linux System administration without cut command, then you are absolutely right. However, mastering this fairly simple command line tool will give you a great advantage when it comes to the efficiency of your work on a user as well administration level. To simply put, cut command is one of many text-filtering command line tools that Linux Operation System has to offer. It filters standard STDIN from another command or input file and sends the filtered output to STDOUT.
Frequently used options
Without too much talk let's start by introducing main and the most commonly used cut command line options.
- -b, --bytes=LIST
Cuts the input file using list of bytes specified by this option
- -c, --characters=LIST
Cuts the input file using list of characters specified by this option
- -f, --fields=LIST
Cuts the input file using list of field. The default field to be used TAB. The default behavior can be overwritten by use of -d option.
- -d, --delimiter=DELIMITER
Specifies a delimiter to by used as a field. As mentioned previously default field is TAB and this option overwrites this default behavior.
List in this case can consist of single or range of bytes, characters or fields. For example to display only second byte the list will include a single number 2 .
- 2 will display only second byte, character or field counted from 1
- 2-5 will display all bytes, characters or fields starting from second and finishing by 5th
- -3 will display all bytes, characters or fields before 4th
- 5- will produce all bytes, characters or fields starting with 5th
- 1,3,6 will display only 1st, 3rd and 6th byte, character or field
- 1,3- displays 1st and all bytes, characters or fields starting with 3th
Read more ...
QuestionHow can I batch resize multiple images using Linux command line? Is there any tool which would help me with this and/or is there GUI application which makes image resizing easy. I have hundreds of images and therefore I'm in the need for such a tool which I also can use in combination with shell scripting.
AnswerThe best and the easiest way to resize multiple images using linux command line is to use
imagemagick tools. First you need to install
# apt-get install imagemagick
Once installed, you will have multiple image processing tools available to our disposal, such as convert, identify and etc.
identify command will help you to get some image information and convert will help you to convert images between hundreds of different image formats as well as it will easily resize any image submitted as an argument.
Let's suppose that our current working directory contains multiple image files with extension *.jpg . To resize all images to a half size of their original size we can combine bash for loop and convert command together in a following manner:
$ for i in $( ls *.jpg); do convert -resize 50% $i re_$i; done
The command above will resize all images to half of its original size. New resized images will be saved with a prefix "re_". It is also possible to resize all images and at the same time convert them to gif format:
$ for i in $( ls *.jpg); do convert -resize 50% $i $i.gif; done
When it comes to GUI application which are able of batch image resizing you might look at Converseen .