Sunday, December 9, 2007

installing vmware-server on gutsy server

First of all you need to install these packages through apt:

1. build-essentials
2. xinetd
3. linux-headers* (try to just install them for server, or just inslall all of them)

Download the vmware server from www.vmware.com
then, extract it:
% tar xvfz VMware-server-1.0.4-56528.tar.gz

enter to the directory, vmware-server-distrib, install it by running vmware-install.pl
% cd vmware-server-distrib
% sudo ./vmware-install.pl

just used the default values for the setting.

Friday, December 7, 2007

untar files in linux

If the file is ended with tar.gz, then use

$ tar xvfz filename.tzr.gz


but, if the file is ended with .tar.bz2, then use

$tar xvjf filename.tar.bz2

Friday, November 23, 2007

XAMPP 1.64 on Ubuntu

We know that Ubuntu server comes with a great support for LAMP, but for mobility issue, we can use XAMPP. However, I encountered a /bin/arch problem on my Gutsy. A quick search on Google, I found this link, http://jauhdimata.wordpress.com/2007/11/20/daripada-lupa/

Just in case something wrong with the link, I copied the solution here:

/opt/lampp/lampp: line 74: arch: command not found
Starting XAMPP for Linux 1.6.3…
/opt/lampp/lampp: line 74: arch: command not found
/opt/lampp/lampp: line 74: arch: command not found
XAMPP: Starting Apache with SSL (and PHP5)…
/opt/lampp/lampp: line 74: arch: command not found
XAMPP: Starting MySQL…
/opt/lampp/lampp: line 74: arch: command not found
XAMPP: Starting ProFTPD…
XAMPP for Linux started.

add this file, /bin/arch by typing:
% sudo vim /bin/arch

put this as the content of /bin/arch:

uname -m

then save and exit from vim by typing :wq

don't forget to make it executable by typing:

% sudo chmod +x /bin/arch

ok. now you can restart the xampp:

% sudo /opt/lamp/lampp restart

Sunday, November 4, 2007

Create Local Repo From DVD

1. Copy DVD contents to the folder in web server:
a. Preparing the folder, ie: /var/www/ubuntu, by doing $ sudo mkdir -p /var/www/ubuntu
b. Mount the DVD Repo to the /cdrom, $ sudo mount /cdrom
c. Copying the DVD Content to /var/www/ubuntu using rsync, $ sudo rsync -avx --progress /cdrom/. /var/www/ubuntu/.
d. Do (b) and (c) for all of your dvd repos.

2. Combine divided repo (ie: Gutsy)
a. Enter dvd repo #1, then mount it: $ sudo mount /cdrom
b. $sudo cp /cdrom/dists/gutsy/main/binary-i386/Packages /var/www/ubuntu/dists/gutsy/main/binary-i386/
c. eject the /cdrom, then do for dcd repo #2 $ sudo mount /cdrom
d. cat /cdrom/dists/gutsy/main/binary-i386/Packages >> /var/www/ubuntu/dists/gutsy/main/binary-i386/
should peemission denied, try: (don't forget to change back to 644)
$ sudo chmod 666
/var/www/ubuntu/dists/gutsy/main/binary-i386/
e. recreate the Packages.gz and Packages.bz
$ cd /var/www/ubuntu/dists/gutsy/main/binary-i386/
$ sudo rm Packages.gz Packages.bz2
$ sudo gzip -9 -c Packages > Packages.gz
$ sudo bzip2 -9 -c Packages > Packages.bz2
f. repeat for dvd #3, #4 and #5 for universe libraries.

3. That's all, you can activate it by adding:

deb http://[your-server-address]/ubuntu gutsy main restricted universe multiverse

Thursday, September 27, 2007

mirroring repository using rsync

% mkdir myloc
% cd myloc
% rsync -v -t -l -r [server-url]::[distro] . or
% rsync -v -t -l -r rsync://[server-url]/[distro] .

trying to mirror pclinuxos repository........
% mkdir myloc
% cd myloc
% rsync -v -t -l -r rsync://spout.ussg.indiana.edu/pclinuxos/ .

Thursday, September 20, 2007

Superspeed USB

http://www.extremetech.com/article2/0,1697,2184743,00.asp

new USB 3.0:
- boost 10x its bandwith to 4.8Gbps/s
- initially available in 2009, mass production in 2010
- saving battery life for laptops
- support virtualization w/o software intervention

hm, Ubuntu JeOS

http://searchenterpriselinux.techtarget.com/originalContent/0,289142,sid39_gci1272918,00.html?track=NL-641&ad=604726&asrc=EM_NLT_2220070&uid=5687621

it's seem my long question is answered. cannot wait for next month!

Wednesday, September 19, 2007

other alternative to M$ office

http://symphony.lotus.com/software/lotus/symphony/home.jspa

- Free from IBM,

- support ODF

- available in linux or windows, but in macos(?)


now, trying....

the true owners....

http://www.informationweek.com/news/showArticle.jhtml?articleID=201806893

"SCO claims it owns all copyrights over Unix and that Linux infringes on those copyrights. In what were widely seen as bet-the-company moves, SCO, beginning in 2003, launched a series of lawsuits against rivals and customers claiming their use of Linux was violating the copyrights. The campaign was dealt a crushing blow on Aug. 10 when federal court Judge Dale Kimball ruled that Novell (NOVL), and not SCO, owns the copyrights to Unix."

Hooray, it should end the 'threatening' era from SCO (M$) to the linux worlds!

Monday, September 17, 2007

good or bad???

http://www.dailytech.com/article.aspx?newsid=8864

Run Solaris in M$ Windows virtualization, run M$ Windows on Solaris virtualization, and run M$ Windows on Sun servers?

good news or bad news?

I am not a M$ hater, but I just wanna use software for free and legally.

long battle SCO (M$) and Linux

http://www.groklaw.net/article.php?story=20070914152904577

It's remind me a few years ago, on 2004 to be exact. many people were attracted to sit for Microsoft training, including me. I felt that it would be the end of free linux. However, Linux becomes strong and strong nowadays. It could compete with Windows and MacOS.

Does my MCSA useless, now? I don't think so, it is still useful, helping me to learn linux and think of creating GUI based configurator such as in M$ world.

Thursday, September 6, 2007

tired....

a week preparation to the seminar on last Tuesday and another assignment due last week, made me really tired.

careers = no time for family? I like to be a family man, but it's not that easy as saying it.

Thursday, August 30, 2007

ssh using php

I found this link http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/

it's really interesting, I like to give it a try!

Monday, August 27, 2007

simple mysql backup or transfer

sometimes we need to backup a database or transport a database from one server to another. the situations are not always good. you are stranded with no phpmyadmin help. mysql provide mysqldump to help you in non-gui environment. just do:

% mysqldump [name_of_the_database] -u [username] -p > [name_of_the_database].sql

as example,

% mysqldump krs -u krs_user -p > krs.sql

the process is finish in few minutes depends on the size of the databases. here you are the backup process is finish. to transport to other server, just copy the krs.sql to the directed server, than do:

% mysql krs < krs.sql -u krs_user -p

or see my previous post about mysql.

Thursday, August 23, 2007

installing ldap server

Easy steps to install LDAP Server:

% apt-get install slapd ldap-utils

Towards the end of the installation process you are asked to answer some configurations questions, if you get errors, just skipped the configuration process then use below command to configure it:

% dpkg-reconfigure slapd

Omit OpenLDAP server configuration? ... No
DNS domain name: ... [enter your domain name here, say example.com]
Name of your organization: ... [enter your organization name here]
Admin Password: XXXXX
Confirm Password: XXXXX
OK
choose Berkeley DB --> BDB
Do you want your database to be removed when slapd is purged? ... No
Move old database? ... Yes
Allow LDAPv2 Protocol? ... Yes/No [Depends on your situation]

To test it use:
% ldapsearch -x -b dc=example,dc=com

If you encountered this error message: ldap_bind: Can't contact LDAP server (-1)
it may caused by the ldap server not started yet, so try to start it using:
% /etc/init.d/slapd start

locales problem

During my revisited to my vps, I encountered this error:

perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

After googling, I found out that the problem is with the locales being not installed on the system. In order to install it:

% apt-get install locales
% dpkg-reconfigure locales

just choose everything started with en_US, and choose the default as en_US.
That's it, no more locales error message!

Tuesday, August 21, 2007

sshfs on mac

being maintaning student databases on several servers, I need a simple way to connect to the servers rather than typing ssh command all the time. Actually, I heard the term sshfs several months ago but never tried it. As now I am using a mac, I wanna try sshfs on mac, Uncle google give me this link to download http://mac.pqrs.org/~tekezo/macosx/sshfs/ and http://mac.pqrs.org/~tekezo/macosx/sshfs/document.html to get the step by step guide.

It's a little bit easier now, but I need to learn the sshkeychain to automate the process.

Thursday, August 16, 2007

uninstall linux ati driver

There is two way to install linux ati driver, automatic and package generation. Therefore, the uninstallation process depend on the way we install it.

1. Automatic:

% cd /usr/share/ati
# must be done as a root
% sh ./fglrx-uninstall.sh

2. Package generation
If you generate the package, then you install it using the package manager available in your compie, so just uninstall it using that. Simple.

Don't forget to uninstall it before install a new version!

Sunday, August 12, 2007

unrar in ubuntu

sometimes we need to extract a file. zip or tar.gz files could be opened directly in linux, but rar is not supported. to be able extract a rar file, we should install unrar.

% sudo apt-get install unrar

two useful and most used command is

% unrar e your-file-name.rar #--- to extract the rar file in the current directory

% unrar l your-file-name.rar #-- to list the content of the rar file

Friday, August 10, 2007

running iso image from hardisk using grub

sometimes you just wanna try a new linux, but you don't wanna burn it to a cd first, grub can be used to do that. [you need to run these command as root or use sudo in ubuntu]

1. mount the iso:
% mkdir /mnt/iso
% mount -o loop /path-to your-iso/youriso.iso /mnt/iso

2. copy vmlinuz and initrd to the /boot
% cd /mnt/iso/boot
% cp vmlinuz /boot/vmlinuz-yourdistro
% cp initrd.img /boot/initrd-YourDistro.img

3. modify /boot/grub/grub.conf (linked to by /etc/grub.conf)

This assumes that /boot is in the first partition of the first hard drive, usually /dev/hda1

title YourDistro
root(hd0,0)
kernel /vmlinuz-YourDistro
initrd /initrd-YourDistro.img

Now you can reboot your pc and run the live cd.

Wednesday, August 8, 2007

ubuntu: listing and removing packages

To view installed packages by size:
% dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less

When you want to remove packages remember to use purge
% apt-get remove --purge package name

Sunday, August 5, 2007

mac fonts to ttf

I was very interesting in the font used in Eclipse IDE under MacOS, so I was thinking how could I used that font in my web.

After googling, I found out this utility called fondu, http://fondu.sourceforge.net. I downloaded it the macos version then installed it as usual pkg installation. Little bit confusion after installation. Where was the fondu? Looking around in Application found nothing. But, when typing in terminal it did exist there!

The font used by Eclipse IDE called Monaco.dfont. to transfer to ttf, just type:
% cd /System/Library/Fonts
% sudo fondu -show Monaco.dfont

-show is to see what fonts are created using fondu.
sudo needs as you try to create a new file in the System directory where your user does not allow to do so.

should you want to create .afm, just add -afm flag,
% sudo fondu -show -afm Monaco.dfont

Now, I could embed it to the html/css....[next]

Saturday, August 4, 2007

wifi, how dangerous it is?

I forgot the link where I read it, but just for a precautions, should you connect to the Internet through a wifi connection, you need to be carefull!

Someone has just show how vulnerable is a wifi connection, he can stole your cookies then play it back later to login to your gmail account, or other webmail.

One of the solution is to login through an https, for google https://mail.google.com

Sunday, July 29, 2007

installing vmware tools in vmware fusion

my virtual machine (guest OS) is feisty-i386-server. the host is mac0s using vmware fusion. in order to activate the shared folder, we need to install vmware tools, by:

1. Select Virtual Machine -> Install VMware Tools
2. Go to the vm and mount the cd using
% sudo mount /dev/cdrom /media/cdrom0

3. copy the VMwareTools-e.x.p-48339.tar.gz to the home directory,
% cp /media/cdrom0/VMwareTools-e.x.p-48339.tar.gz $HOME

4. extract the file
% tar xvfz VMwareTools-e.x.p-48339.tar.gz

5. go to the vmware-tools-distrib and install:
% cd vmware-tools-distrib
% sudo ./vmware-install.pl

6. just accept the all the default values.

7. don't forget to reboot the system!
% sudo reboot


grub in ubuntu

few days without a post as I was so anxious to wait for my teeth operation, so kids don't forget to brush your teeth. It was a small operation, but operation is an operation. the pain is real.

just a quick and lite tips today:

if you need to find out where is your grub menu option, look no further in

/grub/boot/menu.lst

usually after being updated by the system [for example after installing/upgrading to a new kernel], the old one will be save as /grub/boot/menu.lst~

Tuesday, July 24, 2007

[fds part 1]: installing fedora directory server in ubuntu server 64-bit

1. download the fedora directory server (fds) from:
% wget http://directory.fedoraproject.org/download/fedora-ds-1.0.4-1.FC6.x86_64.opt.rpm
2. convert it to deb [--script was put there as it was warned by the system]:
% sudo alien fedora-ds-1.0.4-1.FC6.x86_64.opt.rpm --script
3. as it is amd64 version, we should use the termcap from fedora and do converting to deb again:
% wget http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/Fedora/RPMS/libtermcap-2.0.8-46.1.x86_64.rpm % sudo alien libtermcap-2.0.8-46.1.x86_64.rpm
% sudo dpkg -i libtermcap_2.0.8-47.1.amd64.deb

[deleted as it found to be false]Should 32 bit version is used, we could directly install it using:
% sudo apt-get install termcap-compat [upto here]
we should do:
% wget http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os/Fedora/RPMS/
libtermcap-2.0.8-46.1.i386.rpm
% sudo alien
libtermcap-2.0.8-46.1.i386.rpm
% sudo dpkg -i
libtermcap-2.0.8-47.1.i386.deb


4. We need Java, for feisty fawn you can do:
% sudo apt-get install sun-java6-bin

5. Setting JAVA_HOME enviroment variable:
% sudo vi /etc/profile

add these two lines on the last line:
JAVA_HOME=/usr/bin/java
export PATH JAVA_HOME

to make the modification take effect:
% . /etc/profile

test by
% echo $JAVA_HOME
/usr/bin/java [the expected output]

6. We also need apache:
% sudo apt-get install apache2-mpm-worker

as ubuntu recognize apache as apache and fedora recognize it as httpd, we need to create as symbolic link:
% sudo ln -s /usr/sbin/apache2 /usr/sbin/httpd

7. Installing the package:
% sudo dpkg -i fedora-ds_1.0.1-2_i386.deb

Creating a user and group for the daemon:
% sudo groupadd fds
% sudo useradd -s /bin/false -g fds fds

Next, setting up the server....

adding dvd repo in ubuntu server

using ubuntu server means no gui [no synaptic???]. in order to add dvd repo, do:

1. make sure the /cdrom is link to the correct cd/dvd rom being used.
% ls -l /cdrom
lrwxrwxrwx 1 root root 11 2007-07-24 12:25 /cdrom -> /media/cdrom


I put the dvd repo in /media/cdrom. Otherwise you should point to the right direction, for example:
% sudo rm /cdrom
% sudo ln -s /media/cdrom1 /cdrom
# create symbolic link /media/cdrom1 as /cdrom

2. add the dvd repo by
% sudp apt-cdrom add

3. enter your password, then insert the dvd repo disk 1 and press enter.

4. do for the other three by repeating step 3 three times.

5. after that, don't forget to update the system using
% sudo apt-get update


Now, you have added dvd repo to your system, next time you wanna install software, you will be asked to insert a specific cd to where the software reside.


Monday, July 23, 2007

create cd image in mac

last post is about manipulating cd image in linux, now, how about mac? Disk Utility is a powerful tools that can burn a cd/dvd image. In addition, you do not need cd daemon tools to mount a cd image as you can just double click the iso file and it will be mounted automatically.

One thing that is not yet available in an easy way is how to create an image of a cd. Being BSD based, mac inherited some BSD/Linux commands. one of them is dd. But, just now I found out one freeware application to make a cd image easily, its name is ISOlator. You can download the application in http://www.macupdate.com/info.php/id/18634.

Installing this application is easy, just double click the zip file, then follows the instruction to drag the ISOlator to the Application's folder.

Launch the application, there will be a small window appear on the screen, drag your cd's icon to this window, then you will be asked to give a name and location for the new iamge file.

Wait few minutes and the iso file will be ready. That's it all you need to do.

Friday, July 20, 2007

assorted image cd manipulation commands

These tips are taken from http://ubuntuguide.org/wiki/Ubuntu:Feisty/CDDVDBurning

Assumed that /dev/cdrom is the location of CD/DVD-ROM

How to create Image (ISO) files from CD/DVD

% sudo umount /dev/cdrom
% readcd dev=/dev/cdrom f=file.iso


How to create Image (ISO) files from folders

% mkisofs -r -o file.iso /location_of_folder/


How to generate MD5 checksum files

% md5sum file.iso > file.iso.md5


How to check MD5 checksum of files
Assumed that file.iso and file.iso.md5 are in the same folder

# md5sum -c file.iso.md5


How to mount/unmount Image (ISO) files without burning
To mount Image (ISO) file
% sudo mkdir /media/iso
% sudo modprobe loop
% sudo mount file.iso /media/iso/ -t iso9660 -o loop


To unmount Image (ISO) file
% sudo umount /media/iso/


If you want to mount/unmount your ISO image by directly right-clicking on it, you can do this from your home dir:
% cd .gnome2/nautilus-scripts/
% gedit Mount


Copy this script into Mount file
#!/bin/bash
#
for I in "$*"
do
foo=`gksudo -u root -k -m "Enter your password for root terminal access" /bin/echo "got r00t?"`
sudo mkdir /media/"$I"
sudo mount -o loop -t iso9660 "$I" /media/"$I" && nautilus /media/"$I" --no-desktop
done
done
exit0


Save and close, than do the same with unmount file:
# gedit Unmount


Copy these script into Unmount file
#!/bin/bash
#
for I in "$*"
do
foo=`gksudo -u root -k -m "Enter your password for root terminal access" /bin/echo "got r00t?"`
sudo umount "$I" && zenity --info --text "Successfully unmounted /media/$I/" && sudo rmdir "/media/$I/"
done
done
exit0


Make them executable with:
% chmod +x Mount
% chmod +x Unmount


Or a graphical tool type in terminal:
% sudo apt-get install gisomount


to run type in terminal:
% sudo gisomount

Tuesday, July 17, 2007

java: setting proxy

when your java program needs to access the Internet using proxy, use this:
%java -Dhttp.proxyHost=proxyhost [-Dhttp.proxyPort=portNumber]

for example, I want to execute Reader.java

%javac Reader.java
%java -Dhttp.proxyHost=http://192.168.1.1 -Dhttp.proxyPort=8080 Reader


php: file create, read, write, open, close and delete

I have to figure out how to manipulate file in php in order to automate my database converter. The problem here is the main database is using interbase while my local database is using mysql.

This is just a note for my references:

The typical pattern of manipulating file is open, do write or read then close file.

Create & Open File
Open and creating a file are using the same command in php.

$fileName = 'theFile.txt';
$fileHandler = fopen( $fileName, 'X' ) or die( "can't open file! );

replace X with:
r : to read a file, the pointer starts from the beginning of the file.
w : to write to the file, overwrite the previous content.
a : to wrote to the file, appending the new content to the current file.
r+ : open a file to be read from and write to, the pointer starts from the beginning of the file.
w+ : same as r+, but the content of the file becomes overwrite (empty).
a+ : same as r+, only the pointer is at the end of the file.

die( "can't open file! ) needed to stop the process below. Otherwise, errors are pop up for the following file manipulation commands.


Read File

$txt = fread( $fileHandler, n );

where n can be:
integer, for example 10, to read the first 10 bytes [or characters as 1 byte = 1 character], or
if you want to read the all contents of the file, replace n with filesize( $fileName );


Write File

fwrite( $fileHandler, $txtToWrite );


Delete [Unlink] File
In php, deleting a file is equal to unlink the file, if there is no more link to the file object, the system will forget of its existence.

unlink( $fileName );


Closing File

fclose( $ fileHandler );


Actually I summarize that from http://www.tizag.com, solely for the purpose of maintaining single place documentation.

Monday, July 16, 2007

mysql update & insert from file

Maintaining Enrolment system is not an pleasant task. So many things must be reminded as bad documentation was supplied. Hehehe blame on myself that was too lazy to write them down.

This is just notes from me to rectify those problems above:

In order to update the data by increasing or decreasing its value, you do not need to use select then update. Instead you only need update query. See the example below:

UPDATE employee_data SET
salary = salary + 20000,
bonus = bonus - 5000
WHERE title='CEO';

Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0

While, inserting data from main database server to local database [in my case: I need to copy data from main uni's database into faculty's database, so my proposed solution is to read from main uni's database using php then run a script that contains command below. To make the process run automatically, I will put it as cron jobs]

Inserting data into employee_data table with employee.dat file
On Windows
1). Move the file to c:\mysql\bin.
2). Make sure MySQL is running.
3). Issue the following command
mysql employees < employee.data

On Linux
1). Migrate to the directory that contains the downloaded file.
2). Issue the following command
mysql employees < employee.data -u theUser -p
3). Enter your password.

Example of employee.dat:
INSERT INTO employee_data (f_name, l_name, title, age, yos, salary, perks, email) values ("John", "Hagan", "Senior Programmer", 32, 4, 120000, 25000, "john_hagan@bignet.com");
INSERT INTO employee_data (f_name, l_name, title, age, yos, salary, perks, email) values ("Ganesh", "Pillai", "Senior Programmer", 32, 4, 110000, 20000, "g_pillai@bignet.com");
INSERT INTO employee_data (f_name, l_name, title, age, yos, salary, perks, email) values ("Anamika", "Pandit", "Web Designer", 27, 3, 90000, 15000, "ana@bignet.com");

Sources from the tips above with little modification: http://www.webdevelopersnotes.com

Saturday, July 14, 2007

ssh on macos

I have just experience a funny thing when using ssh on my mac. Usually, I access my file server through wifi, but the access rate was not quite acceptable for iso transfer. Hence, I tried using wired network. What a surprise, I could not access the server using ssh although I could ping the server.

It was not
- MacOS problem as I could access the file server using wifi.
- Firewall problem as I could access the file server using my windows and ubuntu machine with the same IP address.

I have tried to delete .ssh/known_host without any luck!

What a problem.....

Wednesday, July 11, 2007

python for mac: installation

People can say that apple is not opensource, but I am still love it. Actually, vista has better gui than macos, but again people say wait for macos 10.5.

Anyway, I am still love my new MacBook Pro.

I'd like to learn python again to maintain my Online Enrolment System [KRS] for my faculty. I remembered when OSDC Meeting in Melbourne, December 2005, Jeff Waugh said that Ubuntu has better support off the shelf for python than any other distro. But, now, I need to install it on my mac. Mac comes with python version 2.3.5 while the newest is version 2.5.1.

Browsing on the python website, I found out that there is macos version for python [download from here: http://www.python.org/ftp/python/2.5.1/python-2.5.1-macosx.dmg]. The file is almost 18 MB. Download it, double click on it, open the installer.

> double click on MacPython.mpkg
> Click on "Continue" button on Introduction, Read Me and Licence pages, then click "Agree" to acknowledge the Licence Agreement.
> Pick the daetination then click on "Continue" button.
> Choose "Install" then enter the password for the admin user.
> Then close it after installation is finished.

To try it:
type python on terminal, you will get directly the new version:
daniel-adinugrohos-computer:~ adinugro$ python
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
[use Ctrl-D to exit from python interpreter]

This is what I love with mac, instalation is very simple and has the pattern and interface. Although, Linux is catching up with klik, synaptic and many more.

Tuesday, July 10, 2007

few days in exile......

just kidding, it has been few days since my last posting. I was rather busy finishing my research progress report. It is about Student Enrolment via SMS. Today is the deadline to send the report, but I have not finished yet. That's why I woke up in the early morning. Moreover my little daughter was awake asking for milk.

She is a good daughter, she rarely wake up in the night. Usually just wake up at 2 AM and 4 AM. Sometimes even only once at 2AM. I am lucky to have good and understanding children.

Thursday, July 5, 2007

finding the best calendar software

starting from july 2007, i have been in charged for academic matters. it is not easy, so many meetings, while i have to finish my marking.

my other job is to reorganize our curriculum and drawing a best strategy to our students to graduate in 3.5 years plus having more broader knowledge and practical implementable skills.

one thing i learn that timetable is very important. it is not just to organize our schedule but also to others to understand our schedule so that they can see us if they need it.

now, my journey is begin, finding the best calendar software ........

Monday, July 2, 2007

transfer big files ....

transferring a file larger than 4 gb was is a pain. i could not do it from fedora 4/5 although ubuntu feisty fawn could.

the problem is I need to transfer file from my gateway server [fedora 5] to file server [fedora 4].

[scp simply cannot do that as the file, ubuntu repo, is over 4gb. it is the limitation of scp protocol.] <-- not sure, see comment!

sftp should be able to do it by don't know why it stops at 4gb marked.

solution using dd:
# dd if=ubuntu-repo-amd64-1.iso | ssh root@192.168.1.1 of=/data/ubuntu-repo-amd64.iso

resulting the same!

any suggestions?

Friday, June 29, 2007

vps: ftp server

second things that is checked by isponfig installation is ftp server. I will install proftpd:

debian:~# apt-get install proftpd ucf
[choose standalone when asked inetd / standalone]

debian:~# vim /etc/proftpd/proftpd.conf

in line 10: set

UseIPv6 off


add in line 12:
DefaultRoot ~
IdentLookups off
ServerIdent on "FTP Server ready."


create a link in /etc as ispconfig need it, then restart proftpd:

debian:~# ln -s /etc/proftpd/proftpd.conf /etc/proftpd.conf
debian:~# /etc/init.d/proftpd restart
Stopping ftp server: proftpd.
Starting ftp server: proftpd.
debian:~#

Now, finish with the proftpd installation.

vps: quota

Other requirements to install ispconfig is quota. To install quota, run:

debian:~# apt-get install quota


Edit /etc/fstab:

debian:~# vim /etc/fstab


Add usrquota,grpquota to partition with the mount point "/", in my case: /dev/sda1.

/dev/sda1 / ext3 defaults,usrquota,grpquota 1 1


Enable quota by:
debian:~# touch /aquota.user /aquota.group
debian:~# chmod 600 /aquota.*

[this is from my experience, somehow it is best to turn quota off before doing checking
and use aquota.user and aquota.group, if we use quota.user and quota.group, sometimes the kernel unsupported error message will be appeared]

debian:~# quotaoff -a
debian:~# quotacheck -avugm
quotacheck: Scanning /dev/sda1 [/] done
quotacheck: Checked 9318 directories and 80043 files
debian:~# quotaon -avug

Finish, with the quota problem.

vps: sendmail

In order to be able to install ispconfig, we need to have mail transfer agent (MTA). I choode to install sendmail for this case.

debian:~# apt-get install sendmail

that's all you need!

Thursday, June 28, 2007

vps: webmin and usermin

Most people think that a console is the sys admin only tools. I am disagree with that. GUI is not that bad. Especially, for occasional sys admin like me :)

Webmin and Usermin are one of many good tools to do that. To install it do:


1. Get the latest debian packages, by simply run:
debian:~# wget http://prdownloads.sourceforge.net/webadmin/webmin_1.350_all.deb
debian:~# wget http://prdownloads.sourceforge.net/webadmin/usermin_1.280_all.deb

2. Then install their dependent packages:
debian:~# apt-get install openssl libnet-ssleay-perl libauthen-pam-perl libio-pty-perl libmd5-perl

[openssl is required in my vps, while I don't find it in the instruction.]

3. Now, you can install webmin/usermin package without error message:
debian:~# dpkg -i webmin_1.350_all.deb usermin_1.280_all.deb

4. also update your rc*.d and so webmin/usermin will startup correctly, and able to manage by using rcconf:
debian:~# rm -rvf /etc/rc*d/S*webmin*
debian:~# rm -rvf /etc/rc*d/K*webmin*
debian:~# rm -rvf /etc/rc*d/S*usermin*
debian:~# rm -rvf /etc/rc*d/K*usermin*
debian:~# update-rc.d -f webmin defaults 99 01
debian:~# update-rc.d -f usermin defaults 99 01

5. you can now log into your webmin interface by
https://www.example.com:10000 for webmin, and
https://www.example.com:20000 for usermin


Enjoy the GUI Server Management!

sources: http://edin.no-ip.com/html/?q=webmin_usermin_debian_etch_mini_howto

friend, some of them are real, some of them are just enemies undercover

the title tell.....

it is hard to find a truly friends. most of the time we will meet people that keep telling us that he is our best friends but he always does bad thing to you, he just wanna take advantage of you.

the difficult thing is that you keep telling yourself that he is your friend!

Wednesday, June 27, 2007

vps: installing name server, bind9

Name server is needed to manage the hostname to ip address matching. Usually, we use BIND in linux. To install it in my vps, I follow the instructions in http://www.howtoforge.com/perfect_setup_debian_etch_p4 :

debian:~# apt-get install bind9

For security reasons, run BIND chrooted:

debian:~# /etc/init.d/bind9 stop
Stopping domain name service...: bind.
debian:~# vim /etc/default/bind9

edit line 1, so become:

OPTIONS="-u bind -t /var/lib/named"


Create some necessary directories under /var/lib:

debian:~# mkdir -p /var/lib/named/etc

debian:~# mkdir /var/lib/named/dev
debian:~# mkdir -p /var/lib/named/var/cache/bind
debian:~# mkdir -p /var/lib/named/var/run/bind/run

Then move the configuration directory from /etc to /var/lib/named/etc:
debian:~# mv /etc/bind /var/lib/named/etc


Create a symbolic link to the new configuration directory from the old location (to avoid problems when bind gets updated in the future):
debian:~# ln -s /var/lib/named/etc/bind /etc/bind


Make null and random devices, and fix permissions of the directories:
debian:~# mknod /var/lib/named/dev/null c 1 3
debian:~# mknod /var/lib/named/dev/random c 1 8
debian:~# chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
debian:~# chown -R bind:bind /var/lib/named/var/*
debian:~# chown -R bind:bind /var/lib/named/etc/bind


We need to modify /etc/default/syslogd so that we can still get important messages logged to the system logs.

debian:~# vim /etc/default/syslogd

edit line 13, so become:
SYSLOGD="-a /var/lib/named/dev/log"


Restart the logging daemon:

debian:~# /etc/init.d/sysklogd restart
Restarting system log daemon: syslogd.

Start up BIND, and check /var/log/syslog for errors:
debian:~# /etc/init.d/bind9 start

Starting domain name service...: bind.
debian:~#


sources: http://www.howtoforge.com/perfect_setup_debian_etch_p4

System Information using phpsysinfo

To monitor a server from anywhere using the Internet, you can use this php scripts: phpsysinfo. You only need to install it:

debian:~# apt-get install phpsysinfo

Then, open your browser, goto: www.yourdomain.com/phpsysinfo or your-ip-address/phpsysinfo.

There are several template and language supported. Even, Indonesian is there.

For security reason, rename the phpsysinfo to other unique name. This is not entirely secure but it is better than still using phpsysinfo name, for example: kuntul.

This is very useful scripts for a sys-admin.

Tuesday, June 26, 2007

securing vps[4]: turn off directory browsing

Directory browsing is good for intranet with low security, as you do not need separate html coding to produce indexes. But for a web server it is not a good practice. In order to turn it off, edit default file in /etc/apache2/sites-available:

debian:~# cd /etc/apache2/sites-available/
debian:/etc/apache2/sites-available# vim default


add "-" before Indexes in line 11,

Options -Indexes FollowSymLinks MultiViews


don't forget to restart the apache.,

debian:/etc/apache2/sites-available# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)....
debian:/etc/apache2/sites-available#


Now, you will get 403 Forbidden instead of the indexes page.

Monday, June 25, 2007

president Bush daughter made an illegal copy of mix cd

A lawyer has just make a sensation. He told public that president Bush daughter made an illegal copy of mix cd for her father's present in Father's Day. See Lawyer to RIAA: Sue the First Twins for copyright violations!

Unfortunately, US regulation allows such activity, which I am quite surprised that the lawyer did not know before make the headlines.

I was thinking that in Australia, we do not allow to do that. Anyone remember?


Saturday, June 23, 2007

securing vps[3]: hide apache version

It's apache turn. The web server still showing its identity when we telnet it. Edit apache2.conf in /etc/apache2/apache2.conf

debian:~# cd /etc/apache2/
debian:/etc/apache2# ls
apache2.conf envvars mods-available ports.conf sites-enabled
conf.d httpd.conf mods-enabled sites-available
debian:/etc/apache2# vi apache2.conf

# only display 'apache'
ServerTokens ProductOnly

# do not display additional information
ServerSignature Off


Don't forget to restart the web service,
debian:/etc/apache2# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)....
debian:/etc/apache2#

The output become:
daniel-adinugrohos-computer:~ adinugro$ telnet xxxx.vpsfarm.com 80
Trying 209.9.228.xxx...
Connected to xxxx.vpsfarm.com.
Escape character is '^]'.
HEAD / HTTP/1.1

HTTP/1.1 400 Bad Request
Date: Sat, 23 Jun 2007 14:05:04 GMT
Server: Apache
Connection: close
Content-Type: text/html; charset=iso-8859-1

Connection closed by foreign host.
daniel-adinugrohos-computer:~ adinugro$

See the differences!

securing vps[2]: secure php version information

Knowing the version of php is big advantage for a hacker. He or she can use the unpatched hole to attack the web server. Try this (see the bold words):

daniel-adinugrohos-computer:~ adinugro$ telnet xxxx.vpsfarm.com 80
Trying 209.9.228.xxx...
Connected to xxxx.vpsfarm.com.
Escape character is '^]'.
GET / HTTP/1.1 [type enter twice here]

[the output will be:]
HTTP/1.1 400 Bad Request
Date: Fri, 22 Jun 2007 23:05:06 GMT
Server: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch4
Content-Length: 335
Connection: close
Content-Type: text/html; charset=iso-8859-1


In order to secure this, we must edit the php setting in php.ini. Do this:

debian:~# cd /etc/php5/apache2/
debian:/etc/php5/apache2# ls
conf.d php.ini
debian:/etc/php5/apache2# vi php.ini


# remove X-Powered-By
expose_php = Off [in line 260]

# also turn of the error information, it is the best practice for production server.
display_errors= Off [in line 323]

# don't forget to restart the web server:
debian:~# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)....
debian:~#


Now, try again the testing:

daniel-adinugrohos-computer:~ adinugro$ telnet xxxx.vpsfarm.com 80
Trying 209.9.228.xxx...
Connected to xxxx.vpsfarm.com.
Escape character is '^]'.
GET / HTTP/1.1 [type enter twice here]

HTTP/1.1 400 Bad Request
Date: Fri, 22 Jun 2007 23:51:10 GMT
Server: Apache/2.2.3 (Debian)
Connection: close
Content-Type: text/html; charset=iso-8859-1

Connection closed by foreign host.
daniel-adinugrohos-computer:~ adinugro$


See the differences! It is not finish yet as the apache version is still shown. Next post will be how to turn off that!

Friday, June 22, 2007

vps: remove default apache redirection

Apache has default page to tell us that the installation was succesful. Once, we are satisfy with the result, remove the redirection by doing this:

debian:~# cd /etc/apache2/sites-available/
debian:/etc/apache2/sites-available# ls
default
debian:/etc/apache2/sites-available# vi default


find the RedirectMatch line, in my case it is in line 46. Comment it out by placing '#' in front of it:

#RedirectMatch ^/$ /apache2-default/


Finally, check whether the redirection is removed by creating a simple index.php, don't forget to restart the apache, then go to your web browser to check whether you are redirected or not.

debian:/etc/apache2/sites-available# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)....


You can simply remove the apache-default directory as it is unused anymore.

debian:/var/www# rm -rf apache2-default/


Now, your web server ready to serve!

Thursday, June 21, 2007

securing vps[1]: change mysql password

Installing phpmyadmin will help us in managing our mysql database. In my opinion, it is not only for beginner, but for advanced user as well.

Our mysql server has no password for root. It is very dangerous! We can change the password via mysql client [why I chose to install mysql-client], but I like to use phpmyadmin.

1. First thing first, go to the phpmyadmin on our server, login as root with blank password.
2. Choose mysql(17) database on the left menu.
3. Find user table, and click on it.
4. Click on Browse tab, to get the content of this table.
5. In order to change the password, click the pen picture on the row which has user = root and Host = localhost.
6. On the next window, type your password and don't forget to apply Password on the Function field. Click on Go button to save the changes.
7. Apply the same changes to the all root account. You can use the same password for all of the root password depend on your situation.
8. Now, I have changed the password. Choose the Home button on the left side menu. Then, Choose Reload Privileges to flush all the privileges, and click on Go button.
9. We will forward to the login page again. Try to login using root with blank password, your login will be failed.
10. Try with the new password and you can use phpmyadmin again.

Next, I am tending to change the name of phpmyadmin as well. This is just to hide my phpmyadmin from outsiders. By doing this, they have to guess where is the phpmyadmin and the password for root. If you still use phpmyamdmin directory, hackers only need to guess or crack the root password. The way to do it is just renaming the phpmyadmin directory with other name, for example: nasicampur, basisdata, etc.

debian:~# cd /var/www/
debian:/var/www# ls
apache2-default phpmyadmin test.php
debian:/var/www# mv phpmyadmin nasipadang
debian:/var/www# ls
apache2-default nasipadang test.php
debian:/var/www#

Test by go to the your server with nasipadang directory. You will get the phpmyadmin login page.

[Again, for security reason, I has changed again the directory's name.]

Wednesday, June 20, 2007

installing LAMP on vps

Nowadays, Linux is becoming easier to install. More supports and wider community means more people are willing to help you out there.

Me next task is setting up LAMP on my vps. Being a debian 4 server, I will use the magic of apt-get.

# just to update the package system
debian:~# apt-get update

# install mysql first, to be able to be picked up by Apache
# also install the client, for debugging purpose
# use meta package mysql-server and mysql-client to get the newest version
debian:~# apt-get install mysql-server mysql-client

# for basic apache+php5 install, do this!
# don't forget to install mpm-prefork to get better multi-threaded support
debian:~# apt-get install apache2 apache2-mpm-prefork php5

# don't forget to install phpmyadmin, to manage your mysql easily.
debian:~# apt-get install phpmyadmin


Testing my setup by open it in the web browser shows, the apache default message "It works!", Also, test the phpmyadmin by open it in the web browser. [At the moment, I don't publish the url as the server has not been secured yet.]

That's all for today. But my jobs has not finished yet. Next is how to secure the LAMP server.

Tuesday, June 19, 2007

vps, first thing to do!

More than a month, I have been toying around with the vps. Now, I just want to record my activities with it. I think it is very easy. I use vpsfarm @ www.vpsfarm.com. I think they don't have any machines left at the moment.

I choose debian as it is the root of ubuntu. Five minutes after installation, they send me the password via email.

First thing to do, change the password. it must be unique, between 8-12 characters, combination of upper case, lower case and numbers.

the command is:

debian:~# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
debian:~#

You must enter the same password twice, to avoid mistyping the password as the character you typed is not shown in the screen.

It's all done! Next is how we install LAMP into it.

Monday, June 18, 2007

livecd ubuntu feisty fawn

I remember that last month, I had a trouble to run the new ubuntu livecd. Unfortunately, the livecd asked for username and password. What were they? I thought using livecd, we did not need to create account first.

Browsing the google, found the solution. Just reburn the cd, it may caused by bad burning process. But, I think it was caused by my cdrw. I used to save the iso in my hd, then burn it to cdrw when needed.

Now, I enjoy my experience with ubuntu....


Sunday, June 17, 2007

starting from the beginning again...

As usual, the easiest things to do is start from the beginning. Conquer is easy but defend it is very difficult. Create a new blog is very easy, but maintain it will be huge tasks.

Hopefully, this blog will be the main place for me to record my activities during my busy time to do my jobs.

Gone and borne, lost and having a new one is not the same. But, sadness must end. Otherwise, we will never enjoy our short life.

life must go on...