linux poison RSS
linux poison Email
1

Modify Images in Linux - Mogrify

The  Mogrify program is a member of the ImageMagick suite of tool, use the mogrify program to re-size an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more. This tool is similiar to convert except that the original image file is overwritten (unless you change the file suffix with the -format option) with any changes you request.

Imagemagick Mogrify is an easy to use, ligte, command prompt tool and capable of editting most of the image types.

Using Mogrify:
If you want to transform all the .tiff images in a directory to .jpg, you can do it with a single command:
mogrify -format jpeg *.tiff

Create thumbnails using this command:
mogrify -geometry 120x120 *.jpg

To reduce the size of any given image, use this command:
mogrify -resize 50% *.jpg

You can resize all your JPEG images in a folder to a maximum dimension of 256x256 with this command:
mogrify -resize 256x256 *.jpg

Convert PNG images to the JPEG format:
mogrify -format jpg *.png

Rotate an Image using this command
mogrify -rotate "-90" test.jpg

Reduce Colours of any given image using this command
mogrify -colors 2 test.jpg

Monochrome the given image using this command
mogrify -monochrome test.jpg

Add Borders to given image using this command
mogrify -border 2x4 test.jpg

Add Annotate to Image using this command
mogrify -comment 'My holiday highlight' test.jpg

Add some more Decorative Border using this command
mogrify -frame 20x20 test.jpeg

For more information about the ImageMagick project, visit http://www.imagemagick.org.
Run ‘mogrify -help’ to get a summary of the mogrify command options.
Read more
3

How to enable Autologin to Linux console using mingetty

The mingetty program is a lightweight, minimalist getty program foruse only on virtual consoles. Mingetty is not suitable for serial lines (you should use the mgetty program instead for that purpose)

If you got the mingetty program, your /etc/inittab file will look like ....
1:2345:respawn:/sbin/mingetty --noclear tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
The first field says that this is the line for /dev/tty1. The second field says that it applies to run levels 2, 3, 4, and 5. The third field means that the command should be run again, after it exits (so that one can log in, log out, and then log in again). The last field is the command that runs mingetty on the first virtual terminal.

The above series of lines also use the "respawn" option to keep six mingetty processes running on the system. If someone tries to kill one of these processes as root, the process will simply be respawned. Only critical processes are set up in this way to keep them safe from anything else happening on the system.

If you're curious about these processes, check them out on the running system using command

$ ps -ef | grep getty

Now to enable the auto loging for a particular user, edit the /etc/inittab file and identify the terminal on which you want user to have auto login ...
1:12345:respawn:/sbin/mingetty --noclear --autologin username tty1
Reboot the system after making above changes and insure that init has spawned the new version of mingetty, and if all is well, will automatically log you on to the console.
Read more
1

Lightweight Monitoring Tool for Servers and Embedded System - Monitorix

Monitorix is a free, open source, lightweight system monitoring tool designed to monitorize as many services as possible. At this time it monitors from the CPU load and temperatures to the users using the system. Network devices activity, network services demand and even the devices' interrupt activity are also monitored, and more.

The current status of any corporate server with Monitorix installed can be accessed via a web browser.
Monitorix has been designed to be used under production UNIX/Linux servers, but due its simplicity and small size you may also use it to monitor embedded devices.

Installation:
Monitorix is under GPLv2 licensing and available for download on the project homepage as source code and in numerous packages. Rpm based system (RedHat / Fedora / Centos / Opensuse) can install Monitorix using command:
rpm -ivh monitorix-1.4.2-1.noarch.rpm
Configuration of Monitorix:
Before starting the monitorix daemon, be sure to adjust the /etc/monitorix.conf to your liking. For a complete list of options and features, see the man page for monitor.conf.

our $TITLE = "Linux Poison";                                 # your company name
our $HOSTNAME = "poison.hell.com"; # hostname of this server
our $OSTYPE = "Linux-SuSE";                 # choose your OS type (see below)
our $SAMBAVER = "3";                         # Samba version (2 or 3)
our $MULTIHOST = "N";                 # Enable multihost feature
our $MULTIHOST_FOOTER = "Y";         # (multihost) display URL in image
our $MULTIHOST_IMGPERLINE = "2";         # (multihost) # of images per line
our $REPORT_LANG = "en";                         # Report language
our $THEME_COLOR = "black";                 # Default is "black", none is "white"
our $REFRESH_RATE = "150";                 # Web stats' refresh rate in seconds
our $ENABLE_CROND_MAIL = "Y";         # Error messages are sent by crond

Common settings to tweak here include company name, hostname, and theme color.
Finally you'll be able to start Monitorix with: # service monitorix start

To view your system stats, make sure your webserver is running and browse to [http://localhost/monitorix] to see the data.

Read more
0

Sending Mail through command line on Linux

Read mail or send mail to other users. The mail utility allows you to compose, send, receive, forward, and reply to mail. mail has two main modes: compose mode, in which you create a message, and command mode, in which you manage your mail.

While mail is a powerful utility, it can be tricky for a novice user. It is most commonly seen nowadays in scripts. Most Linux distributions include several utilities that are richer in features and much easier to use: mailers built into browsers such as Mozilla and Firefox, graphical mail programs distributed with GNOME (Evolution) and KDE (Kmail), and the terminal-based, full-screen utilities pine and elm. The GNU Emacs editor can also send and receive mail.

Below is the mail command through with you can send mail to any given user ...

mail -s "System Log" nikesh@domain.com

This command sends a message to the user nikesh, with a subject line of "System Log" and the text of the message read from the system logfile /var/log/messages.

Below are few other command line option that you can use with the mail command ...

-s    Specify subject on command line.
-c    Send carbon copies to list of users.
-b    Send blind carbon copies to list. List should be a comma-separated list of names.
-f    Read in the contents of your mbox for processing; when you quit, mail writes undeleted messages back to this file.
-i    Ignore tty interrupt signals. This is particularly useful when using mail on noisy phone lines.
Read more
0

Linux Filesystem Benchmark using Blogbench

Blogbench is a portable filesystem benchmark that tries to reproduce the load of a real-world busy file server. It stresses the filesystem with multiple threads performing random reads, writes, and rewrites in order to get a realistic idea of the scalability and the concurrency a system can handle.

It stresses the filesystem with multiple threads performing random reads, writes and rewrites in order to get a realistic idea of the scalability and the concurrency a system can handle.

Installation:
Download blogbench from here and type the following command to compile and install blogbench

# tar xvzf blogbench-1.1.tar.gz
# cd blogbench-1.1
# ./configure
# make
# make install

Using Blogbench:
The minimal way to run the test is to just give the path to an *empty* and writable directory:
# blogbench -d /path/to/the/directory
Blogbench will start the required threads and the test will run during 5 minutes. A final "score" will then be given as an indication of read and write performance.

Read more
Related Posts with Thumbnails