Monday, July 11, 2011

Setup SVN on CentOS

http://wiki.centos.org/HowTos/Subversion

Sunday, March 6, 2011

VMware: Increase disk space of Linux VM


  • Increase disk space to desired size using the VM Client.

  • Login to the VM and restart the machine (init 6)

  • After restart go to fdisk (fisk /dev/sda or /dev/hda etc.)

  • Create new partition using fdisk, save and exit.

  • If an LVM is used then the newly created partition will be needed to added the the LVM.


  • Follow instructions below. Assume new partition is /dev/sda3 (4GB), volume group is VolGroup-00 and Logical volume is LogVol-100

  • pvcreate /dev/sda3

  • vgextend VolGroup00 /dev/sda3

  • lvextend -L +4G /dev/mapper/VolGroup00-LogVol00

  • resize2fs /dev/mapper/VolGroup00-LogVol00



  • Wednesday, January 26, 2011

    Set umask for a specific directory

    Use the setfacl command. Examples below from man.

    EXAMPLES
    Granting an additional user read access
    setfacl -m u:lisa:r file

    Revoking write access from all groups and all named users (using the effective rights mask)
    setfacl -m m::rx file

    Removing a named group entry from a file’s ACL
    setfacl -x g:staff file

    Copying the ACL of one file to another
    getfacl file1 | setfacl --set-file=- file2

    Copying the access ACL into the Default ACL
    getfacl --access dir | setfacl -d -M- dir



    Found solution here

    http://www.linuxforums.org/forum/slackware-linux/156119-solved-umask-specific-directory.html

    Thursday, September 16, 2010

    Wednesday, September 1, 2010

    Recover GRUB menu after Ubuntu 9.10 update

    A couple the GRUB menu got screwed up after an update. The recover process can be found here. But I had to take a couple additional steps to fix my GRUB.

    1. Figure what your where your /boot and /root partition is installed in. My /boot was /dev/sdc2 and /root was /dev/sdc3.
    2. Mount /root to /mnt using sudo mount /dev/sdc3 /mnt
    3. Mount /boot to /mnt/boot using
      mount /dev/sdc2 /mnt/boot.
      NOTE: If both /root and /boot are on the same partition then you only have to mount the /root partition.
    4. Check /mnt/boot/grub/device.map for an entry for /dev/sdc.
    5. If /dev/sdc does not exist, then add it using vi. For example, the entries in mine were
      (hd0) /dev/sda
      (hd1) /dev/sdb

      So I added (hd2) /dev/sdc to list.
    6. If this was not added to the list, the /root partition will not be found and the grub recovery will fail.
    7. Next re-install the grub by executing
      sudo grub-install --root-directory=/mnt /dev/sdc
    8. Reboot
    9. Refresh the GRUB 2 menu by executing update-grub2

    Wednesday, July 14, 2010

    CentOS static routes

    Temporary Static Route
    Use the route command to add a static route.
    route add -host 192.168.1.2 gw 192.168.50.254 dev eth0:0 (eth0:0 is virtual interface)

    Permanent Static Route
    echo "192.168.1.2/32 via 192.168.50.254" >> /etc/sysconfig/network-scripts/eth0:0

    In both the cases above all requests to 192.168.1.2 will be routed via gateway 192.168.50.254 and device eth0:0

    Friday, April 23, 2010

    Install/Uninstall GlassFish on Linux

    Uninstalling Glassfish V2 and installing Glassfish V3

    Glassfish can be installed with the file-based installer or the JAR-based installer.
    Uninstall instructions from SUN
    Installtion instruction from SUN

    Installing Glassfish

    File-based
    1. Download the file from
    2. chmod +x sges-glassfish-v3-unix.sh
    3. Create the installation directory: mkdir /usr/glassfish
    4. Navigate to where sges-glassfish-v3-unix.sh file exists.
    5. Run ./sges-glassfish-v3-unix.sh
    6. Follow the instructions.
    ZIP file installtion
    1. Download the file from
    2. Create the installation directory: mkdir /usr/glassfish
    3. Unzip contents to installation directory: unzip sges-v3-unix.zip


    JAR-based

    Uninstalling Glassfish

    File-based
    1. Navigate to your Enterprise Server installation directory.

    2. Invoke the uninstallation program as follows:

      • To use the uninstallation in GUI mode, type:

        ./uninstall

      • To use the uninstallation in command-line mode, type:

        ./uninstall -console


    JAR-based and Zip
    1. Change to the directory containing the glassfish directory.

    2. Run the following command: rm —r glassfish.