Wednesday, February 24, 2010

Recursively change permissions of directories only

There was once I accidentally recursively changed permissions of a directory to 777. This meant that all my files in that directory became executable.

Changing it back to 666 recursively meant that all my directories are no longer executable.

using the -type and -exec options in find, we are able to find directories and change permissions for them only.

find Pathname/ -type d -exec chmod 777 {} \;

Thursday, February 18, 2010

How do you find what packages are installed in Debian Linux?

Using the dpkg command with --list option.  

type: dpkg --list to display the status of all the packages installed in the system.


Saturday, February 13, 2010

How to add a user in Debian Linux

To add a user, use the useradd command with all the options necessary.

In order to login with the new user, you'll need to add a password. Log in as root and type passwd username. The system will ask you to enter and re-enter the password.

Monday, January 25, 2010

Installing a Second PCI Ethernet Device

Bought a PCI Ethernet device to install into my PC so that I can use it as a Proxy/NAT server. The model that I bought is a TP-LINK 10/100M PCI Network Adapter (TF-3239DL). I opened up my box and installed it into the white PCI slots in the mainboard. I fired up the system and checked ifconfig but don't see the new ethernet adapter there. 


Went back to the networking page of www.aboutdebian.com, as I had trouble getting the new PCI ethernet card to work. Using lspci | grep -i ethernet shows that linux has detected the new PCI card. I had to install a program modconf to help install a new device driver (modules in linux). After installing the modules, network configuration settings needed to be entered in the /etc/network/interfaces file.

after this is done & rebooting the system, ifconfig will show the new PCI card.


Tuesday, January 12, 2010

Installing Debian Lenny (D4)

Reading through the networking page took quite a long time as they covered a lot of material there. It was more information than steps for you to set-up the networking in Debian. They pointed to other tutorials that covers setting up a Proxy Server etc.

They referred to a program called "mtr" that is similar to traceroute, however it wasn't installed on my system and a search on apt-cache came up empty. So I searched online and found that there is such a program, just that my package sources in source.list was not set-up to find it.

Thus I added these lines in the source.list file and then it worked:


deb http://http.us.debian.org/debian/ lenny main
deb-src http://http.us.debian.org/debian/ lenny main
That's all for now, signing off 


Monday, January 11, 2010

Installing Debian Lenny (D3)

Using Packages  


Started with a new tutorial in www.aboutdebian.com called Using Packages.

The goal was to learn various ways to install packages, to get to use the X-Server GUI, configuring the apt-utilities to get packages information off the net and also to set-up an auto update.

Things started off wrongly in the beginning where they wanted me to run dselect. I tried but the command prompt kept saying telling me there's no such command. Apparently dselect wasn't installed when I installed the OS, so I used apt-get to install dselect and no problems there after.

Went through the tutorial which touched on the basics of using dselect to browse and install programs, and there are many programs available. Next I used apt-cache to search for a particular program so that we could install wu_ftpd using apt-get. Lastly  I learnt how to create a bash script for the cron scheduler to run at predetermined times. This script was used to automate the update of the system regularly.

That marked the end of that tutorial.

Signing off


Sunday, January 10, 2010

Installing Debian Lenny (D2)

Continued from where I left off. 

I realised on Day 1 that the optical drive on my system is a CD Writer, and not a DVD Drive. This is a problem as I had initially downloaded the DVD iso for Debian Lenny and burnt them into DVDs. After realising the error, I went to download the CD versions and although it was kind of expected (1 DVD = 6 CDs), I was shocked to find out that there are 31 CDs to download and burn. But I downloaded them anyway.

After burning the first disk, I proceeded to install Debian following the instructions in Day 1 until step 14. In step 15, I was supposed to use apt-cdrom to index all the packages that were in the CDs, which meant burning all 31 of them! I was tempted to go out and buy an internal DVD drive. But, being reluctant to part with $$$ to buy a drive just to install the OS with DVDs, I decided to try and mount an external usb DVD drive.

After a couple of hours of trying, I managed to mount them with some of the commands that I found on the net, and even got around to fooling apt-cdrom to read from the external DVD drive. When I tried to install a program using apt-get install, they insisted on reading from my cdrom drive. Eventually I worked around this by mounting my external DVD drive on to /media/cdrom, which is the directory actually used to mount media from the internal cdrom drive.

I followed the rest of the steps to install the rest of the packages to the end of the tutorial (Installing Debian).

Signing off