Tuesday, March 13, 2012

Backup scirpt with tar command

Very basic backup script with tar command & date stamp.


[ramank@raman ~]$ cat back.sh
#back-up script with date wise
#!/bin/bash
RK=tempbackup$(date +%Y%m%d).tgz
tar -czf $RK /tmp

In above script,i define variable in 3rd line i,e RK & in 4 line create tar file of Temp dir.


For execute change the permission, like +x or 777.

After run the script, output like this.


tempbackup20120313.tgz

Monday, January 16, 2012

Broadcom + fedora 15

Download

broadcom-wl-4.150.10.5.tar.bz2

then extract

[root@localhost tmp]# tar xjf broadcom-wl-4.150.10.5.tar.bz2

change dir

broadcom-wl-4.150.10.5

Make sure b43-fwcutter tool installed.

after that just hit below command


[root@localhost driver]# b43-fwcutter -w /lib/firmware/ wl_apsta_mimo.o
This file is recognised as:
ID : FW13
filename : wl_apsta_mimo.o
version : 410.2160
MD5 : cb8d70972b885b1f8883b943c0261a3c
Extracting b43/pcm5.fw
Extracting b43/ucode15.fw
Extracting b43/ucode14.fw
Extracting b43/ucode13.fw
Extracting b43/ucode11.fw
Extracting b43/ucode9.fw
Extracting b43/ucode5.fw
Extracting b43/lp0bsinitvals15.fw
Extracting b43/lp0initvals15.fw
Extracting b43/lp0bsinitvals14.fw
Extracting b43/lp0initvals14.fw
Extracting b43/a0g1bsinitvals13.fw
Extracting b43/a0g1initvals13.fw
Extracting b43/b0g0bsinitvals13.fw
Extracting b43/b0g0initvals13.fw
Extracting b43/lp0bsinitvals13.fw
Extracting b43/lp0initvals13.fw
Extracting b43/n0absinitvals11.fw
Extracting b43/n0bsinitvals11.fw
Extracting b43/n0initvals11.fw
Extracting b43/a0g1bsinitvals9.fw
Extracting b43/a0g0bsinitvals9.fw
Extracting b43/a0g1initvals9.fw
Extracting b43/a0g0initvals9.fw
Extracting b43/b0g0bsinitvals9.fw
Extracting b43/b0g0initvals9.fw
Extracting b43/a0g1bsinitvals5.fw
Extracting b43/a0g0bsinitvals5.fw
Extracting b43/a0g1initvals5.fw
Extracting b43/a0g0initvals5.fw
Extracting b43/b0g0bsinitvals5.fw
Extracting b43/b0g0initvals5.fw


Wait for 1-2 min, your wifi connection UP.

enjoy

Thursday, December 15, 2011

NFS setup in Fedora16

To Setup nfs Network File System (NFS) follow the following steps.

Need to edit file like below

#vi /etc/exports

/home/ramank *(rw,sync)


Save the file.

Or you can perform above step by system-config-nfs (gui)

[root@raman ~]# yum install system-config-nfs.noarch

Running Transaction
Installing : system-config-nfs-1.3.51-2.fc15.noarch 1/1

Installed:
system-config-nfs.noarch 0:1.3.51-2.fc15



Now here is catch in fedora 16.

Service name changed in fedora 16.

1st enable the service and then start like below.


[root@raman systemd]# systemctl enable nfs-server.service
ln -s '/lib/systemd/system/nfs-server.service' '/etc/systemd/system/multi-user.target.wants/nfs-server.service'


[root@raman systemd]# systemctl start nfs-server.service



[root@raman ~]# showmount -e 10.131.11.199
Export list for 10.131.11.199:
/home/ramank *



enjoy with your NFS.


Raman

Friday, December 2, 2011

Install JBoss 6 Application server on RedHat 5

Download form here

http://www.jboss.org/jbossas/downloads/

jboss-as-distribution-6.1.0.Final.zip

[root@localhost Desktop]# cp jboss-as-distribution-6.1.0.Final.zip /usr/share/


[root@localhost Desktop]# cd /usr/share/

[root@localhost share]# unzip jboss-as-distribution-6.1.0.Final.zip

now here you can see dir with name jboss-6.1.0.Final

####Now create jboss user & group

[root@localhost share]# groupadd jboss


[root@localhost share]# useradd -s /bin/bash -g jboss jboss


###Give ownership to jboss user to manage

[root@localhost share]# chown -R jboss:jboss jboss-6.1.0.Final


Now set bash profile for jboss.

[root@localhost jboss-6.1.0.Final]# su - jboss

[jboss@localhost ~]$ ls

[jboss@localhost ~]$ vi .bash_profile

export PATH
JAVA_HOME=/usr/java/jdk1.7.0_01
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
JBOSS_HOME=/usr/share/jboss-6.1.0.Final
export JBOSS_HOME

save the file and execute

[jboss@localhost ~]$ . .bash_profile


To test bash profile setting, run following command.

[jboss@localhost ~]$ echo $JAVA_HOME
/usr/java/jdk1.7.0_01

[jboss@localhost ~]$ echo $JBOSS_HOME
/usr/share/jboss-6.1.0.Final


Service script for JBoss i.e Stop/start/restart.

[root@localhost bin]# pwd
/usr/share/jboss-6.1.0.Final/bin

[root@localhost bin]# cp jboss_init_redhat.sh /etc/init.d/jboss

Now edit this file.

18 JBOSS_HOME=${JBOSS_HOME:-"/usr/share/jboss-6.1.0.Final"}

23 #make sure java is in your path
24 JAVAPTH=${JAVAPTH:-"/usr/java/jdk1.7.0_01"}

29 #if JBOSS_HOST specified, use -b to bind jboss services to that address
30 JBOSS_HOST="0.0.0.0"
31 JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"}

Note :- HOST 0.0.0.0 mean allow JBoss to bind to any IP.


Now run JBoss service.

[root@localhost bin]# cd /etc/init.d/

[root@localhost init.d]# chmod 755 jboss


[root@localhost init.d]# /etc/init.d/jboss start
JBOSS_CMD_START = cd /usr/share/jboss-6.1.0.Final/bin; /usr/share/jboss-6.1.0.Final/bin/run.sh -c default -b 0.0.0.0


Make sure Jboss service start

try in browser.

http://systemip:8080

Default username-password admin/admin.

Update Java in RedHat 5.5 /RHEL

Step to update update in Rehdat 5.5 32 bit.

1) Check current Java verison.

[root@localhost ~]# java --version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-48)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


2) Default Java package in RedHat is

java-1.4.2-gcj-compat-1.4.2.0-40jpp.115



Download latest JDK.

http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html

Pkg name :- jdk-7u1-linux-i586.rpm


Install the pkg

#rpm -Uvh jdk-7u1-linux-i586.rpm


Then just create symbolic link which point to new java installation.


[root@localhost bin]# ln -s /usr/java/jdk1.7.0_01/bin/java /usr/bin/java

Now test your Java version.


[root@localhost bin]# java -version
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) Client VM (build 21.1-b02, mixed mode, sharing)


That all,now next post Installing JBoss.

Friday, November 18, 2011

Reconstruct initrd.img

[root@localhost video]# mkdir /cdiso

[root@localhost video]# cp -av /media/Fedora\ 15\ i386\ DVD* /cdiso/

[root@localhost cdiso]# mkdir /initimg

[root@localhost nouveau]# ls -lSh
total 224K
-rw-rw-r--. 1 root root 221K Nov 18 15:18 nouveau.ko.gz

[root@localhost nouveau]# gunzip nouveau.ko.gz
[root@localhost nouveau]# ls
nouveau.ko
[root@localhost nouveau]# ls -ltrh
total 564K



[root@localhost pxeboot]# ls
initrd.img initrd-PAE.img TRANS.TBL vmlinuz vmlinuz-PAE

[root@localhost pxeboot]# cp initrd.img /initimg/

[root@localhost initimg]# cp /cdiso/Fedora\ 15\ i386\ DVD/isolinux/initrd.img .

[root@localhost initimg]# ls -lSh
total 94M
-rw-r--r--. 1 root root 94M Nov 18 15:18 initrd.img
[root@localhost initimg]# xz -d -c initrd.img | cpio -i --make-directories
720557 blocks

[root@localhost initimg]# ls
bin etc init lib proc run selinux tmp var
dev firmware initrd.img modules root sbin sys usr


[root@localhost initimg]# find ./ | cpio --create --format='newc' > initrd.cpio
cpio: File ./initrd.cpio grew, 328701952 new bytes not copied
1363238 blocks

[root@localhost initimg]# ls
bin etc init lib proc run selinux tmp var
dev firmware initrd.cpio modules root sbin sys usr

[root@localhost initimg]# gzip initrd.cpio

[root@localhost initimg]# ls
bin etc init lib proc run selinux tmp var
dev firmware initrd.cpio.gz modules root sbin sys usr

[root@localhost initimg]# mv initrd.cpio.gz initrd.img

Thursday, November 17, 2011

Dell Latitude E6420 Ethernet working

I test this on Dell Latitude E6420 with Ubuntu9.04 (Desktop)

After Installation found Ethernet not working, even ifconfig shows only lo (loop back device).

So for that run following command.

#lspci -nn

Ethernet controller [0200]: Intel Corporation Device [8086:1502]

After google, found this page.

http://www.ubuntu.com/certification/catalog/component/pci:1502:8086-NETWORK

Then i download driver from Intel sites.

http://downloadcenter.intel.com/

Then search for 82579 under Linux section


Network Adapter Driver for PCI-​E Gigabit Network Connections under Linux*

The e1000e Linux* stable base driver for the Intel® PCI-Express* gigabit ethernet adapters/connections.

OS: Linux*

http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=15817&lang=eng&OSVersion=Linux*&DownloadType=%0ADrivers%0A


Download following driver.

e1000e-1.6.3.tar.gz


And install.

#tar -xvzf e1000e-1.6.3.tar.gz

#cd e1000e-1.6.3/src/

Under this dir use following command for Installation.

make install

take hardly 2 min for installation.

Reboot your machine... finally your Ethernet working.