vicker313 tech blog

June 25, 2009

Add header to printout in HPUX using JetDirect

Filed under: HPUX — Tags: , , , — vicker313 @ 8:00 am

In HPUX, we use LP command to print text file, for example lp -dprt1 printme.txt, where prt1 is the LP destination name (or also known as queue name) and printme.txt is the file to be printed.

If the print server used is a HP JetDirect, we can set the printout header using the HPPI utility:

  1. Install the HP JetDirect  Installer (in HPUX 11iv3, the installation file is named as HP11e134.SD).
  2. Then copy /usr/spool/lp/model/hp2560 to /opt/hpnpl/sh.
  3. Run HPPI (HP Printer Installer) by typing hppi or /opt/hpnpl/bin/hppi.
  4. Select option 1 (Spooler Administration) then option 1 again (Add printer to local spooler).
  5. Type in print server IP address.
  6. Type in the LP destination name (option 1) then select option 5 (additional printer configuration).
  7. Type in hp2560 in Model Script (option 1, there is actually a list of model script for you to select but you won’t find hp2560 in the list) then continue for the rest.
  8. Finally you can find a file named exactly like the queue name in /etc/lp/interface/model.orig. You can add or modify a function called do_banner() in order to add a customized printout header.

June 23, 2009

Remote access tape drive in another HPUX server

Filed under: HPUX — Tags: , , , , , — vicker313 @ 10:41 pm

Below is a list of TAR and CPIO command integrated with REMSH command in order to remote access tape drive in another HPUX server. Refer Tar and Untar tape drive in another HPUX server to setup the server before try the commands below.

  • CPIO into tape: find /dir/or/files/to/cpio -print | cpio -oacvB | remsh OLDSERVER 'dd of=/dev/rmt/0m bs=64b'
  • Verify CPIO tape: remsh OLDSERVER 'dd if=/dev/rmt/0m bs=64b' | (cpio -itcvB)
  • CPIO from tape: remsh OLDSERVER 'dd if=/dev/rmt/0m bs=64b' | (cpio -iacvBdum)
  • TAR into tape: (tar -cvfb - 64 /dir/or/files/to/tar) | remsh OLDSERVER 'dd of=/dev/rmt/0m bs=64b'
  • Verify TAR tape: remsh OLDSERVER 'dd if=/dev/rmt/0m bs=64b' | (tar -tvfb - 64)
  • UNTAR from tape: remsh OLDSERVER 'dd if=/dev/rmt/0m bs=64b' | (tar -xvpfb - 64)

June 20, 2009

Tools to access Firebird database

Filed under: Firebird — Tags: , — vicker313 @ 12:43 pm

In my last post, I have recommended to use Firebird as database of standalone application. While to access or administrate the database, we can use tools like Flamerobin. However we need to do something before can use the tools:

  1. Download Flamerobin from its website, I recommend to download the zip version.
  2. Download Firebird database embedded edition (zip file as well) from its website if not yet.
  3. Extract Flamerobin into a directory, then extract the following files to the same directory from the firebird database zip file:
    1. fbembed.dll
    2. firebird.conf
    3. firebird.msg
    4. icudt30.dll
    5. icuin30.dll
    6. icuuc30.dll
  4. Execute Flamerobin by double click flamerobin_ansi.exe or flamerobin_unicode.exe (which ever).
  5. You can see a tree directory with a localhost node. If you are running a server edition database, you straight away connect the database by adding new database. But if you are using embedded edition, you need to right click on the locahost node, click server registration info and clear off the hostname field.

June 13, 2009

Use Firebird as standalone application database

Filed under: .Net, Firebird — Tags: , , — vicker313 @ 8:33 am

Choices of database in doing a standalone application always limited to me. Some people might use MYSQL, MSSQL or even Oracle as database, but to me:

  1. It is not logical to use a server based database for a standalone application
  2. You will need to install the database in order to deploy the application, where some settings might not understandable to non technical personnel.

So all the while I am using MS Access as database for standalone application, but still you need to install Microsoft Data Access Components (MDAC) if the PC you deploy doesn’t have MS Access or Office installed.

But now I am using Firebird as database, which you don’t need to install the extra stuffs, just copy over the whole folder to finish the deployment (Literally standalone). Here are some guidelines to use Firebird in .Net:

  1. Go to Firebird website and download 2 things: database embeded edition (which is in zip format) and .Net FirebirdClient library (in zip format as well).
  2. Extract following files from the database zip file to your project folder (under bin\debug or bin\release):
    1. fbembed.dll
    2. firebird.conf
    3. firebird.msg
    4. icudt30.dll
    5. icuin30.dll
    6. icuuc30.dll
  3. Extract FirebirdSql.Data.FirebirdClient.dll to your project folder (under bin\debug or bin\release).
  4. Add reference of FirebirdClient to your project, and you can start using it.
  5. The methods to use FirebirdClient more or less is the same as other Data class, while the connection string is:
    servertype=1;user=<admin>;password=<password>;dialect=3;database=<database location>

June 5, 2009

Send mail using telnet

Filed under: Linux, Server, Windows — Tags: , — vicker313 @ 8:20 am

Some SMTP server allow you to send anonymous email (or even fake email), by using telnet. Telnet is available in both Windows and Linux.

  1. In your command prompt or terminal, issue following command:
    telnet smtp_server port
    smtp_server is either IP address or URL of the server, while port is the SMTP port of the server. The port normally is 25, but the server admin can change it to other number. Following is a example,
    telnet smtp.servername.com 25
  2. After login (if success), it will show a 220 something message without any prompt sign. Just type the following command and enter:
    helo domain_name
    domain_name is the host name of the server.
  3. Type in following command to set sender’s email address (any address, exists or not exists).
    mail from: sender_email
  4. Type in following command to set recipient’s email address.
    rcpt to: recipient_email
  5. Type in following command to trigger the starting of a message. This means you can start typing your message after this command.
    data
  6. When the message is finished, type . (single dot) to end the message and email will be sent out.
  7. Type quit to logoff.

Aware that any typing error (and backspace for correction) might result a command syntax error.

Blog at WordPress.com.