0

A linux guy's experience with Windows 7

Windows, Technology, 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, Technology, 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!

Setting up Apache, OpenBD, Railo and ColdFusion - Part 2 - Installing Tomcat/Apache/OpenBD

ColdFusion, Linux

This is the second part in a series of posts on setting up ColdFusion, OpenBlueDragon, and Railo all on the same machine using Apache webserver to listen for all requests and direct traffic.  Part 1 can be found here

Remember, the steps below have some commands specific to Linux, and more specifically to Debian/Ubuntu, but the concepts in general should have at least some similarites across any supported platform, especially you Mac folks.

 

To start out, we need to make sure that we have the Apache webserver installed with optional "dev" package.  Additionally, later on we will need to be compiling, so let's make sure that you have the build-essential package as well

$sudo apt-get install apache2 apache2-threaded-dev build-essential
Next I installed the Sun Java 6 JDK
$sudo apt-get install sun-java6-jdk

Next you want to go download Tomcat.  I chose to use Tomcat 6, specifically v. 6.0.18, which the current release as of this posting.  Now, using a terminal cd into the directory where you saved the dowloaded file and do the following:

$ sudo cp apache-tomcat-6.0.18.tar.gz /opt/ 
$ cd /opt 
$ sudo tar xvzf apache-tomcat-6.0.18.tar.gz 
$ sudo mv apache-tomcat-6.0.18 tomcat6 
$ sudo rm apache-tomcat-6.0.18.tar.gz


Next we will need to edit the Tomcat startup script, but to do so, we need to go get a little information first.  We need to ensure that we know what the current Java home is on your machine.  There are surely easier ways of accomplishing this, but here is the series of steps I took.
~$ which java
/usr/bin/java 
$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 2009-01-30 23:00 /usr/bin/java -> /etc/alternatives/java 
$ ls -l /etc/alternatives/java[return] lrwxrwxrwx 1 root root 36 2009-01-30 23:00 /etc/alternatives/java -> /usr/lib/jvm/java-6-sun/jre/bin/java 


From that last line I can see that the default Java lives at /usr/lib/jvm/java-6-sun/ (which too is a sym link, but that's ok!). Now that we have our Java home we can edit the Tomcat startup script
$sudo gedit /opt/tomcat6/bin/catalina.sh


Paste the following lines in just after the big comment block at the top. Make sure that if your Java path looked different than mine did, you will want to adjust accordingly.
JAVA_HOME=/usr/lib/jvm/java-6-sun 
JRE_HOME=/usr/lib/jvm/java-6-sun/jre 
JAVA_OPTS="-server -Xms1024M -Xmx1024M -XX:PermSize=256m -XX:MaxPermSize=256m \
    -Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8 \
    -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl" 	


Now we want to download the Apache Tomcat connector source so that we can pass requests from Apache webserver to Tomcat. This is the one I grabbed: http://apache.org/dist/tomcat/tomcat-connectors/jk/source/ Next you will want to browse to the directory that you downloaded that file into using in the terminal. Next run:
$ tar xvzf tomcat-connectors-current-src.tar.gz 
$ cd tomcat-connectors-1.2.27-src/native 
$ ./configure --with-apxs=/usr/bin/apxs2 
$ make 
$ sudo make install


Now we will need to create a jk mod file to be included by Apache so that it loads the adapter when Apache starts. In your terminal cd to /etc/apache2/mods-available. In this directory we will create a file named jk.load.
$sudo gedit jk.load


In that file pasted the following, then save and exit:
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so  
# Where to find workers.properties 
# Update this path to match your conf directory location (put workers.properties next to httpd.conf) 
JkWorkersFile /etc/apache2/workers.properties 
# Where to put jk shared memory 
# Update this path to match your local state directory or logs directory 
JkShmFile     /var/log/apache2/mod_jk.shm 
# Where to put jk logs 
# Update this path to match your logs directory location (put mod_jk.log next to access_log) 
JkLogFile     /var/log/apache2/mod_jk.log 
# Set the jk log level [debug/error/info] 
JkLogLevel    info 
# Select the timestamp log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "


Now we want to create a symbolic link to this file in /etc/apache2/mods-enabled so that it is loaded when Apache starts.
$ cd /etc/apache2/mods-enabled 
$ sudo ln -s ../mods-available/jk.load ./jk.load 


Next we want to create a virtual host in Apache to catch the requests. We are going to create a new file in the sites-available directory.
$ cd /etc/apache2/sites-available 
$ sudo gedit localhost.bd 
In that file, paste the following, save, and exit:
<VirtualHost *>
	ServerName localhost.bd
	JKMount /* worker1
</VirtualHost> 


Now we need to create a symbolic link to that file from sites-enabled so that it is available when apache2 starts.
$ cd /etc/apache2/sites-enabled 
$ sudo ln -s ../sites-available/localhost.bd ./001-localhost.bd


Next we want to make sure that we can get to that site in a browser, so we are going to add 'localhost.bd' to our hosts file. Open up /etc/hosts, and append 'localhost.bd' (without quotes!) to the line that begins with 127.0.0.1. Now we need to define that "worker1" that we just referenced above in the VirtualHost definition. We will do that by creating a workers.properties file in our apache2 directory.
$ cd /etc/apache2 
$ sudo gedit workers.properties


Insert the following. Then save and exit:
# Define 1 real worker using ajp13 
worker.list=worker1 
# Set properties for worker1 (ajp13) 
worker.worker1.type=ajp13 
worker.worker1.host=localhost.bd 
worker.worker1.port=8009  


Next we want to create a webapp in Tomcat for Apache to send to.
sudo gedit /opt/tomcat6/conf/server.xml
In that config, we need to define the localhost.bd site, or 'webapp'. Add the following:
<Host name="localhost.bd"  appBase="webapps"
      unpackWARs="true" autoDeploy="true"
      xmlValidation="true" xmlNamespaceAware="false">	
	<Context path="" docBase="localhost.bd/" reloadable="true" privileged="true" antiResourceLocking="false" anitJARLocking="false">
	</Context>
</Host>


Now we need to create the local.bd directory under Tomcat. Note: as you get more comfortable and adventurous, you may want this to be a symbolic link to another place on your machine where your source resides, but for now we are keeping it as simple as we can. Once the directory is created, we will download the OpenBlueDragon war file and extract it.
$ sudo mkdir /opt/tomcat6/webapps/localhost.bd
$ cd /opt/tomcat6/webapps/localhost.bd 
$ sudo wget http://openbd.viviotech.net/downloader.cfm/id/64/file/openbd.war 
$ sudo jar xvf openbd.war 


And with that step, and after restarting Apache, and starting Tomcat, OpenBlueDragon will now be available.
$ sudo /etc/init.d/apache2 restart 
$ /opt/tomcat6/bin/catalina.sh start


Open up your browser and go to: http://localhost.bd/bluedragon/administrator

You should be created with your OpenBD admin page like this:

 

Next: Part 3 - Installing ColdFusion 8 and customizing the JRun connector

0

How to install KDE 4.1 on Ubuntu Hardy 8.01 and my impressions of it

Ubuntu, Linux

With yesterday's announcement of the 4.1.0 release of KDE, my willpower did not allow me to go another day without giving KDE4 another shot. For a bit of history, I have been using Gnome for several years. In the past 3 months or so I began using KDE 3.5.9 long enough that I began to enjoy it and realize that it is a nice desktop environment as well. At this point I really have no favorite between the two and like different things about both of them.

When the first releases of KDE 4 started showing up several months ago, I gave it a shot but was extremely underwhelmed. While it came with all the warnings from the community that the 4.0 release was nothing more than the introduction of a new platform which developers would expand, some of the basic pieces of it just felt wrong. I can clearly say that after spending most of an afternoon using it, running my development environment, and doing basic daily functions, 4.1 is light years beyond the first peak I had of it. I am *really* enjoying it so far and I have a feeling it will be my desktop of choice for the immediate future.

One thing that seems to not be common knowledge to some people is that you can just install it and try it out without affecting your existing desktop environments, be it KDE 3.5.x or Gnome. For example, my current installation started out as Kubuntu 8.04 Hardy Heron. Shortly after installing I added Gnome by running:

sudo apt-get install ubuntu-desktop
Then in the GDM or KDM login window, I had options for either logging in using Gnome or the default KDE. Thankfully the two coexist without bothering each other, and I can switch back and forth at will. I took the same approach today when installing KDE 4.1, planning to keep both Gnome and KDE 3.5 as fallback positions or simply to use when I am in the mood.

If this type of setup sounds like something you want to try out, do the following. First, add the following repo into your /etc/apt/sources.list file:

deb http://ppa.launchpad.net/kubuntu-members-kde4/ubuntu hardy main
After adding that you will want to update your repos by running:
sudo apt-get update
Then to install KDE 4.1 you will run the following:
sudo apt-get install kubuntu-kde4-desktop kdeplasma-addons amarok-kde4 and kontact-kde4 kate-kde4 kmail-kde4
Notice that I am also updating several applications, such as kate, amaroK, kmail, and kontact. Kdeplasma-addons also brings you some extra goodies beyond the base install. During that installation you will be prompted to choose your login manager. KDE4 brings you yet another option beyond GDM and KDM. I chose it and it is a really nice clean look. I recommend giving it a look. Once the installation completes, restart X or reboot and have fun!

tags:
Linux, Ubuntu, KDE, Kubuntu
0

CF8 error after upgrading to Ubuntu 8.10 Hardy Heron - libstdc++.so.5

ColdFusion, Ubuntu, Linux
This afternoon I did an upgrade from Gutsy to Hardy on my main development environment. I experienced *almost* no disruption to my system, with one exception (so far!). When I instantiated a ColdFusion 8 application which instantiates a webservice onApplicationStart, I received the following exception:

jikes: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

Jikes! Well fortunately the fix is quite simple. Go to a terminal and install libstdc++5 like so:
$ sudo apt-get install libstdc++5


Restart your application and carry on! I am not sure what changed between the distros, but apparently the libraries that ColdFusion uses for invoking webservices depend on this package.
0

Playing with my new webcam under Linux - watch me work!

Ubuntu, Fun, Linux

I made an impulse buy this past week ordering a Tripp-Lite clip-on webcam for my laptop. My wife and I are leaving next weekend to go on a week-long cruise without our kids, and I thought it might be fun to post some video blog entries for them while we are gone so they (and ultimately you as well) can see what we are up to.

I chose the Tripp-Lite camera due to pretty consistently positive cost/value reviews, although I was a bit worried that I couldn't find a single instance of anyone on the internet actually using one under Linux. Why should that stop me, huh? When it arrived I plugged it in and... nada... nothing! Although my laptop could see the device, I couldn't seem to get the drivers to work. After doing some digging around I found that it uses the Z-Star Microelectronics Corp. ZC0301 WebCam chipset, which seems to be very common in the cheapo-Chinese-made webcam space. There is an unbelievably awesome project out there where a guy named Michel Xhaard has written drivers for tons of webcam chipsets, and although mine was included I just couldn't seem to get it to work, no matter what I did.

Eventually it hit me that since I am using an Alpha version of Ubuntu (Hardy Heron), perhaps I should roll to a release version and see what happens. Given how easy it is to swap distros in Linux, I decided to roll back to a 7.04 (Feisty) remaster disc that was laying around. Upon plugging in my camera on the new distro it just worked natively! YAY.

So, now I am playing with the apps a bit. I found Camorama which does video captures and can FTP them to a server at regular intervals. I thought it might be fun to create a custom pod on my blog that shows a current picture of me working - or zoning out... picking my nose... whatever. So, the pic of me you see on the left is the most recent of those. The timestamp text is a little small when I resize the pic, but if you view it in full size (or pull out your magnifying glass), you can see the date.

As for recording video in Linux, I created a launcher that allows me to record AVI files with audio using mencoder. For those interested in doing that, you will first need to install mencoder:

$ sudo apt-get install mencoder


I then created a shortcut icon that starts the recording:
mencoder tv:// -tv driver=v4l:width=320:height=240:device=/dev/video0:forceaudio:adevice=/dev/dsp -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o /home/dshuck/Desktop/webcam.avi


Then I have another shortcut icon to stop the video:
killall mencoder


Look for pointless videos in the near future...


Search