Posts Tagged tips

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

readonly issue on disk

We have one server became readonly after update DMX.

Error logs:
Buffer I/O error on device dm-1, logical block 1545
lost page write due to I/O error on dm-1
ext3_abort called.
EXT3-fs error (device dm-1): ext3_journal_start_sb: Detected aborted journal
Remounting filesystem read-only
qla2xxx 0000:0d:00.0: scsi(0:0:0): Abort command issued — 1 11299f0 2002.
qla2xxx 0000:0d:00.1: scsi(1:0:0): Abort command issued — 1 113a04c 2002.
……
qla2xxx 0000:0d:00.0: Unable to read SFP data (102/a0/0).
process `sysctl’ is using deprecated sysctl (syscall) net.ipv6.neigh.eth3.base_reachable_time; Use net.ipv6.neigh.eth3.base_reachable_time_ms instead.
ext3_abort called.
EXT3-fs error (device dm-1): ext3_remount: Abort forced by user
ext3_abort called.

mount -o remount,rw /apps
mount: block device /dev/mapper/xxxx is write-protected, mounting read-only

Solution: reboot the server, all fixed :(

No Comments

Network / TCP / UDP Tuning

This is a very basic step by step description of how to improve the performance networking (TCP & UDP) on Linux 2.4+ for high-bandwidth applications. These settings are especially important for GigE links.

Quick Step
Cut and paste the following into a linux shell with root privleges:
sysctl -w net.core.rmem_max=8388608
sysctl -w net.core.wmem_max=8388608
sysctl -w net.core.rmem_default=65536
sysctl -w net.core.wmem_default=65536
sysctl -w net.ipv4.tcp_rmem=’4096 87380 8388608′
sysctl -w net.ipv4.tcp_wmem=’4096 65536 8388608′
sysctl -w net.ipv4.tcp_mem=’8388608 8388608 8388608′
sysctl -w net.ipv4.route.flush=1

Details:
Read the rest of this entry »

No Comments

client 4 rejected from IP x.x.x.x

Xming.exe: client 4 rejected from IP 192.168.1.215

Solution:
Edit: X0.hosts (lay in the installation directory)
add the ip you want allow. my X0.hosts
“localhost
192.168.1.215″
Restart Xming.

3 Comments

Top and useful ssh tips

1. copy ssh key to remote host
ssh-copy-id user@remote_host

2 map the tunnel the remote host 80 port to local host port 2001
ssh -N -L2001:localhost:80 remote_host
# now we can use localhost:2001 to reach remote_host 80

3. compare the local file and remote file
ssh user@host cat /path/to/remotefile | diff /path/to/localfile –

4. jump point to unreachable_host
ssh -t reachable_host ssh unreachable_host
Read the rest of this entry »

No Comments

Installing Perl modules

Perl modules may be installed using the CPAN module or from source.
CPAN method
perl -MCPAN -e shell (to get an interactive CPAN shell)
perl -MCPAN -e ‘install Time::JulianDay’ (if you know the name of the module, you can install it directly without interacting with the CPAN shell)

Manually install from source
1. Download the Perl module from CPAN or other site.
2. Extract the tarball.
3. Run perl Makefile.PL
4. Run make
5. Run make test (optional)
6. Run make install
Read the rest of this entry »

,

No Comments

Enable USB Camera in Virtualbox

Due to some IM need camera in my virtualbox. get the result from ubuntu
if [ "`grep vboxusers /etc/group|grep $USER`" == "" ] ; then sudo usermod -G vboxusers -a $USER ; fi
restart the virtualbox. and follow the following instructions
DO NOT add the line to /etc/fstab, or you may meet some issue :)
none /proc/bus/usb usbfs devgid=groupid,devmode=664 0 0
Details

https://help.ubuntu.com/community/VirtualBox/USB

Also: furiusisomount can mount .bin file that can be mount as cd-rom in Windows.

,

No Comments

some tips

1. disable SSH host key checking, means skip the (yes/no) question when ssh
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
Details
2. generate random password for account
dd if=/dev/random bs=1024 count=1 2> /dev/null |base64
3. autologin
expect-lite is very useful.
4. dos2unix missing (Ubuntu 10.04)
$sudo aptitude install tofrodos
$sudo ln -s fromdos dos2unix
$sudo ln -s todos unix2dos

No Comments