- Perl Script: File test operators

Below is simple perl script which demonstrate the usage if file test operator ..
Feel free to use and copy this script:

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

$FILE = "server.txt";

if ( -b $FILE ){
        print "$FILE is block device \n";
}
if ( -c $FILE ){
        print "$FILE is char device \n";
}
if ( -d $FILE ){
        print "$FILE is dirctory \n";
}
if ( -e $FILE ){
        print "$FILE exists \n";
}
if ( -f $FILE ){
        print "$FILE is ordinary file \n";
}
if ( -l $FILE ){
        print "$FILE is symbolic link \n";
}
if ( -o $FILE ){
        print "$FILE is owned by current user. \n";
}

Continue Reading...


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

- Perl Script: Array examples and Operations

Below perl script demonstrate the usage of array and show all sort of operation that can be done on the array.

Feel free to copy and use this script:

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

@array = ("a", "b", "c", "d");

# Get the lengthe of array
$LEN = @array;
print "Length of the array is:  $LEN \n";

# Print the array elements"
print "@array \n";
print "-------------------------\n";

# Iterate through the array
for ($i=0; $i<=$#array; $i++) {
        print "$array[$i]\n";
}
print "-------------------------\n";

# Add a new element to the end of the array
push(@array, "e");
print "@array \n";
print "-------------------------\n";

# Add an element to the beginning of an array
unshift(@array, "z");
print "@array \n";
print "-------------------------\n";

# Remove the last element of an array.
pop(@array);
print "@array \n";
print "-------------------------\n";

# Remove the first element of an array.
shift(@array);
print "Back to original array .... \n";
print "@array \n";
print "-------------------------\n";

# Copying from One Array Variable to Another
@copy_array = (@array);
print "Element in the new array are: @copy_array \n";
print "-------------------------\n";

# Sort the array element
@list = ("x" , "q", "p" , @array, 1, 3, 5, 9);
@sort_list = sort(@list);
print "Here is the sorted array: @sort_list \n";
print "-------------------------\n";

Continue Reading...


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

- Free eBook - Ubuntu: An Absolute Beginners Guide

"Ubuntu: An Absolute Beginners Guide"

Ubuntu is a free, open-source computer operating system with 20 million users worldwide.

This 30 page guide was written for beginners and will tell you everything you need to know about the Ubuntu experience. You will learn how to install and setup Ubuntu on your computer, find technical support in your community, understand the Ubuntu philosophy, navigate the Unity desktop interface and use Ubuntu compatible software programs. Also with this free guide you will receive daily updates on new cool websites and programs in your email for free courtesy of MakeUseOf.

Download you free copy of "Ubuntu: An Absolute Beginners Guide" - here




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

- Perl Script: Passing Array by Reference to Function

If the array being passed to a function is large, it might take some time (and considerable space) to create a copy of the array when the function is called by passing the array and may have some impact on the performance of your application.

To overcome this problem Perl also allow you to pass the reference of this array to an function, with this approach the local copy of this array is not created but instead the operation is done on the main array and hence it saves the time and space for your application.
 
The following is an example of a similar subroutine that refers to an array by reference:

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

@array = (1, 2, 3, 4, 5);
&array_ref (*array);
print "The new value of same array is: @array \n";

sub array_ref {
        local (*printarray) = @_;
        for ($i = 0; $i <= $#printarray ; $i++) {
                @printarray[$i] = int (rand(100) + 5);
        }
}

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

@array2 = (1, 2, 3, 4, 5);
&array_ref2 (@array2);
print "Oops, the value of array2 is not changed: @array2 \n";

sub array_ref2 {
        local @sub_array = @_;
        for ($i = 0; $i <= $#sub_array ; $i++) {
                @sub_array[$i] = int (rand(100) + 5);
        }
}

Continue Reading...


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

- Perl Script: Predefine Perl subroutine (BEGIN, END and AUTOLOAD)


Perl defines three special subroutines that are executed at specific times.

 * The BEGIN subroutine, which is called when your program starts.
 * The END subroutine, which is called when your program terminates.
 * The AUTOLOAD subroutine, which is called when your program can't find a subroutine to executed.

Below is simple perl script which demonstrate the usage of these predefine perl subroutines.

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

# This will get executed first when your program is started.
BEGIN {
        print "Starting the loop ... \n";
        print " ------------------------- \n";
}

# This will get executed when your program terminates.
END {
        print " ------------------------- \n";
        print "End of this perl script \n";
        print "Perl is awesome :) \n";
}

# This is called whenever the Perl try to call a subroutine that does not exist.
AUTOLOAD {
        print "Oosp, we are not able to find the required function : $AUTOLOAD \n";
        print "This is bad \n"
}

for ($i = 0; $i < 5 ;$i++ ) {
        print "$i \n";
}

&doesnotexists;


Continue Reading...


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

- Perl Script: Creating key-value pair (hash table) using Associative arrays


Associative arrays are a very useful and commonly used feature of Perl.

Associative arrays basically store tables of information where the lookup is the right hand key (usually a string) to an associated scalar value. Again scalar values can be mixed ``types''.

Below simple script demonstrate the usage of associative array and shows all the possible operation that can be done on this associative array.

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

# Creating Associative Arrays
%array = ("a", 1, "b", 2, "c", 3, "d", 4);

# Add more elements to the array
$array{"e"} = 5;

# Get all the keys.
@keys = sort keys(%array);
print "Keys present in the arrays are: @keys \n";

# Get all the values.
@values = sort values(%array);
print "Values present in the arrays are: @values \n";

# Get the value by referring to the key.
print "Enter the value between: ";
$getvalue = <STDIN>;
chop($getvalue);
print "value present for the $getvalue: $array{$getvalue} \n";

# Loop though the array
foreach $key (sort(keys(%array))) {
        print "$key : $array{$key} \n";
}

# Delete the key-value pair
delete($array{"a"});

# Copy associative array to normal array.
@array1 = %array;
print "Now the normal array contains: @array1 \n";

Continue Reading...


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

- Perl Script: How to seek through the file

Perl provides two functions which enable you to skip forward or backward in a file so that you can skip or re-read data.

seek - moves backward or forward
tell - returns the distance in bytes, between the beginning of the file and the current position of the file

The syntax for the seek function is:
seek (file, distance, from)

As you can see, seek requires three arguments:

file: which is the file variable representing the file in which to skip
distance: which is an integer representing the number of bytes (characters) to skip
from:which is either 0, 1, or 2

-- 0 :  the number of bytes to skip from beginning of the file.
-- 1 :  the number of bytes to skip from current location of the file.
-- 2 :  the number of bytes to skip from end of the file.

Below is simple Perl script which demonstrate the usage of seek and tell.
Continue Reading...


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

- Cheat Sheet - Unix/Linux Command Reference

"Unix/Linux Command Reference"

In this cheat sheet you will find a bunch of the most common Linux commands that you're likely to use on a regular basis.

On most systems you can lookup detailed information about any command by typing man command_name. You will need to be root user in order to use some of these commands. Be extremely careful as root if you're not 100% sure about what you're doing. You can make your system unusable. Even if you have a dual boot setup you may not be able to access any of your installed operating systems. Also with this free cheat sheet you will receive daily updates on new cool websites and programs in your email for free, courtesy of MakeUseOf.

Download you free copy of "Cheat Sheet - Unix/Linux Command Reference" - here




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

- Perl Script: How to execute bash (or other) scripts from within the Perl script

system() executes the command specified. It doesn't capture the output of the command.

system() accepts as argument either a scalar or an array. If the argument is a scalar, system() uses a shell to execute the command ("/bin/sh -c command"); if the argument is an array it executes the command directly, considering the first element of the array as the command name and the remaining array elements as arguments to the command to be executed.

For that reason, it's highly recommended for efficiency and safety reasons (specially if you're running a cgi script) that you use an array to pass arguments to system().

Below is simple perl script which explains the concept of system() function call.
Continue Reading...


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

- OpenSource Distribution for Art Creative People - Ubuntu Studio

Ubuntu Studio is Linux-based operating system designed as a free, open, and powerful platform for creative people to create their art.

Ubuntu Studio is also Free and Open Source Software (FOSS). Ubuntu Studio free to download and use. You can get the source code, study it and modify it. You can redistribute Ubuntu Studio and can even redistribute your modified version.

As an officially recognized derivative of Ubuntu, Ubuntu Studio is supported by Canonical Ltd. and an amazing and continually increasing community.

Ubuntu Studio is released every six months, but a long term release (LTS) version is released only every 2 years.
Continue Reading...


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

- Free and OpenSource Mobile Media Converter application

The Mobile Media Converter is a free audio and video converter for converting between popular desktop audio and video formats like MP3, Windows Media Audio (wma), Ogg Vorbis Audio (ogg), Wave Audio (wav), MPEG video, AVI, Windows Media Video (wmv), Flash Video (flv), QuickTime Video (mov) and commonly used mobile devices/phones formats like AMR audio (amr) and 3GP video. iPod/iPhone and PSP compatible MP4 video are supported. Moreover, you can remove and add new formats or devices through the internet.

An integrated YouTube downloader is available for direct downloading and converting to any of these formats. You can trim your clips for ringtone creation or any other purpose and crop your videos for removing up/down black bars or other unwanted parts of the image. Additionally, embedded subtitles can be encoded onto the video for watching movies or shows with subtitles on devices that does not supports them. Finally, a built-in DVD ripper is available to transform your own DVDs to any of the supported formats.

Continue Reading...


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

- Multitrack Non-Linear Video Editor - Flowblade

Flowblade Movie Editor is a multitrack non-linear video editor for Linux released under GPL 3 license.

Flowblade is designed to provide a fast, precise and as-simple-as-possible editing experience.

Flowblade employs film style editing paradigm in which clips are usually automatically placed tightly after the previous clip - or between two existing clips - when they are inserted on the timeline. Edits are fine tuned by trimming in and out points of clips, or by cutting and deleting parts of clips. Film style editing is faster for creating programs with mostly straight cuts and audio splits, but may be slower when programs contain complex composites unless correct work flow is followed.

Flowblade provides powerful tools to mix and filter video and audio.

Flowblade Features
Film style insert/trim editing paradigm
 * 2 move modes
 * 2 trim modes
 * 4 methods to insert/overwrite/append a clip on the timeline
 * Drag'n'Drop clips on the timeline
 * Clip and Compositor parenting with other clips
 * 5 video tracks and 4 audio tracks
Continue Reading...


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

- Perl Script: Insert, Replace or Delet the range of elements from an Array - splice

The Perl splice function is an array manipulation function and is used to remove, replace or add elements.
splice (@ARRAY, OFFSET, LENGTH, LIST)
where:
ARRAY - is the array to manipulate
OFFSET - is the starting array element to be removed
LENGTH - is the number of elements to be removed
LIST - is a list of elements to replace the removed elements with

The splice function returns:
in scalar context, the last element removed or undef if no elements are removed
in list context, the list of elements removed from the array

Below is simple perl script which demonstrate the use of this splice function, feel free to use and copy this code
Continue Reading...


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

- Mount, encrypt and manage disk image files and physical disk drives - eMount

eMount is a free system administrator tool for Linux that can mount, encrypt and manage disk image files and physical disk drives. It relies on cryptsetup, which implements the LUKS disk encryption specification.

eMount Features:
 * Create plain and encrypted disk images using one of the following file systems: ext2, ext3, ext4, FAT-16, FAT-32, HFS, HFS+, NTFS, ReiserFS and XFS.
 * Create encrypted volumes from physical disk drives.
 * Mount system partitions and virtual disks from the GUI or command line. The source can be plain or encrypted. List of supported file systems is O/S dependent. ISO images are widely supported.
 * Enlarge disk images (ext2, ext3, ext4, ReiserFS and XFS).
 * Copy to clone devices and disk images.
 * Supports all ciphers and hash algorithms provided by the operating system.

Continue Reading...


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

- Free eBook - Think Like a Hacker for Better Security

Receive Your Complimentary White Paper NOW!

"Takes One to Know One: Think Like a Hacker for Better Security Awareness"

52% of businesses experienced more malware infections as a result of employees on social media.
Security awareness is mostly about common sense, and thinking like the hackers to understand what security weaknesses they look for. But like other security precautions, it's easy to let down your guard.

Security awareness education can arm your staff with the skills to practice safe Internet usage - to reduce malware and other cyber threats.

Get you free copy of "Think Like a Hacker for Better Security" - here




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

- eBook - Getting Started with Ubuntu 12.10

"Getting Started with Ubuntu 12.10"


This 143 Page guide will cover the basics of Ubuntu 12.10 (such as installation and working with the desktop) as well as guide you through some of the most popular applications.

Getting Started with Ubuntu 12.10 is not intended to be a comprehensive Ubuntu instruction manual. It is more like a quick start guide that will get you doing the things you need to do with your computer quickly and easily, without getting bogged down with all the technical details. Ubuntu 12.10 incorporates many new features including a new kernel supporting newer graphic cards, updates to the Update Manager, and full-disk encryption, to name just a few.

Download you free copy of "Getting Started with Ubuntu 12.10" - here




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

- Free eBook - Build and Deploy Application using Open-Source Products

"SOA and WS-BPEL: Free 316 Page eBook"

Build and deploy your own service-oriented application using open-source products PHP and ActiveBPEL engine, as described in this easy-to-follow tutorial eBook.

Web services, while representing independent units of application logic, of course, can be used as stand-alone applications fulfilling requests from different service requestors. However, the real power of web services lies in the fact that you can bind them within service compositions, applying the principles and concepts of Service-Oriented Architecture. Ideally, web services should be designed to be loosely coupled so that they can potentially be reused in various SOA solutions and used for a wide range of service requestors.

As the name implies, the main idea behind this eBook is to demonstrate how you can implement Service-Oriented Solutions using PHP and ActiveBPEL Designer—free software products allowing you to effectively distribute service processing between the web/PHP server and ActiveBPEL orchestration engine. When it comes to building data-centric services, the eBook explains how to use MySQL or Oracle Database XE, the most popular free databases.

This practical eBook explains in extensive detail how to build Web Services with PHP and then utilize them within WS-BPEL orchestrations deployed to the ActiveBPEL engine.

Download your free copy of "SOA and WS-BPEL" - here




source:http://linuxpoison.blogspot.com/2012/11/135781677510826.html

- Multi-platform EPUB ebook editor - Sigil

Sigil is a multi-platform EPUB ebook editor with the following features

 * Online Sigil User's Guide, and Wiki documentation
 * Free and open source software under GPLv3
 * Multi-platform: runs on Windows, Linux and Mac
 * Full UTF-16 support
 * Full EPUB 2 spec support
 * Multiple Views: Book View, Code View and Preview View
 * WYSIWYG editing in Book View
 * Complete control over directly editing EPUB syntax in Code View
 * Table of Contents generator with multi-level heading support
 * Metadata editor with full support for all possible metadata entries (more than 200) with full descriptions for each
 * User interface translated into many languages
 * Spell checking with default and user configurable dictionaries
 * Full Regular Expression (PCRE) support for Find & Replace
 * Supports import of EPUB and HTML files, images, and style sheets,
 * Documents can be validated for EPUB compliance with the integrated FlightCrew EPUB validator
 * Embedded HTML Tidy: all imported files have their formatting corrected, and your editing can be optionally cleaned

Continue Reading...


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

- Perl Script: Input Line/record Separator examples

The input line/record separator ($/) is set to newline by default. Works like awk's RS variable, including treating blank lines as delimiters if set to the null string. You may set it to a multi-character string to match a multi-character delimiter, or can be set to the numeric value.

Below is simple perl script which demonstrate the usage of input record separator, feel free to copy and use this script.

Input File: cat testfile.txt
google:yahoo:microsoft:apple:oracle:hp:dell:toshiba:sun:redhat

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

$FILE = "testfile.txt";
open (INFILE, $FILE) or die ("Not able to open the file");
$/ = ":";
while ($record = <INFILE>) {
        print "$record \n";
}

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/11/135781677516081.html

- Convert your media files to all the popular formats - Format Junkie

Format Junkie is an Graphical User Interface user-friendly application with lots of options, which can convert your media files to all the popular formats! Unity integration has been bear in mind.

Specifically, it has the following features:

a) Audio: Conversion between the audio formats: mp3, mp2, wav, ogg, wma, flac, m4r, m4a and aac
b) Video: Conversion between the video formats: avi, ogv, vob, mp4, vob, flv, 3gp, mpg, mkv, wmv
c) Image: Conversion between the image formats: jpg, png, ico, bmp, svg, tif, pcx, pdf, tga, pnm
d) Iso|Cso Create an iso with selected files, convert iso to cso and vice versa.
e) Advanced Encode subtitles to an avi file.

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/11/135781677516672.html

- Free eBook - HackerProof: Your Guide to PC Security

"HackerProof: Your Guide to PC Security"

This 53 page guide provides an objective, detailed, but easily understood walk through of PC security.

The terms "PC security" or "computer security" are vague in the extreme. They tell you very little, like most general terms. This is because PC security is an incredibly diverse field. On the one hand you have professional and academic researchers who carefully try to find and fix security issues across a broad range of devices. On the other hand, there is also a community of inventive computer nerds who are technically amateurs (in the literal sense of the word – they're unpaid and unsupported by any recognized institution or company) but are highly skilled and capable of providing useful input of their own.

PC security is linked to computer security as a whole, including issues like network security and Internet security. The vast majority of the threats that may attack your computer are able to survive only because of the Internet and, in some cases, the survival of a security threat is directly linked to a security flaw in some high-end piece of server hardware. However, the average PC user has no control over this.

By the end of this guide you will know exactly what PC security means and, more importantly, what you need to do to keep your PC secure. Also 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 your free copy of "HackerProof: Your Guide to PC Security" - here




source:http://linuxpoison.blogspot.com/2012/11/135781677515878.html

- Free eBook - Citrix NetScaler - A Foundation for Next-Generation Datacenter Security

"Citrix NetScaler - A Foundation for Next-Generation Datacenter Security"


Today's regulatory requirements and evolving network architectures can make data-center security feel like a moving target.

This technical paper is designed to help you build a flexible, powerful security solution that reduces costs by leveraging your existing load balancing and ADC infrastructure.

Application Security - with web app firewall security, Data Loss Protection (DLP) and app-layer Denial of Service (DoS) defenses

Network/Infrastructure Security - including high-performance SSL, DNS security and multiple network-level attack protections

Identity and Access Management - for flexible application access control based on strong user authentication, app authorization and detailed auditing

Management - seamless integration with leading third-party products to extend reporting, analytics, vulnerability assessment capabilities

Download your free copy of - Citrix NetScaler - A Foundation for Next-Generation Datacenter Security - here




source:http://linuxpoison.blogspot.com/2012/11/13578167758006.html

- Database tool for Developers and Database Administrators - DBeaver

DBeaver is free universal database tool for developers and database administrators.

 * It is freeware.
 * It is multiplatform.
 * It is based on opensource framework and allows writing of various extensions (plugins).
 * It supports any database having a JDBC driver.
 * It may handle any external datasource which may or may not have a JDBC driver.
 * There is a set of plugins for certain databases (MySQL and Oracle in version 1.x) and different database management utilities (e.g. ERD).

Supported databases:
MySQL, Oracle, PostgreSQL, IBM DB2, Microsoft SQL Server, Sybase, ODBC, Java DB (Derby), Firebird (Interbase), HSQLDB, SQLite, Mimer, H2, IBM Informix, SAP MAX DB, Cache, Ingres, Linter, Teradata, Any JDBC compliant data source

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/11/13578167754804.html

- Open Source Host-based Intrusion Detection System - OSSEC

OSSEC is an Open Source Host-based Intrusion Detection System that performs log analysis, file integrity checking, policy monitoring, rootkit detection, real-time alerting and active response.

It runs on most operating systems, including Linux, MacOS, Solaris, HP-UX, AIX and Windows.

OSSEC Features:
OSSEC is a full platform to monitor and control your systems. It mixes together all the aspects of HIDS (host-based intrusion detection), log monitoring and SIM/SIEM together in a simple, powerful and open source solution.

 * Compliance Requirements
 * Multi platform
 * Real-time and Configurable Alerts
 * Integration with current infrastructure
 * Centralized management
 * Agent and agentless monitoring
 * File Integrity checking
 * Log Monitoring
 * Rootkit detection
 * Active response

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/11/135781677511245.html

- Perl Script: Read the Environment Variables

The %ENV associative array lists the environment variables defined for a program and their values. The environment variables are the array subscripts, and the values of the variables are the values of the array elements.

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

$term = $ENV{"TERM"};
print "Terminal you are using: $term \n";

$desktop = $ENV{"DESKTOP_SESSION"};
print "Desktop you are using: $desktop \n";

$lang = $ENV{"LANGUAGE"};
print "Lang you are using: $lang \n";

Output: perl env_variable.pl
Terminal you are using: xterm
Desktop you are using: kde-plasma
Lang you are using: en_US:




source:http://linuxpoison.blogspot.com/2012/11/135781677516553.html

- Free eBook - Website Security Threat Report

"Website Security Threat Report"

Updates from Symantec's Internet Security Threat Report.
The Internet Security Threat Report provides an overview and analysis of the year in global threat activity. The report is based on data from the Global Intelligence Network, which Symantec's analysts use to identify, analyze, and provide commentary on emerging trends in attacks, malicious code activity, phishing, and spam.

This shortened version of the report - the Website Security Threat Report - has been created to specifically focus on website security issues.

Download your free copy of Website Security Threat Report - here




source:http://linuxpoison.blogspot.com/2012/11/13578167751290.html

- Perl Script: Signal Handling

You can control how your program responds to signals it receives. To do this, modify the %SIG associative array. This array contains one element for each available signal, with the signal name serving as the subscript for the element.

Below is simple Perl script which demonstrate the way to handle the interrupt signal...

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

$SIG{"INT"} = "catch_signal";
while (1){
        print "waiting for signal ... press ctl+c to catch the interrupt signal \n";
        sleep(1);
}

sub catch_signal {
        print "\n Kool, I am able to handle interrupt signal \n";
        exit();
}

Output: perl signal.pl
waiting for signal ... press ctl+c to catch the interrupt signal
waiting for signal ... press ctl+c to catch the interrupt signal
waiting for signal ... press ctl+c to catch the interrupt signal
waiting for signal ... press ctl+c to catch the interrupt signal
waiting for signal ... press ctl+c to catch the interrupt signal
^C
 Kool, I am able to handle interrupt signal




source:http://linuxpoison.blogspot.com/2012/11/13578167753904.html

- Perl Script: Creating pointers (References) to variable, Array and Hash

A reference is a scalar value that points to a memory location that holds some type of data. Everything in your Perl program is stored inside your computer's memory. Therefore, all of your variables, array, hash and functions are located at some memory location. References are used to hold the memory addresses.

Below is simple Perl script which demonstrate the usage of reference ...

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

# Creating pointer to a variable.
$var = 10;
$pointer = \$var;
print "Pointer address is: $pointer \n";
print "value store at $pointer is $$pointer \n";

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

# Creating pointer to an array.
@array = ("1", "2", "3", "4");
$array_pointer = \@array;
print "Address of the array in the memory: $array_pointer \n";

$len = scalar(@$array_pointer);
print "Length of the array: $len \n";

for ($i=0; $i<$len; $i++) {
  print "$$array_pointer[$i] \n";
}
Continue Reading...


source:http://linuxpoison.blogspot.com/2012/11/135781677510207.html

- White Paper - Enforcing Enterprise-out Security for Cloud Servers

"Enforcing Enterprise-out Security for Cloud Servers"

Learn how to maintain a secure environment in the cloud.

Cloud-based computing models offer the promise of a highly scalable compute infrastructure without having to acquire, install and maintain any additional hardware. However, implementing this new compute model using even the most trusted service providers requires a security solution that empowers IT to maintain control over user and network access to those hosted virtual machines.

Security becomes even more important given the regulatory climate and audit pressures surrounding PCI, SOX, BASEL II and HIPAA. Centrify solves these difficult problems by providing an enterprise-out security enforcement approach that leverages existing Active Directory-based security policy enforcement and IPsec-based server and domain isolation. Together, these technologies enable rapid expansion of cloud compute capacity while still maintaining a secure environment.

Download your free white paper on "Enforcing Enterprise-out Security for Cloud Servers" - here





source:http://linuxpoison.blogspot.com/2012/12/135781677514593.html

- Perl Script - Manipulating Arrays of Arrays (Multidimensional Arrays)

Below is simple Perl scrip which demonstrate the usage of multi-dimension arrays (array of arrays)

Feel free to copy and use this code ..

Source: cat multi-dimensional_array.pl
#!/usr/bin/perl

# Multi-dimension array by reference.
$array = ["A", "B", ["1", "2", "3",  ["x", "y", "z"]]];

print "\$array->[0] == $array->[0] \n";
print "\$array->[1] == $array->[1] \n";

print "\$array->[2][1] == $array->[2][1] \n";
print "\$array->[2][2] == $array->[2][2] \n";

print "\$array->[2][3][0] == $array->[2][3][0] \n";
print "\$array->[2][3][1] == $array->[2][3][1] \n";
print "\$array->[2][3][2] == $array->[2][3][2] \n";

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

@array1 = (
  "A", "B",
  ["1", "2", "3",  ["x", "y", "z"]]
);

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/11/13578167751351.html

- Free eBook - Linux Email -- Free Sample Chapter

"Linux Email -- Free Sample Chapter"

Set up, maintain, and secure a small office email server.
Many businesses want to run their email servers on Linux for greater control and flexibility of corporate communications, but getting started can be complicated. The attractiveness of a free-to-use and robust email service running on Linux can be undermined by the apparent technical challenges involved. Some of the complexity arises from the fact that an email server consists of several components that must be installed and configured separately, then integrated together. This book gives you just what you need to know to set up and maintain an email server. Unlike other approaches that deal with one component at a time, this book delivers a step-by-step approach across all the server components, leaving you with a complete working email server for your small business network.

This free sample chapter, Chapter 4: Providing Webmail Access, shows how to set up webmail access using SquirrelMail. This will give users an easy, out-of-office access to their email. Be introduced to the SquirrelMail software package and examine the pros and cons of this and other webmail access solutions. After that, it will follow the installation and configuration of SquirrelMail step by step. Next, it will examine the installation of plugins and include a reference of useful plugins. Finally, it will include some tips on how to secure SquirrelMail.

Download your free sample chapter - here





source:http://linuxpoison.blogspot.com/2012/12/13578167755415.html

- Bash Script - Protect your server from DDos (Distributed Denial of Service) Attack

What is DDos attack:
On the Internet, a distributed denial-of-service (DDoS) attack is one in which a multitude of compromised systems attack a single target, thereby causing denial of service for users of the targeted system. The flood of incoming messages to the target system essentially forces it to shut down, thereby denying service to the system to legitimate users.

DDoS-Deflate is a very simple but effective bash script which monitors the numbers of connection made by a particular ip address using 'netstat' command and if the number of connection from a single ip address reaches a particular limit (150 default) it will block that ip address using simple iptables rules for defined time period.

DDoS-Deflate Installation:
Open the terminal and type following command:
wget http://www.inetbase.com/scripts/ddos/install.sh
chmod 0700 install.sh
./install.sh
After successful installation, you can find the DDoS-Deflate configuration file at: /usr/local/ddos/ddos.config
Continue Reading...


source:http://linuxpoison.blogspot.com/2012/12/13578167755274.html

- Install Tor Browser Bundle under Ubuntu Linux

Tor protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world: it prevents somebody watching your Internet connection from learning what sites you visit, and it prevents the sites you visit from learning your physical location. Tor works with many of your existing applications, including web browsers, instant messaging clients, remote login, and other applications based on the TCP protocol.

The Tor Browser Bundle lets you use Tor on Windows, Mac OS X, or Linux without needing to install any software. It can run off a USB flash drive, comes with a pre-configured web browser to protect your anonymity, and is self-contained.

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/12/13578167751686.html

- Manage your Flickr Photo from Ubuntu Desktop - Frogr

Frogr is a small application for the GNOME desktop that allows users to manage their accounts in the Flickr image hosting website. It supports all the basic Flickr features, including uploading pictures, adding descriptions, setting tags and managing sets and groups pools.

Frogr Features:
 * Allow to upload pictures to flickr, specifying details such as title, description, tags, visibility, content type, safety level and whether the to "show up on global search results", both individually or to several pictures at once.
 * Allow uploading pictures located in remote machines, through typically supported protocols (SAMBA, SSH, FTP...).
 * Allow sorting pictures by title and date taken, besides the default order ("as loaded").
 * Allow adding tags to pictures, opposite to just set them through the 'details' dialog.
 * Allow setting specific licenses and geolocation information for pictures right from the desktop.
 * Allow specifying sets and group pools for the pictures to be added to after the upload process.
 * Allow to create sets right from frogr, opposite to just adding pictures to already existing ones.
 * Allow specifying a list of pictures to be loaded from command line.
 * Import tags from picture's metainformation if present when loading.

Continue Reading...


source:http://linuxpoison.blogspot.com/2012/12/135781677510250.html

- Free Guide - Web Application Security; How to Minimize Prevalent Risk of Attacks

"Web Application Security; How to Minimize Prevalent Risk of Attacks"

Vulnerabilities in web applications are now the largest vector of enterprise security attacks.

Stories about exploits that compromise sensitive data frequently mention culprits such as "cross-site scripting," "SQL injection," and "buffer overflow." Vulnerabilities like these fall often outside the traditional expertise of network security managers.

To help you understand how to minimize these risks, Qualys provides this guide as a primer to web application security.

The guide covers:
 * Typical web application vulnerabilities
 * Comparison of options for web application vulnerability detection
 * QualysGuard Web Application Scanning solution

Download your free copy of "Web Application Security; How to Minimize Prevalent Risk of Attacks" - here




source:http://linuxpoison.blogspot.com/2012/12/135781677515979.html

- Free EBook - Introduction to Linux - A Hands on Guide

"Introduction to Linux - A Hands on Guide"

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.

For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Download your free copy of "Introduction to Linux - A Hands on Guide" - here




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

- Perl Script: Sorting an Array

The Perl sort function sorts a string ARRAY by an ASCII numeric value and numbers using alphanumerical order and returns the sorted list value.

The problem is that capital letters have a lower ASCII numeric value than the lowercase letters so the words beginning with capital letters will be shown first, so in order to get the desire result we need to do something else to this default sort functionality provide by the Perl.

The Perl sort function uses two operators: cmp and <=>, you can use the cmp (string comparison operator) or <=> (the numerical comparison operator) and also uses two special variables $a and $b are compared in pairs by sort to determine how to order the list.

Below is simple Perl script which demonstrate the usage of the sort functionality of Perl, feel free to copy and use this script.

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

@string_array = ("Foo", "loo", "Boo", "zoo", "Moo", "hoO", "GOo", "Poo");
@sorted_stringarray = sort (@string_array);
print "This is defaul sort : ", join(", ", @sorted_stringarray), "\n";

@sorted_stringarray = ();
@sorted_stringarray = sort ({lc($a) cmp lc($b)} @string_array);
print "This is what we want: ", join(", ", @sorted_stringarray), "\n";

Continue Reading...


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

- Perl Script: Include external Perl script withing Perl script

This is something different that including the package/modules, the require function provides a way to break your program into separate files and create libraries of functions.

NOTE: The last expression evaluated inside a file included by require becomes the return value. The require function checks whether this value is zero, and terminates if it is so, in this case make sure to return some non-zero value from withing your include file and the best way to do is to insert the 1; at the end of this include file.

Below Perl script show the way to include another Perl script within the Perl script.


Include File: cat include.pl
#!/usr/bin/perl

print "Inside the include file \n";
$var = 20;

1;

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

require ("include.pl");
$var = $var + 20;
print "final value of var is : $var \n";

Output: perl require.pl
Inside the include file
final value of var is : 40




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

- White Paper - A Multi-Level Approach to Addressing Targeted Attacks

"A Multi-Level Approach to Addressing Targeted Attacks"
88% of targeted malware is NOT detected by anti-virus according to research by Trustwave.

Targeted malware is tailor-designed to take advantage of an organization's specific device(s), data networks or a specific employee. Taking a multi-level approach, using many solutions, businesses can enable wider coverage for all types of targeted malware, reducing the attack surface and preventing attacks.

Download this paper and learn about:
 * The current state of targeted attacks
 * How and why targeted attacks work
 * Multi-level defenses to combat malware and persistent threats
 * Targeted attacks are increasing in number and complexity - every business is at risk.

 Download this paper now to find out how to improve your security and protect your business - here




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

- Bash Script: Performing Floating point Math Operation

NOTE: If your program depends heavily on Math operation (floating point), better switch to ksh instead of traditional bash.

Bash does not support floating point operations but it's possible to redirects these Math operation to some other program (bc).

The "bc" calculator comes as a part of your Linux distro, so there's no need for you to install anything extra. In addition to performing simple math functions, it can also perform conversions between different number systems, perform a number of scientific math functions, and can even run programs that you write and save in a text file. look the bc man pages for more details.

Below is simple bash script which demonstrate the usage of bc commands in the script

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

echo "----- Addition ------"
x=10.2
y=20.2
z=`echo $x+$y|bc`
echo $z
Continue Reading...


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