Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

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

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, 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!

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.

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

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~

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

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

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?