Friday, November 28, 2008

build perl modules the debian way

http://www.debian-administration.org/articles/78

apt-get install dh-make-perl

tar -pzxvf Locale-Hebrew-1.04
dh-make-perl Locale-Hebrew-1.04/

cd Locale-Hebrew-1.04
debuild
cd ..
ls *.deb
dpkg -i liblocale-hebrew-perl_1.04-1_amd64.deb

it works nicely.

Thursday, November 27, 2008

combine pdf files to one

2 ways
http://opendevice.blogspot.com/2007/03/merge-pdf-files-on-linux.html
http://www.newlinuxuser.com/merge-multiple-pdfs-into-one-file/

install gs or pdftk

pdftk first.pdf second.pdf cat output firstANDsecond.pd

or else

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=firstANDsecond.pdf -dBATCH first.pdf second.pd

finnix a debian testing distro with lvm2

http://www.finnix.org/

wget http://www.finnix.org/releases/92.0/finnix-92.0.iso

Ok:

If we want to use lvm2 we need to be able to boot from a live distro and access the data.
Will we find this with knoppix/kanotix etc?

we need to be able to do

pvscan
say we have a volume group data on a physical volume 'data'
vgchange -ay data

(if it was formally exported before from old system (fat chance) then you can do
vgimport data

mkdir /data
then
mount /dev/data/ /data
say to load the information
see
http://tldp.org/HOWTO/LVM-HOWTO/recipemovevgtonewsys.html

-----------
2. Lets say to start a new physicalvolume and create a volume group

vgcreate volgroup1 /dev/sda1

vgdisplay

lvcreate -L5G -n logicalvolume
mkfs.ext3 /dev/volgroup1/logicalvolume

then can mount it

mount /dev/volgroup1/logicalvolume /data

say.

Thursday, November 20, 2008

convert images to right size and format for presentations

convert a bunch of images to the right size for a presentation
try this

convert -sample 936x720 infile.xfc outfile.jpg

will do the job

Sunday, November 16, 2008

unwanted taps on trackpad while typing

a common problem for laptops.
what to do?

see

https://wiki.ubuntu.com/InstallingUbuntuOnADellXPSM1530#Touchpad stays on while typing

Touchpad stays on while typing

To fix this, the best answer I could find was this one, where you simply install a deb package to add a file to the Xsession.d directory, which gets run every time your start X. Here's are contents:

# Starts the Synaptic daemon which deactivates the touchpad while typing
# This executes for all users

SYNDAEMON=/usr/bin/syndaemon
SYN_IDLE=1 #Seconds to wait after last key press before enabling touchpad

if [ -x $SYNDAEMON ]; then
$SYNDAEMON -i $SYN_IDLE -d
fi

This is a very simple and elegant way to fix the problem. Click here to download the package directly.

dpkg -L xserver-xorg-input-synaptics

includes this program:

syndaemon - a program that monitors keyboard activity and disables the
touchpad when the keyboard is being used.

Thursday, November 13, 2008

create pdf of articles and books

Nice instructions are available from

http://www.mat.univie.ac.at/~michor/howto.html
on how to create pdf files from scanner of articles.
take a look at this.

Saturday, November 1, 2008

grab a few pdf files on web

#!/usr/bin/perl -w
use strict;

open (IN, "list");
my @data=;
my @out= map { local $_ =$_; s/(.*href=\")(.*)(\".*)/$2/; $_} @data;

my @out1;
my $pref='http://ocw.mit.edu';

foreach my $example (@out) {
my $out=$pref.$example;
push(@out1,$out);
}

foreach my $stuff (@out1) {
#print "$stuff \n";
system("wget $stuff");
}

Using regex in Map function

need to localize if you want not to get all 1's as output of the map (since match return is
only 1, regexp substitution occurs in place with $_).

#!/usr/bin/perl -w
use strict;

open (IN, "list");
my @data=;
my @out= map { local $_ =$_; s/(.*href=\")(.*)(\".*)/$2/; $_} @data;

see merlyn at

http://www.perlmonks.org/index.pl?node_id=613280