various stuff Marty's Weblog

Thursday Jul 31, 2008

 I stumbled across the MacOS "say" command the other day.  With a 4 year old at home learning to spell with his "Word Whammer" on the fridge door, I got the idea to recreate the Word Whammer functionality as a perl script, so he's not limited to 3 letter words.  The only problem is that he's taken to entering garbage text to see how it pronounces it.  To verify for real words, I was hoping to find a word list file [native to MacOS] like the Solaris spell command has (/usr/dict/words).  Nothing jumped out at me (didn't look long) I figure worst case I could just get a copy of /usr/dict/words from Solaris.  Anyway, here is what I came up with.  If you've got preschool age kids, this simple script provides hours of fun and learning:

#!/usr/bin/perl
$WORD="";
print "Type \"bye\" to exit.\n";

while ( "$WORD" ne "bye" ){
    print "Enter a word: ";
    system("say \"Enter a word\"");

    $WORD=<STDIN>;
    chomp($WORD);
    $word=$WORD;
    $len=length($WORD);

    for ($i=$len ; $i >= 0 ; $i-- ){
        $W[$i]=chop($WORD);
    }
    if ("$word" eq "bye"){
        system("say \"Goodbye.\"");
        exit 0;
    } else {
        system("say \"You spelled, ${word}.\"");
        for ($i=1 ; $i <= $len ; $i++ ){
            system("say \"$W[$i]\"");
        }
        system("say \"$word\"");
    }
}

exit 0;

Monday Apr 28, 2008

I have been working on an Identity project where we are deploying to Application Server EE v8.2 on Windows Server 2003.  The issue of the passwordfile might be surfacing as a security concern.  I have never been a fan of storing the cleartext password in a file... The counter argument I always hear is that file permissions (*nix:chown or win:cacls) are sufficient to protect the password.  When doing Solaris installs, I've added a layer of pseudo-obscurity that allows the password file to sit on disk encrypted.  Here is a snippet of code from the startup script that I use.

umask 377
cd /opt/SUNWappserver/bin
crypt crypt < key.crypt > key.txt
./asadmin start-domain --user admin --passwordfile key.txt domain1
rm key.txt

If you know the arguments to the crypt command, you are able to figure out how to decrypt the file.  But then "file permissions should be sufficient", right?

So to make the security folks happy, I need to come up with something similar that will work on Windows.  Last week I played with the cipher command on win2k3, but it didn't seem to do anything useful.  Files would be marked as encrypted ("E" vs. "U") but then I could just cat, errr, I mean "type" them.

Has anyone else out there run in to this and come up with a solution that works on Windows?

Friday Feb 15, 2008

I almost sent these questions out to an internal mail list, but I get more verbose responses in the comments when I gripe about Macs in this forum, so here goes:

Gripe 1:
When connecting to a wireless network, there is a little check box that says "Remember this network".  It's checked by default, and I leave it checked.  The SSID of my network at home is not broadcast.  Apparently MacOS cannot remember a network if the SSID is not broadcast.  This is annoying.

Gripe 2:
The tab order in both Firefox and Safari skip non-text input objects.  If you have a web page (gmail login for example) that has a  login field, password field and an OK button, you should be able to click in the login text field, type your login, hit tab to go to the password field, type your password, hit tab to go to the OK button, and hit return to actually login.  This is how it works under Solaris and Windows.

What happens on a Mac is you type your login, hit tab to go to the password field, type your password, hit tab which takes you to the URL field in the Navigation toolbar (instead of the OK button), then when you hit enter it refreshes your login page, losing your login and password.

I've even tried setting the Firefox prefbar to act as if the browser were Internet Exploder, but the behavior is the same.

So those are my two most recent gripes.  Not in any order...  From my earlier post, I'm still very much annoyed by the home and end keys being different from app to app, but there appears to be no fix for that so I've had to stop using them.

Wednesday Jan 30, 2008

I have been fiddling with MySQL for a while now because of Sun's Identity Manager product and one or two web apps I've created internally.  Until the MySQL acquisition was announced, I was never aware that the pronunciation of MySQL was such a sensitive topic.

 In the early 90's I was a SysAdmin for a mid-sized group of Oracle DBA/developers.  All of the Oracle product names were SQL*this or SQL*that (pronounced "sequel")  I don't know if that was an Oracle thing or just the way that particular group pronounced it.  My guess is that it was an Oracle thing and the MySQL pronunciation sensitivity grew from an effort to help differentiate their product from Oracle.

 Apologies in advance are in order though, because I seem to have carried that pronunciation habit with me through the years.  I am working on correcting it though.  So if you hear me mispronounce it, I owe you a beer(See Note 1).

The ironic thing here is that database folks seem to be very keen on optimization.  The insistence that a char(5) word be pronounced with four syllables vs. three strikes me as odd...  Anyway,  MyS-Q-L it is!  Welcome aboard guys!

 ---

Note 1: One beer per occurrence, Must be of legal drinking age, Do not drink and drive, Do not drink and administer databases, Anheuser Busch and Miller products do not qualify as beer.

 

Thursday Dec 20, 2007

I spent the last week of November in Atlantic City with a bunch of other Identity Management folks doing a peer training event called Jamfest II.  The biggest take-away from the session was that Netbeans rocks, and I've got to get more familiar with it.

I was doing the 4 hr. drive home from Atlantic City, thinking about Netbeans and Eclipse, wondering why there is such a Holy war going on between the two IDE camps.  Then I started thinking about real Holy wars and a few interesting parallels came up.  I had them listed out but then thought, "What good will this do?  It will be just another post pointing out the evils of SWT" so I figured I'd omit the list and leave it up to the readers imagination to find their own parallels.  I ran a draft of this blog (with my parallels listed) by a colleague who convinced me to think about it some more...  He also mentioned that he had recently shown Netbeans to some Eclipse users, and they loved it.  So in the spirit of the holiday season, I decided not to perpetuate the IDE wars...

All I am saying, is give 'Beans a chance...  (NetBeans that is...)

To paraphrase Dr. Seuss,
    You do not like Netbeans.
    So you say.
    Try it! Try it!
    And you may.
    Try it and you may, I say.

Thursday Nov 15, 2007

My team has had our new MacBook Pros for a couple of weeks and I'm fairly comfortable with it now.  There are a couple of things I don't like about them though.

First, they are wider than my old laptop(s).  The laptop bag I had was not wide enough to hold this monster.  But then again, that bag was on it's last legs so it was time for a change anyway...

Second, There does not appear to be a native rdesktop client.  I go to client sites and need to access their MS servers that are running under VMWare...  Need rdesktop for that(Solaris has it!).    rdesktop.org has the source you can pull down, but you'd need a compiler.  So I think I'm going to have to fire up a Solaris or Windows VM to get access to rdesktop.  Too many hoops...

Third,  Sun rackmounted servers have a serial port for the console.  The MacBook Pro has no serial port.  There is a USB add-on you can buy, but a serial port is such a basic component that it surprises me that it's not included.

Fourth, I use the HOME and END keys alot when typing.  Depending on the application you are in those keys are different and it drives me nuts!  One application is fn+Left arrow, another is AppleKey+Left arrow.  While using Firefox to type a previous blog, I hit Apple+Left for HOME, which it turns out in Firefox is go back one page in your stack.  Lost the blog...

Fifth,  The Cisco VPN Software doesn't like my Linksys Router.  Read more here.

Sixth,  There is a built-in camera and mic on this thing.  Recording devices are not allowed in many of the places we SE's go.  I may need to carry a customer approved laptop as well.  At least I'll get a workout.

Seventh,  It is Unix, why should I have to load an X Server.  That should just be there...

Eight, eight, I forgot was eight was for...


Now I guess I should also point out some positive points of these new laptops so I don't come off as an anti-Macite.  I should also say that I was stretching to make seven gripes so I could use that line on the eighth... (who caught that?)

The previous clunkers I was issued had nowhere near the battery life of these Macs.

It is Unix, so the basic essentials are there.

The little magnetic power cable is cool, although easily dislodged.

I get to shop at Banana Republic now.

The previous laptops I had were USB 1.x, These are 2.0.

The Airport wireless is pretty easy to use.

Mac errors are interesting, I hit a web page that required some plugin that I didn't have loaded and I got a very dumbed down message saying I need to click a link to load some S/W, and it's a technical thing so I should just click  the link and not ask any questions.  Needless to say I had to figure out what the missing plugin was and go find it myself...  Would you click a link labeled It's OK, you can trust me, click here...
 

Tuesday Oct 16, 2007

My new MacBook Pro arrived yesterday.  I haven't touched MacOS since the days of System 7.x  (pre NeXTStep coming home to Apple)  Major learning curve here...  The first thing that got me was I can't right click on anything.  Right now I'm fiddling with the onboard wifi.  My home wireless network has a few layers of security, I've basicaly had to turn off security to get it to work.  Still playing...

My experiences today and yesterday remind me of when I first went off to college.  I had been happily using my trusty Apple II+ for years.  For H.S. graduation, I got a Macintosh SE, with dual floppies no less!  (no HD).  Going from whatever the word processor was, (I remember it being very similar to writing HTML in notepad) to a full blown WYSIWYG GUI was almost too much to handle.  I almost opted to bring my Apple II+ with me instead of the Mac.  I just had to sit down and use it for a while and then it clicked.  I'm sure the same will hold true for this new Mac.

Friday Oct 12, 2007

I recently had to do an Identity Suite install on a Windows Server.  Not being much of a windows guy, I ended up starting the services from the command line startup scripts, then logged out.  This kills all of your processes...  Not good.  So I ended up running the startup scripts, then just locking the screen.

The Sun products involved were: Directory Server, Web Server, Application Server, Identity Manager, and Access Manager.  Identity and Access Manager, being J2EE apps, just need their web container started.  The Web Server install does this automatically (check box on last screen of install); however, App Server and Directory Server need some additional steps to get them to run as a service.

After the fact I found the right way to do it.  Directory Server has a command that installs itself as a service:

dsadm enable-service --type WIN_SERVICE

http://docs.sun.com/app/docs/doc/819-0995/6n3cq3ano?a=view 

For My info:
There is a utility in the Resource Kit called INSTSRV that you can use to install a service.  Not having access to the resource kit, I had to dig a little deeper.  The SC command provides the same capability.  Here is what I ended up with:

sc create SunDS binpath= "c:\Sun\JES5\DSEE\ds6\bin\dsadm start c:\Sun\JES5\DSEE\var\mydirsrv" type= share start= auto displayname= "SunDS"

sc create SunAS binpath= "c:\Sun\JES5\appserver\bin\asadmin start-domain --user admin --passwordfile key domain1" type= share start= auto  depend= "SunDS" displayname= "SunAS"

Saturday Apr 07, 2007

Here is the "which" command for windows written in perl.  There is no error checking or anything fancy like that...  I cannot remember what prompted me to write this, but it's come in handy a few times.

#!perl
#
$LOOK4=shift;
#
@PATH=split(/;/,$ENV{PATH});
@PATHX=split(/;/,$ENV{PATHEXT});


foreach $path (@PATH){
    chomp($path);

    if ( -d $path ){
        foreach $px (@PATHX){
            chomp($px);
        
            if ( -f "${path}\\${LOOK4}${px}"){
                print "${path}\\${LOOK4}${px}\n";
            }
        }
    }
}

 

Friday Mar 16, 2007

script: isomnt[Read More]
script: start[Read More]
Obligatory first web log entry.[Read More]