Let's Share Knowledge And Make A Difference

  • Monitor your network and systems like a hawk

    There are some perfact open souce solution for monitoing your Network devices and server system's health. Nagios, Cacti, WhatsUpGold and Smokeping are the leading monitoring tools among them...

    Read More
  • Email service and Security

    Now a days life without email service is unthinkable and E-mail service is quite expensive. As always linux gives us the answer with a strong mail service named postfix...

    Read More
  • Data Center Solution

    A data centre is a facility where companies can keep and operate most of the ICT infrastructure that supports their business. IT host the most critical systems that are vital to the continuity of daily operations...

    Read More

Friday, June 13, 2014

Burning CD/DVD using CLI in linux (redhat/debian/ubuntu)

Burning CD/DVD using CLI:
1. find cdrom/dvdrom
2. make an iso
    i. create an iso
    ii. create an iso from collecting data from diffrent location
    iii. add new data to an existence iso
3. burn the disk (cd/dvd)
    i. single session burning
    ii. Multi-session burning
    iii. Blank a disk for re-writing cd/dvd (re-writable disk)


1. First findout the cd drive. Here my cd/dvd rom is dev=1,0,0
root@mahidul:~# cdrecord --devices
wodim: Overview of accessible drives (1 found) :
-------------------------------------------------------------------------
 0  dev='/dev/sg1'    rwrw-- : 'hp' 'DVDRAM GT80N'
-------------------------------------------------------------------------

"OR"
root@mahidul:~# cdrecord -scanbus
scsibus0:
    0,0,0      0) 'ATA     ' 'Hitachi HTS54757' 'JE4O' Disk
    0,1,0      1) *
    0,2,0      2) *
    0,3,0      3) *
    0,4,0      4) *
    0,5,0      5) *
    0,6,0      6) *
    0,7,0      7) *

scsibus1:
    1,0,0    100) 'hp      ' 'DVDRAM GT80N    ' 'R102' Removable CD-ROM
    1,1,0    101) *
    1,2,0    102) *
    1,3,0    103) *
    1,4,0    104) *
    1,5,0    105) *
    1,6,0    106) *
    1,7,0    107) *


2. Then make an iso of the folder that you want to write.
root@mahidul:~# mkisofs -J -r -o /storage/cdwrite.iso /storage/cdwrite/

If -joliet-long error shows then use below command.
root@mahidul:~# mkisofs -joliet-long -r -o /storage/cdwrite.iso /storage/cdwrite/

You can make an iso from diffrent locations.
root@mahidul:~# mkisofs -J -r -o  /root/testburn.iso -graft-points /folder1=/var/log/test.log /folder2=/home/mahidul/DSC_9881_20131111_140755.jpg

You can add folders/files later like the below step.

3. Now, Burn the cd with cdrecord command.
root@mahidul:~# cdrecord -v -dev='/dev/sg1' /storage/cdwrite.iso

"OR"
root@mahidul:~# cdrecord -v -dao dev=1,0,0 /storage/cdwrite.iso

"OR" Using wodim (Write Optical DIsc Media):
root@mahidul:~# wodim -eject -tao speed=1 dev=/dev/sg1 -v -data /storage/cdwrite.iso

Write multiple times to a re-writable disk:
root@mahidul:~# cdrecord -v -multi -eject -tao speed=1 -dev='/dev/sg1' /storage/cdwrite.iso

Note:
1. The programs wodim, cdrskin, and xorrecord may be used on all kinds of media with the options shown with "cdrecord".
2. The meaning of the options is:
    -V: Gives the filesystem a name which will probably show up as mount point if the medium is mounted automatically. The ISO specs allow             only "A" to "Z", "0" to "9", and "_". 32 characters at most.
    -J: Prepares names of up to 64 UTF-16 characters for MS-Windows readers. Aka "Joliet".
    -joliet-long: Would allow 103 UTF-16 characters for MS-Windows readers. Not conformant to Joliet specs.
    -r: Prepares names of up to 255 characters for Unix readers and gives read permission for everybody. Aka "Rock Ridge".
    -o: Sets the file path for the resulting ISO image.

Monday, June 2, 2014

Install and Configure Hudson in redhat 6.x

Install and Configure Hudson in redhat 6.x

Packages Requirements:
. Java
. Apache
. Apache-tomcat

Installing java:
Download the leatest java from http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-7u10-oth-JPR
[root@hudson~]# mkdir -p /usr/jdk
[root@hudson~]# tar -zxvf /Packages/jdk-7u10-linux-x64.tar.gz -C /usr/jdk/
[root@hudson~]# ls /usr/jdk/jdk1.7.0_10/

Installing Apache2:
[root@hudson~]# yum install httpd -y
[root@hudson~]# service httpd restart
[root@hudson~]# chkconfig httpd on

Installing apache-tomcat:
[root@hudson~]# wget http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.tar.gz
[root@hudson~]# tar -zxvf /Packages/apache-tomcat-6.0.36.tar.gz -C /usr/share/
[root@hudson~]# vim /usr/share/apache-tomcat-6.0.36/bin/catalina.sh
    #Add the following lines
    JAVA_HOME=/usr/jdk/jdk1.7.0_10/ 
    JAVA_OPTS="-Xms1024m -Xmx4096m -XX:PermSize=256m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"

### Set Java Heap size: (memory allocation for java)
[root@hudson ~]# vim /usr/share/apache-tomcat-6.0.36/bin/setenv.sh
CATALINA_OPTS="-Djava.awt.headless=true -Xms1024m -Xmx10240m -XX:PermSize=1024m -XX:MaxPermSize=2048m"

[root@hudson~]# sh /usr/share/apache-tomcat-6.0.36/bin/startup.sh

[root@hudson~]# yum install -y nmap
[root@hudson~]# nmap localhost
    8080/tcp open  http-proxy

Sometimes apache-tomcat get stuck then pls kill the apache-tomcat process and restart from the below script.

[root@hudson~]# vim /usr/share/apache-tomcat-6.0.36/conf/tomcat-users.xml
# Append the beloow lines under the tomcat-users tag
  <role rolename="manager-gui"/>
  <user username="tomcat" password="your_tomcat_password" roles="manager-gui"/>
 
Now restart the apache-tomcat services:
[root@hudson~]# killall java
[root@hudson~]# sh /usr/share/apache-tomcat-6.0.36/bin/shutdown.sh
[root@hudson~]# sh /usr/share/apache-tomcat-6.0.36/bin/startup.sh

Now our server is ready. We can install hudson in two diffrent ways. First option is using war file and second is installing from repository as standalone service. Here I have presented both procedures. Lets get started.

Install hudson from war file:
First download leatest hudson.war:
[root@hudson ~]# wget http://eclipse.stu.edu.tw//hudson/war/hudson-3.1.2.war

Stop tomcat service:
[root@hudson ~]# /usr/share/apache-tomcat-6.0.36/bin/shutdown.sh
[root@hudson ~]# ps aux | grep tomcat
[root@hudson ~]# killall tomcat
[root@hudson ~]# kill -9 tomcat_id

Copy the hudson war to the tomcat webapps folder.
[root@hudson ~]# cp hudson-3.1.2.war /usr/share/apache-tomcat-6.0.36/webapps/hudson.war

Make hudson home directory and give proper permission:
[root@hudson ~]# mkdir /usr/share/apache-tomcat-6.0.36/.hudson/
[root@hudson ~]# chown tomcat.tomcat -R /usr/share/apache-tomcat-6.0.36/.hudson/

Startup tomcat and check the logs:
[root@hudson ~]# /usr/share/apache-tomcat-6.0.36/bin/shartup.sh
[root@hudson ~]# tail -f /usr/share/apache-tomcat-6.0.36/logs/catalina.out

Wait until all of your web applications loaded. Now go to the web browser, install your required plugins and complete the installation.
http://your_ip_address:8080/hudson/

Note: If you are not getting the hudson you may need to restart the war from tomcat manager (http://your_ip_address:8080).

Install hudson (standalone) from rpm:

[root@hudson ~]# wget -O /etc/yum.repos.d/hudson.repo http://hudson-ci.org/redhat/hudson.repo
[root@hudson ~]# yum check-update
[root@hudson ~]# yum install hudson
[root@hudson ~]# /etc/init.d/hudson start
[root@hudson ~]# tail -f /var/log/hudson/hudson.log

Thats all. Hope this helps you.



Reference:
http://docs.oracle.com/middleware/1212/core/MAVEN/config_hudson.htm#A1001805