Friday, March 22, 2013

“IOError: urlopen error unknown url type: media” + RHEL Linux

Hey Friends,

Today i faced a different and new problem i.e. while using yum.repo. media error started coming. so i did some googling on it. find some good answers and used them.

1. the first answer i got was to check your repo file.
2. to check the dvd.
3. yes i want to mention that, yum list all, yum update commands were running properly.
but when it came to yum install "rpm" then it started giving problem or media error.

“IOError:

4. the google search suggested to use createrepo command while sitting on the directory where your dvd is or if you have copied all dvd data on your system for repository. this repository can be used to sync using HTTP, NFS, etc.

5.In my case createrepo command itself was not there in the OS. that is createrepo was not installed.

6. the create repo rpm was there in dvd but i was not able to install it due to that error again and again.
7. so just downloaded the rpm from RHEL site named as createrepo.
8. ran rpm -ivh "createrepo......" It got installed.
9. now ran the command from

#pwd
/mnt/Server/
#createrepo /mnt/Server

it created one repo and removed the media error after yum clean all.

10. Now #yum install "package name " worked.


[root@redhat yum.repos.d]# yum install xorg-x11-proto-devel.i386 Loading "installonlyn" plugin Loading "rhnplugin" plugin This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Setting up repositories

Reading repository metadata in from local files Parsing package install arguments Resolving Dependencies

--> Populating transaction set with selected packages. Please wait.

---> Downloading header for xorg-x11-proto-devel to pack into transaction set.

media://1170972069.396645%232/xorg-x11-proto-devel-7.1-9.fc6.i386.rpm: [Errno 4] IOError: Trying other mirror.

Error: failed to retrieve xorg-x11-proto-devel-7.1-9.fc6.i386.rpm from Installer error was [Errno 4] IOError: [root@redhat yum.repos.d]# [root@redhat yum.repos.d]#

 

Script for finding and removing old data + UNIX

Hi Friends,

In day to day job of Unix Admin, we need to remove old data which is not required or not being accessed for more than ten days, twenty days or a month or some times a year.

this is applicable for any UNIX platform. we can use find command and very much use the manual of the same. It is very useful command, which can be used to find data located at any place in the desired directory or internal directories.

before using remove command, we can use list command to check whether the command is working properly or as desired or not.


#find /var/log/ -type f -atime +10 -exec ls -ltr {} \;

 
now if this command is useful and working fine for you then use rm i.e. remove command to remove the content.
 

find /var/log -type f -atime +10 -exec rm -rf {} \;

in my case data listed and then removed is set for 10 days i.e. the data which is not being accessed for more than ten days will be listed or removed respectively.
 
Thanks & Regards
Love Sharing
Amit Chopra

Tuesday, March 12, 2013

Guys ever tried Bungy Jumping?

Hey Friends,

Ever tried bungy jumping? Is yes then please share your comments on it and if not then please do it. You will feel it and it is a test for you and of your strengths.....



Love Sharing
Amit Chopra

Friday, March 1, 2013

how to send message to all users + HP UX

Hey Friends,

A good command to send message to all users, who are currently logged in on the server is "WALL". we can make use of this command prior to reboot, shutdown, any services which can affect users work. the usage of the same is as below :-

# wall
Admin uSer is working.
.
Broadcast Message from root (pts/0) Fri Mar  1 11:01:23...
Admin user is working.
.
#

root user is sending a message :-


# wall
Hi This is server Admin, we are putting a test message to all users.
.
Broadcast Message from root (pts/0) Fri Mar  1 11:06:47...
Hi This is server Admin, we are putting a test message to all users.
.
#
A user below logged in got a message using WALL command.
$
Broadcast Message from root (pts/0) Fri Mar  1 11:06:47...
Hi This is server Admin, we are putting a test message to all users.
.

$

Love Sharing
Amit Chopra

Basic commands of NPAR and VPAR + HP UX

Hi Friends,

Some of the basic commands of NPAR and VPAR.
 
1.       #vparenv
2.       #vparenv –m npars :- to boot into npar mode. it means on boot it will go to npar.
3.       #vparenv –m vpars :- to boot into vpar mode. It means on boot it will go to vpar.
4.       #vparstatus :- to check the status
5.       #parstatus –c 0 :- shows information about specified cell, here like it is for 0. 6.      #parstatus –v :- status in verbose mode i.e. more detailed status.
7.      #parstatus –w:  it will show where we are sitting i.e. on which NPAR we are sitting.
8.       #vparstatus –A: Will show the devices which are free, like IO devices and CPUs etc.
9. #vparcreate
10. #vparremove
11. #icapstatus :- shows information about vpar, about its CPU, Memory, and devices assigned. it also provides serial number, OS info, product number, etc informations of the VPAR server.
this was used in earlier versions.


Love Sharing
Amit Chopra