- Bash Script: Get the length of any given String

Below is a simple script to get the length of any string.

#!/bin/bash
echo "enter the sting: "
read str;

countStringLength() {
        echo `echo -n $1 | wc -c`

        # Or can use the below trick to get the string length
        # I prefer to use the first one - easy to use and easy to remember
        echo ${#1}
}
countStringLength $str




source:http://linuxpoison.blogspot.com/2012/05/13578167751853.html

- Bash Script: Check if variable is integer or not

Below is a simple bash script to check if any given number is integer or not ...

#!/bin/bash
echo "Enter the value: ";
read num;
checkInteger(){
        if [ $1 -eq $1 2> /dev/null ]; then
                echo "$1 is a integer"
        else
                echo "$1 is not a integer"
        fi
}
checkInteger $num



source:http://linuxpoison.blogspot.com/2012/05/135781677510764.html

- Bash Script: Increment the loop by some value on each iteration

Below is the simple bash script which show the way of incrementing the for loop by the value of "2" on each iteration:


#!/bin/bash
for i in {1..10..2}
do
    echo $i
done

=== Output ====
1
3
5
7
9




source:http://linuxpoison.blogspot.com/2012/05/135781677511298.html

- Web Application Vulnerability Scanner - Webvulscan

WebVulScan is a web application vulnerability scanner. It is a web application itself written in PHP and can be used to test remote, or local, web applications for security vulnerabilities. As a scan is running, details of the scan are dynamically updated to the user. These details include the status of the scan, the number of URLs found on the web application, the number of vulnerabilities found and details of the vulnerabilities found.

After a scan is complete, a detailed PDF report is emailed to the user. The report includes descriptions of the vulnerabilities found, recommendations and details of where and how each vulnerability was exploited.

The vulnerabilities tested by WebVulScan are:
 * Reflected Cross-Site Scripting
 * Stored Cross-Site Scripting
 * Standard SQL Injection
 * Broken Authentication using SQL Injection
 * Autocomplete Enabled on Password Fields
 * Potentially Insecure Direct Object References
 * Directory Listing Enabled
 * HTTP Banner Disclosure
 * SSL Certificate not Trusted
 * Unvalidated Redirects

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/05/13578167757918.html

- Bash Script: Check Servers Availability using ping command

Here is the simple bash script to check the server availability using simple ping command, for this you need to create a simple txt file ("server.txt") containing the hostname or ip address of the servers that you want to check ...

$ cat server.txt
google.com
yahoo.com
redhat.com
 
$ cat pingalert.sh
#!/bin/bash
# Read the file line by line
cat server.txt | while read line
do
        # check if there are no blank lines
        if [ ! -z $line ]; then
                PINGCOUNT=2
                PING=$(ping -c $PINGCOUNT $line | grep received | cut -d ',' -f2 | cut -d ' ' -f2)
                if [ $PING -eq 0 ]; then
                        echo "Something wrong with the server: $line"
                        # Or do send out mail
                else
                        echo "All good: $line"
                fi
        fi
done

Output: $ ./pingalert.sh
All good: google.com
All good: yahoo.com
All good: redhat.com




source:http://linuxpoison.blogspot.com/2012/05/135781677513232.html

- Lightweight Email reader for the GNOME desktop - Geary

Geary is a lightweight email reader for the GNOME desktop.

Geary includes the following features:
 * Basic support for viewing and composing HTML email
 * Send and receive email
 * Reply to all and forward email
 * Optional spell checker
 * Keyboard shortcuts
 * Organizes emails into conversations
 * Supports Gmail and Yahoo
Continue Reading...


source:http://linuxpoison.blogspot.com/2012/05/135781677514868.html

- Bash Script: Create simple select menu using select statement

Here is simple bash script which creates an simple options selection menu using bash 'select' statement, fee free to modify/copy and use this script to suite your requirement.

$ cat select.sh
#!/bin/bash

# Selection menu items goes here
SELECTION="option1 option2 option3 quit"

select options in $SELECTION; do

# here using the if statements you can perform the required  operation
if [ "$options" = "option1" ]; then
    echo "You have selected $options"

elif [ "$options" = "option2" ]; then
    echo "You have selected $options"

elif [ "$options" = "option3" ]; then
        echo "You have selected $options"

elif [ "$options" = "quit" ]; then
        echo "You have selected $options"
    exit

# if something else is selected, show the menu again
else
    clear;
    echo "please select some options"

fi
done

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/05/135781677512872.html

- Bash Script: Creating and using Read-only variables

Here is an simple bash script showing the trick to create the read-only variable, feel free to copy and use this script.

$ cat declare.sh
#!/bin/bash

# Declare the variable as readonly
declare -r AGE=25
echo $AGE

# Try to change the value of this readonly variable
# you should get an error message
AGE=34
echo $AGE

Output: $ ./declare.sh
./declare.sh
25
./declare.sh: line 9: AGE: readonly variable
25




source:http://linuxpoison.blogspot.com/2012/05/13578167754992.html

- Bash Script: File related operations

Following table describe the operation that you can perform on any given file.

[ -a FILE ]    True if FILE exists.
[ -b FILE ]    True if FILE exists and is a block-special file.
[ -c FILE ]    True if FILE exists and is a character-special file.
[ -d FILE ]    True if FILE exists and is a directory.
[ -e FILE ]    True if FILE exists.
[ -f FILE ]    True if FILE exists and is a regular file.
[ -g FILE ]    True if FILE exists and its SGID bit is set.
[ -h FILE ]    True if FILE exists and is a symbolic link.
[ -k FILE ]    True if FILE exists and its sticky bit is set.
[ -p FILE ]    True if FILE exists and is a named pipe (FIFO).
[ -r FILE ]    True if FILE exists and is readable.
[ -s FILE ]    True if FILE exists and has a size greater than zero.
[ -t FD ]        True if file descriptor FD is open and refers to a terminal.
[ -u FILE ]    True if FILE exists and its SUID (set user ID) bit is set.
[ -w FILE ]   True if FILE exists and is writable.
[ -x FILE ]    True if FILE exists and is executable.
[ -O FILE ]    True if FILE exists and is owned by the effective user ID.
[ -G FILE ]    True if FILE exists and is owned by the effective group ID.
[ -L FILE ]    True if FILE exists and is a symbolic link.
[ -N FILE ]    True if FILE exists and has been modified since it was last read.
[ -S FILE ]    True if FILE exists and is a socket.




source:http://linuxpoison.blogspot.com/2012/05/13578167754558.html

- Powerful Text Editor for Markdown and reStructuredText - ReText

Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

Thus, “Markdown” is two things:
 * A plain text formatting syntax
 * A software tool, written in Perl, that converts the plain text formatting to HTML.

reStructuredText is an easy-to-read, what-you-see-is-what-you-get plain text markup syntax and parser system. It is useful for in-line program documentation (such as Python docstrings), for quickly creating simple web pages, and for standalone documents. reStructuredText is designed for extensibility for specific application domains. The reStructuredText parser is a component of Docutils.
Continue Reading...


source:http://linuxpoison.blogspot.com/2012/06/135781677518791.html

- Bash Script: Read the passwod without showing on the screen

Here is an simple bash script which reads the password value from a user and does not show the same on the screen.

Feel free to modify and use this script.

Source:
$ cat readpass.sh 

#!/bin/bash
echo -n "Enter your username: ";
read username
echo -n "Enter your passwd: "
read -s passwd
echo
echo "$username, your passwd is $passwd";

Output:  
$ ./readpass.sh
Enter your username: nikesh
Enter your passwd:
nikesh, your passwd is linuxpoison




source:http://linuxpoison.blogspot.com/2012/06/1357816775834.html

- Creating Labels and Business Cards - gLabels

gLabels is a program for creating labels and business cards for the GNOME desktop environment. It is designed to work with various laser/ink-jet peel-off label and business card sheets that you'll find at most office supply stores. gLabels is free software and is distributed under the terms of the GNU General Public License (GPL).

Installing Glabels:
Glabels package is available in the default available repository under Ubuntu, you can search "Glabels" and install it using Software Center or can install it using command:
sudo apt-get install glabels
After successful installation, you can open the glabels application from Unity 'Dash'

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/06/13578167754818.html

- Bash Script : Iterate over command line arguments

Below is simple bash script to calculate the average of integer numbers passed to the script from the command line arguments.

$#  - give the value of total number of argument passed to the script
$@ - using this we can  Iterate over command line arguments.

$ cat average.sh
#!/bin/bash

SUM=0
AVERAGE=0
ARG=$#
for var in "$@"; do
        if [ "$var" -eq "$var" 2>/dev/null ]; then
                if (( "$var" == 0 || "$var" > 100 )); then
                        echo "Invalid entry (ignored): $var"
                        ARG=$(($ARG-1))
                else
                        SUM=$(($SUM+$var))
                fi
        else
                echo "Invalid entry (ignored): $var"
                ARG=$(($ARG-1))
        fi
done
echo
AVERAGE=$(($SUM/$ARG))
echo "Average is : $AVERAGE"
echo

Output: 
$./average.sh 2 2 3.4 2 2 4.5 1001 0
Invalid entry (ignored): 3.4
Invalid entry (ignored): 4.5
Invalid entry (ignored): 1001
Invalid entry (ignored): 0

Average is : 2


Feel free to modify or use this script.



source:http://linuxpoison.blogspot.com/2012/06/135781677510459.html

- E-Mail count and notifications for Ubuntu desktop - Unity Mail

Unity Mail is an E-Mail count and notifications application for Ubuntu Unity desktop, is a script that checks your mail on any IMAP4-compatible server and displays a notification bubble when you get new mail;

Unity Mail Features:
* Works with any IMAP4-compatible server
* Multiple accounts support
* Unread messages count on the Launcher
* Unity Quick-list support (GMail URLs by default)
* Messaging Menu integration
* NotifyOSD notifications

Unity Mail is written in Python and is currently in Beta development phase.

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/06/135781677511655.html

- Bash Script: Array examples and Operations

Below is a simple script which demonstrate all the different kind of array operations like ...

 * Display arrays elements
 * Iterate through the array elements
 * Add a new element to array
 * Replace an array element
 * Copy array
 * Delete array

Source: cat array.sh
#!/bin/bash

array=(a b c d)

# Get the lengthe of array
LEN=${#array[*]}
echo "Length of the array is: $LEN"

# Print the array elements"
echo "${array[@]}"
echo "----------------------------------"

# Iterate through the array
for ((i=0;i<${#array[*]};i++)); do
    echo "$i : ${array[$i]}"
done
echo "---------------------------------"

# Add new value to the end of the array
array=("${array[@]}" "e")
array[10]="f"   # Add another element at index 10
echo "${array[@]}"
echo "---------------------------------"

# Copy the array to another array
declare -a newarray
for i in ${array[@]}; do
    newarray[${#newarray[*]}]=$i
done
echo "New array values: ${newarray[@]}"
echo "----------------------------------"

# Remove a element from the array
unset array[2]
echo "${array[@]}"
echo "---------------------------------"

# Replace a array element
array[0]="z"
echo "${array[@]}"
echo "---------------------------------"

# Delete entire array
unset array
echo "${array[@]}"

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/06/135781677511881.html

- Setting up GlusterFS Network Storage under Ubuntu

GlusterFS is an open source, distributed file system capable of scaling to several petabytes (actually, 72 brontobytes!) and handling thousands of clients. GlusterFS clusters together storage building blocks over Infiniband RDMA or TCP/IP interconnect, aggregating disk and memory resources and managing data in a single global namespace. GlusterFS is based on a stack-able user space design and can deliver exceptional performance for diverse workloads.

GlusterFS supports standard clients running standard applications over any standard IP network. No longer are users locked into costly, monolithic, legacy storage platforms. GlusterFS gives users the ability to deploy scale-out, virtualized storage – scaling from terabytes to petabytes in a centrally managed and commoditized pool of storage.

Attributes of GlusterFS include:
 * Scalability and Performance
 * High Availability
 * Global Namespace
 * Elastic Hash Algorithm
 * Elastic Volume Manager
 * Gluster Console Manager
 * Standards-based
Continue Reading...


source:http://linuxpoison.blogspot.com/2012/06/13578167754450.html

- Install Spotify Client in Ubuntu 12.04

Spotify is a Swedish music streaming service offering digitally restricted streaming of selected music from a range of major and independent record labels, including Sony, EMI, Warner Music Group, and Universal. Launched in October 2008 by Swedish startup Spotify AB

A six month free trial period is activated upon initial login with a Facebook account, where a user can listen to an unlimited amount of music supported by visual and radio-style advertising. After the trial, Spotify will have a listening limit of ten hours per month. An "Unlimited" subscription removes advertisements and time limits and a "Premium" subscription introduces extra features such as higher bitrate streaming, offline access to music and mobile app access. An active Facebook account is required to use Spotify.

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/06/135781677514948.html

- Bash Script: Find and replace string within string

Below is a simple bash script which will find and replace the substring withing the string. Feel free to use or modify this script.

Source: cat stringreplace.sh
#!/bin/bash

echo -n "Enter main string: "
read string

echo -n "Enter the sub-string that you want to replace: "
read old

echo -n "Enter new sub-string that you want to replace with: "
read new

echo "The new string is now: ${string/$old/$new}"

Result: ./stringreplace.sh 
Enter main string: linuxpoison
Enter the sub-string that you want to replace: poison
Enter new sub-string that you want to replace with: os
The new string is now: linuxos



source:http://linuxpoison.blogspot.com/2012/06/135781677513196.html

- Install Ubuntu Tweak under Ubunt 12.04

Ubuntu Tweak is an application designed to config Ubuntu easier for everyone. It provides many useful desktop and system options that the default desktop environment doesn't provide. At present, it's only designed for the Ubuntu GNOME Desktop, and always follows the newest Ubuntu distribution.

 Features of Ubuntu Tweak
 * View of Basic System Information(Distribution, Kernel, CPU, Memory, etc.)
 * GNOME Session Control
 * Auto Start Program Control
 * Quick install popular applications
 * A lot of third-party sources to keep applications up-to-date
 * Clean unneeded packages or cache to free disk space
 * Show/Hide and Change Splash screen
Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/135781677511464.html

- Install Latest version of Opera browser under Ubuntu

Opera 12 comes with more than just these features. Numerous other tweaks, tricks and tucks make this Opera version the best yet:

 * Plug-ins run in their own process, so if they crash, Opera keeps singing.

 * Giddy-up: Opera 12 receives a significant speed boost — faster page loading, faster start up and faster HTML5 rendering — over its predecessor. 64-bit support on Windows and Mac gives better performance on more advanced machines.

 * Right-to-left text support and five new languages: Arabic, Persian, Hebrew, Urdu and Kazakh. Opera 12 now comes in 60 total languages.

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/135781677512186.html

- Google Drive for your Ubuntu Desktop - GWoffice

Google Web Office - GWoffice - brings your Google drive to your desktop. It offers you a nice interface to its editing abilities and also gives you basic syncing for off-line use.

GWoffice features:
 * HUD support for any keyboard bound command
 * theming according to the current Gtk+ theme
 * shortcuts for quickly creating documents
 * drop to upload (and edit, if you enable it..)

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/13578167753394.html

- How-To Install Java JRE and JDK on Ubuntu Linux

Java technology's versatility, efficiency, platform portability, and security make it the ideal technology for network computing. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!

 * 1.1 billion desktops run Java
 * 930 million Java Runtime Environment downloads each year
 * 3 billion mobile phones run Java
 * 100% of all Blu-ray players run Java
 * 1.4 billion Java Cards are manufactured each year
 * Java powers set-top boxes, printers, Web cams, games, car navigation systems, lottery terminals, medical devices, parking payment stations, and more.

To see places of Java in Action in your daily life, explore java.com.

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/13578167751796.html

- Simple Download Manager for Ubuntu Linux - Steadyflow

Steadyflow is a download manager which aims for minimalism, ease of use, and a clean, malleable codebase. It should be easy to control, whether from the GUI, commandline, or D-Bus.

Features of SteadyFlow Download Manager:
 * Add and remove downloads.
 * Multiple downloads at same time.
 * Pause and Resume downloads.
 * Simple Interface.
 * Integration into system tray
 * Notification for download completes

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/13578167757501.html

- Free Video Transcoding Software for Linux and Windows OS - viDrop

viDrop is free video transcoding software for GNU/Linux and Windows operating systems. With its help you can easily convert your favourite movies or videos into format, playable on your Smarthone, Tablet, MID, Portable Media Player etc.

viDrop Features:
 * Extensive codec and file format support
 * Convert DVDs in any format you like, so you can watch movies on your portable device
 * Embed subtitles into the video – useful when your device does not support subtitles
 * Supports user defined presets with predefined settings, so you can save your favorite settings for later use
 * Apply different video filters – resize/crop, sharpen, blur, deinterlace (useful when converting DVDs)
 * Based on the well known mplayer/mencoder engine
 * Free license (GNU GPL3)
 * Multi-platform support – GNU/Linux and Windows versions
 * Created entirely with the aid of free software programs – Python, GTK, GIMP, GEdit

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/135781677513858.html

- Cross-platform files Sharing application - NitroShare

NitroShare makes it easy to transfer files from one machine to another on the same network. Most of the time, no configuration is necessary - all of the machines on your network running NitroShare should immediately find each other and you can instantly begin sharing files.

NitroShare introduces the concept of "share boxes", which are small widgets that are placed on your desktop. Each share box represents another machine on your local network that you can instantly share files with by dropping them on it. (You can also create a share box that will ask you which machine you want to send the files to.)

NitroShare features:
 * Dynamic file compress during transfer to decrease transfer time and bandwidth
 * DRC check sum generation to ensure file integrity during transfer
 * Full compatibility with clients running on other operating systems
 * A helpful configuration wizard to guide you through setting up the application on your machines
 * The application was developed using the Qt framework and therefore runs on any platform supported by Qt, including Windows, Mac, and Linux.

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/13578167751677.html

- Bash Script: Convert String Toupper and Tolower

Here is a simple bash script which converts the given string to upper or to lower case.
feel free to copy and use this script:


Source:
cat toupper_tolower.sh
#!/bin/bash

echo -n "Enter the String: "
read String

echo -n "Only First characters to uppercase: "
echo ${String^}

echo -n "All characters to uppercase: "
echo ${String^^}

echo -n "Only First characters to Lowercase: "
echo ${String,}

echo -n "All characters to lowercase: "
echo ${String,,}


Output:
./toupper_tolower.sh
Enter the String: linuXPoisoN
Only First characters to uppercase: LinuXPoisoN
All characters to uppercase: LINUXPOISON
Only First characters to Lowercase: linuXPoisoN
All characters to lowercase: linuxpoison




source:http://linuxpoison.blogspot.com/2012/07/135781677515324.html

- Bash Script: Using Globbing (glob) in bash script


Glob characters
* - means 'match any number of characters'. '/' is not matched
? - means 'match any single character'
[abc] - match any of the characters listed. This syntax also supports ranges, like [0-9]

Below is a simple script which explains the problem and also provide the solution using globbing:

Source:
cat glob.sh
#!/bin/bash

echo "Creating 2 files with space: this is first file.glob and another file with name.glob "
`touch "this is first file.glob"`
`touch "another file with name.glob"`

echo "---------------------------------"
echo "Using for loop to search and delete file ... failed :( "
for file in `ls *.glob`; do
        echo $file
        `rm $file`
done

echo "-------------------------------"
echo
echo "Using the another for loop to search for the same set of files ... but failed :("
for filename in "$(ls *.glob)"; do
        echo $filename
        `rm $filename`
done

# This is the example of using glob in the script
# This time BASH does know that it's dealing with filenames
echo "-------------------------------"
echo "Finnaly able to delete the file using glob method. :)"
for filename in *.glob; do
        echo "$filename"
        `rm "$filename"`
done


Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/13578167758187.html

- Bash script: Using shift statement to loop through command line arguments

A shift statement is typically used when the number of arguments to a command is not known in advance and it takes a number (N), in  which the positional parameters are shifted to the left by this number, N.

Say you have a command that takes 10 arguments, and N is 4, then $4 becomes $1, $5 becomes $2 and so on. $10 becomes $7 and the original $1, $2 and $3 are thrown away.

Below is the simple example showing the usage of 'shift' statements:

Source:  cat shift2.sh
#!/bin/bash

echo "Total number of arg passed: $#"
echo "arg values are: $@"
echo "-----------------------------------------"

while [[ $# > 0 ]] ; do
        echo "\$1 = $1"
        shift
done

echo

Output: ./shift2.sh a b c d e f
Total number of arg passed: 6
arg values are: a b c d e f
-----------------------------------------
$1 = a
$1 = b
$1 = c
$1 = d
$1 = e
$1 = f






source:http://linuxpoison.blogspot.com/2012/07/135781677515023.html

- Bash Script: Difference betweem single ( ' ) and double quotes ( " )

The Bash manual has this to say:

Single Quotes
Enclosing characters in single quotes (‘'’) preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.

Double Quotes
Enclosing characters in double quotes (‘"’) preserves the literal value of all characters within the quotes, with the exception of ‘$’, ‘`’, ‘\’, and, when history expansion is enabled, ‘!’. The characters ‘$’ and ‘`’ retain their special meaning within double quotes (see Shell Expansions). The backslash retains its special meaning only when followed by one of the following characters: ‘$’, ‘`’, ‘"’, ‘\’, or newline. Within double quotes, backslashes that are followed by one of these characters are removed. Backslashes preceding characters without a special meaning are left unmodified. A double quote may be quoted within double quotes by preceding it with a backslash. If enabled, history expansion will be performed unless an ‘!’ appearing in double quotes is escaped using a backslash. The backslash preceding the ‘!’ is not removed.

The special parameters ‘*’ and ‘@’ have special meaning when in double quotes (see Shell Parameter Expansion).

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/135781677518672.html

- Single application to convert Audio, Video, Image and Document files to other formats

FF Multi Converter is a simple graphical application which enables you to convert audio, video, image and document files between all popular formats, using and combining other programs.

It uses ffmpeg for audio/video files, unoconv for document files and PythonMagick library for image file conversions. Common conversion options for each file type are provided. Audio/video ffmpeg-presets management and recursive conversion options are available too.

FF Multi Converter Features
 * Conversions for several file formats.
 * Very easy to use interface.
 * Access to common conversion options.
 * Audio/video ffmpeg-presets management.
 * Options for saving and naming files.
 * Recursive conversions.

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/13578167758657.html

- Bash Script: Create & Use Associative Array like Hash tables

Before using Associative Array features make sure you have bash version 4 and above, use command "bash --version" to know your bash version.

Below shell script demonstrate  the usage of associative arrays, feel free to copy and use this code.

Associative arrays are created using declare -A name

Source: cat associative_array.sh
#!/bin/bash

# use -A option declares associative array
declare -A array

# Here, you can have some other process to fill up your associative array.
array[192.168.1.1]="host1"
array[192.168.1.2]="host2"
array[192.168.1.3]="host3"
array[192.168.1.4]="host4"
array[192.168.1.5]="host5"

echo -n "Enter the ip address to know the hostname: "
read ipaddress

# Now you can use the associative array as hash table, (key,value) pairs.
echo "Hostname associated with the $ipaddress is: ${array[$ipaddress]}"

# You can also perform all the basic array operation.
# Iterate over Associative Arrays

#for hostname in "${array[@]}"; do
#       echo $hostname
#done


Output: ./associative_array.sh 
Enter the ip address to know the hostname: 192.168.1.4
Hostname associated with the 192.168.1.4 is: host4




source:http://linuxpoison.blogspot.com/2012/07/13578167753804.html

- Cross-platform and easy to use Audio Editor - ocenaudio

Ocenaudio is a cross-platform, easy to use, fast and functional audio editor. It is the ideal software for people who need to edit and analyze audio files without complications. ocenaudio also has powerful features that will please more advanced users.

This software is based on Ocen Framework, a powerful library developed to simplify and standardize the development of audio manipulation and analysis applications across multiple platforms.

Features for Ocenaudio:
 * VST plugins support
 * Preview effects in Real-time
 * Drag & Drop support
 * Various effect options (silence, reverse, invert, delay, etc.)
 * Multi-selection support
 * Large file editing support
 * Fully-featured spectrogram

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/135781677519147.html

- Free Cross-Platform Linux MultiMedia Studio (LMMS)

Linux MultiMedia Studio (LMMS) is a free cross-platform alternative to commercial programs like FL Studio®, which allow you to produce music with your computer. This includes the creation of melodies and beats, the synthesis and mixing of sounds, and arranging of samples. You can have fun with your MIDI-keyboard and much more; all in a user-friendly and modern interface.

Linux MultiMedia Studio Features
 * Song-Editor for composing songs
 * A Beat+Baseline-Editor for creating beats and baselines
 * An easy-to-use Piano-Roll for editing patterns and melodies
 * An FX mixer with 64 FX channels and arbitrary number of effects allow unlimited mixing possibilities
 * Many powerful instrument and effect-plugins out of the box
 * Full user-defined track-based automation and computer-controlled automation sources
 * Compatible with many standards such as SoundFont2, VST(i), LADSPA, GUS Patches, and MIDI
 * Import of MIDI and FLP (Fruityloops® Project) files
Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/13578167754919.html

- Open source E-book Library Management Application - Calibre

Calibre is an free and open source eBook library manager. It can view, convert and catalog eBooks in most of the major eBook formats. It can also talk to many eBook reader devices. It can go out to the Internet and fetch metadata for your books. It can download newspapers and convert them into eBooks for convenient reading. It is cross platform, running on Linux, Windows and OS X.
 
Calibre has a cornucopia of features divided into the following main categories:
 * Library Management
 * E-book conversion
 * Syncing to e-book reader devices
 * Downloading news from the web and converting it into e-book form
 * Comprehensive e-book viewer
 * Content server for online access to your book collection

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/07/135781677515003.html

- Simple & Powerful GTK based Download Manager - UGet

Uget (formerly urlgfe) is a Free and Open Source download manager written in GTK+ , it has many of features like ...

 * Free (as in freedom , also free of charge ) and Open Source.
 * Simple , easy-to-use and lightweight.
 * Support resume download , so if your connection lost you don’t need to start from first.
 * Classify downloads , and every category has independent configuration and queue.
 * Queue download.
 * Integrate with Firefox through Flashgot plugin.
 * Monitoring clipboard.
 * Import downloads from HTML file.
 * Batch download , you can download many files has same arrange , like file_1 file_2 …. file_20 ,  you don’t need to add all links , just one link and changeable character.
 * Can be used from command line.
Continue Reading...


source:http://linuxpoison.blogspot.com/2012/08/135781677516005.html

- Network Traffic and Bandwidth Monitor - NTM (Network Traffic Monitor)

NTM (Network Traffic Monitor) is a monitor of the network and internet traffic for Linux. NTM is useful for the people that have a internet plan with a limit, and moreover the exceed traffic is expensive.

NTM (Network Traffic Monitor) features:
 * Choice of the interface to monitoring.
 * Period to monitoring: Day, Week, Month, Year or Custom Days. With auto-update.
 * Threshold: Auto-disconnection if a limit is reached (by Network Manager).
 * Traffic Monitoring: Inbound, outbound and total traffic; Show the traffic speed.
 * Time Monitoring: Total time of connections in the period.
 * Time Slot Monitoring: Number of sessions used.
 * Reports: Show of average values and daily traffic of a configurable period.
 * Online checking with Network-manager or by "Ping Mode".
 * The traffic is attributed to the day when the session began.
 * Not need root privilege.
 * Not invasive, use a system try icon.

NTM is write in python and is a open source software, the license is the GNU GPL v2.

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/08/135781677518328.html

- Bash Script: String manipulation (Find & Cut)

${parameter#word}
${parameter##word}

Remove matching prefix pattern. If the pattern matches the beginning of the value of parameter, then  the  result  of  the  expansion  is the expanded  value  of  parameter  with  the shortest matching pattern (the ``#'' case) or the longest matching pattern (the ``##'' case) deleted. 

${parameter%word}
${parameter%%word}

Remove matching suffix pattern.  If the pattern matches a trailing portion of the expanded value of parameter, then the result of the expansion is the expanded value of parameter with the shortest matching pattern (the ``%'' case) or the longest matching pattern (the ``%%'' case) deleted. 

Below bash script explains the concepts of find and cut the string within the string, feel free to copy and use this script.

Source: cat string_cut.sh
#!/bin/bash

var="Linuxpoison.Linuxpoison.Linuxpoison"
echo
echo -e "Value of var is: $var"
echo "--------------------------------------------"
echo 'Find all *nux from the start of the string and cut ${var##*nux} :'
echo ${var##*nux}

echo "-------------------------------------------"
echo 'Find the first *nux from the start of the string and cut ${var#*nux} :'
echo ${var#*nux}

echo "-------------------------------------------"
echo 'Find all .* from the back of the string and cut ${var%%.*} :'
echo ${var%%.*}

echo "------------------------------------------"
echo 'Find first .* from the back of the string and cut ${var%.*} :'
echo ${var%.*}

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/08/135781677517236.html

- Free eBook - Linux from Scratch

Linux from Scratch describes the process of creating your own Linux system from scratch from an already installed Linux distribution, using nothing but the source code of software that you need.

This 318 page eBook provides readers with the background and instruction to design and build custom Linux systems. This eBook highlights the Linux from Scratch project and the benefits of using this system.

Users can dictate all aspects of their system, including directory layout, script setup, and security. The resulting system will be compiled completely from the source code, and the user will be able to specify where, why, and how programs are installed.

This eBook allows readers to fully customize Linux systems to their own needs and allows users more control over their system.

Download Free Linux from Scratch PDF Guide - here




source:http://linuxpoison.blogspot.com/2012/08/13578167751294.html

- Bash Script: Using IFS to split the strings into tokens

IFS (Internal Field Separator) is one of Bash's internal variables. It determines how Bash recognizes fields, or word boundaries, when it interprets character strings.

$IFS defaults to whitespace (space, tab, and newline), but can be changed, below example show you how to change the IFS value to split the strings into tokens based on any delimiter, in our case we are using ':' to split the string into tokens.

Source: cat ifs.sh
#!/bin/bash

var="google:yahoo:microsoft:apple:oracle:hp:dell:toshiba:sun:redhat"
echo "Original value of IFS is: $IFS"

# Saving the original value of IFS
OLD_IFS=$IFS
IFS=:
echo "New value of IFS is: $IFS"
echo "================="

for word in $var;do
        echo -e $word
done <<< $var

echo "================"

# Restore the value of IFS back to the script.
IFS=$OLD_IFS
echo "Back to original value of IFS: $IFS"

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/08/13578167756719.html

- Free eBook - Securing & Optimizing Linux: The Hacking Solution

"Securing & Optimizing Linux: The Hacking Solution (v.3.0)"

A comprehensive collection of Linux security products and explanations in the most simple and structured manner on how to safely and easily configure and run many popular Linux-based applications and services.


This 800+ page eBook is intended for a technical audience and system administrators who manage Linux servers, but it also includes material for home users and others. It discusses how to install and setup a Linux server with all the necessary security and optimization for a high performance Linux specific machine. It can also be applied with some minor changes to other Linux variants without difficulty.

Download free eBook - Securing & Optimizing Linux: The Hacking Solution (v.3.0) - here




source:http://linuxpoison.blogspot.com/2012/08/13578167754386.html

- Bash Script: How read file line by line (best and worst way)

There are many-many way to read file in bash script, look at the first section where I used while loop along with pipe (|) (cat $FILE | while read line; do ... ) and also incremented the value of (i) inside the loop and at the end I am getting the wrong value of i, the main reason is that the usage of pipe (|) will create a new sub-shell to read the file and any operation you do withing this while loop (example - i++) will get lost when this sub-shell finishes the operation.

In second and the worst method, One of the most common errors when reading a file line by line is by using a for loop (for fileline in $(cat $FILE);do ..), which prints the every word in a file on separate line, because, for loop uses the default value of IFS (space).

In third perfect method, The while loop (while read line;do .... done < $FILE) is the most appropriate and easiest way to read a file line by line, see the example below.

Input: $ cat sample.txt
This is sample file
This is normal text file

Source: $ cat readfile.sh
#!/bin/bash

i=1;
FILE=sample.txt

# Wrong way to read the file.
# This may cause problem, check the value of 'i' at the end of the loop
echo "###############################"
cat $FILE | while read line; do
        echo "Line # $i: $line"
        ((i++))
done
echo "Total number of lines in file: $i"

# The worst way to read file.
echo "###############################"
for fileline in $(cat $FILE);do
        echo $fileline
done

# This is correct way to read file.
echo "################################"
k=1
while read line;do
        echo "Line # $k: $line"
        ((k++))
done < $FILE
echo "Total number of lines in file: $k"

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/08/135781677518171.html

- Bash Script: Execute loop in background withing a script

Below is simple bash script which shows the way to make any loop execute in background, with this approach one can make the script to perform multiple things at the same time .... somewhat similar to multi threading.

In the example below, the '&' at the end of the first loop which makes this loop to go into background and at the same time second loop also gets started which makes both the loop to operate simultaneously.

Source: cat background-loop.sh
#!/bin/bash

for i in 1 2 3 4 5 6 7 8 9 10; do
  echo -n $i
done &

for i in a b c d e f g h i j k; do
  echo -n $i
done
echo

Output: ./background-loop.sh
abcdef1gh23ij4k5

Practical example: you can use above approach to copy some set of files to some other server or storage (backup) and at the same time you can perform the ftp job to copy other set of files to ftp server.





source:http://linuxpoison.blogspot.com/2012/08/13578167758732.html

- Bash Script: Calculate the total time taken by script execution

There is a bash predefined parameter SECONDS

Each  time  this  parameter  is referenced, the number of seconds since shell invocation is returned.  If a value is assigned to SECONDS, the value returned upon subsequent references is the number of seconds since the assignment plus the value assigned.  If SECONDS is unset, it loses its special properties, even if it is subsequently reset.

Below is simple bash script which demonstrate the usage of SECOND parameter

Source: cat time_taken.sh
#!/bin/bash

for i in {1..10}; do
        sleep 1
        echo $i
done

echo "Total time taken by this script: $SECONDS"

Output: ./time_taken.sh
1
2
3
4
5
6
7
8
9
10
Total time taken by this script: 10




source:http://linuxpoison.blogspot.com/2012/08/135781677519916.html

- Free eBook - A Newbie's Getting Started Guide to Linux

Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it.

You've probably heard about Linux, the free, open-source operating system that's been pushing up against Microsoft. It's way cheaper, faster, safer, and has a far bigger active community than Windows, so why aren't you on it?

Like many things, venturing off into a completely unknown world can seem rather scary, and also be pretty difficult in the beginning. It's while adapting to the unknown, that one needs a guiding, and caring hand.

This guide will tell you all you need to know in 20 illustrated pages, helping you to take your first steps. Let your curiosity take you hostage and start discovering Linux today, with this manual as your guide! Don't let Makeuseof.com keep you any longer, and download the Newbie's Initiation to Linux. With this free guide you will also receive daily updates on new cool websites and programs in your email for free courtesy of MakeUseOf.

Download free eBook of "A Newbie's Getting Started Guide to Linux" - here




source:http://linuxpoison.blogspot.com/2012/08/13578167757103.html

- Free eBook - GNU/Linux Basic

"GNU/Linux Basic"


This guide will introduce you to the world of GNU/Linux.
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux.

Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.

This guide is not intentionally based on any particular distribution, but in most examples and activities the book will be very specific so it will go into detail using Debian GNU/Linux (version 4.0 -Etch-).

Download your free eBook of "GNU/Linux Basic" from here




source:http://linuxpoison.blogspot.com/2012/08/135781677512534.html

- Perl Script: Difference between local and my variables

'my' creates a new variable (but only within the scope it exists in), 'local' temporarily amends the value of a variable

ie, 'local' temporarily changes the value of the variable (or global variable), but only within the scope it exists in.

So with local you basically suspend the use of that global variable, and use a "local value" to work with it. So local creates a temporary scope for a temporary variable.

Below script explains the concepts of local Vs my variables



Source : cat local_my.pl
#!/usr/bin/perl

print " ----- local example ------ \n";
$a = 10;
{
  local $a = 20;
  print "Inside block \$a    : $a \n";
  print "Inside block: \$::a : $::a \n";
}

print "Outside block \$a   : $a \n";
print "Outside block: \$::a: $::a \n";
Continue Reading...


source:http://linuxpoison.blogspot.com/2013/01/135781677515675.html

- Bash Script: How to read password without dispalying on the terminal

Below is the simple script which reads the user's password without displaying on the terminal.

Feel free to copy and use this code.

Source: cat passwd.sh
#!/bin/bash

# Here the input passwd string will get display on the terminal
echo -n "Enter your passwd: "
read passwd
echo
echo "Ok, your passwd is: $passwd"
echo

# Now, lets turn off the display of the input field.

stty -echo
echo -n "Again, please enter your passwd: "
read passwd
echo
echo "Ok, your passwd is: $passwd"
echo
stty echo

Output: ./passwd.sh
Enter your passwd: linuxpoison

Ok, your passwd is: linuxpoison

Again, please enter your passwd:
Ok, your passwd is: linuxpoison.blog@gmail.com

As you can see above in the scrip, with the use of stty we can enable or disable the screen echo.




source:http://linuxpoison.blogspot.com/2012/08/135781677516260.html

- Perl Script: How to find if variable is defined or not?

Below is a simple perl script which explains how to find if any given variable is defined or not.

Feel free to copy and use this code.

Source
: cat undefined.pl
#!/usr/bin/perl

use strict;
use warnings;

my $Undefined;
my $Defined = "linuxpoison";

print "The value of Undefined is ", defined $Undefined, "\n";
print "The value of Defined is ", defined $Defined, "\n";

print "------------------------------\n";

$Undefined = $Defined;
$Defined = undef;

print "The value of Undefined is ", defined $Undefined, "\n";
print "The value of Defined is ", defined $Defined, "\n";

Output: perl undefined.pl
The value of Undefined is
The value of Defined is 1
------------------------------
The value of Undefined is 1
The value of Defined is




source:http://linuxpoison.blogspot.com/2012/08/13578167758219.html

- Free eBook - HA Solutions for Windows, SQL, and Exchange Servers

"HA Solutions for Windows, SQL, and Exchange Servers".

How to protect your company's critical applications by minimizing risk to disasters with high availability solutions.

When total data loss is possible, the absence of a disaster recovery program can put a business at risk. Although disasters are inevitable and, to a degree, unavoidable, being prepared for them is completely within your control.

Increasingly, IT has become the focal point of many companies' disaster planning. Creating a program to preserve business continuity and recover from disaster is one of the central value propositions that an IT department can contribute to an organization.

Download you free HA Solutions for Windows, SQL, and Exchange Servers eBook - here




source:http://linuxpoison.blogspot.com/2012/09/13578167757603.html

- Bash Script: Running part of the script in restricted mode

If Bash is started with the name rbash, or the --restricted or -r option is supplied at invocation, the shell becomes restricted. A restricted shell is used to set up an environment more controlled than the standard shell. A restricted shell behaves identically to bash with the exception that the following are disallowed or not performed:

 * Changing directories with the cd built-in.
 * Setting or unsetting the values of the SHELL, PATH, ENV, or BASH_ENV variables.
 * Specifying command names containing slashes.
 * Specifying a filename containing a slash as an argument to the . built-in command.
 * Specifying a filename containing a slash as an argument to the -p option to the hash built-in command.
 * Importing function definitions from the shell environment at startup.
 * Parsing the value of SHELLOPTS from the shell environment at startup.
 * Redirecting output using the ‘>’, ‘>|’, ‘<>’, ‘>&’, ‘&>’, and ‘>>’ redirection operators.
 * Using the exec built-in to replace the shell with another command.
 * Adding or deleting built-in commands with the -f and -d options to the enable built-in.
 * Using the enable built-in command to enable disabled shell built-ins.
 * Specifying the -p option to the command built-in.
Continue Reading...


source:http://linuxpoison.blogspot.com/2012/09/135781677511765.html

- Free eBook - The GNU/Linux Advanced Administration

"The GNU/Linux Advanced Administration"


The GNU/Linux systems have reached an important level of maturity, allowing to integrate them in almost any kind of work environment, from a desktop PC to the sever facilities of a big company.

In this ebook "The GNU/Linux Operating System", the main contents are related with system administration. You will learn how to install and configure several computer services, and how to optimize and synchronize the resources using GNU/Linux.

The topics covered in this 500+ page eBook include Linux network, server and data administration, Linux kernel, security, clustering, configuration, tuning, optimization, migration and coexistence with non-Linux systems. A must read for any serious Linux system admin.

Download your free copy of "The GNU/Linux Advanced Administration" - here




source:http://linuxpoison.blogspot.com/2012/09/135781677516184.html

- Bash Script: Write debugging information to /var/log/messages

logger is a shell command interface to the syslog system log module, it appends a user-generated message to the system log (/var/log/messages). You do not have to be root to invoke logger.

Below is the simple bash script to log the debugging information to /var/log/message
Feel free to copy and use the below code

Source: cat logger.sh
#!/bin/bash

echo -n "Enter your username: "
read username

logger -i "Username $username started the script"

echo -n "Enter your Password: "
read password

# This is just an sample for comparing the password
if [ "$password" = "linuxpoison" ]; then
        echo "welcome $username"
        logger -i "Authentication successful for $username."
else
        echo "your Username or password does not match"
        logger -i "Authentication failed for $username."
fi

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/09/13578167756346.html

- Bash Script: Set the timeout for reading the user input

If TMOUT set to a value greater than zero, TMOUT is treated as the default timeout for the read builtin.  The select command terminates if  input does  not arrive after TMOUT seconds when input is coming from a terminal. 

In an interactive shell, the value is interpreted as the number of seconds to wait for input after issuing the primary prompt.  Bash terminates after waiting for that number of seconds if input does  not arrive.

Below is the bash script which explains the above concept ...
Feel free to copy and use this script

Source: cat timeout.sh
#!/bin/bash

TMOUT=5
echo -n "Enter you username: "
read username

if [[ -z $username ]]; then
        # No username provide
        username="Not Set"
        echo "Timeout, Run this script again and set your valid username..."
fi


Output: ./timeout.sh
Enter you username: Timeout, Run this script again and set your valid username...


source:http://linuxpoison.blogspot.com/2012/09/13578167754921.html

- Bash Script: Get the Information about the caller of the function (backtrace)

Caller Returns  the  context  of  any active subroutine call (a shell function or a script executed with the . or source builtins). caller displays the line number and source filename of the current subroutine call.  If a non-negative integer is supplied as expr,  caller displays  the line number, subroutine name, and source file corresponding to that position in the current execution call stack.  This extra information may be used, for example, to print a stack trace. 

Below is simple bash script which demonstrate the usage of caller ...
feel free to copy and use this code

Source: cat caller.sh
#!/bin/bash

foo() {
        caller 0
        echo "In function: foo"
}

echo "Outside of the function"

goo() {
        echo "In function: goo"
        foo
}

goo

Output: ./caller.sh
Outside of the function
In function: goo
13 goo ./caller.sh
In function: foo



source:http://linuxpoison.blogspot.com/2012/09/13578167758569.html

- Bash Script: Convert File from DOS to UNIX format

Common problem! If you need to exchange text files between DOS/Windows and Linux, be aware of the "end of line" problem. Under DOS, each line of text ends with CR/LF (Carriage return/Line feed), with LF under Linux. If you edit a DOS text file under Linux, each line will likely end with a strange--looking `M' character;

Below is simple shell script which converts the files in DOS format to Unix format
Feel free to copy and use this code

Source: cat dos_unix.sh
#!/bin/bash

if [ $# -ne 1 ]; then
        echo "Please provide the path of a valid DOS file"
        exit
fi

if [ ! -f "$1" ]; then
        echo "Cannot access file: $1"
        echo "Don't play, provide the vaild file."
        exit
fi

DOSFILE=$1
UNIXFILE=output.unix
CR='\015'

tr -d $CR < $DOSFILE > $UNIXFILE

echo "Done with the conversion"
echo "New output file is: $UNIXFILE"
exit

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/09/135781677519550.html

- Bash Script: Transfer files through FTP from within script

Below shell script demonstrate the usage of FTP operation from within the bash script, feel free to copy and use this script:

Source: cat autoftp.sh
#!/bin/bash

if [ $# -ne 1 ]; then
        echo "Please provide the file path for ftp operation."
        exit
fi

USERNAME=linuxpoison
PASSWORD=password
FILENAME="$1"
FTP_SERVER=ftp.foo.com
echo "Starting the ftp operation ...."

ftp -n $FTP_SERVER <<Done-ftp
user $USERNAME $PASSWORD
binary
put "$FILENAME"
bye
Done-ftp

echo "Done with the transfer of file: $FILENAME"
exit

Output: ./autoftp.sh log.tar.gz
Starting the ftp operation ....
Done with the transfer of file: log.tar.gz




source:http://linuxpoison.blogspot.com/2012/09/135781677511456.html

- Free White Paper - The Trend from UNIX to Linux in SAP Data Centers

"The Trend from UNIX to Linux in SAP® Data Centers"

Linux has arrived in large SAP data centers, and the SAP customer base shows significant momentum in migrating from UNIX to Linux. To explain this development, the following white paper will provide information about which customers are migrating from UNIX to Linux, in terms of size and industrial sector, and why they are migrating.

The paper will provide statistical information on the market shares of originating UNIX flavors, and information on the distribution of source and target databases. It will present a model that compares the cost of UNIX implementations with that of Linux implementations, and it will demonstrate that Linux is ready for business-critical SAP implementations. It will also show that significant savings can be realized by migrating SAP system landscapes from UNIX to Linux.

Download your free copy of White paper (The Trend from UNIX to Linux in SAP® Data Centers) - here



source:http://linuxpoison.blogspot.com/2012/09/135781677515646.html

- Bash Script: Script to check internet connection

Below is simple bash script to test the Internet connection using wget utility.
Feel free to copy and use this script

Source: cat internet_connection.sh
#!/bin/bash

HOST=$1
WGET="/usr/bin/wget"

$WGET -q --tries=10 --timeout=5 $HOST
RESULT=$?

if [[ $RESULT -eq 0 ]]; then
        echo "Connection made successfully to $HOST"
else
        echo "Fail to make connection to $HOST"
fi

Output:
./internet_connection.sh http://yahoo.com
Connection made successfully to http://yahoo.com

./internet_connection.sh http://yahosssss.com
Fail to make connection to http://yahosssss.com




source:http://linuxpoison.blogspot.com/2012/09/135781677519016.html

- Bash Script: Commenting out the block of code using here document

Many times it required to comment out the huge block of code for debugging purpose and it is very annoying to put the "#" tag before each and every line of this code

Below shell script shows how to comment out the block of code using here document (: <<'COMMENT')

Source: cat comment_block.sh
#!/bin/bash

echo "statement before comment."
: <<'COMMENT'
echo "This is inside the comment block and will not get printed"
a=0
b=20
echo $((b/a))
echo "No error"
COMMENT

echo "This is after the comment block."
exit

Output: ./comment_block.sh
statement before comment.
This is after the comment block.




source:http://linuxpoison.blogspot.com/2012/09/135781677514041.html

- An indispensable ebook for every Linux administrator

"Linux® Quick Fix Notebook- Free 696 Page eBook"

Instant access to precise, step-by-step solutions for every essential Linux administration task from basic configuration and troubleshooting to advanced security and optimization.

If you're responsible for delivering results with Linux, Linux® Quick Fix Notebook brings together all the step-by-step instructions, precise configuration commands, and real-world guidance you need. This distilled, focused, task-centered guide was written for sysadmins, netadmins, consultants, power users...everyone whose livelihood depends on making Linux work, and keeping it working.

This book's handy Q&A format gives you instant access to specific answers, without ever forcing you to wade through theory or jargon. Peter Harrison addresses virtually every aspect of Linux administration, from software installation to security, user management to Internet services--even advanced topics such as software RAID and centralized LDAP authentication. Harrison's proven command-line examples work quickly and efficiently, no matter what Linux distribution you're using. Here's just some of what you'll learn how to do:

 * Build Linux file/print servers and networks from scratch
 * Troubleshoot Linux and interpret system error messages
 * Control every step of the boot process
 * Create, manage, secure, and track user accounts
 * Install, configure, and test Linux-based wireless networks
 * Protect your network with Linux iptables firewalls
 * Set up Web, email, DNS, DHCP, and FTP servers

And much more...

By Peter Harrison. Published by Prentice Hall. Part of the Bruce Perens' Open Source Series.

Download your free copy of "Linux® Quick Fix Notebook" - here




source:http://linuxpoison.blogspot.com/2012/09/135781677516019.html

- Perl Script: Convert any given string To-Lower or To-Upper case

Below is simple perl script which converts any given string to Upper or to-Lower case ...
Here, we have used the perl Escape Sequence ( \U \L \E)

\U -- Convert all following letters to Uppercase
\L -- Convert all following letters to Lowercase
\E -- Ends the effect of \L, \U or \Q

Feel free to copy and use this code ...

Source: cat case-conversion.pl
#!/usr/bin/perl

print "Enter the string: ";
$var = <STDIN>;

print "To uppercase: \U${var}\E \n";
print "To lowercase: \L${var}\E \n";

Output: perl case-conversion.pl
Enter the string: LinuxPoison
To uppercase: LINUXPOISON
To lowercase: linuxpoison




source:http://linuxpoison.blogspot.com/2012/09/13578167751058.html

- Bash Script: How to sort an array

Here is simple & dirty trick to sort any types of element in an array ...
Feel free to copy and use this script.

Source: cat sort_array.sh
#!/bin/bash

array=(a x t g u o p w d f z l)
declare -a sortarray

touch tmp
for i in ${array[@]}; do
        echo $i >> tmp
        `sort tmp -o tmp`
done

while read line; do
        sortarray=(${sortarray[@]} $line)
done < tmp
rm tmp

echo "Here is the new sorted array ...."
echo ${sortarray[@]}

Output: ./sort_array.sh
Here is the new sorted array ....
a d f g l o p t u w x z





source:http://linuxpoison.blogspot.com/2012/10/13578167753286.html