Posts tagged with 'debian'
Posted on 10th September 2008. Tagged as tips, ruby, debian
I run Debian Etch on a 256MB Xen instance (provided by Mampi). For quite a long time I've been running into out of memory errors when using RubyGems. The usual transcript would go something like this:
$ sudo gem install rails
Bulk updating Gem source index for: http://gems.rubyforge.org
Killed
For a while, I hacked around this problem by increasing my RAM to 512MB when I needed to run RubyGems (which is a terrible solution, but I have the ability to increase my RAM at will, and when all you have is a hammer, everything looks like a nail). I was using the packaged version of RubyGems (0.90), which it turns out is horribly out of date now. I can't find a definitive source, but various mailing lists are pointing to an issue with the YAML parser causing Gems to use far too much memory.
The upgrade to a more recent version of RubyGems is fairly simple:
wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
tar xzf rubygems-1.2.0.tgz
cd rubygems-1.2.0.tgz
sudo ruby setup.rb
If you haven't removed your old (packaged) version of RubyGems, you will need to do so now, then create a symlink to the new Gems executable:
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
If you run the new version of Gems, you'll notice much reduced RAM usage.
Posted on 21st September 2009. Tagged as web, tips, debian, apache
Every time I need to raise a pitiful YSlow score, I follow the same recipe, and every time I do so, I realise I've not written it down anywhere. In my continuing quest to turn convert this blog from interesting narrative to boring snippets archive, I present the appropriate apache.conf stanza:
# Enable Expires header
ExpiresActive On
ExpiresByType image/gif "access plus 30 days"
ExpiresByType image/jpeg "access plus 30 days"
ExpiresByType image/png "access plus 30 days"
ExpiresByType text/css "access plus 30 days"
ExpiresByType application/x-javascript "access plus 30 days"
ExpiresByType image/x-icon "access plus 30 days"
ExpiresByType text/html "access plus 1 hour"
# Enable gzip compression
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
Enabling the required modules is left as an exercise to the reader, on a Debian-ish system, the modules are installed as 'deflate' and 'expires'.
Posted on 1st January 2010. Tagged as django, python, debian, osx, emacs, personal
Like nearly everyone else on the planet, I've spent some of today thinking about how I can do better next year. My resolutions are roughly split into two categories; tech stuff, and everything else, which makes sense considering I spend at least half of my waking hours in front of a computer.
Since I can remember, I've compulsively tinkered with the computer in front of me; changing hardware, changing operating system, experimenting with different editors, different languages and different organisational systems. I'm a classic computing dilettante, I have a very broad knowledge and very shallow of many areas of programming and administration, but no real expertise anywhere. This bleeds into my choice of environment; I'm forever switching tools and languages trying to find the perfect tool. After years of searching, I've not come any appreciable distance nearer to that goal, so it's time to stop trying.
From what I can tell, this is a fairly common disease among programmer types. Some may tinker with software, some with their time management system, but the problem remains the same; we are wasting time trying to perfect a system which will never be perfect.
So, the main tech resolution I've made is to stop trying new things. This has been happening naturally over the last few years anyway, it's probably a combination of age and habit, but I'm going to endeavour to ignore new software, new methodologies and new trends in the coming 12 months. For the next year, I'm going to use the following tools, without deviation:
- OSX Snow Leopard on my laptop, Debian Lenny on the servers. I already know these platforms, they're both stable, and I have no reason to try anything else. I'm often tempted to try the latest releases of operating systems, which inevitably results in a week of lost productivity. As far as I know, there is no scheduled OSX release in 2010, and no release date has yet been set for Squeeze.
- TextMate. I've spent about half of 2009 using Emacs, but the power of Emacs comes at the expense of distraction; the hours I've spent writing elisp to try to save myself 10 seconds here and there far outweigh the actual time saved. TextMate is stable, the next release is a long way off (in fact, the TextMate 2 FAQ says it's coming when we get Duke Nukem Forever, so I guess that means never), and the lack of customisability compared to Emacs means there's just less to tinker with.
- IPython. I've spent far too long investigating other Python Repls, and while bpython is nice, IPython and ipdb.set_trace() have become so ingrained in my muscle memory that changing to anything else isn't worthwhile.
- Django. I'm not sure exactly how the roadmap for Django is laid out, but I suspect the 1.2 release will be with us for most of 2010, and Django is adequate for all the work I'll be doing with 84labs in the next year. I've toyed with Kohana, Rails and Seashore in the last year, and none of those brought any significant benefits over Django that would be worth holding on to.
- Safari. Safari is the most pleasant browsing experience to use on OSX. 2009's development of the Web Inspector removed any real dependency I had on Firebug, and combined with ClickToFlash and /etc/hosts level ad blocking, I've no need to use any other browser. Thankfully, I very rarely need to test my work in other browsers, so while I'll probably keep around a Firefox installation, it's very unlikely that it'll become my browser of choice again.
So, that's it. We'll see in 2011 if I'm still using this software (that's where the 'resolve' comes in), but I'm looking forward to gaining at least a week or two of productive work simply by keeping a static environment.
Will anyone else commit to joining me?