Akamit Blog

Enterprise sysadmin's blog

  • You are here: 
  • Home
  • HowTo

How to determine disk Solaris booted from

Posted on December 18th, 2010

The script parses prconf -pv output to get bootpath variable and converts it to cXtXdX format

#!/bin/sh
BOOTPATH=`prtconf -pv | grep bootpath | tr -d "'" | awk '{print $2}'`
 
if [ -n "`echo $BOOTPATH | grep "/disk"`" ] ; then
   # The bootpath contains "disk," but the /devices block device contains
   # either "sd" or "ssd"
   BOOTPATH=`echo $BOOTPATH | sed 's/disk@//'`
   BOOT_DISK=`ls -l /dev/dsk | sed -e 's/ssd@//' -e 's/sd@//' \
   | grep "$BOOTPATH" 2>/dev/null | awk '{print $9}' | sed 's/s[0-7]//'`
else
   BOOT_DISK=`ls -l /dev/dsk | grep "$BOOTPATH" 2>/dev/null | \
   awk '{print $9}' | sed 's/s[0-7]//'`
fi
 
if [ -n "$BOOT_DISK" ] ; then
   echo "Your boot disk is ${BOOT_DISK}."
else         
   echo "Unable to determine logical boot disk."
fi

Filed under HowTo, Solaris | 1 Comment »

How to install simple imap service with Solaris 9 OS

Posted on July 23rd, 2010

We are going to create very simple installation of imap service.
1. fetch imapd package from sunfreeware.com and install it.
2. add service to inetd configuration

echo "imap stream tcp nowait root /usr/local/sbin/imapd imapd" >>  /etc/inetd.conf
pkill -1 inetd

3. check the service is runnable from inetd

telnet 10.5.2.28 143
Trying 10.5.2.28...
Connected to 10.5.2.28.
Escape character is '^]'.
* OK [CAPABILITY IMAP4REV1 LITERAL+ SASL-IR LOGIN-REFERRALS STARTTLS LOGINDISABLED] ssm-srv IMAP4rev1 2006e.378 at Fri, 23 Jul 2010 12:34:19 +0400 (MSD)

If you are getting errors related to openssl library, add library path to your linker configuration:

crle -u -l /usr/local/ssl/lib

4. imapd version from sunfreeware only works with TLS. So you need to generate SSL certificate, otherwise authentication won’t work.

cd /usr/local/ssl/certs
/usr/local/ssl/bin/openssl req -new -x509 -nodes \
-out imapd.pem -keyout imapd
.pem -days 3650

5. Finally configure your email client. I’m using mutt. Part of muttrc configuration related to imap follows.

set imap_authenticators="plain"
set spoolfile=imap://mit@10.5.2.28/inbox
set folder=imap://mit@10.5.2.28/

Tags: , ,
Filed under Email, HowTo | No Comments »

How to install openchrome drivers under OpenSUSE 11.3

Posted on July 20th, 2010

This is necessary to make graphics work properly with HP mini-note 2133 netbook.

svn co http://svn.openchrome.org/svn/trunk openchrome
cd openchrome
sh autogen.sh --with-xorg-module-dir=/usr/lib/xorg/modules --prefix=/usr
make && make install

after installing the driver, create /etc/X11/xorg.conf

Section "Device"
  Identifier "hp2133"
  Driver  "openchrome"
EndSection
Section "Screen"
  Identifier "hp2133"
  Device "hp2133"
EndSection
 
Section "ServerLayout"
  Identifier "Layout"
  Screen  "hp2133"
EndSection

Then, just restart X.

Tags: , ,
Filed under HowTo, openSUSE | 7 Comments »

How to disable automatic mount of usb devices in GNOME desktop

Posted on July 19th, 2010

$ gconftool-2 --type bool --set /apps/nautilus/preferences/media_automount false

Tags:
Filed under HowTo, openSUSE | No Comments »