Showing posts with label Linux/Unix. Show all posts
Showing posts with label Linux/Unix. Show all posts

Friday, July 9, 2010

Yum Error in Fedora ("Cannot retrieve repository metadata (repomd.xml)")

Today I installed Fedora 13. But when i tried to use "yum" to update my system, It showed error "Error: Cannot retrieve repository metadata (repomd.xml)".After some research i found the solution. It worked hope it will be usefull for you also.

1. Open terminal, Login with root credentials.

2. Open fedora.repo and fedora-updates.repo file to edit.



#gedit  /etc/yum.repos.d/fedora-updates.repo               


3. Serach for 'baseurl' and uncomment all lines starting with 'baseurl' by  removing '#'.


baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/$basearch/

4. Search for mirrorlist and comment all lines starting with mirrorlist.

#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f$releasever&arch=$basearch


5. Save and close.



#gedit  /etc/yum.repos.d/fedora.repo                                       

6. Repeat step 3, 4 and 5. And you are done.

Read more…

Monday, May 3, 2010

Configure MTS Mobile Bradband on Fedora (Linux/Unix)

Recently I got a chance to use MTS wireless broadband. But like most of service providers MTS also doesn't provide support (at least to me) to use modem on linux. MTS Modem comes with dialler software for windows.But what if you want to install and use it on linux ??

I could install MTS USB Modem (Smart ZTE AC2726 (EVDO)) on Fedora 12. It should work on other distro also.

When you plug Modem linux detect it as usb CD-Drive, that's why linux network manger or wvdial doesn't finds modem and return error. To resolve you have to switch mod of usb modem.


1 - Install usb_modeswitch:

Run this command with root privilege.

#yum install usb_modeswitch                                                                                     


2- Find DefaultVendor and DefaultProduc:
To check Vendor and Product run -
#lsusb                                                                                                                         

3 -Configure switch mode:


Open /etc/usb_modeswitch.conf in your favourite editor.

Copy paste these lines...
#----------------------------------------------------------------------------------------------------------------------------------
# Smart ZTE AC2726 (EVDO)
#
DefaultVendor= 0x19d2
DefaultProduct= 0xfff5
TargetVendor= 0x19d2
TargetProduct= 0xfff1
MessageContent="5553424312345678c00000008000069f030000000000000000000000000000"
#--------------------------------------------------------------------------------------------------------------------------------
Cross check the DefaultVendor & DefaultProduct. It may be different according to your device manufacturers .

Now your usb_switchmod is ready to work. Run this command -


#usb_modeswitch -W                                                                                                 

To confirm you may run "lsusb" command again that if mode of your modem has been changed or not.  If it has been changed then you are ready to install Modem and if not, then there must be some problem. You should try again from step 1.


4 - Install Modem:

Run wvdialconf command to install modem.

#wvdialconf                                                                                                                

5 - Configure Modem
Edit "/etc/wvdialconf"
#gedit /etc/wvdialconf                                                                                                

Configuration (wvdialconf) files should look like -

#-----------------------------------------------------------------------------------------------------------------
[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Phone = #777
ISDN = 0
Username = internet@internet.mtsindia.in
Init1 = ATZ
Password = MTS
Modem = /dev/ttyUSB0
Baud = 9600
Stupid Mode = yes
#-------------------------------------------------------------------------------------------------------------------

Save and exit.


5 - To autodetect DNS every time you connect to modem run this command-

#echo "PREDNS=yes                                                                                                 
  DEFROUTE=yes">/etc/sysconfig/network-scripts/ifcfg-                                           

Its done. You are ready to use MTS Modem.

6 - To connect to your modem open terminal and run with root privilege

#wvdial                                                                                                                       

To disconnect use "ctrl +c ".

Note - To run TATA Photan+ follow from step 4.

Read more…

Saturday, February 13, 2010

Disable GDM "face browser" user list in Fedora 12

GDM (Genome Display Manager) supports a face browser which displays a list of users who can login and an icon for each user. But for security reason i didn't want to display list of all system users. So I decided to disable GDM "face browser" user list. I found the solution to disable face browser by "gonf-editor",
Applications > System Tools > Configuration Editor > Apps > gdm > simple-greeter
Check  "disable_user_list" in right pane.
but it didn't work for me. This is a reported bug (https://bugzilla.redhat.com/show_bug.cgi?id=445449). So I decided to use "lxdm", a nice Display Manager from lxde which by default disable list of users.
lxdm screenshot
                                                lxdm screenshot
Install lxdm
Login with "root" and run the following command.
#yum install lxdm                                                                   
Start lxdm by default
#echo "DISPLAYMANAGER=LXDE" >/etc/sysconfig/desktop          
edit "/etc/X11/prefdm". Notice bold text in script. New prefdm will look like :-
----------------------------------------------------------------------------------------
#!/bin/sh

PATH=/sbin:/usr/sbin:/bin:/usr/bin

# We need to source this so that the login screens get translated
[ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n

# Run preferred X display manager
quit_arg=
preferred=
if [ -f /etc/sysconfig/desktop ]; then
    . /etc/sysconfig/desktop
    if [ "$DISPLAYMANAGER" = GNOME ]; then
        preferred=/usr/sbin/gdm
        quit_arg="--retain-splash"
    elif [ "$DISPLAYMANAGER" = KDE ]; then
        preferred=/usr/bin/kdm
    elif [ "$DISPLAYMANAGER" = WDM ]; then
        preferred=/usr/bin/wdm
    elif [ "$DISPLAYMANAGER" = LXDE ]; then
          preferred=/usr/bin/lxdm

        elif [ -n "$DISPLAYMANAGER" ]; then
        preferred=$DISPLAYMANAGER
    else
        quit_arg="--retain-splash"
    fi
else
    quit_arg="--retain-splash"
fi

# shut down boot splash
/usr/bin/plymouth quit $quit_arg

shopt -s execfail

[ -n "$preferred" ] && exec $preferred "$@" >/dev/null 2>&1

# Fallbacks, in order
exec gdm "$@" >/dev/null 2>&1
exec kdm "$@" >/dev/null 2>&1

for pkg in $(rpm -q --qf "%{NAME}\n" --whatprovides "service(graphical-login)"| LC_ALL=C sort -u) ; do
    dm=$(rpm -q --provides $pkg | awk '/^service\(graphical-login\)/ { print $3 ; exit }')
    if [ -n "$dm" ]; then
        exec $dm "$@" >/dev/null 2>&1
    else
        exec $pkg "$@" >/dev/null 2>&1
    fi
done

# catch all exit error
exit 1

-----------------------------------------------------------------------------------------
That's all. You have replaced GDM with new "LXDM". Reboot system to see you new login window.

Read more…

Sunday, December 27, 2009

Shell script to post twit.

For posting a simple twit, I had to go on twitter every time, But for lazy person like me, Its too tough. I was looking for a simple tool to post twit. I found a very interesting and simple shell script to post twit from Linux command line.

*Install "curl" if you don't have already.
       #yum install curl
*Copy the colored code and save as twit.sh
*Replace USER with your Twitter A/c's user name and PASSWORD with password.
*make twit.sh executable.
       #chmod +x twit.sh

Your script is ready to post messages.Go to terminal. Use the following command.
$sh twit.sh "Your Message here."


------------------------script start  here--------------------------------------

#!/bin/bash
curl -u USER:PASS -d status="$*" http://twitter.com/statuses/update.xml > /dev/null
echo "Message posted successfully."
----------------------------------------------------------------------------------------- 
Note- This tutorial is for Redhat and Fedora Linux, although you can use this script on any distro if you have "curl" installed on your machine. To install curl on your distro look their installation manual.

Read more…

Thursday, December 24, 2009

How fast is your Thumb Drive ?

There are lot of tools available to check data transfer rate in Windows. But on Linux  you can check data transfer rate by just using one command.


Open Terminal.
Application >System Tools > Terminal.
Login with super user credential.
$su
password : (root password)



#hdparm -t /dev/sdb (in my case sdb is pendrive)

/dev/sdb:
Timing buffered disk reads:   60 MB in  3.00 seconds =  19.98 MB/sec





For detail usage of hdparm command go to terminal and type

#man hdparm
or
#hdparm --help

Note - Some command can be dengerous, Please use them carefully.

Read more…