Saturday, December 5, 2009

Design Mockups, realtime, real easy

A few months ago, I introduced Balsamiq mockups into my project because using Excel spreadsheets to design my screens was just stupid. I couldn't really 'communicate' with the rest of the team in India.

I still remember the night when I pulled this out. I remember Amit from Intelligrape in India happily exclaimed, with hope in his timbre, "Oh Brent, this is going to be so much better for us. Thank you."

He was right. It has increased the team velocity tremendously. We are able to work through the screens in realtime over YuuGuu, drilling down to the finest points of the design.

Here are a couple of the screen shots. We even use it for some class diagrams and sequence diagrams.

in reference to: Balsamiq Mockups Home | Balsamiq (view on Google Sidewiki)

Getting a signed in user in Grails tests

I found this to be helpful. I just needed one more piece of information.

def subject = [
isAuthenticated: true,
principal: "admin"
] as Subject

SecurityUtils.metaClass.static.getSubject = {-> return subject }
Subject.metaClass.getPrincipal = {-> return "admin" }

This way, when I needed the user later on in the code, when I called getPrincipal, I got it. E.g.

JsecUser currentUser = JsecUser.findByUsername(SecurityUtils.getSubject()?.getPrincipal());

in reference to:

"void setUp() {       def subject = [           isAuthenticated: false,           ...       ] as Subject       SecurityUtils.metaClass.static.getSubject = {-> return subject }       ...   }"
- Nabble - grails - user - JSecurity-Plugin and Integration-Tests (view on Google Sidewiki)

Thursday, December 3, 2009

Seems pretty cool.

I think I like this Side Wiki. Now, if it would only let me highlight stuff for context, etc, I would love that.

in reference to: Google Sidewiki (view on Google Sidewiki)

Friday, February 22, 2008

subversion troubles...

This is the second time I have had subversion troubles. So I wanted to write down some of the steps I followed to cure the trouble.
Symptom: Database has become corrupted...
Solution:
kill svnserve
svnadmin recover /path/to/repos
then:
chgrp -R subversion /home/svn
chmod -R 770 /home/svn
chmod g+s /home/svn/db
restart svnserve: svnserve --daemon --root /home/svn

Thursday, February 21, 2008

Sorting and filtering...

I finished the sorting and filtering for the companies page. It was a bit of a pain. For the sorting, I used a RAils plugin called sortable_column_headers. I attempted to install it into our application, but it kind of failed to be able to commit it to the SVN. I'll have to learn how to do that later.

For now, you should open the rails plugins view, select sortable_column_headers and check svn:externals and svn:checkout install and then click GO.

But the searching works just fine. Next, I would like it to filter the results as you type. That would be much more useful.

Wednesday, February 13, 2008

Finished deployment to VPS

There was nothing instant about getting rails deployed to the server, but now that it is there, it should be fairly trivial to deploy new instances from now on.

I had to combine the strengths of Dave Stevenson (SilverRack) and the Agile Web Development with Rails book. There were a few gotchas along the way that I will attempt to address here. In the meantime though, you should be able to access the website here:

http://216.194.127.249/company/list

I'm gonna list the gotchas now, but they may not be in any particular order.
  • An SVN client must be installed on my windows box
  • mongrel_rails cluster::configure command produces a mongrel_cluster.yml file that tells capistrano to look for files in the 'conf' directory instead of the config directory, so after executing that step, it is very important to edit the file appropriately.
  • replace cap --apply-to .... with 'capify .' This was no doubt a new command that didn't exist at the time of publishing
  • In the deploy.rb file, you can add the following entries to make it connect correctly (asterisks added for security):
  • set :user, "root"
    set :svn_username, "*****"
    set :svn_password, "******"
  • cap setup has changed to cap deploy:setup. This only has to be run one time to get all of th right directories in place
  • The /var/www/apg/current directory is actually a symlink that points to another directory under releases. This allows capistrano to maintain several versions of the product, and switch between them with ease.
  • cap cold_deploy changed to cap deploy:cold
  • I had missed the right port numbers in the vhost.conf file. Since the mongrel_cluster.yml file specifies two mongrel threads listening on 8000, and 8001, then the vhost.conf file must also point to 8000 and 8001
  • I found that apache on linux has multiple configuration files all under /etc/httpd/conf.d
  • Only Apache 2.2 supports the mongrel mod and the subversion dav_svn_module. So Apache 2.2 is essential
  • When running capistrano, it starts up the mongrel servers in production mode with a -e production parameter to specify the rails app should use the production server
  • I had to manually run the 'rake db:dbdata:load' command on the application because the rake db:migrate tool didn't have that as part of it.
  • In order to allow http access to SVN, I had to change the ownership on the subversion directories /home/svn. I used the command 'chown -R apache.subversion /home/svn'
  • Centos 4 didn't have the yum repository that includes mysql5 or apache 2.2 so I had to integrate with a repository that Dave Stevenson sent me:

(need to add the exact yum line here)

yum --disablerepo=update --disablerepo=base -y install gcc openssl-devel> mod_perl-devel mod_python mod_ssl mod_dav_svn mysql-server mysql-devel> libpng-devel libjpeg-devel libtiff-devel freetype-devel ghostscript-devel> which>> yum --disablerepo=update --disablerepo=base -y update

  • I still need to configure the database passwords to be taken from a shared location, instead of checked into the database. For now then, I have changed the passwords for the database and modified the file on the server for security.

Saturday, February 9, 2008

new info from Dave

Dave's response to my message about it not working still.



Hi Brent -That message is because Apache 2.2 isn't installed.The yum update from the utterramblings repo should've done it. But - I checked your system and it wasn't working. I tried a few things and finally got some stuff to work.Rerun the 2 yum commands like this (notice the disabling of the update and base repositories)yum --disablerepo=update --disablerepo=base -y install gcc openssl-devel mod_perl-devel mod_python mod_ssl mod_dav_svn mysql-server mysql-devel libpng-devel libjpeg-devel libtiff-devel freetype-devel ghostscript-devel whichyum --disablerepo=update --disablerepo=base -y updateYou should notice that all of the files are coming from the utterramblings repository - and that apache will be version 2.2, mysql will be 5x,etc. Dave
On Feb 9, 2008 10:07 AM, Brent Fisher <
bc.fisher@yahoo.com> wrote:
I went through the steps, but when I try to start, it says this:

login as: root
root@216.194.127.249's password:Last login: Fri Feb 8 22:16:39 2008 from 71-213-85-69.slkc.qwest.net[root@apgtest ~]# httpd -k startSyntax error on line 2 of /etc/httpd/conf.d/httpd-vhosts.conf:Invalid command 'BalancerMember', perhaps mis-spelled or defined by a module not included in the server configuration[root@apgtest ~]#
perhaps the load balancer mod isn't installed still? It did have a little bit of trouble with some of the mirror sites when I executed the yum update command. Could that have been the problem?
Brent Fisher
I can help
bc.fisher@yahoo.com
highlandfishers.com
801.842.1114

This seemed to work