Author:
erics , December 26th, 2013
CPAN Error: Undefined subroutine &IO::Uncompress::Base::readonly called at /usr/lib/perl5/site_perl/5.8.8/IO/Uncompress/Base.pm Looks like CentOS update installs an older version of the Scalar::Util so that Perl could not load the module. Download the Scalar::Util module and manually install it:
wget http : //search.cpan.org/CPAN/authors/id/P/PE/PEVANS/Scalar-List-Utils-1.35.tar.gz
tar xvzf Scalar - List - Utils - * . tar . gz
cd Scalar - List - Utils - *
perl Makefile . PL
gmake
gmake test
gmake install
To test: perl -MCPAN -e ‘shell’ For more information, visit the CPAN Util.pm page. Original Post: http://www.perlmonks.org/?displaytype=print;node_id=965635;replies=1
Categories: How-To's , Technology Tags: CPAN , howto , IO , IO::Uncompress , perl , Scalar , Scalar::Utils , tips , Uncompress , Utils
| 1 comment
Author:
erics , April 13th, 2012
I had to patch the distribution by adding the following variable into the code: $Config::Auto::Untaint = 1; Here is the fix on AWS Linux: vim /usr/local/share/perl5/CGI/Application/Plugin/ConfigAuto.pm 141 sub cfg { 142 my $self = shift; 143 144 if (!$self->{__CFG}) { 145 require Config::Auto; 146 $Config::Auto::Untaint = 1; (ADD THIS NEW LINE HERE)
Categories: How-To's , Technology Tags: AWS , AWS Linux , CGI::Application::Plugin::ConfigAuto , Config::Auto , howto , Linux , perl , Taint , Taint Mode , tips
| No comments
Author:
erics , April 12th, 2012
For example, to see the version for DBD::mysql, do this: perl -MDBD::mysql -we ‘print $DBD::mysql::VERSION;’
Categories: How-To's , Technology Tags: DBD , DBD::mysql , howto , module , mysql , perl , tips , Version
| No comments
Author:
erics , March 21st, 2012
Perl to the Rescue! This perl script cleans just one type of infection as an example. Vary the script to search for and clean other combinations and patterns. Also, the script is deliberately written long-hand and verbose, and could be significantly more compact and efficient. It was done this way for ease of use and […]
Categories: How-To's , Technology Tags: base64 , base64_decode , eval , hack , Hacked , Infected , perl , php , WordPress
| No comments
Author:
erics , December 30th, 2011
yum -- enablerepo = epel install perl - Net - Amazon - EC2 perl - File - Slurp perl - DBI perl - DBD - MySQL perl - Net - SSLeay perl - IO - Socket - SSL perl - Time - HiRes perl - Params - Validate ca - certificates
wget - O / opt / aws / bin / ec2 - consistent - snapshot http : //bazaar.launchpad.net/~alestic/ec2-consistent-snapshot/trunk/download/head:/ec2consistentsnapsho-20090928015038-9m9x0fc4yoy54g4j-1/ec2-consistent-snapshot
chmod 0775 / opt / aws / bin / ec2 - consistent - snapshot
http://alestic.com/2009/09/ec2-consistent-snapshot http://www.thatsgeeky.com/2011/05/ec2-consistent-snapshot-on-amazons-linux-ami/ http://www.thatsgeeky.com/2011/06/rotating-ebs-snapshots-ec2-prune-snapshots/
Categories: How-To's , Technology Tags: Amazon , Amazon Linux , AWS , CentOS , chmod , consistent-snapshot , EC2 , ec2-consistent-snapshot , EPEL , howto , Linux , perl , Repo , Snapshot , tips , wget , Yum
| No comments
Author:
erics , November 3rd, 2011
YMMV…
#!/usr/bin/perl
use strict ;
$ | = 1 ;
our $ LIMIT = shift || 5000 ;
open ( STDIN , "/usr/sbin/tcpdump -Atpn dst port 80 |" ) ;
while ( <> ) {
last unless $ LIMIT -- ;
next unless / get | host | post | http | xml / i ;
print ;
}
Additional Reading http://chaosreader.sourceforge.net/ http://www.id-snippet.com/3008/dump-http-packet-using-tcpdump-and-perl/ http://stein.cshl.org/~lstein/talks/WWW6/sniffer/ http://www.perlmonks.org/index.pl?node_id=254612
Categories: How-To's , Technology Tags: howto , perl , tcpdump , tips
| No comments
Author:
erics , October 28th, 2011
This solution is hyper-simplistic, and does not deal with decimals or real numbers (those with either a – or a + in front of them)…
if ( $ value = ~ / ^ \ d + $ / ) {
## $value is an integer
} else {
## $value is NOT an integer
}
Categories: How-To's , Technology Tags: howto , Integer , Number , Numeric , perl , tips
| No comments
Author:
erics , October 27th, 2011
Your mileage may vary widely…
export AWS_CREDENTIALS_FILE = / root / aws / aws - credentials
mkdir / opt / aws / bin
cd / opt / aws / bin
wget http : //aws-catalog-download-files.s3.amazonaws.com/AmazonSES-2011-07-21.zip
unzip AmazonSES - 2011 - 07 - 21.zip
CentOS
yum install libxml2 - devel
Ubuntu
apt - get install gcc
apt - get install libssl - dev
apt - get install libxml2 - dev
apt - get install libio - socket - ssl - perl
apt - get install libnet - ssleay - perl
apt - get install libnet - https - any - perl
apt - get install liblwp - useragent - determined - perl
For all OS
cpan CPAN YAML Digest :: SHA URI :: Escape Bundle :: LWP MIME :: Base64 Crypt :: SSLeay XML :: LibXML LWP :: Protocol :: https
perl - e 'print "@INC;\n";'
cp SES . pm { one path from above command }
/ opt / aws / bin / ses - verify - email - address . pl - l
Categories: How-To's , Technology Tags: Amazon , apt-get , AWS , CPAN , howto , perl , SES , Simple Email Service , tips , XML , Yum
| No comments
Author:
erics , October 24th, 2011
The below worked for me…
# yum repolist
# yum install git --disablerepo=epel
Here are the errors I was getting:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
root @ dev : / root # yum install git
Loaded plugins : fastestmirror , security
Loading mirror speeds from cached hostfile
* epel : mirror . symnds . com
amzn | 2.1 kB 00 : 00
Setting up Install Process
Resolving Dependencies
-- > Running transaction check
-- -> Package git . x86 _ 64 0 : 1.7.4.1 - 1.el5 set to be updated
-- > Processing Dependency : perl - Git = 1.7.4.1 - 1.el5 for package : git - 1.7.4.1 - 1.el5.x86_64
-- > Processing Dependency : perl ( Error ) for package : git - 1.7.4.1 - 1.el5.x86_64
-- > Processing Dependency : perl ( Git ) for package : git - 1.7.4.1 - 1.el5.x86_64
-- > Processing Dependency : libcurl . so . 3 ( ) ( 64bit ) for package : git - 1.7.4.1 - 1.el5.x86_64
-- > Running transaction check
-- -> Package git . x86 _ 64 0 : 1.7.4.1 - 1.el5 set to be updated
-- > Processing Dependency : libcurl . so . 3 ( ) ( 64bit ) for package : git - 1.7.4.1 - 1.el5.x86_64
-- -> Package perl - Error . noarch 1 : 0.17015 - 4.4.amzn1 set to be updated
-- -> Package perl - Git . x86 _ 64 0 : 1.7.4.1 - 1.el5 set to be updated
-- > Processing Dependency : perl ( : MODULE_COMPAT_5 . 8.8 ) for package : perl - Git - 1.7.4.1 - 1.el5.x86_64
-- > Finished Dependency Resolution
Error : Package : git - 1.7.4.1 - 1.el5.x86_64 ( epel )
Requires : libcurl . so . 3 ( ) ( 64bit )
Error : Package : perl - Git - 1.7.4.1 - 1.el5.x86_64 ( epel )
Requires : perl ( : MODULE_COMPAT_5 . 8.8 )
You could try using -- skip - broken to work around the problem
You could try running : rpm - Va -- nofiles -- nodigest
Categories: How-To's , Technology Tags: Amazon , AWS , CentOS , EPEL , git , howto , Linux , perl , Repo , repolist , tips , Yum
| 11 comments
Author:
erics , October 10th, 2011
my $ number = 123.45 ;
printf ( "%.3f" , $ number ) ;
Outputs: 123.450
Categories: How-To's , Technology Tags: Decimal , Float , Floating , Floating Point , Format , howto , Number , perl , printf , Round , Rounding , sprintf , tips
| No comments