Pages

Wednesday, August 18, 2010

How to Enable PHP Inside HTML Pages

php code can be embedded within html pages within the tags:
<?php echo "my php code"; ?>

However, and depending on the server that you are using, this must be enabled. On apache2, you can edit the .htaccess file to include:
AddType application/x-httpd-php .htm .html

I added this line to the .htaccess on my website's root directory.

Voila!

Monday, August 16, 2010

Picasa Installation Error on Ubuntu

So Picasa has failed to install on my Ubuntu box. The caveat is that it also prevented me to install any other packages and gave the following error whenever i tried to install something:
ubuntu previous installation hasn't been completed
I suspected it was Picasa, but to verify, I opened up a terminal and typed the following:
sudo apt-get -f install
and I got the following error message:
The package Picasa needs to be reinstalled, but I can’t find an archive for it.
The solution to this is to cleanup the incorrectly installed package (Picasa or else) via the following:
dpkg --remove --force-remove-reinstreq picasa
That solved the problem for me. I haven't tried reinstalling Picasa though.

Friday, August 13, 2010

How to Change Computer Name or Hostname in Linux

The hostname is stored in the file
/etc/hostname
You can edit that with your favorite editor. I use emacs:
sudo emacs /etc/hostname
You will also need to match that in
/etc/hosts

Wednesday, August 11, 2010

Extract Multipart rar Files in Linux

Open up a terminal and browse to the directory where the multipart rar files are and type
unrar x thefile.part1.rar

Tuesday, August 10, 2010

How to Kill a Process in Linux

First, identify the PID for the process that refuses to end. Open up a terminal and type
top
To close top, type
Ctrl + c
now you're back in terminal. To kill the process, type
kill -9 PID

Hope that works!