Installation Logs

-

Extending the "Direct Link Add On" from Mozilla Firefox

The Direct Link AddOn for Mozilla Firefox is a nice piece of software that allows to call web pages based on the currently selected text.
You are able to open web pages by selecting some text an clicking Direct Link / Open from the context menu. By default you can use this to open google and  wikipedia based on the currently selected text.

If you want to extend the selections offered by the default installation you need to change 2 files a directory called something like .../extensions/{a4ffd900-48b6-11db-b0de-0800200c9a66}/chrome/content 

 

What I'm doing here is to add a link to call the german /english dictionary offered from dict.leo.org 

In search.js add

  case "leo" :
      URL = 'http://dict.leo.org/ende?lp=ende&lang=de&searchLoc=0&cmpType=relaxed&sectHdr=on&spellToler=on&search='
          + selectedText + '&relink=on';
      break;

to the switch {......} block

In  menu.xul add  then line

 <menuitem id="directlink-leo" label="LEO" oncommand="openAsUrlDispatch('leo');"/>

somewhere to the <menupopup> block 

 

The above works for me on Ubuntu 6.10 and Firefox 2.0. But I'm NOT responsible for any damage the above might cause. 

IPCop on VMWare against a Cable Modem without IP Address

Recently I had to setup a virtual IPCop using a cable modem that didn't have an IP Address.
The "normal" way of bridging the physical NIC to IPCop's Red and Green interface didn't work.


My setup is shown in the following scheme:

 

IPCop Scheme

 

The physical eth0 is being bridged over vmnet1 to the virtual eth0 (green) of IPCop

The physical eth1 is defined with the provider's specifications (public IP, Gateway etc.) This eth1 is NAT'ed over vmnet2 to  IPCop's Red interface. The Red interface is set to DHCP.

 

OCS-Inventory on Ubuntu Server in VMWare in 10 Steps

The whole installation procedure took about 30 Minutes Cool (ok it was quite a fast machine)

  1. new virtual Machine of type Linux/Ubuntu
    128MB RAM
    8GB Harddisk
  2. booting Ubuntu 6.06 LTS Server CD
    running a LAMP Installation
    Hostname: inventory
    User: admin
  3. nano /etc/apt/sources.list
    remove entry for Ubuntu CD
    uncomment universe repository
    apt-get update
    apt-get upgrade
  4. apt-get install mc openssh-server libxml-simple-perl libcompress-zlib-perl libdbi-perl libdbd-mysql-perl libapache-dbi-perl libnet-ip-perl libsoap-lite-perl php5-gd build-essential libapache2-mod-perl2 phpmyadmin
  5. open http://inventory/phpmyadmin in browser
    login using root with no password
    change the root password to something meaningful
  6. download von OCS-InventoryServer-Linux von http://ocsinventory.sourceforge.net using wget into /root
    tar xzvf OCSNG_LINUX_SERVER_1.01.tar.gz
    cd OCSNG_LINUX_SERVER_1.01
    ./setup.sh
  7. accept all defaults except
    document root: /var/www
    accepting apache configuration directory didn't work for some reason - but answering 'no' writes everything required into /etc/apache2/apache2.conf and works flawlessly
  8. nano /etc/php5/apache2/php.ini
    increase post_max_size to 10MB
    increase upload_max_filesize to 10MB
  9. open http://inventory/ocsreports and specify the db user crendetials (root/somepwd/localhost) and wait for the database to be created
    logon to the UI and change the admin password to something useful
  10. Have a lot of fun using OCS-Inventory but take a look at the Installation and Administration Guide accessible via the question mark in the UI.

 


In order to install the inventory agent on Ubuntu 6.10 it's required to run at least:
apt-get install libnet-ssleay-perl libcompress-zlib-perl libxml-simple-perl libnet-ip-perl

 

Print to PDF using office stationary with Samba

When sending quotes via email my useres first printed them on office stationary. After that they went to the printer, put the sheets into the scanner and made an enormous big pdf that they sent to their customers.

A quick, easy and quite common solution is to set up a samba printer that accepts postcript jobs and converts them to pdf. This solution can also be tweaked in order to combine the output with another pdf that carries the company logo, adress, a watermark or whatever you like.

The wole magic comes from a package called pdftk which is responsible for merging the 2 documents together. Well and a little modification to sambas smb.conf

So install pdftk using "apt-get install pdftk "

And modify you smb.conf 

 [PDF-Stationary]
    comment = PDF Drucker mit Briefpapier
    path = /srv/smb/pdf
    printable = yes
    guest ok = yes
    create mask = 0777
    use client driver = yes
    
    print command = gs -dNOPAUSE -dBATCH -q -sDEVICE=pdfwrite -sOutputFile="%s.tmp.pdf" "%s"; \
    pdftk "%s.tmp.pdf" burst output "%s"PAGE%02d; \
    for N in "%s"PAGE*; \
    do pdftk briefpapier.pdf background $N output $N.TMP; \
    done; \
    pdftk "%s"PAGE*.TMP cat output "%s.pdf"; \
    rm "%s"PAGE*; rm doc_data.txt; \
    rm "%s"; rm "%s.tmp.pdf"; \
    mkdir "/srv/smb/Home/%u/pdf"; \
    chmod 777 "/srv/smb/Home/%u/pdf"; \
    mv "%s.pdf" "/srv/smb/Home/%u/pdf/%s.pdf";
    lpq command =  

This modification requires a pdf file containing the office stationary called briefpapier.pdf placed in /srv/smb/pdf in my case.
The resulting pdf will be placed in a directory called pdf located in each users home directory.

When connecting to the printer from windows then choose some HP Color Laserjet Printer but take care that it is a PS-Printer.

Many thanks to nkadesign.com who posted a similar solution.

If you take a look at the man pages of pdftk you'll notice that there's an easier solution  than splitting the printjob into its pages and recombine them later. The reason why Icouldn't use the background option of pdftk was that M$ Word seems to place a white rectangle around every pages which overlaps the office stationary...

Happy printing 

The perfect Backup for a Ubuntu Workstation in 10 Minutes

Nobody wants to do backups - but everyone wants to have a backup handy after something went wrong.
Therefore the best backup solution is one that doesn't require any user interaction.

The following does NOT make a system backup ! But what it does without any user interaction about once a day is to backup my data. 

The following has been made on a machine running Ubuntu 8.04.

  1. apt-get install backuppc
    this installs BackupPC 3.0 and a lot of other dependent packages. In case Apache isn't installed you'll get asked which version you prefer. My Answer was "Apache 2".
  2. Now BackupPCshould be available under http://localhost/backuppc
    The password that's required to login has been displayed during the installation process. To change the password open a terminal and type

    sudo htpasswd /etc/backuppc/htpasswd backuppc
  3. By default BackupPC does backups of /etc
    Select the host "localhost" and goto "edit config" and section "Xfer"
    Add as many "TarShareNames" as you like. But at least /home
  4. To give backuppc full access privileges we need to run the backup process as root. Change the "TarClientCmd" to
    /usr/bin/env LC_ALL=C /usr/bin/sudo $tarPath -c -v -f - -C $shareName --totals
    Save the changes
  5. To allow backuppc to use the tar command as root  edit the file /etc/sudoers
    sudo nano /etc/sudoers
    and add the line
    backuppc ALL=NOPASSWD: /bin/tar
  6. Now you can start your first backup manually to see that everything works. Subsequent backups will be done automatically once the last backup is older than 0.97 days.

Having a backup for the last 7 days is nice but doesn't help anything on a defect harddisk. So please store the backup on a additional harddisk ! BackupPC writes it's data to /var/lib/backuppc where I've mounted my backup harddisk.