Source : This is a translation of an article “Passagem para a India” that was published on the magazine section of O Expresso of December 8, 2001. It was translated by Gabriel Figueiredo gdefigueiredo yahoo.com.au, and reproduced here with his permission. It tells the story from a Portuguese perspective … — Commencing at 0:00 hours […]
Tag: perl
Juniper Hardening Procedure
DOWNLOAD – Juniper device hardening Introduction Rationale An out-of-box firewall implementation is not fully secure and needs to be hardened. This document details the various aspects of Juniper firewall security and standards implemented for securing Juniper firewalls. Purpose This document is to define a baseline security standard for the Juniper Firewall implementations by firewall administrators. […]
Perl Expect bindings – Simple example
Hello World file (hello.pl) #!/usr/bin/perl use strict; use warnings; use diagnostics; print “———–\n”, “Hello World\n”, “———–\n”; Test Perl file with expect bindings (test.pl) #!/usr/bin/perl use strict; use warnings; use diagnostics; use Expect; my $timeout=5; foreach my $i (1..20) { my $exp = Expect->spawn(“./hello.pl”) or die “Unexpected error : $!\n”; $exp->expect($timeout); }
Iomega – Customer Service ?
I bought a prestige portable hard drive from IT dot COM from Margao, Goa, India. After a few months the drive stopped functioning properly. I have no idea why. The light keeps blinking; does not detect. Tried on many different systems. I was in Hyderabad when this happened. Believe it or not I couldn’t find […]
How To Get The Current Epoch Time (Unix Timestamp)
Perl time PHP time() Ruby Time.now (or Time.new). To display the epoch: Time.now.to_i Python import time first, then int(time.time()) Java long epoch = System.currentTimeMillis()/1000; Microsoft .NET C# epoch = (DateTime.Now.ToUniversalTime().Ticks – 621355968000000000) / 10000000; VBScript/ASP DateDiff(“s”, “01/01/1970 00:00:00”, Now()) Erlang calendar:datetime_to_gregorian_seconds(calendar:now_to_universal_time( now()))-719528*24*3600. OR element(1, now()) * 10000 + element(2, now()). MySQL SELECT unix_timestamp(now()) PostgreSQL SELECT extract(epoch […]
Perl – system load
To find the system load use the following perl snippet : 1) System load of last one minute : my $system_load = exec(‘uptime | awk -F “load average: ” \'{ print $2 }\’ | cut -d, -f1′); my $system_load = qx(‘uptime | awk -F “load average: ” \'{ print $2 }\’ | cut -d, -f1′); […]
Gearman – Can’t call method “syswrite” on an undefined value at /usr/local/share/perl/5.10.1/Gearman/Taskset.pm line 202.
If you get the following error while running the client code : Can’t call method “syswrite” on an undefined value at /usr/local/share/perl/5.10.1/Gearman/Taskset.pm line 202. … then change this $client->job_servers(‘127.0.0.1’); to $client->job_servers(‘127.0.0.1:4730’); thats it ! 🙂
Gearman and Perl
[slideshare id=3028682&doc=gearman-100130043018-phpapp02]
Perl – How to Read a Text File into a Variable – 6 ways to do it
6 Ways to Read a Text File into a Variable If you are working with large file(s) you might consider using File::Slurp. It is much fast than the conventional: { local $/=undef; open FILE, “myfile” or die “Couldn’t open file: $!”; binmode FILE; $string = <FILE>; close FILE; } { local $/=undef; open FILE, “myfile” […]
9 skills developers will need in the next five years
With the recent changes in the economy, a lot of developers are focused on their short-term job prospects. At the same time, it’s important to make sure that you get the most bang for your buck when it comes to taking the time and energy to learn new skills. Here is a list of 10 […]