Monday, December 12, 2011

Windows 7 Symlinks

I'm finally realizing (maybe the last person to cotton on to this), that starting with Windows Vista, we now have the capability to create Unix-style symlinks between Windows files and folders. YIPPEE!

It's done with the mklink command (from the cmd window):

mklink
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.
        Link    specifies the new symbolic link name.
        Target  specifies the path (relative or absolute) that the new link
                refers to.

In my particular case, I'm experimenting with the Sencha Touch mobile application development kit. Creating the simple "Hello World" app as a place to start. This requires that Sencha SDK. I downloaded that and would prefer not to create a copy of it in my app server. Symlinks to the rescue. Since my Hello World app makes reference to the SDK as  <script src="lib/touch/sencha-touch.js" type="text/javascript"/> , I simply created a lib directory in my app folder and then made a symlink to the Sencha Touch folder:

mkdir lib
cd lib
mklink /D touch ..\..\sencha

And voila - no copying.

Worth noting - to remove the link, use a regular delete: DEL or RMDIR depending.

Tuesday, October 4, 2011

Ubuntu/VirtualBox/Java Team Development Stack - Part II

Part II - Install the Development Stack.
Continued from Part I

Having a virtual machine with Ubuntu installed, we now need the developer tools in our stack.

My target developer's stack has:

  1. Java JDK
  2. Eclipse
  3. Ant
  4. jEdit
  5. Firefox (or Chrome)
  6. Tomcat
  7. MySQL 
  8. MySQL Client
  9. DropBox
It's worth installing Ubuntu Tweak. At the least, this gives us the window icons on the upper-right corner. Open a browser and go to http://ubuntu-tweak.com/. Install that.From within that, I also found the Chrome browser install and did that.

The approach Ubuntu uses for typical software installation is through the "Ubuntu Software Center" which is invoked from the bottom of the Applications menu. Easiest is to use the search box to find the software we want and then choose the version (if there are options) to install. I simply searched for and installed each package. Some notes:
  1. Java JDK: I chose the "OpenJDK Development Kit".
  2. Tomcat is installed on port 8080. Something else must be running on port 80 so I wasn't able to change the tomcat port.
  3. Tomcat installs as a service. As such, it can be stopped and started: service tomcat6 stop|start|restart
  4. I added a manager role and user ID/Password so I can access the tomcat manager and use the Eclipse/Ant deploy tasks.
  5. I created a new folder in home: /home/projects and made it read/write/execute accessible to the users group. 
  6. When I installed dropbox (by going to the www.dropbox.com website and installing from there), I pointed Dropbox at the projects directory so that those files would be under /projects.

Ubuntu/VirtualBox/Java Team Development Stack - Part I

Part I - Setting up a Virtual Machine and Ubuntu

A controlled java web development stack for a distributed development team.  I did this a few times before but never documented it, and (of course) versions of the tools have all moved on. But I have to resurrect it, so this time I think I'll write it up. No where near as easy as Dave Winer's EC2 for Poets (http://poets.scripting.com/), but he's a much better writer than am I!

So, the idea is this: several developers; some co-located and others not; working on a web project being developed in Java. This project is also using MySQL for an underlying database. Code is managed in a remote CVS repository. What I want to create is a controlled environment in which each developer has the same set of tools and test data against which to work. The answer: a virtual machine with all the tools installed and configured so that I can simply deliver a copy of the VM disk image to each developer. I've played with this before in VMWare and some other virtual machine kits that I don't recall, but most recently in Oracle's VirtualBox. So I'm repeating that experience here. It  bears noting that I am doing this stack creation on a Windows Vista 32-bit laptop (no flaming please). But I believe the overall approach here would work on pretty much any host machine. Also of note: since I don't want to deal with licenses (and fees) for virtual machines that I send out to developers, I am using Linux Ubuntu as the virtual client. This being a java development project, what we develop is (or certainly should be) portable across different operating systems, but the production target for this is also Linux, though not Ubuntu.

My target developer's stack has:

  1. Java JDK
  2. Eclipse
  3. Ant
  4. jEdit
  5. Firefox (or Chrome)
  6. Tomcat
  7. MySQL
  8. A VPN connection for CVS
In addition, there needs to be a way to share files from the host machine to the virtual machine. Here are the rough steps I followed:

A. Create an ISO Image of Ubuntu:
  1. Download Ubuntu (http://www.ubuntu.com/download/ubuntu/download). 
  2. The ISO image will need to be available to VirtualBox for installation, either on a CD or a USB drive.  I use a USB drive. Just copy the ISO image to that.
B. Set up a Virtual Machine with Ubuntu:
  1. VirtualBox: https://www.virtualbox.org/wiki/Downloads. This is  simple enough to install - just follow the steps and accept the defaults. Once it is installed, start it and create a new virtual machine.
  2. New Virtual Machine: I chose Linux/Ubuntu and then set memory to 1Gb.
  3. New "Hard Disk": I set it to dynamically expanding.
  4. At this point, I'm done creating the virtual machine - I need to install Ubuntu. By clicking "start" on the newly created machine, I get the "first run" wizard. From there, point to the USB drive from A. above.
  5. Follow the setup for Ubuntu. 
C. Create a root Password.

By default, Ubuntu is installed without a root login. I'm guessing this is for security reasons. But these developer VMs are not really subject to security issues and having the ability to run as root makes a lot of things easier. So I add a root password, enabling me to su and run as root when I need.

  1. sudo passwd root
First, you'll have to enter your password. Then the password you want for root.


D. Add my ID to the "users" group.
I found that my user ID was in its own group. I added "users" as my group so that I can access common folders more readily.

E. Install Guest Additions

This is a big/important key step. It makes many of the hardware and device features of the host computer pass through to the virtual machine. Like the screen size/resolution. And others.

  1. There is a virtual machine menu bar with a "devices" menu. This has a "Install Guest Additions..." item. Clicking this will *not* actually install the guest additions; it only mounts the guest additions as a virtual drive. So I did this, but then still had to run the actual install.
  2. After the mount, open a terminal window and cd to the mount for the additions. These seem to be under /media.
  3. Run the autorun.sh (sh ./autorun.sh). I switch to root before doing this (su).
  4. Restart the server.
F. Ensure Networking Works.
Since we need to access CVS over a VPN, we need the VPN access to work. For our purposes, each developer has VPN access from the host machine (my laptop). So I want this to "pass through" to the virtual machine. I'm not a networking guy, so I don't know much about this, but it seems that by setting the network adapter in the virtual machine to "NAT" (which seems to be the default anyway), I go the pass-through I wanted. Perhaps someone more knowledgeable than me can elucidate? Anyway, I simply tested this by connecting to the VPN and pinging a machine on our internal network.

G. Set up Sharing.
We'll want to be able to share files from the host file system to the virtual machine file system. This means setting up a Shared folder.
  1. On the host machine, create a folder (I called it "Sharing" and located it in the root).
  2. In the Virtual Machine, create a permanent share - from the "Devices" menu, select "Shared Folders..." and create a new share. I created a "permanent", "Auto Mounted" share and named it Sharing. 
  3. After restarting the VM, this share is now found in /media/sf_Sharing.
  4. I had to change my user ID and add "vboxsf" as a group to be able to access this.

Continued: Part II - Install the Development Stack.

Thursday, September 29, 2011

Publishing and Mobile Devices

I've been interested for a long time in writing applications that will provide some useful service on a mobile phone, and with the advent of smart-phones I get to explore this a little more. This got me to thinking about apps that run on smartphones and that are possibly useful to information customers - apps that a publisher might develop and deploy to their subscribers. And since I have a new Droid phone, I started doing some programming for that. But it begs an interesting question - what phone(s) should a publisher target in developing a new app?

Of course, this is heavily informed by the particular publishing sector and by the kind of information being published. Phones, with a small-ish form factor, will favor small units of data; pads would more readily support larger. In fact, the form factor on a pad (like the iPad) is such that simply using a browser in the pad to access the same publisher web resource that one would access via a computer is usually an acceptable user experience. So, if I were a publisher, trying to decide what phone to develop an app for first, what factors might influence my decision? Here's what's floating around in my head:

  1. Hard to ignore the overwhelming presence of the iPhone. Huge market penetration. But small form-factor. And it just plain pisses me off that I have to go through the iTunes marketplace and pay Apple a pound of flesh. It's my data after all! And I suspect most publishers are not really selling the app; they're selling content.
  2. Hard also to ignore the skyrocketing increase in iPads. Seems like everyone has one these days! Wish I did. And, given that the iPad runs the Safari browser (which is Webkit compliant), I can develop a variation of my website using an HTML5/CSS3 approach, host it on my own servers and not have to go through iTunes/Apple. More on Sencha/jQueryMobile/PhoneGap in another post... But if I need to create something that runs on the iPad, I run into the same iTunes/Apple question.
  3. Some of the stuff I'm reading indicates that the various Droid phones are increasing market share considerably. And I can develop an app for a Droid phone and distribute it myself without going through the Google market or, if I choose, I can go that route. 
  4. It seems that in certain market segments Blackberry is ubiquitous. Especially in the legal and lobbying worlds. As with the Droids, I like the fact that I can deploy an App frmo my own sites and am not forced to go through a marketplace. The small form-factor makes the BB somewhat limited for larger units of data and the differences between versions of BBs and the attendant differences in API support make BB develop somewhat challenging, although a cross-platform approach such as HTML5/CSS3/PhoneGap may limit those difficulties. OTOH, RIM is trying to shift to QNX and allow Droid apps to run on Blackberries. But when? And how long will it take for that upgrade to penetrate the marketplace. And a lot of the stuff I read indicates that RIM is losing market share. 
  5. And then there Microsoft. I sometimes think that if MS creates a phone that integrates seamlessly with their back-office servers (Exchange, Sharepoint, etc.), those would become the darlings of IT departments worldwide. Enough so that they could drive RIM out of that spot. But that hasn't happened and MS phones are distant cousins in terms of market share. 
  6. Kindle Fire? I love the idea and the price, but it means limiting app development to Android 2.2. We'll see!
So, I think I still have more questions than answers. And I know that some of this is a religious argument - I hear fans of the droids espousing their virtues over the iPhones and vice-versa.


Wednesday, September 28, 2011

Android Thunderbolt and Verizon

So, my ancient cell phone having started death throws, I went to my Verizon store (with whom I've had service for years) and started looking at "smart" phones. I was particularly interested in a droid phone as opposed to an iPhone or a blackberry. I'm suspicious that if RIM can't make a big splash with QNX next year, they're history. And I really want to do some app development but the idea of being forced into the Apple iTunes marketplace just pisses me off. So I went with a Droid phone. It helps that App development for Droids is in Java and although I like to talk about developers being language agnostic, my most extensive and recent experience is in Java.And as I looked at them, I ended up buying the Thunderbolt. Mostly because the screen size is bigger than the other non-pad phones.

So now I have a Thunderbold and a brand-new 2-year contract for voice and data from Verizon. I have some minor gripes about the phone. I think the touchpad is too sensitive for my fat fingers and I'm always mis-dialing. The blue-tooth voice recognition is a continual source of entertainment and not accurate for me at all. And the battery life just plain sucks (though the salesman did warn me about that). But my biggest gripes are a) that the phone comes preloaded with a pile of app that I have no interest in, and b) that connecting the phone to my laptop causes a pile of messages about installing the Verizon media application on my laptop.

The bloated list of installed apps is particularly troublesome. I can't un-install them in any normal way. I'm told by my (many) nerd friends that I need to "root" my phone and then, as super-user, I can remove the apps I don't want. Well, it may come to that. But I don't feel like I should have to hack my phone to make it into the device I want. And the idea that Verizon is intentionally burning my data plan so that all these apps can "phone home" regularly is seriously insulting and may in the end cause me to switch carriers.

The Verizon Media application is also irksome, though a problem that I could solve. After getting warnings and requests to install this every time I plugged my droid into my laptop to charge it, I went ahead and let it install. After that, it inconveniently launches when I log in.  I have enough crap on my laptop that starts when I log in - it already takes too long! So after it installed, I went out on the web and found a Windows (yes, my laptop runs Windows, Vista no less) NO-OP program (http://joenord.com/apps/nop/index.html). Essentially a program that does nothing. I then copied that into the media center install directory, renamed the media center (verizon.exe) and then renamed the nop.exe to verizon.exe. Voila, it doesn't launch anymore.

Next up - rooting the phone.

Starting Again

It's been a while since I posted anything - I went for a long period without feeling like I had much to say. Then I realized that part of the problem is that I was feeling constrained to write specifically about content management. And about that, I really don't have much to say that other aren't saying more eloquently.

So I'm starting anew, with a more general technology focus. I'm heavily influenced by reading other folks blogs so, in true copy-cat style, I'm plagiarizing their concepts and opening this up to just about anything that hits me as worthy of jotting down. Since almost all of my tech work is in the publishing world and since my interests tend to span not only content harvesting, management and delivery but also technologies in the "active" world (as in personal sports), I'll probably offer up misguided observations across all of those boundaries.

And since I'm doing this more for personal catharsis than for either marketing or networking reasons, I can safely say that I don't really care who reads this or if they like or agree with what I write. But if I'm wrong (often) or if there are better ways (oftener), please comment and let me know.