Wednesday, September 14, 2011

Reset MySQL root password


  • Kill the mysql process using. Some process has may not be in the folder in the example below. The folder can be found my using ps aux | grep mysqld and looking for the file that ends with .pid or starts with mysqld
    • $: kill `cat /var/run/mysqld/mysqld.pid`


  • Create a file with entries below.
    • UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';

    • FLUSH PRIVILEGES;


  • Start mysql using the command below. Where --init-file is the path to the file created above.
    • mysqld_safe --init-file=/home/me/mysql-init &


  • Login to mysql using the new mysql root password

MySQL root password should be reset now.

Reference: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix

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