home · blog · groups · about us · contact us
DevelopmentNow Blog
 Friday, March 23, 2007
 
 

I've been using Webmin to manage my Linux server, but I wanted the backup files to be timestamped so that subsequent backups didn't overwrite them. Since I didn't see an option for that, I created a simple Linux shell script that will prepend a timestamp to a filename. So for example, if the shell script is called stamp_file, then running the command

./stamp_file /var/backup/apache_config_backup.tar.gz

will make a copy of /var/backup/apache_config_backup.tar.gz file, and call it something like like /var/backup/20070323142367-apache_config_backup.tar.gz. Note that the original file is maintained, and that the copy starts with YYYYMMDDhhmmss.

Anyhow, here's the script

#!/bin/sh
# timestamp a file
# args: <fullfilename>

echo -e "\n\n"

# check arguments
if [ $# -ne 1 ]; then
        echo -e "Usage: $0 <fullfilename> \n\n"
        echo -e "e.g. $0 /var/backups/apache_backup.tar.gz \n\n"
        exit 127
fi

echo -e "Timestamping $1 \n\n"

# get file, directory, and new filename
fname=$(basename $1)
newname="$(date +%Y%m%d%H%M%S)-$fname"
dname=$(dirname $1)

# make a copy
cp -vf $dname/$fname $dname/$newname

echo "\n\nDone, created $dname/$newname\n\n"

Now for all my backup tasks I can just run the stamp_file script to make sure that I don't overwrite older backups, which means I can do daily or weekly backups & go back in time when I need to. Ideas for future expansion might be to have the script make folders for each month, copy the backups into those.

Linux | Tools
March 23, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]



 
 

This was inspired by a form post over in startupping, where people were discussing doing projects in ASP.NET or PHP (specifically, LAMP: Linux, Apache, MySQL, and PHP).

I do both ASP.NET (.NET 2.0, C#, SQL Server) & PHP development (LAMP). PHP is pretty easy to pick up (especially if you've programmed in classic ASP), and there's a lot of information, libraries, etc. out for it. For an IDE you could use Zend Studio ($99-$300), PHP Designer ($50+), or free ones like SciTE or PSPad (both are good).

If you just want to try out some PHP development, I'd suggest getting a cheap hosting account from GoDaddy, Dreamhost, or somewhere else. Or even e-rice.net ($10/year). While you could install Linux locally & play around with shell access & administering Linux, Apache, MySQL, and PHP, you could end up spending a lot of time being a Linux sysadmin -- time that you could have instead spent strengthening your PHP & MySQL skills. One step up from a cheap hosting account would be to run LAMP as a virtual machine by downloading the free VM player and ready-to-go LAMP packages.

Once you get beyond coding some basic stuff, you may want to look into better PHP frameworks to help accelerate your development. I like Code Igniter, but here's a list of other frameworks you can read about.

FWIW, I develop in both environments b/c I have a range of clients & projects w/ different needs. One of my current projects is a site that includes a lot of features (social networking, wiki, CMS, data management), but the client wanted to leverage existing open source libraries & avoid building everything from scratch. So LAMP was a natural way to go. Other clients are Microsoft shops, so they want .NET apps built that their existing IT staff can take over.

Like any project, I think deciding on a technology involves many factors -- how skilled are you in it? Do you want to learn a new technology? What does the technology cost? Are there things about this technology (language features, environmental features, pre-existing libraries & applications) that will help the project to be more successful?

Lastly, if it's costs that you're concerned about, IMO Microsoft projects aren't as expensive as some may think. You don't need to spend a lot of money on the IDE -- there are cheap or free IDEs you can develop in, or (if you qualify) you can enroll in the MS Empower for ISVs program for $375, which gets you an MSDN Universal license w/ OSes & dev tools. The .NET framework is free, and you can run IIS on XP Pro. SQL Server Express is free & has (almost) all the features that you'd be using in SQL Server Workgroup/Standard/Enterprise. I have a client that didn't have a very large database, so their production site runs on SQL Express.

Also, if you're using a hosting provider for your site (which you usually should), choosing a Windows OS & SQL Server for your hosting account isn't usually significantly more expensive than Linux.

Still, obviously LAMP is cheaper (free, unless you pay $$ for a better IDE), and Microsoft costs can add up if you're looking at big server farms or are buying your OS & SQL Server licenses outright (for some reason). But of course switching frameworks has its own cost in terms of time & mistakes made while learning. If I were building something simple from the ground up, I might just choose the platform I was strongest in.

March 23, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]



 Tuesday, March 13, 2007
 
 

I've been having some issues with a hosting provider getting HTTP Compression set up correctly for ASP.NET pages in IIS. It's not hard to set up, but you need to do it using command line tools, not the IIS Management Tool. Thus it's probably not well-known, and possibly viewed as an unsupported hack by some hosting companies.

Believe me, when you're working with a hosting provider, you don't really want to do too much stuff that they don't support. Otherwise, if anything goes wrong, they'll say "well, of course you're having problems, it's probably because you're doing that crazy unsupported stuff."

So I was worried that I'd never get HTTP Compression running for this ASP.NET site, when today I ran across this HTTP Compression module from Ben Lowery that you can literally drop into your bin directory, add a few things to your web.config, and shazam! your ASP.NET pages are compressed. Now that's frickin awesome. And it's free & open source. And it seems to work.

So...if you have an ASP.NET site that you'd like to try compressing, and you either can't or won't configure compression in IIS, give Ben's module a try. Note that compression uses up CPU, so if you're using shared hosting, you should probably use the deflate algorithm on the low setting to minimize the CPU usage. And even that might be too much CPU utilization -- you'll have to see.

Also one thing I noticed ... the high/medium/low compression settings only affect deflate, not gzip. :/

Edit: well, looks like it's somehow corrupting the AJAX return calls in Anthem. Or, trimming out most of the JSON. Or something. Anyhow, the non-AJAX pages seems to work pretty well, but I'll test it a bit further. I like how to can specify URLs & mime types to not compress, although the ability to provide a regex to skip compression on would be nice.

March 13, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [1]



 Friday, March 09, 2007
 
 

Brian Benzinger put together a big list of developer-oriented sites listing things about project collaboration, code control, bug/issue tracking, etc.. Basecamp is of course on there, but I saw a bunch of new sites that seems interesting.

His post merges well with this one.

March 9, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]



 Wednesday, March 07, 2007
 
 
Ok Zend Studio Standard is only $99, not "hundreds of dollars" like I said before. It comes with debugging, code-completion, & some other stuff. So maybe it's not a bad (non-free) alternative to PHP Designer, TruStudio, etc.
March 7, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]



 Tuesday, March 06, 2007
 
 

Let's say you already have Visual Studio 2005 Professional, but you now want to be able to connect to Team Foundation Server from within Visual Studio. Let's say you have a Team Suite CAL (needed to access TFS), but you want to connect to TFS using your existing VS Professional install, and avoid the "traditional" route of spending 3+ hours uninstalling VS Pro, SQL 2005, and everything else, then reinstalling VS Team Suite.

You could probably use the MSSCCI provider, but I sortof wanted to use the cool Team Explorer as a Visual Studio addin. So to do that, I believe you can

  1. Download & install the Office 2003 Primary Interop Assemblies. Per this post, even though Team Explorer requires Office Project, the interops are all that's needed.
  2. Download & install Team Explorer

Now you should be able to connect to TFS using Visual Studio Pro with the Team Explorer addin. This is untested (so far), but I'll be testing this theory extremely soon & letting you (my two faithful readers) know.

Mild rant: why is Team Explorer a 250mb download as an .IMG file? You'd think it could be way smaller if we only want the add-in version (instead of the standalone client), and in a ZIP file, too. Oh well.

Edit: I recently tested this process and it does indeed work. :)

March 6, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]



 
 
FYI, if you're in the Microsoft Empower for ISV program, you don't get a Visual Studio Team Suite license, even though you do have a pretty good MSDN subscription. This was news to me, & was a bummer. I've read that one way to get Team Suite licenses at a discount is become a Certified Partner (fill out some info, get a certification, and pay $1300 or so), but that still hurts.
March 6, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]



 Monday, March 05, 2007
 
 

FYI I started a GoDaddy VDS (Virtual Dedicated Server) wiki at

http://godaddyvds.wikispaces.com/

My $0.02 on wikispaces: you can create a free, basic wiki there. It's not bad, although slow. I'd like to be able to set my preferences so that when I edit a page it starts with the text mode editor instead of the WYSIWYG editor, b/c
it takes considerably longer to edit a page using the WYSIWYG editor than the text editor. Also, the lack of any AJAX on the site is noticeable...everything you do involves a page load or page refresh (this is why the WYSIWYG editor is so slow, since it uses a number of popup windows).

So, if your audience is non-technical and/or you want a hosted solution, Wikispaces is fine. Or try StikiPad which is pretty similar (thx Scott).

Otherwise, if you have your own Linux host and/or you're more of a techie? Pick a different wiki. :) Moin Moin is easy to install, Giki is really easy to install (no search feature though), TWiki is easy enough...there are a lot of wikis you can compare. A number of hosting providers (e.g. DreamHost) offer various wikis as one-click installs, which is even easier. :)  And of course there are a few ASP.NET Wikis you can install, too.

Other | Tools
March 5, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]



 Friday, March 02, 2007
 
 

I updated Project Timer a bit. Projects are now grouped by day (each day has different projects), you can record notes for a project, and all your data is saved on your local machine.

Future ideas would be to let the user have a master project list, export data to Excel, and integrate with sites like SlimTimer.

 

March 2, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]



 Thursday, March 01, 2007
 
 

If you want a better administrative panel on your GoDaddy VDS/VPS, and you have PHP5 installed, you can install WebMin. SSH into your box using PuTTY.

First we want to install Perl's Net::SSL library, which allows Webmin to run under SSL. But first we need the OpenSSL source code:

su - root

cd /usr/local
wget http://www.openssl.org/source/openssl-0.9.7f.tar.gz
tar xvfz openssl-0.9.7f.tar.gz
mv openssl-0.9.7f openssl

Next we install perl's Net::SSL library via RPM:

wget ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/linux/extras/4/i386/perl-Net-SSLeay-1.26-3.fc4.i386.rpm
rpm -i perl-Net-SSLeay-1.26-3.fc4.i386.rpm

Now test to make sure Net:SSLeay works. When you run the below command you should get no response. If you get an error then it's not installed correctly:

perl -e 'use Net::SSLeay'
Ok, now we can download and install WebMin:

wget http://prdownloads.sourceforge.net/webadmin/webmin-1.330-1.noarch.rpm
rpm -U webmin-1.330-1.noarch.rpm

Now you can log into webmin at https://yourserver:10000. Log in under the same account as your PuTTY account.

Note the above assumes you're installing version 1.330 :)

Hosting | OS | Tools
March 1, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]



 
 

activeCollab is a free, open source competitor to Basecamp, a very popular online project collaboration tool. It's been getting good buzz & good steam, but I was bothered to read this on their blog a few days ago (edited):

There will be no 0.7.5 or any other major version in 0.x branch. Next major release is activeCollab 1.0 and it is scheduled for summer 2007. Code in 1.0 branch is not compatible with 0.x code so parallel development is not possible.

To keep the development process focused as possible there will be no public beta versions.

activeCollab 1.0 and future core development will be developed exclusively by company that [Ilija Studen, the activeCollab founder] started, and [the] community will be able to contribute by developing plugins, themes and translations.

Note that the above are exerpted from the full blog post. When asked about licensing, Ilija responded with

Can’t tell much about licensing, but we will most probably go with something used by profit oriented open source projects (MySQL, SugarCRM…) One thing is for sure – there will be a free and open source version that match current feature set so current users will not be let down when 1.0 gets launched.

Whole point of this transformation is to provide more value to users, not to drive them away. We are aware that some people will now like the idea of profit oriented open source project, but still being able to provide good support, dedicated development team and guaranty that we’ll be here next year is something that we find really important. Hope that most of the users agree with us on that.

So...hmm. To me it sounds like activeCollab is privatizing the project, disappearing for several months before the next release, and focusing more on profit. Not a good sign, really...I felt it had potential to move ahead, fueled by contributions from the community, but whether for money-seeking and/or project management reasons, that sounds like it's going to change. It might work out well, but I could also see the project disappearing for months while the community waits patiently for summer 2007. The community asks about progress, but since the source & beta are closed, no one can monitor progress. The deadline slips to fall 2007, then winter 2007, and ... well, could be bad.

Granted, I could be wrong .. I don't know Ilija or the team he's assembled, and 37 signals did very well with a small team & closed source when they built BaseCamp. Of course, one of activeCollab's strengths (IMO) is that it's not BaseCamp.

I wouldn't be surprised to see some of the activeCollab community forking off the source code on their own & keeping a separate open source version of activeCollab under a new name. It happens with wikis a lot, I know. :)

Edit: this thread in the activeCollab forums is worth reading if you want more background on Ilija's motivation. It seems like Ilija wants to work on activeCollab, wants it to remain free, and wants it to be a successful product that's still around 5 years from now. But, he wants to earn a living on it, and he feels like having a controlled (not open?) project with a small team (ideally in the same physical space) is the right way for him to achieve that. Not that there's anything wrong with his goals & opinions, but I think the activeCollab community was definitely (IMO) caught off guard.

March 1, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [3]



 
 

Read/Write Web has a writeup on software for virtual teams. Stuff for project collaboration, VoIP, screen sharing, source code repositories, etc.

Also see my other tools roundup post, or the Tools category.

March 1, 2007    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]