Tuesday, August 31, 2010

YUM : Proxy authentication cofiguration

You are connected through proxy server which asks for authentication (i.e. username & password). In this case you have to make some configuration to work with YUM. So simply follow these instructions:
open your terminal as root and type:

#gedit .bashrc hit Enter

you can use vim, emac instead of gedit.
Type the following at the end of file:

export http_proxy="http://username:pw@proxyserver:port" 
hit Enter, then save file. close gedit and restart your computer

username & pw is your proxy username & password respectively. proxyserver:port is address of your proxy server with port e.g. export http_proxy="http://mac:jack@10.1.1.18:80"

Increase SWAP memory whenever You need it...

You want to increase your allocated swap memory and you don't want to do it permanently by Re-Partition or Re-Installation. Don't Worry!!! Your solution is here:


Insure that you have sufficient free disk space. Now suppose you need to increase SWAP by, say, 500Mb. Open ur terminal switch to admin. (use su followed by admin password) and use the following commands


# dd if=/dev/zero if=/home/tempswap bs=1k count=500000
# cd /home
# chmod 600 tmpswap
# mkswap tempswap
# swapon tempswap



Approximately 500 mb of swap will be added. For checking use free as:
# free -m
To release swap goto your tmpswap folder(it will be in
/home) #cd /home
#swapoff tmpswap
now delete tempswap
#rm -f tmpswap
recheck your swap now
#free-m

Monday, August 30, 2010

Set up the VNC Server in Fedora Core Part:1


Prerequisites

A user account should exist on the remote machine.
The RPM packages vnc-server and vnc should be installed on the remote machine and your workstation respectively.
Setting up the server

I assume that we have setup a remote user account, named "leopard" and we want to start an X session through VNC for this user.

In Fedora Core or Red Hat based distros in general, all we have to do is define the VNC server instances in /etc/sysconfig/vncservers. These will be started by the vncserver initscript. This has to be done as root. Edit this file so that it contains the following:
VNCSERVERS="3:leopard" 
VNCSERVERARGS[3]="-geometry 1024x768 -depth 16"
With these we define that a vnc server instance should be started as user leopard on display 3 and we also set some options for this server such as resolution and color depth. Each VNC server instancelistens on port 5900 plus the display number on which the server runs. In our case, leopard’s vnc server would listen on port 5903.

For multiple vnc instances /etc/sysconfig/vncservers would look like this:
VNCSERVERS="1:tiger 2:albatros 3:leopard" 
VNCSERVERARGS[1]="-geometry 1024x768 -depth 16" 
VNCSERVERARGS[2]="-geometry 800x600 -depth 8" 
VNCSERVERARGS[3]="-geometry 1024x768 -depth 16"
These would listen on ports 5901, 5902, 5903 respectively.

Set up the VNC Server in Fedora Core Part:2

User Configuration
There is one more thing that needs to be done on the remote machine. User leopard’s vnc password needs to be set. So, as user leopard give the command
:
# vncpasswd
We are prompted for a password. This is the password that we will use when we connect to leopard’s vnc server instance. This password is in /home/leopard/.vnc/passwd.

Start the VNC server
After the initial configuration is done we restart the vnc service. As root:# service vncserver restart
To make VNC server to start on boot:
# chkconfig vncserver on

More User Configuration
After the VNC service is started, some new files are created in /home/leopard/.vnc/ directory. These include leopard’s vnc server log file, pid file and an X startup script. As user leopard we edit the script in order to customize some settings. The default /home/leopard/.vnc/xstartup script contains some commands that are executed when the VNC server is started. These include:
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

xsetroot in this case sets the background color.

vncconfig is a supplementary program that can be used to control the vnc server. Apart from this, when run without arguments it acts as a helper application and its main purpose is to provide support for clipboard transfers between the client (vncviewer) and the vnc server. xterm starts an xterm terminal. twm starts the X server’s default window manager. We probably want to change that to a more user friendly window manager, eg fluxbox.

Set up the VNC Server in Fedora Core Part:3

The VNC server, apart from letting us control a remote machine using a graphical interface, it serves as a way to start graphical applications on boot. For example, I want my favourite p2p program, amule, to start on boot. So, I add this to the /home/leopard/.vnc/xstartup script. This is how my xstartup file looks like:
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" -e ./menu &
amule &
fluxbox & 
menu is a script of mine that is executed when xterm is started.
Remember to put the "
&" symbol after each command, so that it goes to the background and the xstartup script continues on.
Restart the VNC service for the changes to take effect. As root:
# service vncserver restart

Connect to the VNC server

In our example, leopard’s vnc server listens for connections on port 5903. So, open this port in the remote machine’s firewall.
We connect to the remote machine using a vnc viewer. Having installed the vnc package, connect to to the server with the following command:
# vncviewer 192.168.0.1:5903:3
The general usage is :
vncviewer [Server's IP]:[Port]:[Display]
We are prompted for the password and eventually connect to the server. Closing the vncviewer’s window, does not affect the server or the programs we run on it. If we reconnect everything will be there.

Change default boot option in multy-OS systems

Assuming that you have Grub boot loader (common in most of the Linux Distros.)
To change ur default boot option, do as follows:
Open terminal, then type the following codes(don't type $ or #, it will appear by itself)
$ su
enter ur admin password..
# cd /boot/grub 
(you will enter in to grub directory, there is a file named grub.conf. You have to edit it in some editor like Vim or Gedit, im going to use gedit. so type the following).
# gedit grub.conf 
gedit window will show u details something like below.

default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core details......
........................
..........................
title Windows details......
........................
..........................
You can see the first line having default as 0 means the first OS (see title) is default. If default is 1, second title. If default is 2 third tiltle would be the default OS to get booted.
So just choose default as 1 in ur windows is in second position.
save the current changes and reboot.

Saturday, August 28, 2010

Share your files on LAN with Samba Server

Hello friends!
Here we are going to see how we share files on LAN with Samba.
1. Goto System > Administration > Server Settings > Samba
2. Enter your root password in a popped 'Query' window( to gain root privilege)
3. Preferences > Server settings > Basic
you have two things now. Work group & Description
fill Workgroup with your workgroup name and brief description about it in Description.
4.now goto Security fill Authentication Mode - 'Share'
Encrypted password - NO.
Gest Account - select a valid account. > OK
5. Now Add Share files.
but firewall will ask for a password now
ok to handel this go to System > Administration > Security Level and Firewall > Firewall Options
male sure that box is clicked active for Samba .
6. Now SElinux > Modify SElinux Policy > Samba
click the box for Allow samba to share users home directories.
> OK
well it was the simplest configuration.

Friday, August 27, 2010

NTFS File Access Inside FEDORA CORE

Well this is a basic topic on allowing NTFS file access inside Fedora Core. NTFS is a file system used on Windows 2000, and Windows XP mainly. If you wish to access the data on these drives whilst inside Linux, firstly you need to install a module that is the ntfs.ko. This allows the kernel to read the NTFS partitions. Then u will need to locate and download the right RPM (FC users) for your system from http://www.linux-ntfs.org/content/view/187/. Look through the list, and search for your kernel version. To know your kernel version type: uname -r
Newer NTFS RPMs have names like
kernel-module-ntfs-2.6.8-1.541-2.1.17-0.fc.1.2.i586.rpm
When downloading the RPM save it to disk, and do not run using the install package manager. Go to where you saved the RPM, and at the command line (in the directory where the RPM is stored) .To install the RPM: rpm -ihv *.rpm
You should see:
Preparing...      ############################### [100%]
1:kernel-ntfs  ############################### [100%]

/sbin/modprobe ntfs

There should be no output. If there is a lot of error messages see the Help Section on http://www.linux-ntfs.org/content/view/124/60/

Do the following for configuration:

1. Login as root by running from a terminal su followed by typing the root password.

2. Create a directory in your /mnt folder. This can be done by running mkdir /mnt/X where X is the name of the directory where the NTFS partition will be mounted.

3. /sbin/fdisk -l This will output your HPFS/NTFS partition identifier. Lets say the device file name is found to be /dev/Y.

4. gedit /etc/fstab . Gedit will open

5. On a new line at the bottom of the file, add the line

/dev/Y /mnt/X ntfs ro,defaults,umask=0222  0 0

where X is the name of the directory you created in step 2.

6. Save and quit the file /etc/fstab

7. Then run mount -a (or some say mount -t ntfs /dev/hdb1 /mnt) and the NTFS partition will be mounted. It will also be mounted automatically after reboot so that you do not have to do anything after you reboot.