linux poison RSS
linux poison Email
1

Free Guide: Make Your Own Android App - MIT App Inventor

"Make Your Own Android App: Your Unofficial Guide to MIT App Inventor"

App Inventor is an easy and fun way for the uninitiated to learn about computer programming, and is at the same time a productive tool for advanced programmers alike.

For most, the underlying technology that makes an app ‘tick' is shrouded in mystery. This has been a boon for programming experts and has spurned a very profitable niche for professional programmers who are paid to research, develop, and build these apps. But what if you have an idea for the “next big thing” - or even the “next little thing” for that matter - with no programming skills to speak of and, for whatever reason, you don't want to hand over your idea to a professional and pay to have it developed? In the past, if you weren't an app programmer yourself, you would have had the option to

(a) do nothing, of course,
(b) be brave and trust your idea in the hands of a developer, or
(c) develop your programming skills and learn how to build the darn thing yourself.

Well, now there is hope for non-programmers. Recently, thanks to a collaboration between Google and MIT, the world of mobile app creation has been opened to everyone with App Inventor, which is a web-based development platform, making option (c) not so out of reach for many.

Download your free copy of - Make Your Own Android App: Your Unofficial Guide to MIT App Inventor - here


Read more
1

Web-based personal media streaming system - Subsonic

Subsonic is a free, web-based media streamer, providing ubiquitous access to your music. Use it to share your music with friends, or to listen to your own music while at work. You can stream to multiple players simultaneously.

Subsonic is designed to handle very large music collections (hundreds of gigabytes). Although optimized for MP3 streaming, it works for any audio or video format that can stream over HTTP, for instance AAC and OGG. By using transcoder plug-ins, Subsonic supports on-the-fly conversion and streaming of virtually any audio format, including WMA, FLAC, APE, Musepack, WavPack and Shorten.

If you have constrained bandwidth, you may set an upper limit for the bitrate of the music streams. Subsonic will then automatically resample the music to a suitable bitrate.

In addition to being a streaming media server, Subsonic works very well as a local jukebox. The intuitive web interface, as well as search and index facilities, are optimized for efficient browsing through large media libraries. Subsonic also comes with an integrated Podcast receiver, with many of the same features as you find in iTunes.
Read more
0

White Paper - Overcoming Security Concerns with SSL

"Cloud Adoption in Asia Pacific: Overcoming Security Concerns with SSL"


Cloud computing is a service delivery model that provides on-demand computing and storage services. Clouds may be public and open to all users, private and available only to users within an organization, or a hybrid. Although public clouds offer valuable services for businesses, this cloud model requires sound practices to maintain adequate security.

Secure Sockets Layer (SSL) certificates are essential to implementing the encryption and authentication services used with cloud computing resources. When both cloud providers and their customers implement security best practices, they can comply with the demands of government and industry regulations as well as overcome security concerns. This white paper explores SSL technologies as an essential element of sound cloud security practices.

Offered Free by: VeriSign Authentication Services, now a part of Symantec Corp

Download your free copy of "Cloud Adoption in Asia Pacific: Overcoming Security Concerns with SSL" - here


Read more
0

Perl Script: Simple Network Programming (Client - Server Application)

A network socket is an endpoint of an inter-process communication flow across a computer network. Today, most communication between computers is based on the Internet Protocol; therefore most network sockets are Internet sockets.

In Perl, IO::Socket::INET provides an object interface to creating and using sockets in the AF_INET domain. It is built upon the IO::Socket interface and inherits all the methods defined by IO::Socket.

Below is a simple server created using Perl IO::Socket::INET module

Source: server.pl
#!/usr/bin/perl

use IO::Socket::INET;

$socket = new IO::Socket::INET (
    LocalHost => '127.0.0.1',
    LocalPort => '40000',
    Proto => 'tcp',
    Listen => 10,
    Reuse => 1
) or die "Oops: $! \n";
Read more
0

Perl Script: Creating Method Override (Polymorphism)

Polymorphism means that methods defined in the base class will override methods defined in the parent classes and is mainly used to add or extend the functionality of an existing class without reprogramming the whole class.

The following simple Perl code demonstrate the concepts of Polymorphism (Method overriding):

Source: Polymorphism.pl
#!/usr/bin/perl

package parent;
  sub foo {
    print "Inside the parent. \n";
  }

# Inheritance is accomplished by placing the names of parent classes into a special array called @ISA.

package child;
  @ISA = (A);
  sub foo {
    print "Inside the child. \n";
  }
 
package main;
  child->foo();
 
Output: perl Polymorphism.pl
Inside the child.



Read more
0

Perl Script: Exception handling using eval()

eval in Perl is something like try .. catch block in Java, The statement eval { ... } catches an exception that was given inside it, and after it sets the special variable $@ to be the value of the exception or undef if none was caught.

If there is a syntax error or runtime error, or a die() statement is executed, an undefined value is returned by eval(), and $@ is set to the error message. If there was no error, $@ is guaranteed to be a null string. Beware that using eval() neither silences perl from printing warnings to STDERR, nor does it stuff the text of warning messages into $@.

source: eval.pl
#!/usr/bin/perl

eval {
  cal();
};
   
if ($@) {
  print "Error due to :\n $@ \n";
}

print " === This will always get executed. === \n";
Read more
0

Perl Script: How to use system defined Error message

There are many Perl defined system variables that you can use in your script, one of them is "$!", When used in a numeric context, holds the current value of errno. If used in a string context, will hold the error string associated with errno.

Below is simple Perl script which prints all available system error message and their corresponding error codes.


Source: error_message.pl

#!/usr/bin/perl
for ($! = 1, $i = 1; $! <= 25; $!++, $i++) {
    $errormsg = $!;
    chomp($errormsg);
    print "$i : $! \n";
}
Read more
0

White Paper - Zero Day Exploits

"Zero Day Exploits"
A zero day exploit is an attack that was previously unknown to the target or security experts in general.

For several years, most news articles about a computer, network, or Internet compromise has mentioned the phrase "zero day exploit" or "zero day attack," but rarely do these articles define what this is.

Many believe that the term refers to attacks that were just released into the wild or developed by hackers in the current calendar day. This is generally not the case. The "zero day" component of the term refers to the lack of prior knowledge about the attack. That the victim has zero day's notice of an attack. The main feature of a zero day attack is that since it is an unknown attack, there are no specific defenses or filters for it. Thus, a wide number of targets are vulnerable to the exploit.

Download your free copy of "Zero Day Exploits" - here


Read more
0

Perl Script: Creating Class (package) Inheritance

Inheritance provides a powerful and natural mechanism for organizing and structuring your code.In object-oriented programming, inheritance is a way to form new classes using classes that have already been defined. The new classes, known as derived classes, take over (or inherit) attributes and behavior of the pre-existing classes, which are referred to as base classes (or ancestor classes). It is intended to help reuse existing code with little or no modification.

In Perl, Inheritance is accomplished by placing the names of parent classes into a special array called @ISA in your child class.

Below is simple Perl script which demonstrate the usage of Package Inheritance:


Source: Inheritance.pl
#!/usr/bin/perl

package mother;
  sub a {
    print "Inside the package mother \n";
  }
Read more
0

Perl Script - Reading / Writing Binary files

A binary file is a computer file that is not a text file; it may contain any type of data, encoded in binary form for computer storage and processing purposes.

If you want to open a file and read its content in binary mode, you should use the following functions:
 * open() to open the file to a file handle.
 * binmode() to set the file handle to binary mode.
 * read() to read data from the file handle.
 * close() to close the file handle.

Below sample Perl script demonstrate the usage of reading / writing the binary files using binary mode.

Source: binary.pl
#!/usr/bin/perl

$buffer = "";
$infile = "binary.dat";
$outfile = "binary_copy.dat";
Read more
0

Perl Script: Reading the list of files from Directory

There are couple of ways to get the list of files from withing directory.

#1 - Using the built-in Perl glob function
#2 - Using opendir, readdir and closedir

Below Perl script demonstrate the usage of above methods to get the list of files, feel free to copy and use this code.

Source: read_dir.pl
#!/usr/bin/perl

# Method #1 - using the built-in Perl glob function
@filelist = <*>;
foreach $filename (@filelist) {
  print $filename;


# Method #2 - Using opendir, readdir and closedir

$dir = "/home/poison";
opendir(DIR, $dir) || die "Problem reading the dir. \n";

# Read the entire file names into a array
#@filelist = readdir(DIR);

while ($filename = readdir(DIR)) {
  print $filename , "\n";
}
closedir(DIR);



Read more
0

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";
Read more
0

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
Read more
2

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


Read more
0

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


Read more
0

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";

Read more
0

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


Read more
Related Posts with Thumbnails