Subversion hosting, CVS hosting, Trac hosting, Bugzilla hosting and software collaboration Providing hosted Subversion, CVS, Trac and Bugzilla repositories
 

February 29, 2008

This Is Getting Ridiculous!

Filed under: Business — Tags: , — Greg Larkin @ 3:57 pm

Hi everyone,

SourceHosting.net is still attracting a fair number of confused folks who think they’ve landed on the CVS pharmacy corporate site. This all started when we launched some new Google AdWords campaigns. Apparently, the folks viewing the ads on the Google AdWords Content Network aren’t terribly aware of what they’re clicking. Here are some recent sample inquiries:

<span style="width: 500px">*** *** ***
I have a CVS <span class="hl">Blood</span> <span class="hl">Pressure</span> Monitor and it keeps showing Full before the reading </span>

<span style="width: 500px">appears. How do I get rid of that word?.
*** *** ***</span>

Umm, reboot the monitor?
*** *** ***
I picked up a perscription [sic] at ny [sic] CVS store today and on the bottom of

the receipt there is a message:

" Your Extracare Accounr [sic] Information is incomplete. Please visit www.cvs.com/extracare "

Well, here I am........What does the mesage [sic] mean ??????
*** *** ***


I love this – “Well, here I am…” and the actual web site URL is included. If you really were “here”, I wouldn’t have received this message!

Ok, I guess the ads need to be configured with some negative keywords. Interestingly, the negative keywords “pharmacy” and “extracare” were already in the campaign, but I just added some more like “pharmacy” and “drugs”. Next step – turn off the ad delivery on the content network.


Call me - Greg Larkin: error

February 22, 2008

Super-Configurable Subversion Notifications

Filed under: Source Code Control — Tags: , , , — Greg Larkin @ 8:13 pm

Hi everyone,

Are you using the Perl SVN::Notify module to generate your Subversion commit notification emails yet? If not, go install it, and try out svnnotify. It generates very nice-looking text or HTML-formatted emails, and it has loads of options to make it do just what you want. Place as many svnnotify commands as you like in your Subversion post-commit hook script, and off you go.

Unfortunately, with a large number of developers and many different projects in your repository, your post-commit script may start to look like this:

svnnotify -r $2 -d -P "SVN Commit " -O -H HTML::ColorDiff -p $1 -t dev@company.com
svnnotify -r $2 -H  Mirror::Rsync -p $1 --rsync-host devserver.company.com \
    --to /usr/local/www/htdocs --rsync-delete=yes
svnnotify -r $2 -d -P "SVN Tag Creation " -O -H HTML::ColorDiff -p $1 \
    -x builder@company.com=/tags
svnnotify -r $2 -d -P "SVN Branch Creation " -O -H HTML::ColorDiff -p $1 \
    -x builder@company.com=/branches
svnnotify -r $2 -d -P "SVN Vendor Drop " -O -H HTML::ColorDiff -p $1 \
    -x vendormgr@company.com=/vendor
svnnotify -r $2 -d -P "ClientA Special Version Commit " -O -H HTML::ColorDiff \
    -p $1 -x dev@clientA.com=/branches/clientA

Yikes -that’s bound to keep any Subversion administrator up nights! However, help is on the way from Perl developer John Peacock.

John has created a nice wrapper around SVN::Notify named SVN::Notify::Config. This Perl module transforms the mess of command lines above to a cleaner, easily-editable form using YAML to express the desired svnnotify options.

The equivalent post-commit hook using SVN::Notify::Config is now:

#!/usr/bin/perl -MSVN::Notify::Config=$0
 --- #YAML:1.0
 '':
   PATH: "/usr/bin:/usr/local/bin"
 '/':
   handler: HTML::ColorDiff
   with-diff:
   no-first-line:
   subject-prefix: "SVN Commit "
   to: dev@company.com
 '/':
   handler: Mirror::Rsync
   to: /usr/local/www/htdocs
   rsync-host: devserver.company.com
   rsync-delete: yes
 '/tags':
   handler: HTML::ColorDiff
   with-diff:
   no-first-line:
   subject-prefix: "SVN Tag Creation "
   to: builder@company.com
 '/branches':
   handler: HTML::ColorDiff
   with-diff:
   no-first-line:
   subject-prefix: "SVN Branch Creation "
   to: builder@company.com
 '/vendor':
   handler: HTML::ColorDiff
   with-diff:
   no-first-line:
   subject-prefix: "SVN Vendor Drop "
   to: vendormgr@company.com
 '/branches/clientA':
   handler: HTML::ColorDiff
   with-diff:
   no-first-line:
   subject-prefix: "ClientA Special Version Commit "
   to: dev@clientA.com



That’s a lot more readable, and I expect it will be easier to maintain, even though there are more lines in the file. I’m still boning up on the YAML syntax and how this module uses it, so there may be some optimizations to be made. Feel free to send corrections!

The other thing I like about using YAML this way is it lends itself well to hooking into a notification management web interface, and that makes it even easier to keep those emails flowing where they should.


Call me - Greg Larkin: error

February 20, 2008

Pssst… Hey Kid, Wanna Free Hard Drive?

Filed under: Misc — Tags: , — Greg Larkin @ 8:17 pm

Hi everyone,

Here’s a little trick I’ve been using for quick deployment of additional virtual disk space to the VMware VMs that comprise the SourceHosting.net service. The VMware Server installation includes the vmware-vdiskmanager tool for creating, renaming, expanding and generally messing about with virtual hard drives.

However, I don’t like running this tool to create a new 50Gb virtual disk in the middle of the day because it just slams the disk I/O channel. To get around the problem, I’ve created several disks of different sizes during off-hours and compressed them down for easy storage. Then when I need to provision a disk, I expand it, rename it and hook it to the virtual machine in Virtual Center:

VirtualCenter Add Hardware Wizard

So here are some compressed disk images for you (SCSI format):

  • 10Gb (8391 byte download)
  • 20Gb (16415 byte download)
  • 50Gb (40373 byte download)
  • 100Gb (80373 byte download)

Once downloaded, extract them as follows:

nice -19 bzcat xxxGb.tar.bz2 | tar xvfB -

CAUTION: The resulting extracted files will be the actual size represented in the filename. They compress down so well because they are mostly empty space until they are hooked to a VM and a filesystem is created.

After I extract the files, I typically rename the virtual disk to something more meaningful, like the name of the mount point in my VM. This way, I can easily tell which virtual disk is used for what without consulting the VM config file. The disk rename command looks like this:

# vmware-vdiskmanager -n 10GbDisk.vmdk UsrSrc.vmdk
Using log file /tmp/vmware-root/vdiskmanager.log
Renaming completed successfully.
# ls *.vmdk
UsrSrc-f001.vmdk  UsrSrc-f003.vmdk  UsrSrc-f005.vmdk  UsrSrc.vmdk
UsrSrc-f002.vmdk  UsrSrc-f004.vmdk  UsrSrc-f006.vmdk
#

Simple!


Call me - Greg Larkin: error

Hooking My CodeIgniter Application to MySQL

Filed under: Software Development — Tags: , , , — Greg Larkin @ 7:19 pm

Hi everyone,

When I last posted about my sample application development with CodeIgniter, I had created a simple Hello, World application. The next thing I want to explore is how easy it is to connect to a MySQL database and retrieve data.

As a quick side note, the CodeIgniter User Guide is well-written and very clear with plenty of examples. That’s always nice to see and instills some confidence in the quality of the underlying code.

According to the guide, all of the database connections should be defined in the application/config/database.php file. After setting up a new database named “ci” and a database user, I opened database.php and set up my connection:

$db[‘default’][‘hostname’] = "localhost";
$db[‘default’][‘username’] = "ci";
$db[‘default’][‘password’] = "ci";
$db[‘default’][‘database’] = "ci";
$db[‘default’][‘dbdriver’] = "mysql";
$db[‘default’][‘dbprefix’] = "";
$db[‘default’][‘active_r’] = TRUE;
$db[‘default’][‘pconnect’] = TRUE;
$db[‘default’][‘db_debug’] = TRUE;
$db[‘default’][‘cache_on’] = FALSE;
$db[‘default’][‘cachedir’] = "";

That was easy enough. Now I’ve got the skeleton of a model defined in application/models/user_model.php:

class Group_model extends Model {
    function Group_model()
    {
        parent::Model();
        $this->load->database();
    }
}

The $this-&gt;load-&gt;database() statement automatically connects to MySQL using the default connection I defined previously. Now I can use the $this-&gt;db object to run queries and process results elsewhere in my model file.

I’ll replace my original hard-coded count_users function with something that runs an actual database query:

function count_users()
{
    $query = $this->db->query(‘SELECT COUNT(*) AS num_users FROM user’);
    if ($query->num_rows() > 0)
    {
        return $query->row()->num_users;
    }
}

Of course, I have to leave a newbie coding error in there for someone to notice. Anyone? Anyone? Bueller?

Here’s my simple MySQL database schema:


– Table structure for table `user`

CREATE TABLE IF NOT EXISTS `user` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`user_name` VARCHAR(128) NOT NULL,
`full_name` VARCHAR(128) NOT NULL,
`email` VARCHAR(128) NOT NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;


– Dumping data for table `user`

INSERT INTO `user` (`id`, `user_name`, `full_name`, `email`) VALUES
(1, ‘glarkin’, ‘Greg Larkin’, ‘glarkin@sourcehosting.net’),
(2, ‘morsel’, ‘Morsel The Cat’, ‘morsel@meow.com’);

When I navigate to my /codeigniter/user/count_users/ URL, I see:

There are 2 users defined

Great! Next up, we’ll take a look at creating an actual output page with views.


Call me - Greg Larkin: error

February 16, 2008

VMware Server Watchdog Timeouts on Host-Only Interface

Filed under: Operating Systems — Tags: — Greg Larkin @ 11:33 pm

Hi everyone,

I installed a bunch of security updates, new kernels, etc. to the VMware Server hosts and virtual machines tonight. One problem that has been dogging me for a while now is that one (and only one) of the VMs boots in a strange state and reports Ethernet watchdog timeouts on its host-only interface. The issue here is that it’s then unable to communicate with its name server, NFS server and other LAN resources.

After some different Google searches, I found a solution provided by Antonio Lorusso. I’ve made his changes to the VMware Server file in question, and I’ll keep an eye on the VMs as they auto-start after the next host server reboot. I expect that the timeouts will be a thing of the past. Thank you, Antonio!


Call me - Greg Larkin: error

February 15, 2008

Telecommuting PHP Developer Position

Filed under: Jobs — Tags: , , — Greg Larkin @ 4:38 pm

Hi everyone,

SourceHosting.net recently started a professional services contract for a new client in Maine, and they  need a PHP developer to finish a project for a client of theirs. The system is a content management and e-commerce web site used to order and fulfill scientific supplies. The site is targeted to a typical LAMP stack.

I had a look at the database schema and the existing code, and it is surprisingly well-commented, indented nicely and follows a naming convention. That was a nice change of pace! I suspect that it won’t be too difficult to pick up what’s there and learn it well enough to finish the project.

This project is available to an off-site developer, and there is some time pressure to get it done. They would like a person who can work full-time over the next few weeks. If you are interested, please reply directly to me with an introduction, your resume and a description of recent LAMP projects. If that all looks good, I’ll put you in touch with the hiring manager.


Call me - Greg Larkin: error

CodeIgniter 1.6.1 Is Released

Filed under: Software Development — Tags: , , , , — Greg Larkin @ 4:31 pm

Hi everyone,

I just saw that CodeIgniter 1.6.1 has been released. I guess that means I’d better get on the stick and upgrade the FreeBSD CodeIgniter port! Once I do that, I’ll upgrade my PHP Framework VM with the new version of the port and continue on with the experimentation.


Call me - Greg Larkin: error

February 11, 2008

Definition Of An Unqualified Lead

Filed under: Business — Tags: , — Greg Larkin @ 11:50 am

Greetings everyone,

I’m always excited to see a new RFQ inquiry come in from the SourceHosting.net Professional Services RFQ page. Generally, the prospect needs help with an internally-hosted source code control system, some release management consulting or perhaps a solution to a particularly thorny infrastructure problem that’s impacting their software developers. There’s always a good opportunity to flex the ol’ brain cells and learn about a new environment.

However, within the past couple of weeks, I’ve received 2 inquiries from somewhat confused visitors. I’m posting them here for your amusement (names changed to protect the, um, clueless). Anyone care to hazard a guess how these folks landed at SourceHosting.net?

From: confused_person@Yahoo.com
Sent: Saturday, January 26, 2008 11:49 AM
To: support@sourcehosting.net
Subject: [SHN] Pro Servs RFQ

Name:         Confused Person
Company name: cvs
Email:        confused_person@Yahoo.com
Phone:        8005551212
Request:      Everytime I visit cvs my receipt says Your
Extracare account information is incomplete .Please visit web
site I have tried this number of times I'm have problem where to go.

Additional information
Number of users:
Number of remote users:
Repository size:
Does backups:           N/A
Number of servers:
Server types:           Windows
Tools in use:           CVS

I sent this person a polite note with a pointer where he most likely should have directed his inquiry and had a good laugh.

This morning, I got 2 inquiries from the same person, so maybe this is going to be a trend!?

Date: Sun, 10 Feb 2008 11:30:59 -0500 (EST)
To: support@sourcehosting.net
Subject: [SHN] Pro Servs RFQ
From: I_am_confused@sbcglobal.net

Name:         Confused Person
Company name: self0employe
Email:        I_am_confused@sbcglobal.net
Phone:        800-555=1212
Request:      Complaint at the Nowheresville, Nostate Store.
I was treated by Anonymous (sore empolyee) wrongly this morning

Additional information
Number of users:
Number of remote users:
Repository size:
Does backups:           N/A
Number of servers:
Server types:
Tools in use:

And then minutes later:
*** *** ***
Anonymous (store employee) treated wrongly this morning she
question my ID .I have been going to this store for 21 years
*** *** ***

Bummer – the sore, er, store employee should be reprimanded!

If you’ve got some amusing CCRM (confused customer relationship management) tidbits, feel free to share them here!


Call me - Greg Larkin: error

February 8, 2008

Diving Into CodeIgniter

Filed under: Software Development — Tags: , , , — Greg Larkin @ 5:19 pm

Hi everyone,

Now that I’ve got my FreeBSD virtual machine set up with the various PHP frameworks, it’s time to start putting together a sample application in each one to learn their strengths and weaknesses. The sample application will be a simple mailing list manager and contain common features such as:

  • User account self-registration
  • Email generation
  • Management interface
  • MySQL database backend

I think that will exercise enough of each framework to get a good handle on their functionality and ease of use.
I’m starting off with CodeIgniter. At first glance, the documentation seems excellent, and the code is commented very clearly. Looking at the index.php file in the root installation directory (/usr/local/www/codeigniter on FreeBSD), I see:

/*
|—————————————————————
| APPLICATION FOLDER NAME
|—————————————————————
|
| If you want this front controller to use a different "application"
| folder then the default one you can set its name here. The folder
| can also be renamed or relocated anywhere on your server.
| For more info please see the user guide:
| http://www.codeigniter.com/user_guide/general/managing_apps.html
|
|
| NO TRAILING SLASH!
|
*/
$application_folder = "application";
 

Ok, that seems easy enough. To keep the default application intact and start working on my custom application, I simply copied the existing application directory to /usr/local/www/ci_sourcehosting and updated the index.php file.

$application_folder = "/usr/local/www/ci_sourcehosting";
 

According to the welcome page displayed by CodeIgniter, I have to change the views/welcome_message.php file to change the default page contents. Ok, easy enough…

Custom Hello World on CodeIgniter

The controllers/welcome.php controller is called by default, and that’s configured in the config/routes.php file in your application directory.

To create a new controller, simply create a new class that extends Controller and name it with a capital letter. Save the new class to the lowercase version of the class name into the /controllers directory, and you’re ready to test.

My simple class is:

class User extends Controller {
    function index()
    {
        echo ‘Welcome to the user controller’;
    }
    function count-users()
    {
        echo ‘There are 0 users defined’;
    }
}
 

When I visit http://192.168.95.128/codeigniter/user, I see:

Welcome to the user controller

and http://192.168.95.128/codeigniter/user/count-users displays:

There are 0 users defined

Ok, that’s pretty straightforward, but I did have to do a bit of mucking about to get the URLs to look like http://192.168.95.128/codeigniter/user/count instead of http://192.168.95.128/<strong>index.php</strong>/codeigniter/user/count.

The CodeIgniter manual specifies a .htaccess file to be placed in the directory where the index.php front controller is located:

RewriteEngine on
RewriteCond $1 !^(index.php|images|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
 

Normally, this works fine, except Apache 2.2 specifies AllowOverride None by default, so .htaccess files don’t work. After changing that, I had to make one small change to the .htaccess file, since my CodeIgniter installation is rooted at /codeigniter:

RewriteRule ^(.*)$ /codeigniter/index.php/$1 [L]
 

Next time, we’ll take a look at hooking CodeIgniter to MySQL.


Call me - Greg Larkin: error

February 6, 2008

RSS Feed for FreeBSD /usr/ports/UPDATING

Filed under: Operating Systems — Tags: , — Greg Larkin @ 10:44 am

Hi everyone,

Since I’ve transitioned to FreeBSD, one thing I haven’t done regularly is keep track of the /usr/ports/UPDATING file. This file contains important information about incompatible changes to ports that could cause a port upgrade to break or yield unexpected results. Therefore, it’s important to check it before running a wholesale upgrade on a production server.

I’ve been using Awasu as my desktop RSS reader, and every time I find something I want to keep track of without having to remember to do so, I look for an RSS feed. The contents of the UPDATING file seem a natural fit for delivery as an RSS feed, but a few Google searches yielded no results.

Finally, I went straight to the freebsd-ports mailing list archive, and simply searched for “rss”. Lo and behold, Alex Kapranoff set up a feed back in 2005: http://lists.freebsd.org/mailman/htdig/freebsd-ports/2005-June/024285.html

The feed URL is http://kapranoff.ru/~kappa/files/ports.UPDATING.rss20.xml, for anyone who’s interested. Thanks Alex!


Call me - Greg Larkin: error
Pages: 1 2 Next

Powered by WordPress