Showing posts with label Fedora. Show all posts
Showing posts with label Fedora. Show all posts

Tuesday, April 7, 2009

How to resolve Locked YUM

Mistakenly many times YUM is locked. When this happens for such problem like
Existing lock /var/run/yum.pid: another copy is running as pid 18092.

Here's the way to resolve.
Locate the yum.pid file, usually in fedora, it is located in /var/run dir
cd /var/run
ls
vim yum.pid

press insert
delete pid number and save pressing esc + : +
x then press enter

now run your yum command

Monday, March 30, 2009

Blackberry as a modem with Grameenphone Mobile

To Connect Blackberry USB Modem in your linux machine is now pretty simple with the third party software distribution Barry. Mine is Fedora Core 10 (FC10) but it would work for any Debian System as well. Here's the steps how I did this.

This tutorial is for Grameen Phone Providers, Bangladesh. Other services like rogers, O2 have been automatically configured once you install the software Barry.

Step 1: Initiating Directories as a Preparation
cd /usr/local/src
mkdir blackberry
cd /blackberry
Step 2: Download Barry Distribution by git
If your system is a workstion or desktop configured, then get the following packages
git clone git://repo.or.cz/barry.git barry
git clone git://repo.or.cz/barry.git libbarry0
(above line is required in most configurations)

If your system is a development configured then get this as well along with previous twos.
git clone git://repo.or.cz/barry.git libbarry-devel
Step 3: Configuring and Installing barry/libbarry0
Go inside directory:
cd /barry
Build the source:
./buildgen.sh
Configure:
./configure
Make the install file:
make
Install the make file:
make install

Step 4: Configuring peers script
Go to ppp dir: cd /etc/ppp/peers
Create a file: touch gp
Edit the file: vim gp

Insert following lines and then save:
##################################
debug debug debug
nodetach

pty "/usr/sbin/pppob"
connect "/usr/sbin/chat -f /etc/chatscripts/gp.chat"
user "gp"
password "gp"

defaultroute
usepeerdns
noipdefault
nodetach
novj
nocrtscts
nomultilink
ipcp-restart 7
ipcp-accept-local
ipcp-accept-remote
lcp-echo-interval 0
lcp-echo-failure 999
mtu 1492

##################################

Notes:
"pty" command is used to connect pppob tool by barry to connect your Blackberry Modem. Here it will be directed to the location where it has been installed
"Connect" command has been used to run a chatscript, which will be written after a while here. The chatscript file will require to pass parameters to Grameen Phone's PPP server.

Step 5: Configuring chatscripts
Go to the location:
vim /etc/chatscripts/

Create a chatscript File:
touch gp.chat [naming gp.chat is important according to the tutorial]

Insert lines below and then save:
###############
ABORT ERROR
'' AT&F
OK ATZ
OK ATI
OK AT+CGDCONT=1,"IP","gpinternet"
OK ATDT*99***1#
CONNECT
################


Step 6: Before you run the ppp scripts:
This step is to ensure whether these scripts can run smoothly. Here's a TO DO list before run.
TO DO 1: Inactive your current internet
TO DO 2: If you are in a LAN, then disable your LAN Card before you want to run the scripts.

Step 7: Running Scripts
Type this in your Shell Prompt:
pppd call gp
After Running this, you would see something like following:
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/pts/4
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x19 ]
sent [LCP ConfAck id=0x19 ]
rcvd [LCP ConfRej id=0x1 ]
sent [LCP ConfReq id=0x2 ]
rcvd [LCP ConfAck id=0x2 ]
rcvd [CHAP Challenge id=0x7 <00>, name = ""]
sent [CHAP Response id=0x7 <6cca03043ecea893752b4767db33835f>, name = "gp"]
rcvd [CHAP Success id=0x7 ""]
CHAP authentication succeeded
CHAP authentication succeeded
sent [CCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
rcvd [LCP ProtRej id=0x1a 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP ConfReq id=0x1b ]
sent [IPCP ConfAck id=0x1b ]
rcvd [IPCP ConfNak id=0x1 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [IPCP ConfAck id=0x2 ]
local IP address 10.65.24.13
remote IP address 169.254.1.1
primary DNS address 202.56.4.120
secondary DNS address 202.56.4.121
Script /etc/ppp/ip-up started (pid 3700)
Script /etc/ppp/ip-up finished (pid 3700), status = 0x0

TO DO: let this shell window alone and be run

Note: See the lines above in bold. Primary DNS and Secondary DNS, keep these two IPs it will require in next to complete the process.

Final Step: Configuring resolve.conf
Edit the file:
vim /etc/resove.conf
Now, comment any lines by using ';' (semicolon)
Set nameservers:
nameserver 202.56.4.120
nameserver 202.56.4.121

Now save and quit

That's All...
Enjoy..

Wednesday, March 11, 2009

Fedora Core 10: Disable SELinux

Hi folks.
Not really know why SELinux does not allow to me run some of my applications. Then, I had asked one of my seniors about this problem, he suggested to disable the SELinux running in my Linux Fedora core 10. Then I have disabled the SELinux, which I have shown below.

Firstly: Edit this file ( /etc/selinux/config )
vim /etc/selinux/config
or any of your text editors like vi or nano whatever
vi /etc/selinux/config

Secondly: Now you will see a line like this: "SELINUX=enforcing".
There are three options in that file, options are enforcing, premissive, disabled
Now, set the option as: SELINUX=disabled

Finally: Reboot or re-login the system.

you can do this from /boot/grub/grub.conf in fedora core 7, but this can not be done in fc 10 (fedora 10)

Enjoy

Thursday, March 5, 2009

Fedora 10: yum update rpm db fail and meta data did not match error fixed

hey folks
I was trying to update my yum using: yum update but was getting an error saying that rpm db is failed, but I have fixed up that thing in the following steps.

Step 1: clean the yum
yum clean all

Step 2: removing all rpm db from /var/lib/rpm
rm -fr /var/lib/rpm/__db*

Step 3: Now update the yum
yum update


Now enjoy

Monday, March 2, 2009

Fedora 10: Mount Logical Drives editing fstab

There are two ways to mount Logical Drives in linux, editing /etc/fstab
Using Device's file system path

Using Device's UUID


For example we will mount a unmounted LVM device which has no label yet. Let's assume that our device's system path is /dev/sda5


Structure of /etc/fstab file:
# [file system] [mount point] [type] [options] [dump] [pass]

Using Device's file system path

This is the most commonly used way to permanently mount a device.

Step 1: Open the fstab file, I have used vim. you can use yours.
vim /etc/fstab
Step 2: Put the following line there.
/dev/sda5/ /billah ext3 default 0 1
Where,
file system = /dev/sda5/
mount point = /billah
type = ext3
options = default
dump = 0
pass = 1

Now save and restart your PC

Using Device's UUID:
When you are using more than one hard drive in your PC, then most often device's file system path in fstab wont work. Then UUID, that means Universal Uniqe Identifier.

Step 1: Determinig UUID
ls -l /dev/disk/by-uuid/
which will result like following
lrwxrwxrwx 1 root root 10 2009-03-02 20:25 0499e06a-05cb-4272-ac37-7308eb7d7326 -> ../../sda5
Here the UUID of sda5 is
0499e06a-05cb-4272-ac37-7308eb7d7326
Step 2: Edit the /etc/fstab
0499e06a-05cb-4272-ac37-7308eb7d7326 /billah ext3 default 0 1
Now, restart your PC, thats all.