Archive

Archive for March, 2010

Comparing Arrays in Java

March 5, 2010 Leave a comment

When comparing to array == operator won’t do the job. Because using == operator only compares the objects whether they are the same object or not. That means operator won’t check the objects data.

for example
byte[] a = “Test”.getBytes();
byte[] b = “Test”.getBytes();

(a == b) –> false
Arrays.equals(a,b) –> true

Categories: Java Tags: ,

Install MySql Server on FreeBSD

March 2, 2010 Leave a comment

cd /usr/ports/databases/mysql50-server
make install clean
cp /usr/local/share/mysql/my-small.cnf /usr/local/etc/my.cnf
echo “mysql_enable=\”YES\”” >> /etc/rc.conf
mysql_install_db
chown -R mysql:mysql /var/db/mysql

Categories: FreeBSD Tags: ,

Install vulnerable ports on FreeBSD

March 2, 2010 Leave a comment

While installing ports portaudit may stop installation becasue of vulnerabilities of ports. In order to ignore vulnerability reports use -DDISABLE_VULNERABILITIES parameter in your make command.

make -DDISABLE_VULNERABILITIES install clean

Categories: FreeBSD Tags: , ,

Install Php for Apache22 on FreeBSD

March 2, 2010 Leave a comment

Install php5
cd /usr/ports/lang/php5
make install clean

Note: portaudit may stop installation because of vulnarabilities of php5 port. In order to solve this problem give following command.
make -DDISABLE_VULNERABILITIES install clean Read more…

Categories: FreeBSD Tags: , ,

How to enable/disable IP Packet Forwarding in Windows 2000/NT/XP

March 1, 2010 Leave a comment

Open registry by typing

regedit

in Run Dialog ( Win + R ), then find system key

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]

Set the value of “IPEnableRouter” 0 to disable or 1 to enable IP Packet Forwarding. You must restart your computer.

Categories: Windows Tags: ,

Disable Beep/Bell Sound on FreeBSD

March 1, 2010 Leave a comment

This command would disable the hardware beep/bell sound for the current session.

sysctl hw.syscons.bell=0

If you want to disable the beep/bell sound persistently you should add the “hw.syscons.bell=0” entry to /etc/sysctl.conf file by giving the following command;

echo “hw.syscons.bell=0” >> /etc/sysctl.conf

Categories: FreeBSD Tags: