Create New User in Ubuntu

1. Open your terminal:

$ useradd -m -s /bin/bash hrp

$ passwd hrp

$ cd /home

$ ls -l

$ mkdir hrp

$ chmod  0700 hrp

$ chown -R hrp:hrp hrp

2014-02-01_213019

Advertisements

Install JBoss AS 7.1.1.Final on RHEL 6.3

1. Download JBoss AS 7.1.1.Final from this website: [ LINK ]

2013-05-25_082101

2. Downlaod JDK 1.7 from this website: [ LINK ]

2013-05-25_082447

3. Install JDK 1.7, I’m using JDK 1.7Update21. Move jdk-7u21-linux-x64.gz file to /opt

2013-05-25_082755

4. Extract the file.

2013-05-25_083306

5. Put JAVA into the path of root.

2013-05-25_083616

6. Check that JAVA is now in the path of root.

2013-05-25_084152

7. Create an “application” directory in /and move jboss installer into it.

2013-05-25_084732

8. Extract the installer.

2013-05-25_085002

9. Rename jboss-as-7.1.1.Final to jboss-as. This is not strictly necessary, but it will save you the bother of changing the start up script later.

2013-05-25_085500

10. Since we will want to run JBoss as non-root user with minimal privileges, we will create a user “jboss“, who will own the JBoss files and JBoss will run under this account.

2013-05-25_085917

11. Switch to the user jboss and type this command; ‘java -version‘ to verify that JAVA is now in the path of user jboss.

2013-05-25_090308

12. To create our JBoss script, we will copy the jboss-as-standalone.sh script located under /application/jboss-as/bin/init.d

2013-05-25_101251

13. Change line 5 from it’s original ‘# chkconfig: – 80 20‘ to ‘# chkconfig: 234 80 20

2013-05-25_101700

14. Set the JBOSS_USER (refer a) and set the jboss path (refer b).

2013-05-25_102220

15. To run JBoss as service and enable start up at boot, make the script we created above executable and add it to our chkconfig so it starts at boot.

2013-05-25_102715

16. Try reboot your operating system. If still unable to start after reboot the OS, refer to this screenshot.

2013-05-25_103039

17. Mark jboss as startup services.

2013-05-25_103330

18. Bind your server IP address to these lines.

2013-05-25_103519

19. Start your server by using this command: $ service jboss start | stop | restart

2013-05-25_103833

20. Let’s start with adding a Management user. Login as root, naviate to /application/jboss-as/bin

2013-05-25_104242

21. Follow the prompts, some defaults are provided.

2013-05-25_104456

22. Restart JBoss to reload the changes.

2013-05-25_104707

 

23. Yeay!

Linux Crontab

Overview

Crontab is the program used to install, deinstall or list the tables used to drive the cron daemon in Vixie Cron. Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly.

Each user has their own crontab, and commands in any given crontab will be executed as the user who owns the crontab. Uucp and News will usually have their own crontabs, eliminating the need for explicitly running su as part of a cron command.

  • To view crontab file:

$ crontab -l

  • To edit crontab file:

$ crontab -e

  • To remove crontab file:

$ crontab -r

  • To display the last time you edited your crontab file:

$ crontab -v

cron

(credit image: link)

Expand Hard Disk Size

1. Display all the hard disk size. Available space is zero. (sigh!)

2. Use the command fdisk to examine the physical hard disk.

3. Examine the partition table.

4. Create a new partition.

5. Quit and reboot the system.

6. Use partprobe to load the table.

7. Create a new physical volume.

 

8. Add new physical volume to the volume group.

 

9. Extend the logical volume to include the physical volume we just added to the group.

 

10. Extend the logical volume to include all free extents.

 

11. Use resize2fs to extend our ext3 filesystem online.

 

12. Use df again to verify.

 

13. Yeah! (poolparty)

Read Hard Disk Info

#!/bin/sh
DISC=$1
PARTITION=`df -h |grep $DISC |awk ‘{print $1}’`
SIZE=`df -h|grep $DISC|awk ‘{print $2}’`
USED=`df -h|grep $DISC|awk ‘{print $3}’`
FREE=`df -h|grep $DISC|awk ‘{print $4}’`
echo “Partition: $PARTITION”
echo “Total size: $SIZE”
echo “Used space: $USED”
echo “Free space: $FREE”

credit: http://www.forevergeek.com/2005/10/check_disk_space_in_linux/

install java jdk on linux platform

Follow the simple steps:

1. To set the environment variables :

echo ‘export JAVA_HOME=/opt/jdk1.6.0_18’> /etc/profile.d/jdk.sh
echo ‘export PATH=$JAVA_HOME/bin:$PATH’ >> /etc/profile.d/jdk.sh

2. You have to source the file you just created by typing:
source /etc/profile.d/jdk.sh

3. Test if Java environment is successfully installed by typing in this in the shell:
java -version