Tuesday, June 26, 2007

Adding .flv MIME type in IIS

1) Select the site to configure in IIS, right click and select "Properties"
2) Under HTTP Headers Tab, select "File Types" under the MIME Map section and select "New Type"
3) Type ".flv" as the associated extension and "video/x-flv" as the content type.
4) Select "OK" and you're ready to fly!

Tuesday, June 19, 2007

Oracle 9i Install Guide for Linux (Ubuntu 7.04) - 32bit

Oracle 9i Install Guide for Linux (Ubuntu 7.04) - 32bit


Pre Install Steps

1) Get JRE 1.3.1 (jre1.3.1_20)
1.a) Install this at /opt/jre1.3.1_20
1.b) cd /opt/jre1.3.1_20/bin
1.c) ln -s java jre
1.d) cd /opt/jre1.3.1_20/bin/i386/native_threads
1.e) ln -s java jre

2) Apply patch for Oracle 9i
2.a) unzip p3006854_ 9204_LINUX.zip
2.b) cd 3006854
2.c) sudo sh rhel3_pre_install.sh

3) Set Kernel Parameters
3.a) sudo vim /etc/sysctl.conf
3.b) Add -
kernel.sem = 250 32000 100 128
kernel.shmmax = 2147483648
kernel.shmmni = 128
kernel.shmall = 2097152
kernel.msgmnb = 65536
kernel.msgmni = 2878
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 6500
3.c) execute "sysctl -p" or reboot system to apply above settings

4) Create Oracle account
4.a) groupadd dba
4.b) usradd -g dba oracle

5) Setting Oracle Enviroment *
5.a) sudo mkdir /u01
5.b) sudo mkdir /u01/app
5.c) sudo mkdir /u01/app/oracle
5.d) sudo chown oracle:dba /u01/app/oracle
5.e) sudo vim /etc/profile
5.f) ORACLE_BASE=/u01/app/oracle
ORACLE_SID=WOORAU
export ORACLE_BASE ORACLE_SID
ORACLE_HOME=/home/oracle/OraHome1
export ORACLE_HOME

export PATH:$PATH:$ORACLE_HOME/bin

6) Get Oracle 9i from www.oracle.com
6.a) Login as user oracle
6.b) mkdir Oracle9i
6.c) cd Oracle9i
6.d) Copy all the 3 files here as downloaded
6.e) gunzip ship_9204_linux_disk1.cpio.gz
6.f) gunzip ship_9204_linux_disk2.cpio.gz
6.g) gunzip ship_9204_linux_disk3.cpio.gz
6.h) cpio -idmv <>7) Fix JRE PATH
7.a) sudo vim Disk1/install/linux/oraparam.ini
7.b) JRE_LOCATION=/opt/jre1.3.1_20

8) Run Installer
8.a) ./runInstaller
8.b) edit the JRE_LOCATION setting in the $ORACLE_BASE/oui/oraparam.ini
sudo vim $ORACLE_BASE/oui/oraparam.ini
8.c) JRE_LOCATION=/opt/jre1.3.1_20

Post Install

9) Creating Listner and Database
Installer will create Listener, Database and set Apache server. In case this is not done at that tim we can use these tools to achieve the same.
9.a) For Database use dbca tool in $ORACLE_HOME/bin.
9.b) For creating Listner and Local Service use netca in $ORACLE_HOME/bin.

10) Start and stop script.
10.a) Oracle start script
sqlplus /nolog <<>

* - Additional Settings Fedora Core 2,3,4 only

LD_ASSUME_KERNEL=2.4.1
THREADS_FLAG=native

Note -

In case of error while running runInstaller edit it and change

if [[ ($RHVER = $Check1) || ($RHVER = $Check2) ]];
then
export LD_ASSUME_KERNEL=2.4.19
fi

to

#if [[ ($RHVER = $Check1) || ($RHVER = $Check2) ]];
#then
# export LD_ASSUME_KERNEL=2.4.19
#fi

VCEESetup

Note: If you are using Microsoft Visual Studio Professional, there is no need to apply any of the steps listed below.

The following install packages are required:


ISO IMG
Microsoft Visual C++ 2005 Express Edition download download
Microsoft ® Windows Server® 2003 R2 Platform SDK download download

Steps:

1. Microsoft VCEE

1.1. Install Microsoft Visual C++ 2005 Express Edition

1.2. Start the IDE and follow the instructions from the start page.

2. Platform SDK

2.1. Install Microsoft Windows Server 2003 R2 Platform SDK

2.2. Follow the instructions to add your source, include and library paths (Tools->Options->Projects and Solutions->VC++ Directories) and modify corewin_express.vsprops file.

2.3. Add the additional include directory : $(platformsdkdir)\\Include\\atl, where $(platformsdkdir) is where your SDK is installed. You can set an environment variable in vsvars32.bat to reflect that.

2.4. Modify the following in the atlbase.h (the file should reside in $(platformsdkdir)\\Include\\)

Starting at line 287 in the original file:

/*
PVOID __stdcall __AllocStdCallThunk(VOID);
VOID __stdcall __FreeStdCallThunk(PVOID);

#define AllocStdCallThunk() __AllocStdCallThunk()
#define FreeStdCallThunk(p) __FreeStdCallThunk(p)

#pragma comment(lib, "atlthunk.lib")
*/

#define AllocStdCallThunk() HeapAlloc(GetProcessHeap(), 0, sizeof(_stdcallthunk))
#define FreeStdCallThunk(p) HeapFree(GetProcessHeap(), 0, p)

2.5. It is a very good idea to try to create and build a simple Win32 project in order to verify that all the modifications undertaken are in place.


3. Service Packs

3.1. Download Visual C++ 2005 Express SP1

Tuesday, June 12, 2007

JRE for HPUX 11.11

1.5

http://www.hp.com/cgi-bin/products1/unix/java/mailform_hm.pl/download_jre_5.0.08_pa-risc.html
OR
wget http://ftp.hp.com/pub/gsy/jre15_15008_pa.tar.Z
OR
wget ftp://ftp.hp.com/pub/gsy/jre15_15008_pa.tar.Z

Friday, June 08, 2007

Using port forwarding with PuTTY

Using port forwarding with PuTTY

This page briefly describes how to use port forwarding using the PuTTY SSH client. Port forwarding is useful when you need to use certain services which are normally only available within the institute.

Suppose you want to setup your PC at home to use our internal proxy server.

First, start PuTTY, specify the host you want to connect to, e.g. shell.cs.uu.nl and the SSH protocol:
Set the remote shell host

Then, click the "Tunnels" tab and specify local port, remote host and port and click the [Add] button:
The Tunnels tab

Finally, press the [Open] button to start the session:
Final view of the Tunnels tab

You can, of course, save your settings in the first tab (Session) before you press the [Open] button.

The above example is the equivalent to the UNIX 'ssh' command:

ssh -L 3128:proxy:3128 your_username_here@shell.cs.uu.nl
It will forward the local port 3128 to host 'proxy', port 3128, via the SSH connection. PuTTY is an SSH client, so it will still spawn a terminal window. When you're finished using your forwarded connection(s) you can close this window.

Setting up a PDF printer in CUPS (in my case in Slackware)

1. Create a sub-directory in CUPS directory sturcture
Code:
mkdir /usr/lib/cups/pdf
Put the following script into the newly created directory, e.g
Code:
vim /usr/lib/cups/pdf/ps2pdf.cups
i

Then highlight the following script with the mouse, and middle-click into the terminal session with vim open.
Code:
#!/bin/sh
# Convert PostScript to PDF.
umask 002
OPTIONS=""
while true
do
case "$1" in
-*) OPTIONS="$OPTIONS $1" ;;
*) break ;;
esac
shift
done

if [ $# -lt 1 -o $# -gt 2 ]; then
echo "Usage: `basename $0` [options...] input.ps [output.pdf]" 1>&2
exit 1
fi

infile=$1;

if [ $# -eq 1 ]
then
outfile=$1
else
outfile=$2
fi

# Doing an initial 'save' helps keep fonts from being flushed between pages.
exec gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
-sOutputFile=$outfile $OPTIONS -c save pop -f $infile
exec chmod a+r $outfile
After the middle-click, press ESC, :wq to save the file, followed by a
Code:
chmod 755 /usr/lib/cups/pdf/ps2pdf.cups
to make it executable.


2. Create the backend

The next bit of our PDF printer driver goes into /usr/lib/cups/backend
The back-end directory holds several binary executables that take care of varied printing methods, e.g. parallel, usb, ...

We're now going to add a shell-script that handles pdf-files!
Code:
vim /usr/lib/cups/backend/pdf
i
As before, copy & paste time
Code:
#!/bin/sh
#
umask 002
PDFBIN=/usr/lib/cups/pdf/ps2pdf.cups
FILENAME=
# filename of the PDF File
PRINTTIME=`date +%Y-%m-%d_%H.%M.%S`
# no argument, prints available URIs
if [ $# -eq 0 ]; then
if [ ! -x "$PDFBIN" ]; then
exit 0
fi
echo "direct pdf \"Unknown\" \"PDF Creator\""
exit 0
fi
# case of wrong number of arguments
if [ $# -ne 5 -a $# -ne 6 ]; then
echo "Usage: pdf job-id user title copies options [file]"
exit 1
fi
# get PDF directory from device URI, and check write status
PDFDIR=${DEVICE_URI#pdf:}
if [ ! -d "$PDFDIR" -o ! -w "$PDFDIR" ]; then
echo "ERROR: directory $PDFDIR not writable"
exit 1
fi
# generate output filename
OUTPUTFILENAME=
if [ "$3" = "" ]; then
OUTPUTFILENAME="$PDFDIR/unknown.pdf"
else
if [ "$2" != "" ]; then
OUTPUTFILENAME="$PDFDIR/$2-$PRINTTIME.pdf"
else
OUTPUTFILENAME="$PDFDIR/$PRINTTIME.pdf"
fi
echo "PDF file: $OUTPUTFILENAME placed in: $PDFDIR" >> $LOGFILE
fi
# run ghostscript
if [ $# -eq 6 ]; then
$PDFBIN $6 $OUTPUTFILENAME >& /dev/null
else
$PDFBIN - $OUTPUTFILENAME >& /dev/null
fi

exit 0

And as before, this script needs to be made executable, too.
Code:
chmod 755 /usr/lib/cups/backend/pdf


3. Download and install distiller.ppd

The printer definition file for distiller is freely available from the adobe-website, if you have a windows-installation handy follow steps 1 to 5 of the instructions...
If you don't: there's some other sites on the web that hold just the ppd rather than an installer. Google is your friend.

Once you have downloaded it add it to your CUPS' printer-model
directory:
cp distiller.ppd /usr/share/cups/model/distiller.ppd

and then, the second to last step:

4. Create the printer object

To be able to use all the pre-requisits that held us up ....
Code:
lpadmin -p PDF -v pdf:/directory/of/your/choice/ -E -P /usr/share/cups/model/distiller.ppd


5. Re-start CUPS

Now that all the set-up and installation is done, we need to let the CUPS daemon know about the new printer, too.

To achieve that we restart the daemon.

Code:
/etc/rc.d/rc.cups restart

And if all went well we should now have a printer-object that will create PDFs for us.

Tuesday, June 05, 2007

Increading ASP Buffer Limit in IIS 5.0

In Command Prompt

cd C:\Inetpub\AdminScripts

adsutil set w3svc/aspbufferinglimit 500000000

iisreset