Wednesday, September 19, 2007

NWAM and zones

Of course, NWAM wont help me at all with zones on a laptop, or will it? If my wired interface is not plumbed, I cant tie a zone to physical bge0 (my network card on my laptop). Before NWAM (network/physical:nwam) I had found a way to assign a secondary IP to bge0 and that worked to some extent. Basically, you would define an addif to /etc/hostname.bge0 and bge0:1 would come up, with bge0 plumbed or not, and the zones would be on that same network.

Let's try. I unplug the laptop from the network and reboot, so that bge0 is nowhere to be seen. 172.16.0.0 is one of the reserved private B class (up to 172.31.0.0) that is available, with plenty of breathing room (instead of potentially dealing with multiple C classes). Adding to /etc/hosts


172.16.0.2 globalzone
172.16.0.3 zone1
172.16.0.4 zone2 etc.


and adding to /etc/hostname.bge0


addif globalzone


Reboot, and... it didn't work. Hmmm. Maybe the standard way to assign IPs and NWAM can coexist.


# svcs | grep network
[...]

This shows many services, but two that are dealing with physical.


# svcs | grep physical

online 12:46:34 svc:/network/physical:nwam
disabled 12:46:37 svc:/network/physical:default

# svcadm enable network/physical:default

# svcs | grep physical
online 12:46:34 svc:/network/physical:nwam
online 14:48:46 svc:/network/physical:default

# ifconfig -a

bge0:1: flags=201000843 mtu 1500 index 2
inet 172.16.0.2 netmask ffff0000 broadcast 172.16.255.255



We are up, yay! We can now proceed at the installation of zones on a laptop without worry about network access (very useful for demos on the road).

In the next blogs I'll show why zones are so cool for a desktop or laptop (it's not just for servers, you know). I'll also show how you can gain (real) network access from a zone.

NWAM

Waiting for the newest Developer Edition, I'm running a relatively recent Solaris Express, B66 (selected the Developer Edition option at boot time). Coming from B57 or so, it's a big boost for laptops. Why is that? NWAM. No, not a new WHAM produced by Maurice Starr, but simply NetWork Auto Magic, an opensolaris project.

Imagine the following. You install B66, networked, with full intent to unconfig the network card and install something like inetmenu, wireless network drivers, write some scripts etc so you can switch between at home wired, at home wireless, at work wired, at work wireless, on the road wired, on the road wireless etc.

Then, you finally login (forgetting to plug in your wired network) and are greeted by a dialog showing you all the various wireless access points and asking you to choose which one you want to connect to. Whoa! This is a cold install and everything was detected, and now this dialog is telling me that I dont need inetmenu and all those scripts to attempt to connect to a network?

iwi0 shows up under ifconfig. I decide to instead go with wired, plug the cable and bge0 is brought up, detects DHCP, gets a new IP and instantly i'm on the wired network.

Pretty cool! Wired or wireless, this pretty much "just works (tm)". Couldn't have been an easier experience.

See:
http://dar-k.blogspot.com/2007/07/solaris-network-auto-magic-nwam-project.html

Thursday, September 6, 2007

Quick!

From time to time, the marketing team at Sun change their graphics on the Homepage. When the image with the sunflowers appeared (http://fr.sun.com/sunnews/feature/2007/070821/images/b1_geo_eco.jpg), I noticed that the time to load was long. And every time. But I had other things to take care of.

Finally, this morning I sent a message to the Webmaster, mentioning that the size of the image is too large.

The same image by regional sites:

USA (nla) ~50KB-60KB
Canada (English) 49KB
Canada (French) 51KB
Spain 40KB
Latin America 49KB
France 250KB !


I did not expect anything, so imagine my surprise when a short time later, I receive an email which tells me that the issue is transmitted to the technical team. Furthermore, less than 10 minutes later it was corrected (60KB now)!

Now, why so much difference between the different sites? More than likely, each one uses a different software, a different ratio etc.

How can you prepare an image for the Web with Solaris?

With Imagemagick, included with Solaris (/usr/sfw/bin):
convert b1_geo_eco_master.png -quality 50% b1_crushed.jpg

50% is usually very good for the Web, but if not, you can use -quality 60% or more (the size goes up with the quality).

Another option, with Imagemagick found at Sunfreeware (pkgadd -d imagemagick-6.3.0-sol10-x86-local) or Blastwave (pkg-get -i imagemagick):
convert b1_geo_eco_master.png -strip -quality 50% b1_crushed.jpg

The -strip option is new (not found in Imagemagick 5.x) and remove all profiles and meta-data that the image may have due to programs like Gimp or Photoshop and color profiles that digital cameras tag to images.