Category: Uncategorized

App::Fatpacker stuffs they never inform you about

I don’t own this picture. Copyright to whoever owns this

Neat lil app to pack the dependancy in your script without having to carry all your dependancies with your script each time.

Skip at the last few lines if you just want the solution;

Problem is :

Can't locate Config/Any.pm in @INC (@INC contains: FatPacked::19874200=HASH(0x12f4198) /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/dafuq_you_dont_need_to_know_scr/masterXMLwriterFAT.pm line 242.
BEGIN failed--compilation aborted at /usr/local/bin/dafuq_you_dont_need_to_know_scr/masterXMLwriterFAT.pm line 242.
Can't locate Config/Any.pm in @INC (@INC contains: FatPacked::14311832=HASH(0xda6198) /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/dafuq_you_dont_need_to_know_scr/masterXMLwriterFAT.pm line 242.
BEGIN failed--compilation aborted at /usr/local/bin/dafuq_you_dont_need_to_know_scr/masterXMLwriterFAT.pm line 242.
Can't locate Config/Any.pm in @INC (@INC contains: FatPacked::26575256=HASH(0x1958198) /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/dafuq_you_dont_need_to_know_scr
/masterXMLwriterFAT.pm line 242.
BEGIN failed--compilation aborted at /usr/local/bin/dafuq_you_dont_need_to_know_scr/masterXMLwriterFAT.pm line 242.
Can't locate Config/Any.pm in @INC (@INC contains: FatPacked::27951512=HASH(0x1aa8198) /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/dafuq_you_dont_need_to_know_scr/masterXMLwriterFAT.pm line 242.
BEGIN failed--compilation aborted at /usr/local/bin/dafuq_you_dont_need_to_know_scr/masterXMLwriterFAT.pm line 242.
Can't locate Config/Any.pm in @INC (@INC contains: FatPacked::11256216=HASH(0xabc198) /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/dafuq_you_dont_need_to_know_scr/masterXMLwriterFAT.pm line 242.
BEGIN failed--compilation aborted at /usr/local/bin/dafuq_you_dont_need_to_know_scr/masterXMLwriterFAT.pm line 242.


A little bit of investigation:

$ cat fatpacker.trace
warnings/register.pm
File/Spec/Functions.pm
List/Util.pm
Cwd.pm
File/Find.pm
File/Copy.pm
base.pm
Convert/UU.pm
Config.pm
File/Basename.pm
Carp.pm
Scalar/Util.pm
File/Spec/Unix.pm
vars.pm
File/Spec.pm
overload.pm
Devel/InnerPackage.pm
Module/Pluggable/Object.pm
Config/Any.pm

$ cat packlists
/home/myusername/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Convert/UU/.packlist
/usr/local/lib/perl/5.14.2/auto/Config/Any/.packlis

$ cat packlists |while read line; do cat $line; done
/home/myusername/perl5/bin/puudecode
/home/myusername/perl5/bin/puuencode
/home/myusername/perl5/lib/perl5/Convert/UU.pm
/home/myusername/perl5/man/man1/puudecode.1p
/home/myusername/perl5/man/man1/puuencode.1p
/home/myusername/perl5/man/man3/Convert::UU.3pm
/usr/local/man/man3/Config::Any.3pm
/usr/local/man/man3/Config::Any::Base.3pm
/usr/local/man/man3/Config::Any::General.3pm
/usr/local/man/man3/Config::Any::INI.3pm
/usr/local/man/man3/Config::Any::JSON.3pm
/usr/local/man/man3/Config::Any::Perl.3pm
/usr/local/man/man3/Config::Any::XML.3pm
/usr/local/man/man3/Config::Any::YAML.3pm
/usr/local/share/perl/5.14.2/Config/Any.pm
/usr/local/share/perl/5.14.2/Config/Any/Base.pm
/usr/local/share/perl/5.14.2/Config/Any/General.pm
/usr/local/share/perl/5.14.2/Config/Any/INI.pm
/usr/local/share/perl/5.14.2/Config/Any/JSON.pm
/usr/local/share/perl/5.14.2/Config/Any/Perl.pm
/usr/local/share/perl/5.14.2/Config/Any/XML.pm
/usr/local/share/perl/5.14.2/Config/Any/YAML.pm

$ cat packlists |while read line; do cat $line|xargs ls -l; done
-r-xr-xr-x 1 myusername myusername 1010 Feb 28 15:28 /home/myusername/perl5/bin/puudecode
-r-xr-xr-x 1 myusername myusername 980 Feb 28 15:28 /home/myusername/perl5/bin/puuencode
-r--r--r-- 1 myusername myusername 5332 Mar 3 2008 /home/myusername/perl5/lib/perl5/Convert/UU.pm
-r--r--r-- 1 myusername myusername 4506 Feb 28 15:28 /home/myusername/perl5/man/man1/puudecode.1p
-r--r--r-- 1 myusername myusername 4496 Feb 28 15:28 /home/myusername/perl5/man/man1/puuencode.1p
-r--r--r-- 1 myusername myusername 5822 Feb 28 15:28 /home/myusername/perl5/man/man3/Convert::UU.3pm
-r--r--r-- 1 root root 14038 Feb 26 16:17 /usr/local/man/man3/Config::Any.3pm
-r--r--r-- 1 root root 5126 Feb 26 16:17 /usr/local/man/man3/Config::Any::Base.3pm
-r--r--r-- 1 root root 5113 Feb 26 16:17 /usr/local/man/man3/Config::Any::General.3pm
-r--r--r-- 1 root root 5648 Feb 26 16:17 /usr/local/man/man3/Config::Any::INI.3pm
-r--r--r-- 1 root root 5120 Feb 26 16:17 /usr/local/man/man3/Config::Any::JSON.3pm
-r--r--r-- 1 root root 4847 Feb 26 16:17 /usr/local/man/man3/Config::Any::Perl.3pm
-r--r--r-- 1 root root 5442 Feb 26 16:17 /usr/local/man/man3/Config::Any::XML.3pm
-r--r--r-- 1 root root 5006 Feb 26 16:17 /usr/local/man/man3/Config::Any::YAML.3pm
-r--r--r-- 1 root root 1844 Aug 15 2013 /usr/local/share/perl/5.14.2/Config/Any/Base.pm
-r--r--r-- 1 root root 1596 Sep 10 22:41 /usr/local/share/perl/5.14.2/Config/Any/General.pm
-r--r--r-- 1 root root 2227 Sep 10 22:41 /usr/local/share/perl/5.14.2/Config/Any/INI.pm
-r--r--r-- 1 root root 2142 Sep 10 22:41 /usr/local/share/perl/5.14.2/Config/Any/JSON.pm
-r--r--r-- 1 root root 1133 Sep 10 22:41 /usr/local/share/perl/5.14.2/Config/Any/Perl.pm
-r--r--r-- 1 root root 12325 Sep 10 22:41 /usr/local/share/perl/5.14.2/Config/Any.pm
-r--r--r-- 1 root root 2285 Sep 10 22:41 /usr/local/share/perl/5.14.2/Config/Any/XML.pm
-r--r--r-- 1 root root 1582 Sep 10 22:41 /usr/local/share/perl/5.14.2/Config/Any/YAML.pm

$ find ./fatlib/
./fatlib/
./fatlib/Convert
./fatlib/Convert/UU.pm

Turns out that fatpacker does not pack stuffs which has been installed as root or another user, the packages needs to exist in YOUR cpan directory.
So obviously we can’t uninstall from cpan so easily, what do we do?

Here’s what YOU NEED TO DO:

selven@bousouliki.com$cpan
cpan > force install Config::Any
cpan > q

selven@bousouliki.com$ fatpack pack whatever.pl >whateverFAT.pl

🙂 You are good to go!

+selven

Config::Any; great module, Bad Documentation

Bad documentation!

Config::Any provides a facility for Perl applications and libraries to load configuration data from multiple different file formats. It supports XML, YAML, JSON, Apache-style configuration, Windows INI files, and even Perl code.

Pretty nice module to read up configs quickly if you are into perl, but the lack of detail explanation for this is incredible, the author claims that using cpan is to actually help you save time in development rather than code a new thing by yourself, as this might save others the trouble of having to go through more code..

(WordPress is breaking my tabs and space in the code.)

UNFORTUNATELY, by the time one read up that documentation and figures out how to read a simple configuration file, he could have just coded up a simple perl script to read his configuration file easily.  E.g Without Config::Any one can do something as quick as this:

#!/usr/bin/perl
use warnings;
use strict;
my $cfgFile = "./master.conf";
my %bconfig;
sub fetchConfig()
{
my $line="";
open my $cfg, "<", $cfgFile or die "Cannot open config file $cfgFile\n";
while ($line=<$cfg>) {
chomp($line);
if ( $line=~/^#/ && $line=~/^\s/) {next; }
elsif ($line=~/^([^=]+)=(.+)$/) {
$bconfig{"$1"}="$2";
}
}
close($cfg);
}
fetchConfig();
print $bconfig{'mysql_login'}."\n";
print $bconfig{'mysql_password'}."\n";

and then how one can do it with Config::Any.


#!/usr/bin/perl
use warnings;
use strict;
use Config::Any;
use Data::Dumper;
my $t='./master.conf';
my $cfgFile = qq{$t};
my @cfgFileList = ($cfgFile);
my $cfg = Config::Any->load_files({files => \@cfgFileList, use_ext => 1});
print $cfg->[0]{$cfgFile}{mysql_login};

If you want to see the structure of your data you can run this from your shell:
perl -Mstrict -Mwarnings -E '
use Config::Any;
use Data::Dumper;
my $cfgFile = q{./master.conf};
my @cfgFileList = ($cfgFile);
my $cfg = Config::Any->load_files({files => \@cfgFileList, use_ext => 1});
say q{Full $cfg structure:};
say Dumper $cfg;
say q{Password: }, $cfg->[0]{$cfgFile}{mysql_login};
'

Really, writing great software is in no way an excuse not to write proper documentation. If you can’t write example of usage for your piece of software, it is as good as telling someone to just write up his own version. Because bad documentation CONSUMES time. . . and remember, always give example of usage.

Filters
Hmm sometimes you may want to strip out stuffs from your data you picked up from the config file, e.g stripping out single quotes (yes if you have double quotes in the values, it is ignored when read, but single quotes are weirdly kept.)
#!/usr/bin/perl
use warnings;
use strict;
use Convert::UU qw(uudecode uuencode);
use Config::Any;
my $CONFIGFILE='./master.conf';
sub readConfig
{
my $cfgFile=qq{$CONFIGFILE};
my @cfgFileList = ($cfgFile);
my $cfg = Config::Any->load_files({files => \@cfgFileList, filter =>\&doWhateverFilter, use_ext => 1});
return $cfg;
}
sub doWhateverFilter
{
use Data::Dumper; warn Dumper(\@_);
}
readConfig();

# As you can see we are are calling doWhateverFilter when loading the config, this will jsut pass by reference our config hash. In the above example I have used data dumper so as you can have an idea what the structure looks like, you can write anything in the doWhateverFilter to change the content of that structure hence directly affecting $cfg.

🙂 to MST, thank you for the great piece of software, and FUCK YOU for the bad documentation so bad that it is better to just go and look at the source and figure out rather than reading the documentation :p.

Yes I’d pay you a beer any time though.

+selven

Latency Issues in Mauritius

Am not gonna explain what latency here is, if you want to know, read here http://whatis.techtarget.com/definition/latency.

 

In creole, latency en terme rezo, c komien letemp sa prend pou 1 packet sorti depi kot toi pou al kot 1 destination et pou ki to gagne 1 response ki linn rentre laba.

Normalement sa passe dans les millisecond, mais Moris nu ena bann routaz bizare kot dEs fois sa al en terme second! Ena osi Conzestion lor rezo ki kapav affectE latence (enfin ena boukou plis deriere sa).

Tou sa pou dir, here is a list of the closest country network wise (i.e they based on their latency how close they are. [obviously if they have a lower latency time, it means they are close network wise])

Click on the pdf to view.
Latency_To_country

Latency_To_country1 Latency_To_country2

 

 

 

 

 

 

 

Singapore in re vinn proche. Bizarrement, Sud Afrik MAAAAARIII LOIN ar nou :p. Al comprend.

 

+selven

Quakelive maps not downloading?

Well am playing from OSX and i’ve been having some maps not downloading at times, i guess it must be some flags not clearing specially after I’ve cancelled the loading of a map and decided to play it at a later time.

 

Anywyaz, go in the quakelive console, type

\condump quakeliveselven.log

 

then view the log file at /Users/selven/Library/Application Support/QuakeLive/quakelive/home/baseq3

 

In my case i had :

———————-
8819 files in pk3 files
ERROR: DL_BeginDownload called with a download request already active
Failed to initialize download for
‘http://cdn.quakelive.com/assets/2013022601/game/baseq3/hiddenfortress.pk3’

 

So i just went to

/Users/selven/Library/Application Support/QuakeLive/quakelive/baseq3

and manually downloaded the quake hiddenfortress .pk3 there.

 

 

Quakelive from Mauritius

I know that playing Quakelive from Mauritius tends to suck because of our high pings, but guess what, there’s new servers from Korea, so now our pings drops from 400 to 175! Hurray!

(for some reasons sorting by closest servers should have work, but it doesn’t )

So here’s how you change those servers to use korean’s machines (Click on play online, then click on Customize):

selven_blah

 

 

 

 

 

 

Choose the korea server, and save!

 

 

 

 

 

Happy fragging.

My nick is selven_blah btw 🙂 so a hi in a match would be appreciated 😀

found 2 bugs while installing screen on aix 3.5

May be of help if someone somewhere is trying screen on aix
“Makefile”, line 29: make: 1254-055 Dependency line needs colon or double colon operator.
“Makefile”, line 31: make: 1254-055 Dependency line needs colon or double colon operator.
make: 1254-058 Fatal errors encountered — cannot continue.

and
osdef.h:91: error: conflicting types for ‘naccept’
/usr/include/sys/socket.h:534: error: previous declaration of ‘naccept’ was here
make: 1254-004 The error code from the last command is 1.

Fix & problem description
https://savannah.gnu.org/bugs/index.php?33587
https://savannah.gnu.org/bugs/index.php?33588