Ramblings of a Deranged Mind
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?
Posted at 12:40AM Jan 07, 2009 by samktan in IT | Comments[0]
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?
Posted at 10:11AM Dec 29, 2008 by samktan in IT | Comments[8]
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?
Posted at 11:04AM Dec 09, 2008 by samktan in IT | Comments[2]
This would be a funny story if it wasn't too true.
Read this and tell me how it makes you feel. :-Ohttp://www.gather.com/viewArticle.jsp?articleId=281474977067637
Comments?
Posted at 10:56AM Dec 02, 2008 by samktan in IT | Comments[0]
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?
Posted at 10:53AM Dec 02, 2008 by samktan in IT | Comments[0]
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?
Posted at 03:31PM Nov 30, 2008 by samktan in IT | Comments[0]
OpenOffice 3.0 a threat to Microsoft Office! Read all about it!
Check out this article. :-)Comments?
Posted at 09:57AM Nov 27, 2008 by samktan in IT | Comments[0]
Leopard & Samba & Plaintext Password
So, this one is so weird that I *have* to blog about it.A number of my colleagues have upgrades their MacBooks to Leopard and then discovered that they can no longer mount their home directories via our corporate Samba systems. Now, the first thing I should mention is that our Samba servers use plaintext passwords (the reason for this is too long to explain here) so the first step is to enable plaintext password support in Leopard.
To do this, you create a /etc/nsmb.conf file using the following command via Terminal:-
sudo vi /etc/nsmb.conf
and you enter the following two lines:-
[default] minauth=none
Save the file and reboot your machine. When you get back to the Finder, under the "Go" menu select "Connect to Server", and enter the server address URL, usually in the format
smb://<servername>/<loginID>
You should then get a prompt asking for a name and password.
Here's the magic part.
If you have a password with a percent symbol ('%') the login will fail. What you need to do is to change your password so that it doesn't have the '%' symbol and it should all work.
WHY???
My suspicion is that Leopard is constructing a mount URL using the information provided from the login dialog box. The full format of the URL is:
smb://<userID>:<password>@<servername>/<sharename
Since this is a URL, Leopard is parsing the whole string looking for escape characters which start with (you guessed it!) a percent symbol. The format of the escape sequence is %hh where hh is a two digit hexademical value. For example, a space character is ASCII 32 decimal or 20 hexadecimal, so the escape sequence for a space would be %20.
If your password has a percent symbol, the next two characters are interpreted as a hexadecimal value. If it happens to be a valid hex value, the all three characters (the % and the next two) are replaced with one character, which changes the password and the login will fail.
If the two characters are not valid hex values, then the nameauth daemon will crash with a "Bad Number" error (you can see this in the Console) and the mount dialog will spin forever.
So far, I've only been able to prove this with one machine, but I'd be interested to hear if anyone else has similar experiences.
Why this breaks in Leopard but works perfectly well in Tiger is beyond me!
Posted at 12:05AM Jan 30, 2008 by samktan in IT | Comments[4]
Sun Fire x64 servers plus Windows Server 2008 (with Hyper-V)
If you are interested in testing out our Sun Fire x64 servers with Windows Server 2008, here are a couple of links that will be useful for you.Download a trial copy of Windows Server 2008 from http://www.microsoft.com/ws08eval
Read the Sun Blueprint at http://www.sun.com/blueprints/1107/820-3781.html
Enjoy! (I hope.)
Powered by ScribeFire.
Posted at 11:09AM Dec 16, 2007 by samktan in IT | Comments[0]
09-F9-11-02-9D-74-E3-5B-D8-41-56-C5-63-56-88-C0
So why do these 16 hexadecimal numbers cause so much fear in the hearts of the MPAA? Read all about it at http://news.com.com/8301-10784_3-9714898-7.html and http://www.theinquirer.net/default.aspx?article=39330 and www.digg.com.Powered by ScribeFire.
Posted at 09:02PM May 02, 2007 by samktan in IT | Comments[0]
Apple MacBook and MacBookPro battery recall
Well, this the season it seems. Apple have announced yet another battery recall, this time for MacBook and MacBookPro systems (I refuse to call them laptop when I can't operate them on my laptop without severe burns!) sold between February 2006 and April 2007. The recall is applicable even if your system is out of warranty. Read all about it at http://www.apple.com/support/macbook_macbookpro/batteryupdate/.Posted at 02:02PM Apr 29, 2007 by samktan in IT | Comments[2]
Proxy Servers
One of the downsides of proxy servers is that most corporate networks have them and most home users don't. Having to remember to switch the proxy servers on and off is difficult because the setting is usually buried several layers deep in the Preferences of the browser.Two options exist for Firefox/Mozilla/Seamonkey users. The first is to use PrefBar from http://prefbar.mozdev.org/ which puts a preferences bar on the toolbar that you can use to turn your proxy settings on and off with a single click.
After installing PrefBar and restarting your browser, click on Customise, then click on "Proxies" in the left-column and click "Add Item", then click "OK". You'll now have a check box on the PrefBar toolbar that you can use to turn your proxy setting on or off.
The second option and this probably works for IE as well but I haven't tested it, is to use a PAC file. A PAC file is nothing more than a simple JavaScript file with a single function called "FindProxyForURL" that returns a proxy server name for a given URL.
The PAC file that I use is given below, and basically it says if the host is resolvable, i.e. the browser can get an IP address for the host from the local DNS server, then connect directly without a proxy, otherwise use the specified proxy server.
There is a line commented out that checks if the domain of the host ends with ".sun.com" and if it does, go direct, but I found that this breaks sites outside SWAN like www.sun.com and sunsolve.sun.com so I took it out. You can certainly put it back in for specific domains that you know are reacheable directly.
To use this file, save the following lines in a file on your local drive, e.g. proxy.pac, then in your browser, under "Network Settings", in "Automatic proxy configuration URL", put in the path to your local proxy.pac file, e.g. file:///Users/samktan/Documents/proxy.pac or file:///c:/Documents and Settings/samktan/My Documents/proxy.pac. Yes, that is three (3) forward slashes after the file: protocol specifier.
function FindProxyForURL(url, host)
{
if (isPlainHostName(host) ||
// dnsDomainIs(host, ".sun.com") ||
isResolvable(host))
return "DIRECT";
else
return "PROXY webcache.sfbay.sun.com:8080; DIRECT";
}
Now no matter where I go, I don't have to worry about checking my proxy settings, everything just works, as it should be.
Powered by ScribeFire.
Posted at 10:22AM Apr 27, 2007 by samktan in IT | Comments[4]
Gears of War
Possibly the best game on any console, Gears of War is the reason to get an Xbox 360 and a HD plasma or LCD TV. Take a look at this trailer and judge for yourself.
Due to the size of the file, you need a BitTorrent client to download it. Check out the list at http://en.wikipedia.org/wiki/BitTorrent_Client and pick one that you like. Personally I like Azureus because of the many options available but some people find that daunting.
Posted at 02:51PM Apr 25, 2007 by samktan in IT | Comments[0]
Managing Bookmarks (2)
After a few weeks of testing, I've settled on using Google Browser Sync http://www.google.com/tools/firefox/browsersync/ for keeping my bookmarks synchronized between multiple browsers on multiple machines.I did try a few others including the Google Toolbar and del.icio.us, with varying degrees of success. Google Toolbar was overkill, it had many more features than I needed, although it was the only one that ran on both IE and Mozilla. del.icio.us worked erratically, I don't know if it was a server or client problem from within SWAN, Sun's internal corporate network. I kept getting error 999, saying that I had tried to connect to the server too many times and consequently my connection was being rejected. I suspect that the Yahoo! servers track by IP address and since everyone on SWAN is using proxy servers, it might look like a lot of connections coming from one IP address.
Google Browser Sync is not without it's flaws. On startup it tries to connect to the server but since I use my computer at home and at work every day, the first start is always going to fail until I can change the proxy settings. I'm experimenting on using a proxy PAC file but I've not figured out how to specify one in Firefox, the input field seems to expect a HTTP URL.
More when I get some time to test it out.
Posted at 08:45AM Apr 22, 2007 by samktan in IT | Comments[5]
Another windows exploit found !
This shouldn't surprise many people but another windows exploit has been found, one the exposes private data if you're not careful. Read all about it at http://www.caughq.org/advisories/CAU-2007-0001.txt. :-DPowered by ScribeFire.
Posted at 03:31PM Apr 17, 2007 by samktan in IT | Comments[0]
Wednesday Jan 07, 2009