Ramblings of a Deranged Mind

pageicon Wednesday Jan 07, 2009

To C or not to C? (part 3)

So I've finally managed to get my C compiler working. (yay, the crowd goes wild!)

Needless to say my opinion is that this was harder than it needed to be for an operating system that is aimed at the open source developer community, especially if the intent was to lure developers over to OpenSolaris, encourage and foster the development of applications on OpenSolaris, and to grow the OpenSolaris community.

Nevertheless, I am here and one of the suggestions from readers of my blog is to document the process that I went through to get things going so that others may benefit from it, so here goes.

After installing OpenSolaris, you will need a few more packages to enable you to write C and C++ applications. The commands that you need are listed below, any mistakes, let me know.

$ su - root

# pkg set-authority -O http://blastwave.network.com:10000/ blastwave
# pkg list -a

At this point you should see a long list of packages scrolling on your screen. Packages beginning with IPS are from the blastwave repository and those beginning with SUNW are from the OpenSolaris repository. The reason for adding the blastwave repository is that there are some packages that aren't available yet on the OpenSolaris repository.

# pkg install SUNWhea SUNWarc IPSgcc3

The line above installs the C header files and the standard libraries in /usr/include that all compilers need, whether you are using gcc or Sun Studio. These files are not included with the compilers so you have to install them separately.

The choice of compilers are either IPSgcc3 or IPSgcc4core, which you choose depends on the compatibility of your source code and which features you prefer.

# export PATH=/opt/csw/bin:/opt/csw/gcc3/bin:/usr/gnu:$PATH

The final step is to update the PATH variable with the new locations, and away we go! I hope this has been useful for some of you.

Comments?

pageicon Monday Dec 29, 2008

To C or not to C? (part 2)

So here's the conclusion to my last post.

In case anyone hasn't figured it out, I'm running OpenSolaris 2008.11 and apparently our open source, developer focussed, Web 2.0 community targetted, Linux alternative operating system it doesn't include any of the C header files in /usr/include which means that it's useless for developers.

Can anyone say oops?

BTW it also seems apparent that the compiler that was used to build OpenSolaris 2008.11 is a newer version that is used internally in Sun but it not available for external download yet. I say apparently because when I downloaded the Sun Studio 12 compilers from our external website, it's dated May 2007 and I have a comment posted that informs me the "latest" version in use is dated April 2008.

Also if you read part 1 of this blog entry, the output from the Sun Studio 12 C compiler detects OpenSolaris 2008.11 as Sun OS 5.9? WTF?

Sigh! Comments?

pageicon Tuesday Dec 09, 2008

To C or not to C?

How hard can it be to download a compiler to start cutting some code?

I downloaded a copy of the Sun Studio compilers from http://developers.sun.com/sunstudio/downloads/index.jsp, installed it and tested that it was working.

$ /opt/SUNWspro/bin/cc -V
cc: Sun C 5.9 SunOS_i386 2007/05/03

Next I tried the venerable "Hello, World!" test, using the following source code which I tried to extract out of my very aged brain.

$ vi helloworld.c

#include <stdio.h>

void main() {
	printf("hello, world!");
}

Then comes the real test, the compile.

$ /opt/SUNWspro/bin/cc helloworld.c

Any guesses what happened? Has the world changed so much that C is no longer C?

Comments?

pageicon Tuesday Dec 02, 2008

This would be a funny story if it wasn't too true.

Read this and tell me how it makes you feel. :-O

http://www.gather.com/viewArticle.jsp?articleId=281474977067637

Comments?

Changing power management settings in OS X

So the other night I was sitting in bed working on my MacBook Pro sitting on the blanket on my lap. After about 20 minutes I noticed that my legs were sweating, a lot!

I picked up the MacBook Pro and it was *hot*, damn *hot*, felt like the chassis was on the verge of melting. So hit F12 and looked at iStat Pro and it showed most components at around the 50C mark, with both fans running above 2000 rpm.

My theory about what happened is that OS X waited too long before turning on the fans and now it wasn't cooling the system fast enough to lower the temperature. So doing some searching on the internet led me to an utility called Fan Control which allows me to change the minimum fan speed (I increased it to 2000 rpm from 1000 rpm) and to change the lower and upper trigger levels.

In my search for a solution to my overheating problem I discovered a way to turn off Intel SpeedStep, for those times where I need all the performance I can get without OS X trying to 2nd guess what my CPU speed should be.

To turn off Intel SpeedStep, use the following command:-

sudo pmset -a reduce 0

and change the 0 to 1 to turn it back on again.

Just checked iStat Pro again and everything is nice and cool, at least my legs are sweating. :-)

Comments?

pageicon Sunday Nov 30, 2008

Quest for the holy grail (of blogging!)

So I've been on this quest for a decent blog editor. Note I said decent, not perfect, not awesome, not great, just decent.

For a while now I've been a fan of ScribeFire but I've encountered problems, some of which I have been able to find my way around but the one that really irks me is the one where my posts don't appear on the blog. The post appears in the list of posts in ScribeFire and as far as ScribeFire is concerned, the post is on the blog *except* for the fact that it doesn't appear on the webpage.

So I've moved over to MarsEdit to see what my experience is like. First things first, it posts just fine, which already wins kudos in my book.

Setup was no easier and no more difficult than ScribeFire, but this being the first day, the full experience is still awaiting discovery. More about MarsEdit as we travel the blogging journey in the future.

If you're interested in MarsEdit, you can find a copy at:-

http://www.red-sweater.com/marsedit/

Comments?

The new Silicon Valley Parlour game? Really?

Have you seen this?

http://www.theregister.co.uk/2008/11/29/whats_going_to_happen_to_sun/

Comments?

pageicon Thursday Nov 27, 2008

OpenOffice 3.0 a threat to Microsoft Office! Read all about it!

Check out this article. :-)

http://www.smh.com.au/news/digital-life/articles/openoffice-30-a-fresh-blow-for-microsft/2008/11/24/1227491461526.html

Comments?

pageicon Monday Nov 24, 2008

Moving to http://fangzilla.blogspot.com/ - NOT !!!

Yes, I'm back. :-) Of course, this might be good or bad news depending on your perspective.

First some good news of my own. I've been able to narrow down the source of my problems and it's not Scribefire nor Firefox nor OS X nor anything on my side. The crowd goes wild!

Now the bad news. It turns out that our blogs server is as stable as a bowl of rotting jello. The XML RPC server agent (I'm assuming it's an agent.) throws spurious errors as return messages and it causes Scribefire to return all kinds of nasty error messages that freaked me out. The solution is to ignore the error messages, and keep hitting that "Publish" button until it finally gets through.

Not the most intuitive nor the most conclusive of analyses, but it suffices my needs for the time being. Now back to catching up on my blogging!

Comments?

Installing OpenSolaris 2008.11 for the Enterprise (Part 2)

So I'm sitting in the back of a training room waiting for my turn to present, so I'm taking the opportunity to update my blog. :-)

To continue from the last blog, I want to configure my server with two active network ports named geppetto and pinocchio with the following configuration:-

e1000g0 - xx.xx.xx.51/24 - geppetto
e1000g1 - xx.xx.xx.52/24 - pinocchio

Default router for this network is xx.xx.xx.200/24.

Network Automagic (NWAM) doesn't currently support two NICs, so I had to go back to the old school files-based configurations. So first, the hosts file needs to be populated with the correct values, like so:-

# vi /etc/hosts

127.0.0.1 localhost loghost
xx.xx.xx.51 geppetto
xx.xx.xx.52 pinocchio

Then off to populate the local files:-

echo geppetto > /etc/hostname.e1000g0
echo pinocchio > /etc/hostname.e1000g1
echo xx.xx.xx.200 > /etc/defaultrouter
echo geppetto > /etc/nodename
touch /etc/notrouter


Just in case you missed it, that last line is there to tell Solaris not to route between the two interfaces. Not strictly necessary but helps save some hair pulling if you need to debug a network problem later.

So, now the next step is to turn off NWAM and turn on the old-style files-based network configuration. Make sure you do this next step from the console (i.e. directly on the keyboard connected to the server, off the serial port, or off the RKVMS on the ILOM).

# svcadm disable network:nwam
# svcadm enable network:default

So now, NWAM is turned off, and your static IP files-based configuration should be active, assuming you got all the correct values entered.

Voila! My server is now running with two active network ports. Next article, installing 3rd party software packages.

pageicon Sunday Nov 23, 2008

Sun and Intel Training

So some of you might already know of this website but we've recently updated it to include our latest servers and will continue to update it as new products are announced. Check it out.

http://www.sunandinteltraining.com/

Comments?

pageicon Saturday Nov 22, 2008

Why Sun won't be acquired?

Here's yet another article espousing an opinion on Sun.

http://news.cnet.com/8301-1001_3-10105585-92.html

Comments?

pageicon Tuesday Nov 18, 2008

Installing OpenSolaris 2008.11 for the Enterprise (Part 1)

So I've just got the latest version of OpenSolaris 2008.11 build 101a RC2b (it's a long story!) and I immediately got to work installing it.

Three installs later, I think I've finally got it working in the best compromise possible. Keep in mind, I'm not saying that OpenSolaris is flawed, but there are a couple of caveats that wasn't necessary with Solaris 10.

Scenario

OK, so here's the configuration of my server:-

  • Sun Fire X4600
  • 4 x 73 GB hard disks
  • 4 x network ports (2 ports cabled)

And here's what I wanted:-

  • ZFS Boot with all 4 hard disks in one pool
  • No additional users nor packages in the global zone
  • 3 zones each with its own user list and installed packages
  • All zones to use 2nd network port
After the first install, I discovered a couple of annoyances that I managed to get around but I'd hoped I wouldn't have to.

Firstly, NWAM (Network Automagic) only supports one wired interface and one wireless interface. That is to say, I had two out of the four on-board NIC ports connected to the switch, NWAM plumbed all four ports but only activated one. The other three had no IP addresses assigned.

Secondly, I can't add additional hard disks to the root pool (yet!) so I had to create another pool to store all my data.

Thirdly, because I wanted to keep a "clean" global zone, I wanted to install all my software packages in local zones, but local zones in OpenSolaris 2008.11 does not have the pkgadd command. Why do I need pkgadd instead of pkg? Because not all packages are available yet via pkg and I wanted to use blastwave which requires the pkgadd command. Sigh! (Note to self: make a list of packages that aren't available via pkg and port them in my copious spare time.)

Anyway I made some compromises to my desired configuration, reinstalled and reconfigured things, and I've finally got a machine with both ports running and the software packages running (somewhat) like how I wanted them.

Details to be provided in the next blog.

Comments? (c) samktan@sun.com



pageicon Wednesday Sep 03, 2008

Moving to http://fangzilla.blogspot.com/

So, I give up. I've been trying to get ScribeFire, my preferred blog client to connect to my blog at blogs.sun.com/ramblings but I can't get past the authentication. I know the password is correct because I use it to login via the webpage, but ScribeFire (or Apache Roller) chokes on the authentication. This is not the first time this has happened, everytime there is some upgrade or change to the Apache Roller backend that powers blogs.sun.com, I have to go through a whole lot more pain than I think I should have to to get ScribeFire to connect again. So no more, I'm moving to fangzilla.blogspot.com and hopefully this will work better, otherwise I'll have to investigate some other options. :-(
pageicon Wednesday Jul 09, 2008

Running Netbeans on OS X

Just got my new MacBook Pro running 10.5.4 Leopard and installed Netbeans 6.1. First thing I tried was to change was to get Netbeans to use JDK1.6 64-bit version. The way to do this is to edit this file:-

/Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/etc/netbeans.conf

and change the following line.

netbeans_jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/

This is the About dialog before the change:-

Product Version: NetBeans IDE 6.1 (Build 200804211638)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119
System: Mac OS X version 10.5.4 running on i386; MacRoman; en_US (nb)
Userdir: /Users/samktan/.netbeans/6.1

and this is the About dialog after the change:-

Product Version: NetBeans IDE 6.1 (Build 200804211638)
Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52
System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb)
Userdir: /Users/samktan/.netbeans/6.1

« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today

Feeds

Search this blog

Links

Weblog menu

Today's referrers

Today's Page Hits: 11

Gamertag

WebMap

ip-location

AdSense

Kiva Microloans