Felix' blog

search
feeds
links
Thursday Mar 26, 2009

count files open on a solaris machine without lsof

If there is no lsof installed and you want to know how many files are currently open you could use this script:

#!/bin/bash

count=0

for i in `ls /proc`; do
if [ -d /proc/$i/fd ]; then
add=$( ls /proc/$i/fd | wc -w )
else
add=0
fi
let "count=count+add"
done
echo $count

Tuesday Mar 10, 2009

Nanoseconds

Sun's version of date does not allow the display of nanoseconds.
But if one needs to do so one can use this handy perl one-liner:


perl -e 'use Time::HiRes qw(gettimeofday); print gettimeofday(),"\n";'

found on: http://perldoc.perl.org/Time/HiRes.html#EXAMPLESexternal link

Wednesday Feb 25, 2009

Getting console access via SC using expect

To get access to a console via the machine's sc, using expect I did the following:


proc ilom3 {} {
send "console -f\r"
expect "\[y/n\]"
send "y\r"
expect "ALOM\."
send "\r"
return 0
}
proc ilom2 {} {
send "stop /SP/console\r"
expect "(y/n)\? "
send "y\r"
expect -re ".+"
send "start /SP/console\r"
expect "(y/n)\? "
send "y\r"
expect "To stop, type ESC ("
send "\r"
return 0
}

expect {
-re "-> " ilom2
-re "sc> " ilom3
}

Tuesday Feb 17, 2009

current status

The current status.
location: Dublin, Ireland, East Point Business Park, Boole House, Second Floor, sitting at my desk by the window overlooking the city
weather: sunny and mild
working on: waiting for a test run to complete

internship with Sun in Ireland

Hi,

this will become my new blog in which I will let you know about the stuff that is happening to me here at my internship in Dublin, Ireland with Sun.

Felix