Wednesday, December 1, 2010

Building Perl 5.6.2

Edit Configure:

@@ -14249,7 +14249,7 @@
 set signal
 if eval $compile_ok; then
- ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
+ ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
 else
  echo "(I can't seem be able to compile the whole test program)" >&4
  echo "(I'll try it in little pieces.)" >&4

(see http://www.nntp.perl.org/group/perl.perl5.porters/2007/07/msg126333.html) 

Edit config.sh and config.h to remove pointers to libraries > 5.6.2 (such as 5.13.7)

On Linux ">/usr/include/asm/page.h"

sh Configure -de
make -j2
make test
make install
 
Then you need to install old stuff,  because newer ones don't support 5.6:
  
install G/GA/GAAS/Digest-MD5-2.40.tar.gz
install G/GA/GAAS/libwww-perl-5.837.tar.gz 
install R/RA/RAM/Storable-1.0.14.tar.gz
force install  D/DA/DAGOLDEN/Capture-Tiny-0.21.tar.gz
install A/AN/ANDK/CPAN-1.9800.tar.gz

Wednesday, October 27, 2010

/dev/random on GNU/Hurd

To create /dev/random and /dev/urandom (needed for ssh etc.):
apt-get install random-egd

Wednesday, August 4, 2010

Monitor incoming HTTP GET requests

tshark -i eth0 -p -f "port 80 and tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420 and dst net 1.2.3.4"

Monday, August 2, 2010

Using icc to build CPAN Modules

1) Firstly install ExtUtils::FakeConfig

2) Create a file called icc_Config.pm containing

package icc_Config;

use ExtUtils::FakeConfig ccflags => '-O2 -i_dynamic -w2',
cc => 'icc',
ld => 'icc',
cppflags => '-O2 -i_dynamic -w2',
optimize => '-O2 -i_dynamic -w2',
libpth => '/opt/intel/Compiler/11.0/081/lib/ia32 /opt/intel/Compiler/11.0/081/ipp/ia32/sharedlib /opt/intel/Compiler/11.0/081/mkl/lib/32 /opt/intel/Compiler/11.0/081/tbb/ia32/cc4.1.0_libc2.4_kernel2.6.16.21/lib /usr/local/lib /lib /usr/lib',
lddlflags => '-L/usr/local/lib',
ccdlflags => '-shared',
cccdlflags => '-shared',
lddlflags => '-shared -O2 -i_dynamic -w2 -L/opt/intel/Compiler/11.0/081/lib/ia32 -L/usr/local/lib',
ldflags => ' -shared -L/opt/intel/Compiler/11.0/081/lib/ia32 -L/usr/local/lib';

1;

3) Put that file in /usr/local/lib/perl5/site_perl/5.10.0/icc_Config.pm (or wherever is appropriate for this system)

4) export LD_LIBRARY_PATH=/opt/intel/Compiler/11.0/081/lib/ia32:$LD_LIBRARY_PATH

5) export PERL5OPT=-Micc_Config

6) If you get errors that CPAN can't find a working ptee, then reinstall the Tee module, ensuring "PERL5OPT=-Micc_Config perl Makefile.PL"

Note: to build Perl with icc: "PERL5OPT= perlbrew --force install perl-5.x.y -Acc=icc -Accflags="$CFLAGS"

Wednesday, July 21, 2010

Running SQL commands

To run a file containing SQL commands:

mysql --user=u --password=p --host=h < filename

Thursday, June 24, 2010

Newer Grub

For newer grubs use grub-setup.
  • boot from Knoppix
  • mount /dev/hda3 /media/hda3
  • mount /dev/hda2 /media/hda3/boot
  • chroot /media/hda3
  • grub-setup -v /dev/hda
Fancy things, such as the graphical background, will be lost, but the machine should be bootable.

If, on boot, you get "grub rescue" don't try commands such as help as suggested on the Internet, they will say "help: command not found".  Do this:
  • ls
  • ls (hd0,5)/boot (or whatever filesystem ls tells you is the right one)
  • ls (hd0,5)/boot/grub
  • set prefix=(hd0,5)/boot/grub
  • set root=(hd0,5)
  • set normal

Saturday, March 6, 2010

Windows Perl fails to parse FTPstats.yml

If you get an error about a failure to parse ...\cpan\FTPstats.yml, edit \perl\lib\cpan\config.pm (Activestate) or \strawberry\perl\lib\cpan\config.pm (Strawberry) changing

'yaml_module' => q[YAML::XS]
to

'yaml_module' => q[],