September 21, 2017

idrac_pwd.pl – Script for iDRAC root password change

Posted in Perl tagged , , , at 12:22 pm by alessiodini


The customer I’m working for in these days, asked me to reset a hunderd of iDRAC consoles root password because they were still using the default root/calvin credentials.

Having fun for this request, I wrote a perl script using Net::OpenSSH module. This script checks for root account index, and it changes the password using this index. If something does not work as expected, the script will let u know on which host it faced the issue.

It’s very easy to use, for example:

$ perl idrac_pwd.pl 1.2.3.4

Connection to host 1.2.3.4
Reset password succesfully executed on 1.2.3.4 – index 2

That’s all!
You can download the script here.

Have fun 😀

Advertisements

January 31, 2012

Solaris: How to verify 64 bit Perl installation

Posted in Perl at 10:15 am by alessiodini


Today i needed to understand if a Perl installation was 32 or 64 bit.
Looking on the web i found that is possible to know this even using perl command itself , as follow:

system2 # perl -V:use64bitall
use64bitall=’undef’;
system2 # perl -V:use64bitint
use64bitint=’undef’;

With these commands there are 2 possibilities:
define = says “yes”
undefined = says “no”

So , where i ran these commands Perl running was in 32 bit.

March 3, 2009

Uniq command

Posted in Perl at 4:25 pm by alessiodini


Today in my free time at job , i wrote a perl script that works as uniq command:

[cr@eseross01 tmp]$ cat test
ciao
bello
brutto
alessio
pippo
pluto
alessio
alessio

The test file contains three “alessio” , so this string is replicated.
I run my script on this file:

[cr@eseross01 tmp]$ perl uniq.pl test
ciao
bello
brutto
alessio
pippo
pluto

He returns the singles strings!
The code is here