Main

March 19, 2011

Learning from others mistakes - move configs out of your boot loader

I'm a keen believer of learning from other folks mistakes and attempting to not repeat them. Source code disclosure and even worse configuration disclosure which happened with tumblr. One thing to remember, if you keep your configuration for your app outside your webroot, you reduce the chances of you actually accidentally disclosing your configuration. Typically one could even do something like:


<?php
require_once dirname(dirname(__FILE__)) . '/bootstrap.php';


Rather than having everything in your index.php file. Separating your configuration directives out to a separate configuration file outside the webroot and modifying that when making changes.

One can use your version control pre commit scripts to check that you've not borked a the file - checking for php scripts being of a file type php script vs file is one way of doing this - foo.php contains a php script starting with "i?php" and bar.php has same code starting with "

$ file foo.php 
foo.php: PHP script text
$ file bar.php 
bar.php: ASCII text

January 22, 2007

Version controlled home directory?

Evert mentioned that he is keeping his home directory in subversion.

I tend to have two setups. A full and basic home directory. Version controlled using subversion. Previously I used CVS.

The basic gets checked out at webhosts, etc. which I use. The full gets checked out at work and basically ensures that i have some level of sanity with my shells. I'm using svk to do revision control with subversion.

What's in my version controlled home directory:

The only difference between the two currently is that the work one has a few extra directories setup. I tend to use svk for work.

July 3, 2006

Getting subversion to ignore multiple files in a directory

For example to ignore all files with a .jpg file extension the following works:

nostromo$ svn propset svn:ignore "*.jpg" .

But when you now want to ignore multiple files like say "*.gif *.jpg and *.png" using "*.gif *.jpg *.png" does not work as expected:

nostromo$ svn propedit svn:ignore .

Which will give you your editor (vim) in my case and just add the file pattern under each file pattern e.g.:

*.gif
*.jpg
*.png

Don't forget to commit to the repository.

July 2, 2005

Remote subversion backup script

I wrote a script to backup a subversion database from a remote host mainly for syncronising a huge subversion database containing over 9300 changesets and just incremently retrieve changeset data rather than downloading compressed dump which takes over an hour to do.

Feel free to download the script (1.8Kb) and modify for your own usage.

June 14, 2005

Trac 0.8.2 patch for FreeBSD Ports

I've created a patch for upgrading trac to 0.8.2 to fix the issues with subversion 1.2.0.

Specifically the svn >= 1.2.0 trouble ticket 1500 has been re-opened. Expect to see a patch for 0.8.3 once it is released to resolve the additional bug-fix.

June 10, 2005

Subversion Mailing Lists

Was fiddling with colobus this evening and now have the subversion developers mailing running on colobus. Now to just get round to shoving a web interface infront of colobus ;)

June 4, 2005

MySQL choosing subversion for version control?

With all the noise regarding bitkeeper no longer being able to be utilised by Open Source projects, MySQL are looking at using the Subversion version control software.

infoworld caught on that other open-source projects are facing a decision about bitkeeper besides the linux kernel. while the article mentions we’re looking at subversion as an alternative for mysql server development, i don’t imagine that will be our long-term solution. distributed version control is just too nice. but our gui team has been using subversion for their projects for quite a while, and we are using it in many other places.

You have to love Larry's marketing spin on the saga that is brewing.

The Subversion Development Team explain why Subversion is not right for Linus and Debunking BitMover's Subversion Comparison.

May 31, 2005

Subversion pre-commit script

The subversion pre-commit script which I've sent to the subversion developers is online here. Basically what it does is catches commits where there is a short commit message or a blank commit message before they are committed to a subversion repository. As a side effect, it also seems to stop blank commits from users using tortoisesvn.

December 18, 2004

Version Control

What version control software are you using? I've used CVS as well as subversion for version control at work and for personal projects. I tend to prefer subversion currently as it has better ways of managing files than CVS does.

I am wondering if there are any decent ways of migrating hundreds of CVS controlled projects over to subversion and storing the data such as release tags, etc. with each file revision or is it normally better to do a clean import into subversion and then scrap the old cvs repositories?

November 24, 2004

cvs to subversion migration

So I'm busy migrating CVS Repositories from SourceForge over to a locally self-hosted solution. One of my pet irritations with cvs2svn is that it insists on thinking each module is part of the same "project". Highly annoying.

September 22, 2004

Cronable svn updates ala Kasia

Taking a look @ Kasia's blog, she has written a script which runs as part of one of her nightly cronjobs for updating her local copy of code from a subversion repository.

Running "svn update" is really simple and speedy, but I like having a nightly cronjob updating my local copy of the code, so I wrote a script that does just that and sends me a small, quick summary of what it did, paying special attention to conflicts.

I really don't care what files have changed, were added, etc, but I do care which files have merge conflicts.. so that's what this script does..

September 20, 2004

Subversion

Started tinkering with Subversion again in the hopes of figuring it out so that I can get a move on and decide whether I want to migrate from CVS which seems sufficient after fiddling with subversion for an hour today.

I've had a quick glance at the Subversion book seeing that Brad was saying that they are looking at using Subversion instead of CVS for version control at his company.

More and more people have been saying things about migrating to Subversion and I'm at this point in time just going to wait and see what happens.

Afrigator