User creation bash script

May 2nd, 2013 2 comments

So a friend asked me to write a little script for him that looks up for a specific username on a system, and if it doesn’t exist, it will create it for him. pretty easy right ?

since adding a user with useradd with a password ( -p )  requires the password to be encrypted, I also included that option in the script.

 

Categories: Bash Scripting Tags:

yum checksum error -3

April 18th, 2013 1 comment

While trying to update my repository on a RHEL 5.5 system,  (note: I use a local repository on a RHEL6.0 distro), I faced this error:

[Errno -3] Error performing checksum
Trying other mirror.
Error: failure: repodata/primary.xml.gz from Updates: [Errno 256] No more mirrors to try.

This error relates to the SHA module support in 5.x version

this error is fixed once you re-create the repo with the -a sha1 command

$createrepo -a sha1 .

$yum clean all

$yum repolist

and the error was gone.

Categories: Miscellanous Tags:

RHCE: Sample Exam

April 9th, 2013 38 comments

First, I would like to thank all people who find my site valuable and sent me an email about their experience with it, that was very warming to see.

After receiving many emails asking for some more exam samples, I have created a new exam for RHCE.

The exam tends to cover all RHCE objectives in different ways and approaches, feel free to ask me regarding anything that is in there.

You may download the RHCE exam in pdf format from the following Link

 

Edit: I’m in the process of creating a video with solutions to the exam together with sound, this may take time, please be patient.

Edit 2: you can find the complete video ( 1:22 hours!) of each objective + some tips regarding the RHCE exam. in the Link below

I would like to get feed backs regarding this tutorial, if things were clear enough, I may include a similar video with the objectives I had not managed to cover in video 1.

Download (152MB RAR -> AVI)

 

Categories: RHCE Tags:

Central package repository with createrepo for RHEL

March 29th, 2013 No comments

Where I work, we have an isolated network with no internet access, and many (many) Linux servers, mostly Red Hat Enterprise, from versions 4.0 to 6.4.  and Fedora.

Wouldn’t it be awesome if you could use yum inside a network without internet access?

basically what I wanted to achieve is a central server that will serve the others with packages according to their architecture and version.

I came across the CreateRepo package that creates the metadata for your ISOs and that way the servers in your network can retrieve desired packages via httpd, with a small .repo file in their /etc/yum.repos.d.

all it takes is installing httpd, mounting ISOs to a directory (neat order preferred, each ISO gets a directory and “i386″ & “x86_64″ sub directories with rpms) and running the

createrepo .

inside that directory, and that way you get the metadata files that allows others to use the correct RPMs according to the yum command..

I have also spread a script across the linux systems that automatically detects the OS and architecture and that way creates the proper .repo file for the server with the correct path to the repository of the server.

to install createrepo simply rum

yum install createrepo

Categories: Miscellanous Tags: