Install CentOS 6.0(64bit) with one CD

CentOS 6.0 Finally released. seems the CD/DVD has been updated. you should choose one net install CD or 4.4G DVD. could we have minimal install with one CD ? YES.

Here is the CD, you can minimal install the CentOS 6.0. so it good for guys who want to download one CD and install CentOS, of course you can install once you have installed basic system.

Download link:Download from linuxdict
Arch: 64bit
CD Size: 313M
Md5sum: 3f75769d89c8d5f897435f714abe4d11

Install details, please check http://www.linuxdict.com/2011-07-centos-6-0-in-one-cd/

No Comments

CentOS 6.0 In One CD (261M)

CentOS 6.0 Finally released. seems the CD/DVD has been updated. you should choose one net install CD or 4.4G DVD. could we have minimal install with one CD ? YES.

Here is the CD, you can minimal install the CentOS 6.0. so it good for guys who want to download one CD and install CentOS, of course you can install once you have installed basic system.

Download link:Download from china network Download from linuxdict
Arch: 32bit
CD Size: 261M
Md5sum: 0f668976b05374d2ecd09801b096f2e4

Guide for new guys use CentOS 6.
Read the rest of this entry »

No Comments

/var/adm/wtmpx too big

How to safely clean the /var/adm/wtmpx

Solution 1 (clean everything):
# cd /var/adm
# gzip -c wtmpx > wtmpx.backup.gz
# > wtmpx

Solution 2(keep last 1000 logs):
# cd /var/adm
# /usr/lib/acct/fwtmp < wtmpx | tail -1000 > wtmpx.ascii
# /usr/lib/acct/fwtmp -ic < wtmpx.ascii > wtmpx
# rm wtmpx.ascii
The commands makes convert info from binary to ascii from wtmpx, save last 1000 lines into wtmpx.ascii file, convert the info in wtmpx.ascii to binary again, and save it into wtmpx. Finally no-needed wtmpx.ascii is removed.

No Comments

Converting a virtual disk image: VDI to VMDK to a raw loopback file you can mount

By default, VirtualBox creates virtual disk images in a special format called VDI, which is unique to VirtualBox. Disk images are stored in $HOME/.VirtualBox/HardDisks.

You’ll need to convert VDI into another format if you want to run a VirtualBox VM on another virtualization platform, such as VMWare or KVM.

The VMDK virtual disk format is a good choice because even though it originated with VMWare it is supported by other virtualization platforms including VirtualBox and KVM.

VirtualBox enables the conversion using the low-level “VBoxManage clonehd” command:

VBoxManage list hdds # prints a list of disk image UUIDs
VBoxManage clonehd -o converted.vmdk format VMDK
cd ~/.VirtualBox/HardDisks/
ls -la converted.vmdk

Once you have converted to VMDK you can use qemu-img, a tool bundled with qemu (KVM’s virtualization backend) to further convert VMDK to other formats.

A particularly useful format to convert to is ‘raw’ which you can then mount as a loopback device:

apt-get install qemu
qemu-img convert -f vmdk converted.vmdk -O raw converted.raw
mount -o loop converted.raw /mnt

,

No Comments

Changing password inside a script

In an ideal world you’d never need to change the password associated with a user account without using passwd, but there are times when it is helpful to script such things.

The naive attempts to automate the use of passwd will fail, so the standard advice has always been to use a tool like expect to interactively call the passwd binary.

But there is an alternative approach which is more sensible which is to use the usermod command to change a password.

Assume you have a user account called guest upon your system and you wish to set the user’s password to openaccess you can do this by running:

# hash=$(echo openaccess | openssl passwd -1 -stdin)
# usermod –pass=”$hash” guest

If you wish you could combine that into a single line:

# usermod -p $(echo openaccess | openssl passwd -1 -stdin) guest

If a local user can see the commands you’re running in the output of “ps”, “top”, or similar then this is insecure – but if you generate the hash remotely you should probably be safe enough.

No Comments

Solaris: Boot archive error or corrupt

Boot archive error or corrupt

A few weeks ago, I got a little problem with my solaris box, namely solaris won’t boot because the boot archive was corrupt, *sigh*. Anyway the boot archive in solaris 10 was contain kernel module and configuration file was needed for solaris to startup the system.

Error:

module /platform/i86pc/boot_archive error 3 bad or corrupt data while decompressing file

Workaround:

Boot up your solaris in “solaris failsafe mode”, next solaris image will mount with writeable mode on “/a” mount point

rm -f /a/platform/i86pc/boot_archive
bootadm update-archive -R /a
reboot

,

No Comments

Solaris: get global zone name from non-global zone

run the netstat -p from non-global zone, get the ip information.
check the ip. one of the ip should be global zone’s ip.

there is any commands to check ? No.
so we’d better keep a good record, like motd. or cmdb.

,

No Comments

short scripts: convert squid timestamp

cat > /var/convert.pl
#!/usr/bin/perl -p
s/^\d+\.\d+/localtime $&/e;

Ctrl+D
. /var/convert.pl /var/squid/log/access.log |more

No Comments

how to get latest php mysql

There are many ways, you can compile by yourself, but not good in production env.

Here is option from iuscommunity.org

We are committed to providing up-to-date and regularly maintained RPM packages for the latest upstream versions of PHP, Python, MySQL and other common software specifically for Red Hat Enterprise Linux and clones.

Ref: http://iuscommunity.org/Docs/ClientUsageGuide
Try at your own risk. :)

No Comments

Patch ESXi from 4.0 to 4.1 Update 1

Target: Patch ESXi from 4.0 to 4.1 Update 1
Preparation: Install vSphere Client

1st round
# halt all the VMs from Vsphpere

# put the ESXi into “maintenance mode”, right click the host.

# backup the firmware configuration
C:\Program Files\VMware\VMware vSphere CLI\bin>vicfg-cfgbackup.pl –server beivm
srv01 -s beivmsrv01_20110320.bak
Enter username: root
Enter password:
Saving firmware configuration to beivmsrv01_20110320.bak …

Read the rest of this entry »

No Comments