
Writing about C++, Programming, FOST.3™, Mahlee™, the web, Thailand and anything else that catches my attention—with some photos thrown in
The latest version of Fost was tagged in our repositories a few days ago.
The latest release was tagged yesterday.
The next version is due out in June 2012. The most interesting changes are:
| Linux & Mac |
|---|
svn co http://svn.felspar.com/public/fost-hello/tags/4.12.03.44089 fost-hello cd fost-hello Boost/build hello/compile dist/bin/hello-world-d On the Mac you will need to set DYLD_LIBRARY_PATH before running hello-world-d export DYLD_LIBRARY_PATH=dist/lib dist/bin/hello-world-d |
| Windows |
svn co http://svn.felspar.com/public/fost-hello/tags/4.12.03.44089 fost-hello cd fost-hello Boost\build hello\compile dist\bin\hello-world-gd |
Everything is available through our Subversion repository. Below are the locations for the tagged releases for Fost 4.12.03.44089 components.
Since that unfortunate incident last summer when the contract for the web server I'd been using was cancelled I've been running this site on an EC2 micro instance. This is great and all, but micro instances aren't all that fast and they have very limited CPU (at least, for anything other than in short bursts). Windows, SQL Express, and everything else that this has been using have a lot of overhead and the micro instance has been somewhat slow.
Actually, that's an understatement. It's been pretty much unusably slow :(
Today though I've finally managed to get the new web server up and running with (at least most of) the old content. Some things don't work — user logins, the forums/threads, the postcode pages and a couple of other minor things. The new server software also doesn't have any content authoring capability, but I can solve that by simply running a version of the old software in a virtual machine.
There are some parts that I've not brought across yet, those will give “Service Unavailable” for now. I'm sure that I've forgotten redirects and other such things. I'll get all of this stuff fixed up over the coming months (honest).
This new version is totally written in C++ using Fost 4. Most of the actual content is rendered by the old software and written as files on disk. The site chrome is wrapped around this and knowledge about the site structure is in a JSON database.
I'll write up more details about how all of this actually works, but for now I'm just going to be happy if this new software is a lot more stable and a lot faster than the old…
At Proteus we're doing some experimenting with git for a few new projects. We're making use of git flow, despite an expectation of having problems with it under Windows.
For the examples I'm going to use our profab project on github, but all of our projects work the same way.
Make sure that you have the very latest git flow installed. This will make sure that you are properly tracking the develop branch after you set up a repository.
$ cd /tmp $ wget —no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo bash $ git flow version 0.4.2-pre
I do this in /tmp as the sudo execution of the install script leaves a check out of git flow in the current folder with root file permissions.
You really want to install bash completion as well. You also really want to use git cola for managing check ins (apt-get git-cola on Ubuntu).
First of all, we need to fetch the data:
$ git clone git@github.com:Proteus-tech/profab.git Cloning into profab… remote: Counting objects: 1276, done. remote: Compressing objects: 100% (478/478), done. remote: Total 1276 (delta 835), reused 1215 (delta 774) Receiving objects: 100% (1276/1276), 139.76 KiB | 71 KiB/s, done. Resolving deltas: 100% (835/835), done.
Then we need to initialize git flow. This has to be done every time a project is cloned.
$ cd profab $ git flow init -d Using default branch names. Which branch should be used for bringing forth production releases? - master Branch name for production releases: [master] Branch name for "next release" development: [develop] How to name your supporting branch prefixes? Feature branches? [feature/] Release branches? [release/] Hotfix branches? [hotfix/] Support branches? [support/] Version tag prefix? []
This will leave you on the develop branch ready to start working.
$ git branch * develop master
We track individual tasks by story card, so we'll just follow that convention for now.
$ git flow feature start card-123
This will create the correct branch for you and leave you ready to work on the card.
If during the development of this you want to get changes from the develop branch then you'll need to switch back to it, pull changes and then merge them in to your feature branch.
$ git checkout develop Switched to branch 'develop' $ git pull —rebase remote: Counting objects: 5, done. remote: Compressing objects: 100% (1/1), done. remote: Total 3 (delta 2), reused 3 (delta 2) Unpacking objects: 100% (3/3), done. From github.com:Proteus-tech/profab 9d414f0..4567ef5 develop -> origin/develop First, rewinding head to replay your work on top of it… Fast-forwarded develop to 4567ef5040386ef545d8bfe57bb74b3f6cdb8ad3. $ git checkout feature/card-123 Switched to branch 'feature/card-123' $ git rebase develop First, rewinding head to replay your work on top of it… Fast-forwarded feature/card-123 to develop.
The use of rebase is important here as it makes sure that any changes you have made are put after the changes you get from the origin. This makes merge conflicts far easier to deal with and also makes the history easier to understand as commits don't get interleaved.
In any case, when you've finished a feature you need to get your changes back in to develop.
$ git flow feature finish card-123 Switched to branch 'develop' Already up-to-date. Deleted branch feature/card-123 (was 4567ef5). Summary of actions: - The feature branch 'feature/card-123' was merged into 'develop' - Feature branch 'feature/card-123' has been removed - You are now on branch 'develop' $ git pull —rebase Current branch develop is up to date. $ git push Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 429 bytes, done. Total 3 (delta 2), reused 0 (delta 0) To git@github.com:Proteus-tech/profab.git 9d414f0..4567ef5 develop -> develop
This is pretty simple.
$ mkdir -p client/project.git $ cd !$ cd client/project.git $ git init —bare Initialized empty Git repository in /home/git/client/project.git/
The latest version of Fost was tagged in our repositories a few days ago.
The latest release was tagged a few days ago, but no changes have been made this quarter.
The next version is due out in March 2012.
| Linux & Mac |
|---|
svn co http://svn.felspar.com/public/fost-hello/tags/4.11.12.43952 fost-hello cd fost-hello Boost/build hello/compile dist/bin/hello-world-d On the Mac you will need to set DYLD_LIBRARY_PATH before running hello-world-d export DYLD_LIBRARY_PATH=dist/lib dist/bin/hello-world-d |
| Windows |
svn co http://svn.felspar.com/public/fost-hello/tags/4.11.12.43952 fost-hello cd fost-hello Boost\build hello\compile dist\bin\hello-world-gd |
Everything is available through our Subversion repository. Below are the locations for the tagged releases for Fost 4.11.12.43952 components.
These are some notes for running Oneiric on a development machine.
Make sure all old Postgres installations are purged:
sudo apt-get purge postgresql postgresql-8.4
Install postgres:
sudo apt-get install postgresql
Turning off the fsync option will make Postgres run faster as it won't insist that all database changes are written to disk. Clearly do not do this if you care about the data you are writing to Postgres. This shouldn't be a problem on any development machine as they're all test databases.
Edit the server configuration:
sudo nano /etc/postgres/9.1/main/postgresql.conf
Change:
fsync = off
Then:
sudo service postgresql restart
Making proper use of ident authentication means that you can access Postgres without needing to use a password. Many of our Postgres set up scripts for projects assume that you have ident configured as a Postgres superuser.
Run psql as the postgres user to add in your configuration:
sudo -u postgres psql
And now we need to configure ident authentication — my user name is kirit, change to whatever you log in to Ubuntu as:
create role kirit login superuser; create database kirit with owner=kirit;
Exit psql and try again with your own account:
psql
You should now be able to see the postgres prompt again.
I have a Django user that I use across projects:
create role "Django" login superuser password 'django';
From here you can set up the databases or add other roles that you need normally.