Important for LPI 117-101
Cropping Multiple Images in the Same Way
by lpilinuxblog on Jul.03, 2010, under Important for LPI 117-101
‘Getting the right cropping values using GIMP
In 5 steps:
Where to find the cropping values
1. Open up GIMP.
2. Open one of the images in GIMP.
3. Using the Rectangle Select Tool (hotkey “R”), select the area you want to be cropped.
4. Note the X, Y, Width and Height values GIMP gives you (have a look at the picture, you can find them in the GIMP main window).
5. Close GIMP (or leave it open if you plan to use it again soon).
Creating an mpeg with mencoder that plays on Windows Media Player
by lpilinuxblog on Jul.03, 2010, under Important for LPI 117-101
‘Let’s have a look at a rather simple mencoder command that should create a WMP-compatible MPEG file:
[rechosen@localhost ~]$ mencoder
-oac lavc -ovc lavc -lavcopts acodec=mp2:vcodec=mpeg2video:mbd=1:vbitrate=1800 -of mpeg -o
Replace “
” with the video source (for example a file or a DVD scene) and “
If Condition in Bash Script
by lpilinuxblog on Jul.03, 2010, under Important for LPI 117-101
‘If you use bash for scripting you will undoubtedly have to use conditions a lot, for example for an if … then construct or a while loop. The syntax of these conditions can seem a bit daunting to learn and use. This tutorial aims to help the reader understanding conditions in bash, and provides a comprehensive list of the possibilities. A small amount of general shell knowledge is assumed.
Difficulty: Basic – Medium
Introduction
Bash features a lot of built-in checks and comparisons, coming in quite handy in many situations. You’ve probably seen if statements like the following before:
How to Prevent damage after system lockup?
by lpilinuxblog on May.24, 2010, under Important for LPI 117-101
No matter how stable the Linux kernel is, things like hardware failures can still lock up your system quite effectively. If you ever encounter a case like that, rebooting is pretty much the only option. However, there is rebooting and rebooting. This solution describes a way to reboot your system that will do things like terminating all processes, syncing the remounting the disks, in order to prevent damage as much as possible. This can save you a lot of fscking and data loss.
What this is and what this isn’t
Bash Script – Full Tutorial
by lpilinuxblog on May.24, 2010, under Important for LPI 117-101
If you use bash for scripting you will undoubtedly have to use conditions a lot, for example for an if … then construct or a while loop. The syntax of these conditions can seem a bit daunting to learn and use. This tutorial aims to help the reader understanding conditions in bash, and provides a comprehensive list of the possibilities. A small amount of general shell knowledge is assumed.
Difficulty: Basic – Medium
Introduction
Bash features a lot of built-in checks and comparisons, coming in quite handy in many situations. You’ve probably seen if statements like the following before:
How to translate, squeeze and delete characters using tr in Linux
by lpilinuxblog on May.23, 2010, under Important for LPI 117-101
Translate, squeeze, and/or delete characters from standard input, writ- ing to standard output. -c, -C, –complement first complement SET1 -d, –delete delete characters in SET1, do not translate -s, –squeeze-repeats replace each input sequence of a repeated character that is listed in SET1 with a single occurrence of that character -t, –truncate-set1 first truncate SET1 to length of SET2
mysql command
by lpilinuxblog on May.16, 2010, under Important for LPI 117-101
The mysql program provides a curses-based interface to the SQL-based database server daemon, mysqld(1). Full fuller documentation, refer to the HTML documents installed with the package.
OPTIONS
mzip command
by lpilinuxblog on May.15, 2010, under Important for LPI 117-101
The mzip command is used to issue ZIP disk specific commands on Linux, Solaris or HPUX. Its syntax is:
mzip [-epqrwx]
Mzip allows the following command line options:
e
Ejects the disk.
f
Force eject even if the disk is mounted (must be given in addition to -e).
r
Write protect the disk.
w
Remove write protection.
p
Password write protect.
x
Password protect
u
Temporarily unprotect the disk until it is ejected. The disk becomes writable, and reverts back to its old state when ejected.
q
Queries the status
anemone command
by lpilinuxblog on May.14, 2010, under Important for LPI 117-101
anemone [-display host:display.screen] [-visual visual] [-window] [-root] [-delay number] [-arms number] [-finpoints number] [-width number]
DESCRIPTION
Wiggling tentacles.
OPTIONS
-visual visual
Specify which visual to use. Legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual.
-window
Draw on a newly-created window. This is the default.
-root
Draw on the root window.
-delay number
Per-frame delay, in microseconds. Default: 40000 (0.04 seconds.).
-arms number
Arms. 2 – 500. Default: 128.
-finpoints number
Tentacles. 3 – 200. Default: 64.
-withdraw number
Frequency that the arms withdraw. Arms withdraw on randomly generated values between 1 and 11; this value determines the maximum value of that range. So 100 spends a lot of time withdrawn, while 1000,000 tends not to withdraw at all. Default: 1200.
-turnspeed number
How fast it turns. At zero, not at all, all they way up to thousands which are very fast indeed. Default: 50.
-width number
Thickness. 1 – 10. Default: 2.
alsactl – advanced controls for ALSA soundcard driver
by lpilinuxblog on May.13, 2010, under Important for LPI 117-101
alsactl is used to control advanced settings for the ALSA soundcard drivers. It supports multiple soundcards. If your card has features that you can’t seem to control from a mixer application, you have come to the right place.
INVOKING
alsactl [options] [store|restore]
Commands
store saves the current driver state for the selected soundcard to the configuration file.
restore loads driver state for the selected soundcard from the configuration file.
If no soundcards are specified, setup for all cards will be saved or loaded.
Options
-h, –help
Help: show available flags and commands.