Tuesday, July 14, 2015

Windows server boot problem



I got this error after restore windows server 2008 using clonezilla. To fix it, boot to Windows Server 2008 DVD, enter command line, use this command :


bootrec /scanos

Bcdedit /export C:\BCDBkp

ren c:\boot\bcd bcd.old

Bootrec /rebuildbcd



Reference :

Monday, June 29, 2015

Replacing hard disk on xenserver / linux software RAID

mark as failed disk :

    mdadm --manage /dev/md0 --fail /dev/sdb1 

remove the disk :

    mdadm --manage /dev/md0 --remove /dev/sdb1


change the physical drive, copy the partition, create the exact same partitioning as on/dev/sda :
    sfdisk -d /dev/sda | sfdisk /dev/sdb


add the new drive
    mdadm --manage /dev/md0 --add /dev/sdb1


done, check the progress :
    cat /etc/mdstat



references:

Sunday, June 28, 2015

Xenserver / linux software raid

I want my Storage Repository (SR) run under the software RAID (RAID1). My xenserver version 6.5. XenServer 6.5 do not load soft raid kernel modules on boot. To load soft raid manually run :

modprobe raid1

To load the soft raid module on boot, we can follow this steps : http://discussions.citrix.com/topic/360943-software-raid-mdadm-on-xenserver-65-unexpected-failure/?p=1855912

To build the RAID array :
 
mknod /dev/md1 b 9 1

mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1


/dev/sdb1
and
/dev/sdc1
is using linux raid autodetect as the partition type. Use fdisk to create those partition.

To check the RAID building process :
cat /proc/mdstat

reference :

Thursday, June 25, 2015

Internet access for android on vmware

If you download android x86 virtual appliance (http://www.osboxes.org/android-x86/) or installing android x86 manual to your vmware, you can give an internet access to the device

1. Add Network Adapter, with NAT as the network adapter type
2. Don't start your vm, edit the .vmx file, add / edit this line :

ethernet0.virtualDev = "vlance"

3. Now start your vm and you should can browsing from the android vm

reference:
https://lkubaski.wordpress.com/2012/08/15/running-android-on-vmware-player-with-networking-enabled/

Tuesday, May 26, 2015

Grails / GORM database mapping Money data type on Microsoft SQL Server

import java.math.BigDecimal
class Cloth {
    ...
    BigDecimal price
    ...
    static mapping = {
        price sqlType: "money"
    }
}

reference : https://msdn.microsoft.com/en-us/library/ms378878(v=sql.110).aspx
remember, grails is java too :D

Friday, May 1, 2015

Make uninitialized disk using diskpart

Warning this command will erase all of data on the disk!!!

1. run cmd
2. type : diskpart
3. type : list disk
4. select the disk you want to clean / uninitialize, in this example : select disk 1
5. clean
6. done


This steps are useful if we want to change the disk partition type (GPT or MBR or other)

Friday, October 17, 2014

Grails Spring Security no password encoding

http://stackoverflow.com/questions/8465016/spring-security-no-password-encoding

t's a really really bad idea in general, but if you have a use case for it then it is doable. Override the passwordEncoder bean in grails-app/conf/spring/resources.groovy:

import org.springframework.security.authentication.encoding.PlaintextPasswordEncoder

beans = {
   passwordEncoder(PlaintextPasswordEncoder)
}