Thursday, November 5, 2015

Linux command low level format

Warning!!! This command will destroy all data on your drive

This command is use to check bad sector on a hard disk.

dd if=/dev/zero of=/dev/sda1 bs=1024



Now we know that is a trouble at first 1 GB

Monday, August 10, 2015

How to check data chanel and info chanel (MikroTik + USB Modem / 3G Modem)

[admin@MikroTik] > /system serial-terminal usb2 channel=2

[Ctrl-A is the prefix key]


ATI
Manufacturer: Option N.V.
Model: GTM378
Revision: 2.3.3Hd (Date: Jul 17 2007, Time: 15:49:23)

OK

reference : http://wiki.mikrotik.com/wiki/Option_Globetrotter_HSDPA_USB_Modem

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)