rami.info



Generating A Self Signed Certificate For IIS

Posted in Sysadmin, TechNotes, UNIX, Windows by Rami on the March 9th, 2007

Generate the CA key:
openssl genrsa -des3 -out ca.key 1024
Generate the CA certificate:
openssl req -new -key ca.key -x509 -days 1095 -out ca.crt
Generate the IIS certificate by using the CSR generated from IIS:
openssl x509 -req -days 1095 -in certreq.txt -CA ca.crt -CAkey ca.key -CAcreateserial -out cer.crt
Export the CA certificate to DER encoded binary format if needed to be installed on a WM5 device:
openssl x509 -in ca.crt -outform DER -out ca.cer

Calling JAVA code from Oracle

Posted in RDBMS, Software, TechNotes by Rami on the March 19th, 2006

To run java code from oracle do the following:

1. Create the java code on the server:

CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "hello" AS
public class hello {
public static String world() {
return "Hello World";
}
}
/

2. Create the oracle function on the server:

CREATE OR REPLACE FUNCTION hellofunction RETURN VARCHAR2 AS
LANGUAGE JAVA NAME 'hello.world() return java.lang.String';
/

3. Call the function using a SELECT:

SELECT hellofunction() from DUAL;

Testing SSL Services

Posted in TechNotes by Rami on the November 9th, 2005

Testing SSL services by connecting to it is possible using the following command:

openssl s_client -connect host:port -state

Using Sendmail’s mailertable

Posted in TechNotes by Rami on the November 8th, 2005

Edit sendmail.mc and add the following:

FEATURE(`mailertable')dnl

Run:

m4 sendmail.mc > sendmail.cf

Create /etc/mail/mailertable and add the incoming mail to route as in:

example.com smtp:[192.168.0.1]

Run:

makemap hash /etc/mail/mailertable < /etc/mail/mailertable

Restart sendmail.

Setting Up Sendmail To Act As An MX Backup Server

Posted in TechNotes by Rami on the November 8th, 2005

Edit or create /etc/mail/relay-domains and add the domains you want to have MX backup for one on each line.

Using Radius For System Authentication With PAM

Posted in TechNotes by Rami on the October 2nd, 2005

Download pam_radius ftp://ftp.freeradius.org/pub/radius/ and run the following:
tar -xvf pam_radius*.tar
cd pam_radius*
make
cp pam_radius_auth.so /lib/security

Edit /etc/raddb/server and add the following:
127.0.0.1 secret 1

Under Gentoo edit /etc/pam.d/system-auth and add the following line:

auth sufficient pam_radius_auth.so skip_passwd

After:

auth sufficient pam_unix.so likeauth nullok

Make sure you add the users locally on the machine as well as the radius is just used for the password authentication.

Enjoy.

Installing Oracle 10g (10.2.0.1.0) On Gentoo 2005.1

Posted in TechNotes by Rami on the September 17th, 2005

Before installing add the following to /etc/sysctl.conf:
kernel.shmall = 3279547
kernel.shmmax = 4294967295
kernel.sem = 256 32000 100 142
fs.file-max = 327679
net.ipv4.ip_local_port_range = 10000 65000
kernel.msgmni = 2878
kernel.msgmnb = 65535

And get a compatible libaio by doing the following (tip from http://gentoo-wiki.com/HOWTO_Install_Oracle_10g):
wget ftp://ftp.suse.com/pub/suse/i386/9.1/suse/src/libaio-0.3.98-17.src.rpm
rpm2targz libaio-0.3.98-17.src.rpm
tar zxf libaio-0.3.98-17.src.tar.gz
tar jxf libaio-0.3.98.tar.bz2
cd libaio-0.3.98
make
make install

The rest is straight forward.

Update: ln -s /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/libstdc++.so.5 /usr/lib/libstdc++.so.5 is also needed to be done.

IE HTML 4.01 Specification Bug?

Posted in Software, TechNotes by Rami on the April 25th, 2005

While developing the new WiFi system I think I found a bug. Apperntly IE is not following the HTML specifications. In the OPTION tag for a SELECT you don’t really need to specify value as it is implied and uses the content of the OPTION tag (link) but IE requires the value if you want to use the value in a JavaScript. Spent a whole hour to find that out! Lesson learned: Always use value in the OPTION tag.

Netscreen 5XP Default Factory Reset

Posted in TechNotes by Rami on the February 23rd, 2005

Was messing with this for like 15 minutes to get it right. To reset a
Netscreen 5xp to the default configuration connect to the console and
press the reset button with a paper clip for 4-6 seconds. When it says
that it is waiting for a 2nd push remove the clip, wait for 1-2 seconds
then press the button again till it resets.