Tuesday, December 23, 2008

10 Things You Should Do Immediately After Installing Ubuntu 8.10

10 Things You Should Do Immediately After Installing Ubuntu 8.10




Ubuntu

The latest version of the popular Linux distribution Ubuntu, code named as Itrepid Ibex (Ubuntu 8.10), has been released to the public. You can download it here or even get a CD shipped to you absolutely free of cost.

In today’s Linux Gyan, we help you get-things-working once you have installed the Intrepid Ibex. Most people expect certain functions to work out-of-the-box in a modern operating system. Features like MP3 playback, DVD authoring and playback, DivX support, flash player etc to name a few. Unfortunately, due to certain ethical reasons, Ubuntu doesn’t provide such features out of the box.

Though the users are free to add these features themselves, it is always a pain in the neck to figure out all the various procedures involved and then apply it. This post will help you in getting all the required information on a single page (but you’ll still have to do the ‘applying them’ part yourself). Make sure that you book mark this page.
1. Add the Medibuntu Repository

Medibutu stands for Multimedia, Entertainment & Distractions In Ubuntu and is a repository of packages that cannot be included in Ubuntu due to legal reasons. We need to add this repository to enable MP3, DVD playback, install certain codecs etc.

Take a terminal and enter:
sudo wget http://www.medibuntu.org/sources.list.d/intrepid.list --output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update


Now we’ll enable all repositories (including Universe and Multiverse repositories) that Ubuntu provides. Take a terminal and enter:

sudo sed -i -e "s/# deb/deb/g" /etc/apt/sources.list && sudo apt-get update


2. Enable Playback of Encrypted DVDs in Ubuntu 8.10

Once the Medibuntu repository has been added as said above, take a terminal and enter:

sudo apt-get install libdvdcss2

3. Playing MP3, WMA, Real and Apple QuickTime Files in Ubuntu 8.10

Once the Medibuntu repository has been added as said above, take a terminal and enter:

For a 32 bit machine:

sudo apt-get install w32codecs

For a 64 bit machine:

sudo apt-get install w64codecs


For a PPC machine:

sudo apt-get install ppc-codecs

4. Install Skype in Ubuntu 8.10

Once the Medibuntu repository has been added as said above, take a terminal and enter:

sudo apt-get install skype

5. Install Adobe Acrobat Reader in Ubuntu 8.10

Once the Medibuntu repository has been added as said above, take a terminal and enter:

sudo apt-get install acroread


6. Install Google Earth in Ubuntu 8.10

Take a terminal and enter:
wget http://dl.google.com/earth/client/current/GoogleEarthLinux.bin && chmod +x GoogleEarthLinux.bin && ./GoogleEarthLinux.bin

7. Install VLC Player in Ubuntu 8.10

VLC is the media player that is said to play all media formats under the sky. Install it by running the following command from a terminal:

sudo apt-get install vlc


8. Installing OpenOffice 3.0 in Ubuntu 8.10

Take a terminal and run:

echo 'deb http://ppa.launchpad.net/openoffice-pkgs/ubuntu intrepid main' >> /etc/apt/sources.list.d/openoffice.sources.list && sudo apt-get update


9. Install Flash Plugin for Firefox in Ubuntu 8.10

The latest flash plugin (Flash player 10) can be installed using this command:

sudo apt-get install flashplugin-nonfree


10. Install Google Picasa in Ubuntu 8.10

F-Spot sucks if compared to Google Picasa. Run this command from a terminal to get Google Picasa:

sudo echo 'deb http://dl.google.com/linux/deb/ stable non-free' >> /etc/apt/sources.list && sudo apt-get update && sudo apt-get install picasa


What else do you do immediately do after installing a new distro? Share with us in the comments.

Monday, December 22, 2008

How do I start chrooted httpd with Centos OR Redhat

Red Hat / CentOS: Chroot Apache 2 Web Server

by Vivek Gite [Last updated: December 22, 2008]

A chroot on Red Hat / CentOS / Fedora Linux operating changes the apparent disk root directory for the Apache process and its children. Once this is done attacker or other php / perl / python scripts cannot access or name files outside that directory. This is called a "chroot jail" for Apache. You should never ever run a web server without jail. There should be privilege separation between web server and rest of the system. In this quick tutorial, you will learn about securing an Apache 2 web server under Red Hat Enterprise Linux / CentOS Linux using mod_chroot.

Requirements

  1. Server: Apache 2 Web server
  2. Jail directory: /httpdjail
  3. User / Group: apache / apache (never ever run chroot using root user)
  4. Virtual domain directory for all domain inside jail: /home/httpd
  5. Instructions are tested under CentOS / RHEL 5.x

More about Jail directory: /httpdjail

Create a jail directory as follows:
# J=/httpdjail
# mkdir $J

  1. Do not create /dev directory
  2. Do not create special device files inside jail.
  3. Do not copy shell or any other executable files inside jail.
  4. if possible mount $J using a separate partition with nosuid, nodev and noexec options. This will improve security as user will not able to run suid enabled programs and device files inside a jail.

Install Apache, PHP and MySQL

Install required packages, enter:
# yum install mysql mysql-server httpd php-mysql php-par php-xml php-mysql php-cli php-imap php-gd php-pdo php-dv php-mbstring php-common php-ldap php httpd-devel

Now, create required directory inside a jail:
# mkdir -p $J/var/run
# chown -R root.root $J/var/run
# mkdir -p $J/home/httpd
# mkdir -p $J/var/www/html

Install mod_chroot

mod_chroot makes running Apache in a secure chroot environment easy. You don't need to create a special directory hierarchy containing /dev, /lib, /etc. mod_chroot allows you to run Apache in a chroot jail with no additional files. The chroot() system call is performed at the end of startup procedure - when all libraries are loaded and log files open. Download mod_chroot using wget command:
# cd /opt/
# wget http://core.segfault.pl/~hobbit/mod_chroot/dist/mod_chroot-0.5.tar.gz

Untar it:
# tar -zxvf mod_chroot-0.5.tar.gz
Compile and install mod_chroot for using apxs, enter:
# cd mod_chroot-0.5
# apxs -cia mod_chroot.c

Configure Apache mod_chroot

Open /etc/httpd/conf/httpd.conf file, type:
# C=/etc/httpd/conf/httpd.conf
# vi $C

Set PidFile path in which the server should record its process identification number when it starts. Find line that reads as follows:

PidFile run/httpd.pid

Replace with:

PidFile /var/run/httpd.pidM

Next add ChrootDir directive, enter:

ChrootDir /httpdjail

Find line that read as follows:

ServerRoot "/etc/httpd"

Append following lines:

LockFile /var/run/httpd.lock
CoreDumpDirectory /var/run
ScoreBoardFile /var/run/httpd.scoreboard

Make sure mod_chroot.so line exists. For example, 64 bit Linux should have line as follows:

LoadModule chroot_module      /usr/lib64/httpd/modules/mod_chroot.so

32 bit Linux config line:

LoadModule chroot_module      /usr/lib/httpd/modules/mod_chroot.so

Save and close the file.

Disable SELinux for Apache

You need to disable SELinux for apache, enter:
# setsebool httpd_disable_trans 1
See article "disable SELinux for only Apache / httpd in Linux" for further details.

Patch up /etc/init.d/httpd.conf

Open /etc/init.d/httpd.conf file, enter:
# vi /etc/init.d/httpd.conf
Find out line that read as follows:

# Start httpd in the C locale by default.
HTTPD_LANG=${HTTPD_LANG-"C"}

Add following line (set ROOT to $J):

ROOT=/httpdjail

Find stop() that read as follows:

stop() {
echo -n $"Stopping $prog: "
killproc -d 10 $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}

Replace it as follows (you need to link /var/run/httpd.pid to $J/var/run/httpd.pid; so that stop operation works):

stop() {
/bin/ln -s $ROOT/var/run/httpd.pid /var/run/httpd.pid
echo -n $"Stopping $prog: "
killproc -d 10 $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}

Save and close the file. Set immutable permission on /etc/init.d/httpd so that file cannot be modified, updated by yum, deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute:
# chatter +i /etc/init.d/httpd.conf

How do I start chrooted httpd?

Type the following command:
# /etc/init.d/httpd start
You should not see any error in /var/log/httpd/error_log file:

[Sun Dec 21 18:43:09 2008] [notice] core dump file size limit raised to 18446744073709551615 bytes
[Sun Dec 21 18:43:09 2008] [notice] SELinux policy enabled; httpd running as context root:system_r:initrc_t
[Sun Dec 21 18:43:09 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Dec 21 18:43:09 2008] [notice] Digest: generating secret for digest authentication ...
[Sun Dec 21 18:43:09 2008] [notice] Digest: done
[Sun Dec 21 18:43:10 2008] [notice] mod_chroot: changed root to /httpdjail.
[Sun Dec 21 18:43:10 2008] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations

How do I stop chrooted httpd?

# /etc/init.d/httpd stop

How do I restart chrooted httpd?

# /etc/init.d/httpd restart

Thursday, December 18, 2008

How to configure Citycell Zoom USB Modem for Linux (EC325)

Today I have configured the CDMA USB modem (HUWAEI EC325) provided by citycell with their zoom connection to use in my linux distro (Mandriva Spring 2007) - Heres how to-

Attach the modem with your pc/laptop

1. check if the USB device is detected properly
cat /proc/bus/usb/devices

you will get some output like this

…..
…..
T: Bus=02 Lev=01 Prnt=01 Port=05 Cnt=02 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 1.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs= 1
P: Vendor=12d1 ProdID=1001 Rev= 0.00
S: Manufacturer=Huawei Technologies
S: Product=Huawei Mobile
S: SerialNumber=HUAWEI EC3X1
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=pl2303
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
E: Ad=8a(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=0b(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=pl2303
E: Ad=83(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=06(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
…..
…..

2. Now probe for this USB device
modprobe usbserial vendor=0×12d1 product=0×1001

3. Now check with dmesg if it has been successfully probed
dmesg

you will get some output like this

[ 2315.412106] usbcore: registered new interface driver usbserial
[ 2315.412508] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[ 2315.461938] usbcore: registered new interface driver usbserial_generic
[ 2315.461945] drivers/usb/serial/usb-serial.c: USB Serial Driver core
[ 2315.480382] drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
[ 2315.480414] pl2303 2-6:1.0: pl2303 converter detected
[ 2315.480608] usb 2-6: pl2303 converter now attached to ttyUSB0
[ 2315.480620] pl2303 2-6:1.1: pl2303 converter detected
[ 2315.480691] usb 2-6: pl2303 converter now attached to ttyUSB1

4. Now configure your wvdial.conf as shown here.
vi /etc/wvdial.conf

[Modem0]
Modem = /dev/ttyUSB0
Baud = 230400
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)
[Dialer cdma]
Username = waps
Password = waps
Phone = #777
Stupid Mode = 1
Inherits = Modem0

Now save this file

You are done!!

Now you can connect to internet by applying the following command in shell

wvdial cdma

Thats it!



Collect from http://hasin.wordpress.com/

Monday, December 15, 2008

How to Install Software using Gentoo Emerge

Installing software using Gentoo Emerge
http://learn.clemsonlinux.org/wiki/Gentoo:emerge

Installing Binary Files and Scripts (.BIN/.SH)

Binary files (.BIN) and shell scripts (.SH) are another popular format for distributing applications, particularly in the commercial, closed-source world. A good example of this are the Quake 3 and Doom 3 games from id Software. Basically all these files are is a list of commands that are run inside a terminal to copy, move, and create files in your file system. You can run these files like so:

For BIN files:
1. Make sure the file is set to "executable" by running this command:
Code:
chmod +x NameOfYourFile.bin
2. Run the file like this:
Code:
./NameOfYourFile.bin
NOTE: If the installer requires access to directories outside of your /home/ directory, you may need to log in as root before you can execute these commands successfully. That can be accomplished with the su command, followed by your root (Administrator) password. Ubuntu users will use sudo and their regular user password instead.

For .SH files:
1. Make sure the file is executable by following Step 1 above.
2. Run the file either with the same command as the previous Step 2, or like this:
Code:
sh NameOfYourFile.sh
_________
Further reading

Copyright, Re-Printing, and comments

This document is copyright Jason Lambert, 2004.

The mandrake section is contributed by jeremy1701 and is copyright jeremy1701 2004.

The Debian apt-get section was originally written by Jason Lambert and revised by antidrugue in 2006.

The .BIN/.SH section was contributed by techieMoe.

You may not re-produce or reprint this document in part or in full without my prior written permission..

If you would like to request permission to re-print any part of this document, please send me a private message on the forums.

The mandrake section may not be reprinted without written permission of jeremy1701

All trademarks remain the property of their owners etc.

If you have a comment about this howto, please Email Me. Please do NOT email me or send me a private message asking for technical assistance. If you need help please post on the forums!


-- EOF --

Note: This message was broken into smaller, more manageable chunks and reposted by techieMoe.

Installing slackware packages

Installing slackware packages
Slackware packages are usually .tgz files containing pre-built binaries. To install software in slackware you will need to find and download the .tgz package manually beforehand. If you are looking for a slackware package for a piece of software and have not found it yet, search Linux Packages for it.

Ok, once we have our package, lets install it. To install slackware packages, ensure you are the root user using the command:
Code:
su
Now run the following command to install the package:
Code:
installpkg 
Uninstalling a package is also quite simple:
Code:
removepkg 
Also worth noting about slackware packages, is a utility called pkgtool which will allow you to install, remove and list packages on your system. To use pkgtool, run:
Code:
pkgtool
and follow onscreen prompts.

Anyone who likes the debian apt-get system but is currently using Slackware may be interested to hear about a utility called slapt-get, the Slackware answer to apt-get. Slapt-get is avaible from Here. There is also a nifty Gnome/GTK front end for slapt-get in development, you can preview it at the same url.

Lastly, if you are having trouble locating a slackware package, but have been able to find a equivilent RPM, you can "convert" that RPM to a slackware package which you can use with the installpkg and removepkg commands. To convert your RPM to .tgz, use the command:
Code:
rpm2tgz .rpm
__________________
Registered Linux user #270181