0

A linux guy's experience with Windows 7

Windows, Linux
Anyone who knows me well knows that I am typically somewhat of an anti-Windows guy. I absolutely love linux, and get very frustrated by Windows in general. The only thing that I really dislike about linux is the lack of application support by a number of companies (ahem…. Adobe).  Before going to the Adobe MAX conference, I decided I should swap out OSes on my personal laptop so that I could run all the stuff I would need for labs without constantly cursing about being stuck in a VM, limited functionality, etc.  A friend had just bought a package of Windows 7 licenses and sold me one for 5 bucks, which I considered to be a pretty reasonable risk.  I opted for installing Windows 7 on my laptop.

Given that background and my previous feelings about Windows, I have to say that it is a pretty dang nice operating system.  It is by far the best offering to date by MS in my opinion.  There are a few things that they still haven't managed to get right (native file copy still makes me want to stick forks in my eyes), but by and large they have done a great job with Windows 7.  Other than having to track down a few drivers for my laptop, the installation was painless – if not fast.  This is still an area that linux, and especially Ubuntu, wins hands down though.  Apps run extremely stable, and with the addition of a new concept of "Libraries", directories that I need access to regularly are right at hand instead of having to tree down through big hierarchies.  I am also not finding what I expected would be an immediate degradation of performance after installing all the servers and development tools that I use on a daily basis.  Over all, so far so good.

A few things that I think are a *must* for the way that I use it.

  • I found a "sudo" program called Start++ that allows me to open applications from the terminal or start menu as Administrator by typing sudo notepad [or some other program].  It will prompt you for the UAC stuff and the program will open as administrator.  I use this regularly for editing system files like hosts, apache configs, and use it to open a terminal to fire off j2ee servers. 

  • Install Teracopy which is a replacement for the Windows copy program.  While certainly not as fast/efficient as a linux terminal, it greatly increases file copy speed over the native windows GUI file copy.  No more "preparing to copy" waits while your system bogs down.
Things that annoy me
  • I still wish I could have a real terminal and be able to use VI in sudo, but that is just something I will have to get over I guess.

  • I hate that I now have to be so careful with regard to viruses and spyware.  I love the protection that linux offers in that area, and having to go out of my to stay protected seems a bit cumbersome.

  • I miss being able to easily try out software with the ease of the synaptic package manager.  It seems foreign now to have to download an exe run an installer and have settings being obscurely written all over a "black box" registry.

  • I miss built-in networking tools.  Even simply things like being able to run "whois" from the teminal.

  • My drive is getting fragmented far faster than with linux, and I find that I am running the defrag tool fairly often.  Linux just manages this under the covers and I never have to worry about it.
All said, after using it for about the past 4 weeks, I can honestly say that I am surprised (and perhaps even a bit disappointed) that I like it as much as I do.  I planned on just running it while I was at the Adobe MAX conference and going back to linux when I got home, but it looks like I will be keeping it for a while longer.


0

Strange behavior with ColdFusion ExpandPath() when using Symbolic Links

ColdFusion, Linux

I was playing around with the Quicksilver framework last night, and for some reason it was unable to find and instantiate my CFCs properly.  After digging into the framework a bit and determining where it was breaking, I discovered something strange about the way that ColdFusion interprets ExpandPath() when it exists in a directory that is defined as a symbolic link.  I am not sure if the same behavior exists on Macs, but I would imagine it does.  If someone could confirm that to be the case, I would be interested.

For starters, I usually have a 'www' directory in my user home directory. This way when I pass my user profile around from distro to distro, my development work is included in my home directory.  For ease of configuration I typically have a symbolic link in my OS that points /www/ ---> /home/dshuck/www/.  Then when I am creating a new web project called 'davescode', I would put it in /home/dshuck/www/davescode, but my Apache config would usually point to /www/davescode.  For the past several years, this approach has worked will for me.  That is until last night when experimenting with Quicksilver. 

When Quicksilver loads, it creates a list of service CFCs in the the application in such a way that if I had Foo.cfc in a directory 'com' in the root of my davescode site, it would look like /home/dshuck/www/davescode/com/Foo.cfc.  When I initted the application, I was getting an error that  it couldn't find the CFC home/dshuckcom/Foo.cfc.  Essentially what was happening is that it was getting the full path of the CFC and replacing the path to the root of the site with "".  In a perfect world the value of the path after the string replace would have looked like com/Foo.cfc.  Unfortunately that was not so.  Here's why!

I put a test file called path.cfm in the root of my davescode site that considted of the following:

<cfoutput>#ExpandPath("./")#</cfoutput>
<br/>
<cfoutput>#ExpandPath("/")#</cfoutput>


The result was very surprising!
/home/dshuck/www/davescode/
/www/davescode/


For some reason when you do ExpandPath("/") it looks at the symbolic link path, but when you do ExpandPath("./"), it looks at the true file path.  For the life of me, I can't think of why that would be.  If anyone has an explanation, I would be all ears!

Photos from the Dallas Adobe User Group Tour event

InstantSpot, Tips and Tricks

We had a great time Friday night with around 170 in attendance!  Terry did a great job and everyone left hungry for the new releases that he teased.  Here are some pics from the night.

 

Solving java.lang.SecurityException: Seed must be between 20 and 64 bytes. Only 8 bytes supplied.

ColdFusion, Java

Recently I have began working with JMS and ColdFusion, in which we are building a system that subscribes to an enterprise JMS server and picks up messages relevant to its needs and acts on them. I had my proof of concept working with the open source Apache ActiveMQ server and was very pleased with the results.  However, in our production environment, the powers that be decided to use the very non-free SonicMQ server.

As I tried to convert the event gateway over to the SonicMQ server, it failed on initialization with the following exception: 

javax.naming.NamingException [Root exception is java.lang.SecurityException: Seed must be between 20 and 64 bytes. Only 8 bytes supplied.]
	at com.sonicsw.jndi.mfcontext.MFConnectionManager.connect(Unknown Source)
	at com.sonicsw.jndi.mfcontext.MFConnectionManager.<init>(Unknown Source)
	at com.sonicsw.jndi.mfcontext.MFConnectionManager.getManager(Unknown Source)
	at com.sonicsw.jndi.mfcontext.MFContext.<init>(Unknown Source)
	at com.sonicsw.jndi.mfcontext.MFContextFactory.getInitialContext(Unknown Source)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
	at javax.naming.InitialContext.init(InitialContext.java:223)
	at javax.naming.InitialContext.<init>(InitialContext.java:197)
	at examples.JMS.JMSConsumer.start(Unknown Source)
	at examples.JMS.JMSGateway.startGateway(Unknown Source)
	at coldfusion.eventgateway.GenericGateway.start(GenericGateway.java:118)
	at coldfusion.eventgateway.EventServiceImpl$GatewayStarter.run(EventServiceImpl.java:1428)

In my research on this problem, I found several people reporting similar errors, each on CF8, and each talking to 3rd party tools.  Eventually I found the solution through an email discussion between one of the developers in my company and an Adobe developer.  Apparently in CF8, they added FIPS security, which disables the Sun JCE (encryption libraries).  To solve this error, you need to add the following line to your java.args in your jvm.config file in JRun.

-Dcoldfusion.disablejsafe=true

Now restart your server and try again!

Making your application flow obvious in Mach-II with event-mappings

ColdFusion

I recently joined a company that makes use of Mach-II in a few applications.  Some of them were created as the developers were learning the framework and employ some obvious un-best practices.   The team is made up of people from various skill levels, but I have noticed that about half of the team just absolutely cringes when they hear "Mach-II".  They talk about how difficult it is to troubleshoot and how it is next to impossible to follow application flow.   I was very surprised to hear that response, because I think one of the big benefits of using Mach-II is that I can look at a config XML and read the story of my application.   I will touch on this in more detail in a bit.

So the other day I had my first experience digging in deeply into one of they apps to solve a problem... and it took me forever to figure out where the hell anything was.  I started on the default home event, which only had a filter that announced other events, that had listeners that announced other events and so on until I was *EIGHT* events deep.  In each one of these announcements, I had to go find the listener/filter, look into the methods, and search for where I might be going next.  It suddenly became overtly clear why the other developers hate Mach-II.

Now, back to why my config files tell a story... first of all, I can't think of many cases where an app needs to announce 8 events before it gets to a destination.  However, troubleshooting this would have been so much simpler if only the developer had been clear in the XML using event-mappings.  As a rule, if I ever alter the flow of my application from within a filter/listener, I always have an event-mapping that shows this in my config.  That way I can quickly skim the XML and know what possible exits I have.  In most cases, it should be pretty obvious where you are going based on that alone,  and you don't even need to open the CFCs to figure it out.  Although I certainly do use event-mapping for aliases, more often than not they will look like this:

<event-mapping event="SomeEvent" mapping="SomeEvent" />

It serves no actual functinal purpose other acting as a means to document the flow. Does anyone else use the practice?  How do you keep the application flow obvious in your configuration files? 

I was talking to Aaron Lynch about this (who uses the same practice) and from that conversation I decided I would open this up for conversation.  What I would love to see is some type of optional setting in Mach-II that would enforce this so that all developer on a team had to use this methodology.   Maybe something along the lines where when an event is announced from within a CFC and it hasn't been mapped in the XML it would barf up an exception? 

I have no doubt that some people will hate this idea.  However, in the bigger picture I would like to see less people hating frameworks, and if we can make things more clear from a troubleshooting/maintanence perspective, I think that there would be less FUD!

Any thoughts on this?

 

How to set JAVA_HOME environment variable in Ubuntu

Ubuntu, Tips and Tricks

I am actually creating this blog entry as a bookmark for myself, but since I know that I never remember how to do it, others might benefit as well!

One way that you can set your JAVA_HOME variable and add to your PATH, is be doing the folowing.  As 'sudo' open up /etc/bash.bashrc and add the following to the end of the file.  NOTE: Set the java path to whatever the actual path is on your environment if it does not match /usr/lib/jvm/java

JAVA_HOME=/usr/lib/jvm/java
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

When you reboot, try running the following:

$ echo $JAVA_HOME
/usr/lib/jvm/java
 echo $PATH
[probably lots of paths]:/usr/lib/jvm/java/bin

tags:
Ubuntu, JAVA_HOME

Search