This tutorial is meant for people who are want PHP5 on their Ubuntu computer along with Apache2, but can’t seem to make it happen. I’ll just explain it all as it happened to me.

I have an old pc running BackTrack 4 R2 which is used as a MySQL server. It’s Ubuntu version is Intrepid, which isn’t officially supported anymore. As it happened, we needed to run a small webserver on it with PHP support. Although Apache2 is installed and running fine, server wouldn’t handle PHP files and will just offer them as download instead of processing them.
Now the first step is to install PHP.

Now, as I said before, my Ubuntu version is old and not supported, I had to manually change my repository list at /etc/apt/sources.list and add the following lines:Continue reading

I just managed to get BackTrack 5 running on my PC at home after  a lot of struggle.  Installation was pretty smooth as everything from booting up from Live DVD to installation was very easy. But the real problems popped out after that. I originally intended to write one long post listing all the problems faced, but this one will address one only.

 

 startx command doesn’t work

 

This was the most annoying problem which just refused to get fixed.  After logging in on command prompt, you need to run startx command in order to start GUI, but for some folks GUI doesn’t start and it falls back to command prompt with errors like:

VESA(0): no valid modes
Screens found but, no usable configuration.

 

and / or something similar. The problem is particularly vexing because live DVD works just fine.  I had the same problem in GNOME 64 bit and KDE 32 bit versions.  There are quite a few people who faced this problem and it seems like the solutions provided in these pages, Techarena and BackTrack forums do work for many people. But no solution provided in those threads at that time worked for me.  If you are like me and neither of those solutions worked for you, then read on.

There are two ways to do this. First an easier way is to boot using live DVD and connect to internet to download drivers and update. Other is to  log in to BackTrack installation using root account with password toor and access internet from command prompt. You can do it either way, it’s your choice. Please read the following tutorial here to learn how to configure internet connection from command prompt.  From command line, you can use lynx browser, but it’s utility is rather limited. So I suggest booing up from CD and downloading drivers first to a location which you can access from installation.

Once your internet is up and running, check up your repositories and update,

apt-get update 

Don’t run apt-get upgrade yet. It’ll just download and install 500MB worth of software and the problem will come back on next reboot. Also keep in mind that updates have to be installed on hard disk installation. Don’t run this command on live DVD boot Now you have to download and install drivers for your graphics card. Mine is a NVidia and I downloaded my drivers from this page: http://www.nvidia.com/object/unix.html

For 32-Bit, run command

 

wget http://us.download.nvidia.com/XFree86/Linux-x86/290.10/NVIDIA-Linux-x86-290.10.run 

 

For 64 bit,

wget  http://us.download.nvidia.com/XFree86/Linux-x86_64/290.10/NVIDIA-Linux-x86_64-290.10.run

Users with Intel and ATI chipsets  can download their divers from http://www.intel.com/support/graphics/sb/cs-010512.htm and http://support.amd.com/us/gpudownload/Pages/index.aspx . After the downloads are complete, install the divers using  either ./driver-file-name.run or sh driver-file-name.run command. You may have to make the files executable first using chmod +x driver-file-name . Some drivers may come in different packages. Follow the instructions in that case.

Run apt-get -f install to fix any missing dependencies and then run startx. You may want to reboot once before doing that though.  startx will work just fine as intended and will guide you to he BackTrack 5 desktop.

This series of posts will contain a list of some very useful Linux commands that you might need every now and then. This one is  a small tutorial on how to delete files in linux.
 First post on Linux networking here

1. Delete files and directories

rm command

Let us assume you want to delete some files in directory /usr/tmp . You first navigate to directory using command

cd /usr/tmp

Now if you want to delete a particular file use rm as following:

rm filename

or you can run following command from whichever directory you are in.

rm /usr/tmp/filename

But if you want to delete all the files in that directory, use rm as following:

rm *.*

To refine it further, if you want to delete only a few files but leave the rest, you’ll have to use wild-cards. I’ll explain it first using deleting by extension example. Let us assume that you have a collection of zip, mp3 and bin files (with extensions .zip, .mp3 and .bin respectively) and you want to delete only mp3 files, then execute :

rm *.mp3

It’ll delete all mp3 files file leaving all zip and bin files intact. But if you want to delete .bin files too, just add the extension like this:

rm *.mp3 *.bin

In order to delete directories, you have to modify it a little by adding -rf, If you have a directory named DIR which you want to delete, execute

rm -rf DIR

As posted earlier, you can use *.* wildcard to delete everything in the directory including all the sub-directories:

rm -rf *

Similarly you can delete files based upon their names too. Executing

rm a*.mp3

will delete all mp3 files which start with alphabet a, while

rm -rf a*

will delete every file and directory which starts with a

Apart from this, you might come across a scenario where you have to find and delete some type of files from multiple directories / folders. In this case I’m assuming that you need to delete all mp3 files located in various sub-folders inside /usr/tmp/. In such a case use find command

find /usr/tmp/ -type f -iname “mp3″ -delete

or

find /usr/tmp -type f -iname “mp3″ -exec rm -f {} ;

If you replace path /usr/tmp with just a / it’ll find and delete ALL mp3 files on your computer. So be careful

Useful links:

http://www.cyberciti.biz
www.linuxquestions.org

NoDoFollow is a Mozilla Firefox addon which Highlights links in a document and color codes them according to follow / nofollow.  It’s used quite a bit in my office but the author hasn’t released updated version compatible with Firefox 4 or Firefox 5. So when I installed latest Firefox version 5.0.1, there were quite a few protests from the minions. So I modified the NoDoFollow to make it work with Firefox 5.

Download it from this link: http://www.jjamwal.in/dl/nodofollow.xpi
Open the XPI file from Firefox’s Open menu and it’ll be installed.  

In case, you want to know how it’s done, read on.
There isn’t much to it. XPI files are just ZIP files with modified extensions. All one needs to do is unzip the file into a folder and open install.rdf file in a text editor. Find and modify the following line em:MaxVersion=”3.6″
Replace 3.6 with any version number of Firefox you want. I changed it to 6.6. :p
After that, all you need to do is to create a zip up these files in to an archive again and change the extension to XPI from ZIP. Take care of not zipping the folder in which you extracted the files. The archive should be of content structure as it is.