Wednesday, January 26, 2011

Solaris - CPU

Nothing fancy, just a quick note for thyself

# psrinfo -vp
The physical processor has 1 virtual processor (0)
x86 (GenuineIntel family 6 model 23 step 10 clock 2387 MHz)
Intel(r) Core(tm)2 Duo CPU P8600 @ 2.40GHz
#


Macam cat /proc/cpuinfo kat linux,

# kstat cpu_info
module: cpu_info instance: 0
name: cpu_info0 class: misc
brand Intel(r) Core(tm)2 Duo CPU P8600 @ 2.40GHz
cache_id 0
chip_id 0
clock_MHz 2387
clog_id 0
core_id 0
cpu_type i386
crtime 31321.127312219
current_clock_Hz 2387348216
current_cstate 0
family 6
fpu_type i387 compatible
implementation x86 (GenuineIntel family 6 model 23 step 10 clock 2387 MHz)
model 23
ncore_per_chip 1
ncpu_per_chip 1
pg_id -1
pkg_core_id 0
snaptime 33573.371480431
state on-line
state_begin 1295996392
stepping 10
supported_frequencies_Hz 2387348216
supported_max_cstates 0
vendor_id GenuineIntel

#

read more...

Monday, January 24, 2011

Solaris Zone

Create zone:
bash-3.00# zonecfg -z 1
1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:1> create
zonecfg:1> set zonepath=/opt/zones/1
zonecfg:1> add net
zonecfg:1:net> set physical=e1000g0
zonecfg:1:net> set address=192.168.1.111
zonecfg:1:net> end
zonecfg:1> add inherit-pkg-dir
zonecfg:1:inherit-pkg-dir> set dir=/opt
zonecfg:1:inherit-pkg-dir> end
zonecfg:1> verify
zonecfg:1> commit
zonecfg:1> exit

# zoneadm -z 1 install
Preparing to install zone <1>.
Creating list of files to copy from the global zone.
Copying <2924> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1102> packages on the zone.
Initialized <1102> packages on zone.
Zone <1> is initialized.
The file contains a log of
the zone installation.
#

# zoneadm -z 1 boot
# zlogin -C 1
(follow on screen instructions)

If you want to rename zone:
# zoneadm -z 1 halt
# vi /etc/zones/index (rename "1" to your new zone name, i.e. zone1x86)
# cd /etc/zones/
# mv 1.xml zone1x86.xml
# vi zone1x86.xml (change any reference "1" to new zone name, i.e. zone1x86)
# zoneadm -z zone1x86 boot


Cloning zone1x86 to zone2x86:
# zonecfg -z zone1x86 export > zone2x86.cfg
# vi zone2x86.cfg (change zone1x86 to your new zone name, i.e. zone2x86 and IP address)
"zone2x86.cfg" 23 lines, 331 characters
create -b
set zonepath=/opt/zones/zone2x86
set autoboot=false
set ip-type=shared
add inherit-pkg-dir
set dir=/lib
end
add inherit-pkg-dir
set dir=/platform
end
add inherit-pkg-dir
set dir=/sbin
end
add inherit-pkg-dir
set dir=/usr
end
add inherit-pkg-dir
set dir=/opt
end
add net
set address=192.168.1.112
set physical=e1000g0
end
"zone2x86.cfg" 23 lines, 331 characters
# zonecfg -z zone2x86 -f zone2x86.cfg
# zoneadm -z zone1x86 halt
# zoneadm -z zone2x86 clone zone1x86
Copying /opt/zones/zone1x86...
grep: can't open /a/etc/dumpadm.conf
#

Verify zones are correctly installed:
# zoneadm list -vi
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1x86 installed /opt/zones/zone1x86 native shared
- zone2x86 installed /opt/zones/zone2x86 native shared
#

Boot zones:
# zoneadm -z zone1x86 boot
# zoneadm -z zone2x86 boot

read more...

Sunday, January 23, 2011

Luser Attitude Readjustment Tool



lart(8)         lart(8)

NAME
       lart  - Luser  Attitude Readjustment Tool - use a lart to
       adjust lusers' attitudes

SYNOPSIS
       lart [ -use tool ] [ -bBfFgklp ] 

DESCRIPTION
       lart adjusts the attitudes of those pesky, clueless people
       who  rely  upon their  admins for everything from picking
       their mice off of the floor to turning on their monitors;
       namely, the  luser(8). Running lart with the appropriate
       arguments will cause  the  specified  luser  to run  away
       screaming in agony.  Alternatively, you can make the luser
       buy you a beer, after killing all of their processes.


read more...

Solaris 10 x86 on VMWare disk mirror


umount /export/home

bash-3.00# format
Searching for disks...done



AVAILABLE DISK SELECTIONS:
       0. c1t0d0
          /pci@0,0/pci15ad,1976@10/sd@0,0
       1. c1t1d0
          /pci@0,0/pci15ad,1976@10/sd@1,0
Specify disk (enter its number):


select 0
p
p
7
enter
enter
0
0
label
y
p
3
enter
enter
981
40mb
p
7
home
enter
987
$
label
y
name
root
q
disk
1
p
p
select
(select "root")
label
y

comment /export/home in /etc/vfstab
newfs /dev/rdsk/c1t0d0s7
uncomment /export/home
mount -a

metadb -afc 3 c1t0d0s3 c1t1d0s3
metainit -f d10 1 1 c1t0d0s0
metainit -f d20 1 1 c1t0d0s1
metainit -f d70 1 1 c1t0d0s7
#metainit -f d80 1 1 c1t0d0s8
metainit d1 -m d10
metainit d2 -m d20
metainit d7 -m d70
#metainit d8 -m d80

sub-mirror:
metainit -f d11 1 1 c1t1d0s0
metainit -f d21 1 1 c1t1d0s1
metainit -f d71 1 1 c1t1d0s7
#metainit -f d81 1 1 c1t1d0s8

metaroot d1

edit /etc/vfstab
tukar:
1. /dev/dsk/c1t0d0s1 jadi /dev/md/dsk/d2
2. /dev/dsk/c1t0d0s7 jadi /dev/md/dsk/d7 (/dev/md/rdsk...)


reboot

metattach d1 d11
metattach d2 d21
metattach d7 d71
#metattach d8 d81

bash-3.00# metastat
d7: Mirror
Submirror 0: d70
State: Okay
Submirror 1: d71
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 5060475 blocks (2.4 GB)

d70: Submirror of d7
State: Okay
Size: 5060475 blocks (2.4 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s7 0 No Okay Yes


d71: Submirror of d7
State: Resyncing
Size: 5060475 blocks (2.4 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s7 0 No Okay Yes


d2: Mirror
Submirror 0: d20
State: Okay
Submirror 1: d21
State: Resyncing
Resync in progress: 4 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 1076355 blocks (525 MB)

d20: Submirror of d2
State: Okay
Size: 1076355 blocks (525 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s1 0 No Okay Yes


d21: Submirror of d2
State: Resyncing
Size: 1076355 blocks (525 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s1 0 No Okay Yes


d1: Mirror
Submirror 0: d10
State: Okay
Submirror 1: d11
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 14667345 blocks (7.0 GB)

d10: Submirror of d1
State: Okay
Size: 14667345 blocks (7.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s0 0 No Okay Yes


d11: Submirror of d1
State: Resyncing
Size: 14667345 blocks (7.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Okay Yes


Device Relocation Information:
Device Reloc Device ID
c1t1d0 Yes id1,sd@f13b360d84d3b15f40006e7540000
c1t0d0 Yes id1,sd@f000000004d3b6fa3000592b50000
bash-3.00#

disk status after mirror sync'ed:
bash-3.00# metastat
d7: Mirror
Submirror 0: d70
State: Okay
Submirror 1: d71
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 5060475 blocks (2.4 GB)

d70: Submirror of d7
State: Okay
Size: 5060475 blocks (2.4 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s7 0 No Okay Yes


d71: Submirror of d7
State: Okay
Size: 5060475 blocks (2.4 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s7 0 No Okay Yes


d2: Mirror
Submirror 0: d20
State: Okay
Submirror 1: d21
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 1076355 blocks (525 MB)

d20: Submirror of d2
State: Okay
Size: 1076355 blocks (525 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s1 0 No Okay Yes


d21: Submirror of d2
State: Okay
Size: 1076355 blocks (525 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s1 0 No Okay Yes


d1: Mirror
Submirror 0: d10
State: Okay
Submirror 1: d11
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 14667345 blocks (7.0 GB)

d10: Submirror of d1
State: Okay
Size: 14667345 blocks (7.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s0 0 No Okay Yes


d11: Submirror of d1
State: Okay
Size: 14667345 blocks (7.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Okay Yes


Device Relocation Information:
Device Reloc Device ID
c1t1d0 Yes id1,sd@f13b360d84d3b15f40006e7540000
c1t0d0 Yes id1,sd@f000000004d3b6fa3000592b50000
bash-3.00#

read more...

Solaris 10 x86 on VMWare


read more...

Tuesday, January 18, 2011

MacOSX 10.6.4 running on AMD Phenom X2 555

Finally I managed to install 10.6.4 on my AMD Phenom X2 555 system with Asus M4A88T-V EVO/USB3.

The problem that I'm facing right now is to get my onboard AT HD4250 to work, at least to change resolution to 1920x1080. So far I found out that 4250 is NOT supported. Tried installing RadeonHD kext but somehow couldn't get it to work. Will continue to work on this later on.

USB 2.0 seems to work (haven't check whether it's 1.1 or 2.0 - later), USB 3.0 not tested (i don't have USB 3.0 device), Firewire not tested

Anyway, I'm using retail DVD 10.6.4, created USB install disk using nawcom method in Ubuntu, repartition my 2TB to make root disk < 1TB (I learned that OSX cannot boot if root disk is more than 1TB). Install Chameleon RC4 and legacy kernel 10.6.4.

Haven't test my onboard audio after install VoodooHDA kext but I got no sound via HDMI. Next is to fix my GFX, and then to get audio to work via HDMI (if possible, haven't research thoroughly yet)

Final step is to install XBMC and Jdownloader :) That is my sole purpose.

Complete hardware specs:
AMD Phenom X2 555 BE
Asus M4A88T-V EVO/USB3 (onboard ATI HD4250, onboard ALC892 8-channel HD Audio, ..)
Seasonic 520W modular PSU (not related to OSX but what the heck :P )
Silverstone LC17B
750GB Samsung HDD (running Ubuntu 10.10)
2TB WD Green Ed. (running MacOSX 10.6.4 - not yet finished completely)
Connected to LG LCD LD420 via HDMI
Asus USB wireless 54g stick (can't remember the model and haven't configure/test in MacOSX as well)

read more...

MacOSX 10.6.4 ISO/DVD offset

dump everything in DVD to ISO (change /dev/sr0 to your DVD device):
# cat /dev/sr0 > macosx_10.6.4_install.iso

find your offset (it is gonna take quite some time, so be patience):
# hexdump -C macosx_10.6.4_install.iso | grep "48 2b 00 04"
31b4b400 48 2b 00 04 80 00 01 00 31 30 2e 30 00 00 00 00 |H+......10.0....|


convert 31b4b400 to decimal and minus 1024

example:
$ echo `printf "%d\n" 0x31b4b400` - 1024 | bc
833925120

so:
10.6.4 ISO/DVD offset: 833925120

maybe you can try to find your offset if you're using DVD (haven't try this one):
# hexdump -C /dev/sr0 | grep "48 2b 00 04"

then mount your ISO:
# losetup -o 833925120 /dev/loop0 ./mac osx_10.6.4_install.iso
# mkdir /media/osx-dvd
# mount -t hfsplus /dev/loop0 /media/osx-dvd/


to unmount:
# umount /media/osx-dvd
# losetup -d /dev/loop0

you might ask, why "48 2b 00 04" and why minus 1024? refer here: http://www.64lines.com/mounting-hfs-plus
[snip]
Finding an HSF+ Partition

How do you find an HFS+ partition? Well according to docs at http://developer.apple.com/technotes/tn/tn1150.html#VolumeHeader an HFS+ partition starts with 1024 reserved bytes for boot code followed by the VolumeHeader structure. The first 4 bytes of the VolumeHeader structure are a signature and a version number. Essentially "H+" followed by version 4 (or HX followed by 5 for HFSX). Therefore we are looking for the following hexadecimal sequence within the file: "48 2b 00 04" (or "48 58 00 05" for HFSX).

[/snip]

read more...

Thursday, January 13, 2011

Cron (solaris) "bad user" error

cron (solaris) "bad user" error message in /var/log/cron
--------------------------------------------------------

Cron needs to be able to access a shell as the cron user in order to
do its thing. The easiest work-around for this is to edit the
/etc/shadow file and change the *LK* to *NP* for the affected
accounts.

read more...

Tuesday, January 11, 2011

vxrestore / vxdump

# vxdump 0fu /dev/rmt/0m /var ; dump vxfs file system /var to tape /dev/rmt/0m using level 0 and update /var/adm/dumpdates

# vxrestore tf /dev/rmt/0m | grep eaaa ; obtain table of contents from tape /dev/rmt/0m and look for filename containing "eaaa"

# vxrestore -yxf /dev/rmt/0m ; restore the whole content of the tape into current dir, answer 1 and y

# mt -f /dev/rmt/0m rewind ; rewind tape after listing the tape

read more...