пятница, 18 марта 2011 г.

Normal ping in Solaris

I always disliked default behavior of Solaris ping:

me@host$ ping example.org
example.org is alive

Luckily, ping has "-s" parameter.

me@host$ ping -s example.org
PING example.org: 56 data bytes
64 bytes from example.org (192.168.1.1): icmp_seq=0. time=0.214 ms
64 bytes from example.org (192.168.1.1): icmp_seq=1. time=0.317 ms
64 bytes from example.org (192.168.1.1): icmp_seq=2. time=0.222 ms
64 bytes from example.org (192.168.1.1): icmp_seq=3. time=0.202 ms
^C
----example.org PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 0.202/0.239/0.317/0.053


Less known feature is MACHINE_THAT_GOES_PING environment variable, available at least in all recent OpenSolaris versions and derivatives. When it set, '-s' key is set by default.

me@host$ export MACHINE_THAT_GOES_PING=1
me@host$ ping example.org
PING example.org: 56 data bytes
64 bytes from example.org (192.168.1.1): icmp_seq=0. time=0.218 ms
64 bytes from example.org (192.168.1.1): icmp_seq=1. time=0.218 ms
64 bytes from example.org (192.168.1.1): icmp_seq=2. time=0.193 ms
^C
----example.org PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 0.193/0.210/0.218/0.014


Now I'm going to add this variable to my .profile :)

вторник, 15 марта 2011 г.

PostrgreSQL pgarch_ArchiverCopyLoop

Today I had an interesting experiment while tuning our new PostgreSQL server. I powered it off during operation. PostgreSQL restored after reboot and was rather happy after restoring from log files in pg_xlog, but later it began to swear:

Mar 15 17:36:01 pgsql pgsql[1579]: [10-2] db , client , user LOCATION: pgarch_ArchiverCopyLoop, pgarch.c:466
Mar 15 17:37:03 pgsql pgsql[1579]: [14-1] db , client , user WARNING: 01000: transaction log file "00000001000000170000007E" could not be archived: too many failures

It seems that during power failure one log was archiving and as result file "00000001000000170000007E.bz2" existed in archive. So, PostgreSQL refused to overwrite it (test -f returned not 0). So, I moved that file to other directory and postgresql created new archive copy of this wal file. I compared md5 sums of original log file in pg_xlog and archived one, they matched and I deleted old copy. It seems that bzip2 process was interrupted during power failure. It's a good expirience: it confirms that my archive_command

/bin/test ! -f /path/to/archived/logs/%f.bz2 && /bin/cat %p | /usr/bin/bzip2 -c > /path/to/archived/logs/%f.bz2'
is right.

понедельник, 14 марта 2011 г.

POSIX rules, bashism sux, and shell is a great tool...

Just one link. Here I found a lot of useful advices and tricks concerning writing scripts in POSIX shell. As I'm really fond of shell, I'd like to share this link...

FreeBSD, Java plugin and Firefox 3.6

I've just found out, that java plugin is working on FreeBSD with Firefox 3.6 and OpenJDK (openjdk6-b21_3). You just need to compile openjdk port with WEB option and later do

ln -s /usr/local/openjdk6/jre/lib/IcedTeaPlugin.so ~/.mozilla/plugins/

I can't determine the quality of plugin - all my admin applications work strange (don't work seems right expression), but it may be caused by SSH tunneling...

суббота, 5 марта 2011 г.

I like people filling oracle.com with info

Once you could see SPARK processors in Oracle portfolio, now we have Doc: Trace User's Guide. It seems that men filling these pages either have never listened about Sun or just sleep at work :)

понедельник, 28 февраля 2011 г.

Read UPDATING, Luck...

I spent weekend updating my desktop system. I've built 8.2, updated Xorg, KDE and different trifles. Finally I reinstalled autoconf,automake,libltdl,libtool, because portmaster couldn't update them (ports moved). Periodically I had to kill grep during port install, because I forgot to update portmaster. These two problems could be solved if I had read "UPDATING"... But the last one was interesting: I didn't manage to make xf86-video-ati work, system hanged with "radeon" driver and performance dropped significantly with "radeonhd". At last, I rolled back to using x11-drivers/xf86-video-ati613. I have to update other major ports (OpenJDK, Chromium, Firefox), but this can wait. I'm going to wait for Chromium 9 (which was promised to land in ports tree in March-April) and to replace OpenOffice with LibreOffice on this week...

среда, 16 февраля 2011 г.

Finally wine is fixed...

Finally one irritating wine bug was fixed. Now I've just updated my wine to 1.3.3 (I had this in my port tree) with applied suggested patch. Some windows applications still don't work on my desktop (FreeBSD 8.1, xf86-video-ati-6.13.2, wine-1.3.3). However, they work on Linux and Intel integrated video adapter, but it seems I should blame ati video driver for this. It seems that Intel is the best video adapter for Unix-like system. At least, I hope Intel will not make it unusable by dropping support for no-KMS mode.