Posted: November 3rd, 2009 | Author: James | Filed under: linux | Tags: linux, subversion, svn, ubuntu | 6 Comments »
I’ve got a number of servers that are currently running the latest LTS release of Ubuntu, 8.04. Unfortunately this release doesn’t have the latest version of subversion (1.6.6 at time of writing) available from apt and as the various clients that get used to access these working copies get updated, they stop working with the command line version on the server (1.5.1).
I found installing from source a bit fiddly at first but after some research managed to get everything hooked up as required.
Start off by grabbing the latest version from the subversion site and untar/gzipping it
wget http://subversion.tigris.org/downloads/subversion-1.6.6.tar.gz
tar xf subversion-1.6.6.tar.gz
There’s a few pre-requisites that need to be installed to compile subversion so if you’ve not already got them add these packages.
sudo apt-get install libc6-dev g++ gcc
sudo apt-get install libapr1 libapr1-dev libaprutil1 libaprutil1-dev libneon27 libneon27-dev
Configure the compilation from within the newly uncompressed directory and declare where you want the binaries to be saved to
./configure –prefix=/usr/bin/subversion-1.6.6 –disable-nls
And finally run the make process
make
sudo make install
All being well you should have the latest version of subversion accessible from the directory you specified (in our case /usr/bin/subversion-1.6.6). If you want this new version to precede the existing version so you don’t have to write in the full path each time. Alter /etc/environment and add the path to the newly installed subversion to the start of the PATH variable. e.g.
PATH=”/usr/bin/subversion-1.6.6/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games”
Reload you environment file with
source /etc/environment
And type svn ––version to check that you do indeed have SVN 1.6.6 installed
svn, version 1.6.6 (r40053)
compiled Nov 3 2009, 12:19:16
Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
svn, version 1.6.6 (r40053) compiled Nov 3 2009, 12:19:16
Copyright (C) 2000-2009 CollabNet.Subversion is open source software, see http://subversion.tigris.org/This product includes software developed by CollabNet (http://www.Collab.Net/).
Posted: May 15th, 2009 | Author: James | Filed under: linux | Tags: linux | 3 Comments »
Again, part of the ‘need to write this down somewhere cos i’ll need it at some point in the future’ series – counting the number of files in a directory in Linux.
ls -1 | wc -l
Posted: May 15th, 2009 | Author: James | Filed under: linux | Tags: convert, imagemagick, linux | No Comments »
The main point of this blog post is so that I have a resource next time I need to do this job. I’ve recently been presented with thousands of images that need to be converted to different sizes and didn’t really want to go to the hassle of installing some 3rd party utility or writing a script.
ls *.png | xargs -I {} convert -thumbnail 200 {} thumb.{}
You can add whatever arguments are required to the convert command. In this case i’ve specifed a thumbnail with a width of 200px. The brackets {} represent the file you’re operating on so in the example above the new image has thumb. prepended to the filename.
Posted: May 8th, 2009 | Author: James | Filed under: Web Development, Work, linux | Tags: amazon, amazon ec2, apache, aws, ec2, hosting, lighttpd, ubuntu | No Comments »
I mentioned previously that I’d been looking at Amazon EC2 as a solution to host a site that underwent heavy bursts of traffic for only a couple of hours a week. The expected traffic bursts were 10-15k visitors in a 2 hour period and unfortunately a small EC2 instance just wasn’t enough. The next trial was with a large EC2 instance, with Apache tweaked to allow more simultaneous connections. Results went better than first time but I ended up having to bounce Apache a couple of times during the time frame to get it back up and running.
So fast forward to this week and it was time to try again. This time I went with an Extra Large instance running a stock 64-bit Ubuntu 8.04 and Lighttpd instead of Apache. And this time there were no problems. For the full 2 hours the site remained up and responsive, and because I could time the instance to come up just before the additional cost was negligible.
To give you an idea of the kind of traffic it had to deal with, the site took in just over 25,000 unique visitors in a 2 hour time frame. Glad to get the problem solved and now I know what to do next time I need some heavy traffic handled.
Posted: April 26th, 2009 | Author: James | Filed under: Web Development, linux | No Comments »
Recently while helping a friend with their website I required the need to convert any video file uploaded to FLV and have that display on the site. My first instinct was to set up a conversion pipeline using FFMpeg on the Ubuntu server and have that convert the videos as required. Unfortunately there seems to be an issue with the standard FFMpeg release on Ubuntu as it has issues attaching the sound when converting to Flash video.
Luckily it can be fixed fairly trivially by installing FFMpeg from Medibuntu. Turns out the FFMpeg is in Medibuntu as some of the encoding libraries it use may violate some patents.
To get things up and running start by adding Medibuntu to your sources lists
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
and then add Medibuntu to your sources keyring
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
Finally, install FFMpeg and its related tools
sudo apt-get install ffmpeg
sudo apt-get install libavcodec-dev libavcodec1d libavformat-dev libavformat1d libavutil-dev libavutil1d libpostproc-dev libpostproc1d libswscale-dev libswscale1d
And now when doing conversions with FFMpeg on Ubuntu the sound should be properly encoded as well. This information was grabbed from the Ubuntu Forums.