Tuesday, November 18, 2008

I love hg.

No no.. not the element.
I though I would share the rollback thing hg has and how neat and easy it is to use.

[edward@SXCE-Workstation]:/AuroraUX/KDE4/KDE4-Testing/kde4-specs-dev:~>hg rollback
rolling back last transaction
[edward@SXCE-Workstation]:/AuroraUX/KDE4/KDE4-Testing/kde4-specs-dev:~>hg head
changeset: 202:ebee44fa159b
tag: tip
user: evocallaghan
date: Tue Nov 18 06:06:13 2008 +1100
summary: Fix KDE bugID 175420

[edward@SXCE-Workstation]:/AuroraUX/KDE4/KDE4-Testing/kde4-specs-dev:~>hg commit -m "Add Kmix support, needs testing."
[edward@SXCE-Workstation]:/AuroraUX/KDE4/KDE4-Testing/kde4-specs-dev:~>hg head
changeset: 203:cbbcb0228bf2
tag: tip
user: evocallaghan
date: Tue Nov 18 16:04:20 2008 +1100
summary: Add Kmix support, needs testing.

[edward@SXCE-Workstation]:/AuroraUX/KDE4/KDE4-Testing/kde4-specs-dev:~>uname -sv
SunOS snv_99

~

Monday, November 10, 2008

Learn Ada, not C++.

Its common these days for students to learn C++ , and many apps are indeed written in C++ as a side effect of the above endless circle.

However, The truth is C++ is not all that great really.

**But why Ada..**

Over the next few blogs I am going to just throw(hehe) out a few examples and you can see for yourself.

The important thing here is to learn both before making calls on what is better for what. Clearly everything has its place. Although its good to know a little more then just past your nose ;)

Here goes...

Exception handling;

As you know exception handling consists of three components, the
exception (derr), raising the exception and handling the exception.
However, In C++ there is no exception type. When you raise an
exception you pass out any sort of type while selecting the exception
on its type. In Ada, there is a 'psuedo-type' for exceptions.

So here is some example code:

In C++

try {
 my_func();
} catch (declaration) {
 clean_up();
}

In Ada

begin
 my_func();
exception
 when ident => clean_up();
 when others => clean_up();
end;

OK, now here is a example where we call a function which we know may
raise a particular exception. Although it _may_ raise one that we
don't know about so we *must* pass everything else back up to whoever
called the function.

try {
 func_call();
} catch (const char* string_exception) {
 if(!strcmp(string_exception, "what_we_are_look_for")) {
 handle_it();
} else {
 throw;
 }
} catch (...) {
 throw;
}

OK, now in Ada:

begin
 func_call();
exception
 when what_we_are_look_for => handle_it;
 when others => raise;
end;

Yes it even looks better !

This shows how much safer the Ada version is, we know exactly what we
are waiting for and can immediately process it. In the C++ case, all we
know is that some kind of exception occured of type 'const char*' had
been raised, we must then check it still further before we can handle

it !

I will try to keep these short, so that is it for now.

Regards,

Edward O'Callaghan.

Friday, October 24, 2008

VirtualBox 2.0.4 is out !

Nothing really very interesting.. Still no USB host support for Solaris :(
When is this going to be fixed Sun ?

http://www.virtualbox.org/wiki/Changelog
http://www.virtualbox.org/wiki/Downloads

~

Sunday, October 19, 2008

Brand new USB pen.

So while I was shopping for caffeine supplements in the *super* market I saw a 2GB USB pen for 5$AU. As it had "Linux support" on the front over I though I would buy it out of principle and the fact that I need some flash storage.

Here is what I did when I plugged it in:

Intel(r) Pentium(r) Dual CPU E2180 @ 2.00GHz
[edward@SXCE-Workstation]:/export/home/edward:~>/usr/bin/rmformat
Looking for devices...
1. Logical Node: /dev/rdsk/c0t1d0p0
Physical Node: /pci@0,0/pci-ide@1f,2/ide@0/sd@1,0
Connected Device: HL-DT-ST DVDRAM GSA-H62N CL00
Device Type: CD Reader
Bus: IDE
Size:
Label:
Access permissions:
2. Logical Node: /dev/rdsk/c2t0d0p0
Physical Node: /pci@0,0/pci1458,5006@1d,7/storage@6/disk@0,0
Connected Device: Verbatim Store'n'Go Mini 1.30
Device Type: Removable
Bus: USB
Size: 1.9 GB
Label:
Access permissions: Medium is not write protected.

[edward@SXCE-Workstation]:/export/home/edward:~>mount | tail -n 1
/media/STORE'N'GO on /dev/dsk/c2t0d0p0 read/write/nosetuid/nodevices/hidden/nofoldcase/clamptime/noatime/timezone=-36000/dev=6c0090 on Sun Oct 19 11:22:17 2008

[edward@SXCE-Workstation]:/export/home/edward:~>/usr/bin/pfexec umount /dev/dsk/c2t0d0p0

[edward@SXCE-Workstation]:/export/home/edward:~>pfexec zpool create MYDATA c2t0d0

[edward@SXCE-Workstation]:/export/home/edward:~>zpool status
pool: MYDATA
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
MYDATA ONLINE 0 0 0
c2t0d0 ONLINE 0 0 0

errors: No known data errors

pool: rpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c0d0s0 ONLINE 0 0 0

errors: No known data errors

[edward@SXCE-Workstation]:/export/home/edward:~>zfs list | grep -i MYDATA
MYDATA 69K 1.83G 18K /MYDATA

I can only conclude one thing from this.
Solaris needs to support auto mounting of usb pens that are formated with the ZFS FS.

~

Friday, October 17, 2008

Scons for Solaris - lol, no really..

Due to popular demand, here is a spec file to build Scons for SXCE and Solaris 10.
OpenSolaris is useless for building anything past HTML thus I don't care if it does not work on OpenSolaris.

Thanks for everyones feedback on my last post.
The following can be build as follows; N.B. you will need CBE installed.

First save the below file in a file called EVOscons.spec
Then follows this;

Intel(r) Pentium(r) Dual CPU E2180 @ 2.00GHz
[edward@SXCE-Workstation]:/export/home/edward:~>/opt/dtbld/bin/env.sh
Desktop CBE version 1.7.0-rc1 built on 2008-10-07 by edward@SXCE-Workstation
Unsetting ORBIT_SOCKETDIR
Unsetting DTSOURCEPROFILE
Unsetting SDT_NO_TOOLTALK
Unsetting GTK_RC_FILES
Unsetting WINDOWID
Unsetting DTHELPSEARCHPATH
Unsetting USER
Unsetting DTDEVROOT
Unsetting OPENWINHOME
Unsetting DTXSERVERLOCATION
Unsetting XMBINDDIR
Unsetting GNOME_KEYRING_SOCKET
Unsetting SESSION_SVR
Unsetting HELPPATH
Unsetting START_SPECKEYSD
Unsetting LANG
Unsetting GNOME_KEYRING_PID
Unsetting DTAPPSEARCHPATH
Unsetting SDT_NO_DTDBCACHE
Unsetting XFILESEARCHPATH
Unsetting VTE_CJK_WIDTH
Unsetting SESSIONTYPE
Unsetting DTSCREENSAVERLIST
Unsetting GNOME_DESKTOP_SESSION_ID
Unsetting G_FILENAME_ENCODING
Unsetting AB_CARDCATALOG
Unsetting DTDATABASESEARCHPATH
Unsetting XMICONSEARCHPATH
Unsetting DTUSERSESSION
Unsetting XMICONBMSEARCHPATH
Unsetting G_BROKEN_FILENAMES
Unsetting dtstart_sessionlogfile
Unsetting COLORTERM
Using CC=/usr/bin/cc
Using CXX=/usr/bin/CC
Setting PATH=/opt/dtbld/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/bin:/usr/sfw/bin
Setting CONFIG_SHELL=/bin/bash
Setting MAKESHELL=/bin/bash
Setting MAKE=/opt/dtbld/bin/make
Setting M4=/opt/dtbld/bin/m4
Starting subshell /bin/ksh93 -p
$pkgtool -v --pkgformat=ds build-only EVOscons.spec


------------------------ Start of EVOscons.spec --------------------------------
#
# spec file for package EVOscons.spec
#
# includes module(s): SCons
#
%include Solaris.inc

%define src_name scons
%define src_url http://waix.dl.sourceforge.net/sourceforge

Name: EVOCscons
Summary: Substitute for the classic Make utility.
Version: 1.0.1
Release: 1
Source: %{src_url}/%{src_name}/%{src_name}-%{version}.tar.gz
SUNW_BaseDir: %{_basedir}
Vendor: Refer URL
URL: http://ultravioletos.blogspot.com/
Packager: EdwardOCallaghan
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: SUNWPython
BuildRequires: SUNWPython-devel

%include default-depend.inc

%prep
%ifarch sparc
echo "Sorry no sparc version yet! - Need testing.."
exit 1
%endif

%setup -q -n scons-%version

%build
# python bootstrap.py build/scons
python setup.py build --build-base=$RPM_BUILD_ROOT%{_prefix}

%install
rm -rf $RPM_BUILD_ROOT
python setup.py install --prefix=$RPM_BUILD_ROOT%{_prefix}
mkdir $RPM_BUILD_ROOT%{_datadir}
mv $RPM_BUILD_ROOT%{_prefix}/man $RPM_BUILD_ROOT%{_datadir}

%{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr (-, root, bin)
%dir %attr (0755, root, bin) %{_bindir}
%{_bindir}/*
%dir %attr (0755, root, bin) %{_libdir}
%{_libdir}/scons-*
%dir %attr (0755, root, sys) %{_datadir}
%dir %attr(0755, root, bin) %{_mandir}
%dir %attr(0755, root, bin) %{_mandir}/man1
%{_mandir}/man*/*

%changelog
* Fri Sep 10 2008 - edwardoc _@_ blastwave.org
- Initial version

------------------------ End of EVOscons.spec --------------------------------

Thanks,
Edward.

Monday, October 13, 2008

How to *not* go mad.

echo 'set bell-style none' > ~/.inputrc
usermod myuser -s /bin/ksh93

[edward@SXCE-Workstation]:/export/home/edward:~>cat .kshrc
/usr/sbin/psrinfo -vp | sed 's/[^t]//' | tail -1
set -o ignoreeof
stty susp '^z'
export PS1=$'\E[0m['$'\E[1;32m'`logname`$'\E[0m'@$'\E[1;36m'`hostname`$'\E[0m]':$'\E[1;34m''$PWD'$'\E[0m:~>' #Custom prompt settings
export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:/usr/sbin:/usr/X/bin:/usr/X11/bin:/usr/ccs/bin:/opt/SUNWspro/bin:/usr/sfw/bin:/usr/gnu/bin:/opt/scons/bin/

# If there is no VISUAL or EDITOR to deduce the desired edit
# mode from, assume vi(C)-style command line editing.
if [ -z "$VISUAL" -a -z "$EDITOR" ]; then
set -o vi
fi

Thursday, October 9, 2008

Broadcom NetLink BCM5906M Fast Ethernet Support in snv_100 !

Broadcom NetLink BCM5906M Fast Ethernet Support in snv_100 !
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6603710

Looks like snv_100 is going to be a massive release !