Friday, 15 November 2013

Get better performance and life from your SSD in Linux-based systems

I recently purchased a new laptop which came with a 24GB SSD disk. In order to get the most of this technology and prevent unnnecessary writes (which affects the longevity of these systems) I kind of followed the superb advice given at Get better performance and life from your SSD in Linux-based systems.

In particular, I mounted the /home directory in the tradicional HD and moved temporary directories (e.g., /tmp) to RAM.

Works as a charm!

Friday, 9 November 2012

Google link converter

Links provided in the search results of Google look something like
http://www.google.co.uk/url?sa=t&source=web&cd=1&ved=0A&url=http%3A%2F%2Fabc.go.com%2F&rct=j&q=abc&ei=kuw&cad=rja
when the URL it links to is simply
http://abc.go.com/
This tool allows users to transform the former into the later for easier copying and pasting.

Monday, 30 July 2012

Apache ignoring mod_rewrite rules?

Then it is very likely in the site configuration file, usually at
/etc/apache/sites-available 
you have directives such as
AllowOverride None 
Change them to
AllowOverride All 
and try again.

Tuesday, 6 March 2012

Unique rows in vim

Simple! Just

:sort u

Tuesday, 30 August 2011

Sending UTF-8 mail with PHP

I was facing issues sending mail encoded as UTF-8 via PHP. In order to do it properly, you need to set UTF-8 as the encoding for the mail function (first line of code below). Then, mail can be sent (second line).

mb_internal_encoding("UTF-8");
mb_send_mail( 'myrecipient@wherever.com', 'Polite subject', $message, $headers );

Sunday, 26 June 2011

Apache module modwsgi 3.3 on Ubuntu Lucid

A bit of library hell on Linux. I tried to install modwsgi on Ubuntu Lucid. I downloaded the Debian version. However,

root@virt251:/tmp# dpkg -i libapache2-mod-wsgi_3.3-2+b2_i386.deb 
...
dpkg: dependency problems prevent configuration of libapache2-mod-wsgi:
libapache2-mod-wsgi depends on libpython2.7 (>= 2.7); however:
Package libpython2.7 is not installed.
dpkg: error processing libapache2-mod-wsgi (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libapache2-mod-wsgi


You cannot install Python 2.7 (easily, at least) on Lucid, but you can install Python 3.1. Use apt-get and that will do the trick.

Friday, 3 June 2011

Automatic creation of regular expressions in different computing languages

Regular expressions are a powerful tool, albeit they can become difficult to build. This page, text2re, helps you build complex re's and provides code in a number of computing languages such as Python, Perl, etc.