Tuesday, September 19, 2006

Mac OSX Tiger unix groups

Step 1 in setting up the development environment on my Mac OSX Tiger system was to make the common directories needed for development shared among both developers. By default, Tiger will create files/directories as writable by only your user and your group (same as username). So for both developers to be able to use tomcat for example, I added group read/write to all tomcat files and directories. Also had to chgrp all files/directories to a common group for both of us as well. At first I read that I could use the "staff" group, because as I read all users should be added to this group by default. On my Tiger installation though, I was sad to see that only the user root was a part of that group.

Adding new groups and associating users to groups using the Mac OSX UI is very difficult, if not impossible. When adding a user I was surprised there was no option to specify the groups that user should be a part of. Tiger has an application until the Utilities folder called "NetInfo Manager" which manages what unix people would recognize as the /etc/passwd and /etc/groups files among other things, from here you can add new user and group, but there was no clear way to associate multiple users to a group using the tool (for current ones, it displayed a comma-separated list of users within parenthesis, and a drop down denoting the users, but I could not create a drop down using the tool). Another dead end. Finally I found the answer in a couple of obscure command line programs (can be found in Mac OSX for Unix Geeks) called nicl and nireport. Here is what I did to add both users to the "staff" group, and created a group just for development of our project called "developer" and it worked...

To add user1 and user2 to the group "staff":
# nicl / -merge /groups/staff users user1 user2

To get a list of all current groups and gid's (so you know which gid to assign next, use the max here + 1):
# nireport . /groups gid name

To create a new group called "developer" (assuming the highest gid in the previous step was 502):
# nicl / create /groups/developer gid 503
# nicl / create /groups/developer passwd '*'

To add user1 and user2 to the group "developer":
# nicl / -merge /groups/developer users user1 user2

Next time you login to the shell, type "groups" and the new groups should show up for either user1 or user2.

Monday, September 18, 2006

New Blog

I've decided to point my main website to this new blog for now, and link my specialized project page, resume, links, etc from it back to my old server. My old homepage hadn't been updated in ages, and I figured it would be easier this way to keep my public and professional persona updated and current.

Also to keep my skills sharpened, I'm starting a couple of new projects that I will use to play around with some new technologies. As you can see I haven't written a complete personal project from beginning to end in years, Chinese Polar Races and PoopieWars! included. I wrote a live recording review site in a day and a half for my old Live Garbage Hub website, it was a quick and dirty tomcat/jsp/mysql application. One of my first projects will be to refactor this quick and dirty site using Hibernate/Spring/Spring MVC. I plan to put this onto Google Code or SourceForge eventually as well. Afterwards, I may explore writing a JSF version as well, but we'll see, as I'm not sold on JSF completely yet. Also a project after getting the hang of Spring/Hibernate will be to write a Web Files type web application that allows one to upload documents and files, but rather than having a strict directory structure, files are tagged (ala flickr and delicious) since documents can have multiple categories and users can search based on these. Along with the Spring/Hibernate backend, I'll move away from the usual http form post/response communication architecture and try out some AJAX (probably Google Web Toolkit, GWT) as the front-end. As the projects mature I'll probably create separate blogs for them on their public source download site, but for now I will post any insights I come across on this blog. I'll be doing Java development on my Mac OSX Powerbook, using Tomcat 5.5.x and MySQL 5 and Eclipse 3.2.