Installing memcached on CentOS 5 with libevent

13 May 2010 22:03

There’s quite a few guides out there to install memcached and libevent but here are the steps I took to get it installed. This is largely based around checking out my history entries, but, it doesn’t the job!

Note that if you don’t add the prefix to configure libevent you can end up with bits everywhere and it getting a little bit fiddly.

[root@host ~] wget http://www.monkey.org/~provos/libevent-1.4.10-stable.tar.gz
[root@host ~] tar xvfz libevent-1.4.10-stable.tar.gz
[root@host ~] cd libevent-1.4.10-stable
[root@host libevent-1.4.10-stable] ./configure --prefix=/usr/local
[root@host libevent-1.4.10-stable] make && make install
[root@host libevent-1.4.10-stable] cd ~
[root@host ~] vi /etc/ld.so.conf.d/libevent-i386.conf
	insert:
	/usr/local/lib/
[root@host ~] ln -s /usr/local/lib/libevent-1.4.so.2 /lib/libevent-1.4.so.2
[root@host ~] wget http://memcached.googlecode.com/files/memcached-1.4.4.tar.gz
[root@host ~] tar xvfz memcached-1.4.4.tar.gz
[root@host ~] cd memcached-1.4.4
[root@host memcached-1.4.4] ./configure --with-libevent=/usr/local
[root@host memcached-1.4.4] make && make install

Now you should be able to run memcached.

memcached -vv -u nobody

Alternatively of course you can use yum but that’s no fun and not always the latest version.

Filed: General // No Comments

Simplicity with o2

26 April 2010 23:23

If you’ve got yourself an iPhone, particular a 3G, odds are you’re out of, or, coming up to being out of contract. You’re probably paying £35/m right now as well. If like me you’re holding on for June/July to see if a new iPhone is launched, which, it probably will be you’re not going to want to jump into a 18/24 month contract to upgrade to a 3GS (albeit tempting). O2 actually seem to have an answer in their reasonable new Simplicity SIM only tariffs. For £20/m you can get unlimited texts and 300 minutes inclusive.

It’s also really easy to switch online once you’ve found the right links. If you click on the “Shop” dropdown at the top you’ll see an Upgrade Your Phone link. Follow that, enter your mobile number and then the code you’ll get by SMS. Once in you can pick from the don’t want a phone section and just pick the new tariff. You can also just go on a month to month rolling contract which is great, saves you money and hopefully makes you ready for the iPhone 4G. You can also “downgrade” to these tariffs and save £5/m if you go for a 12 month contract.

I’ve gone through the process just now and as yet not received a confirmation email but hopefully that’ll turn up soon!

Edit: Still no email but now the O2 iPhone app shows I’m on to simplicity 20 tariff.

Filed: Personal, Technology // Tagged: , , , // No Comments

MySQL and 0x0B

23 April 2010 12:01

You may or may not know about the wonderful vertical tab character 0x0B. It’s a character that’s not easy to see and can cause issues across a number of different programming languages. In my case a Rails developer was having trouble passing some data from an API. A JSON parser was throwing errors about a specific character. Originally we suspected line breaks were causing the issue but after more digging and examination using Textmate and the Text bundle we spotted the invisible characters and having converted it to hex found out it was 0x0B. A quick Google brings back quite a few results of people having the same problem.

In order to find them in the database I knocked up the following SQL:

SELECT * FROM table WHERE data LIKE CONCAT('%',CHAR(0x0B),'%');

Then to replace them quickly (assuming the 3 records have ID’s 1,2 and 3):

UPDATE table SET data = REPLACE(data,CHAR(0x0B),'') WHERE id IN (1,2,3);

Filed: Technology // Tagged: , , // 1 Comment

Tweeting from the command line

21 April 2010 17:22

I read an article over at OS X Daily about posting a tweet from the command line using the twitter API. Taking this one step further here’s a handy little script that’ll even stop you posting nothing and stuff that’s too long.

#!/bin/bash
TWEET=$1
TWEETLEN=${#TWEET}
if [ $TWEETLEN -eq 0 ] || [ $TWEETLEN -gt 140 ]; then
	if [ $TWEETLEN -gt 140 ]; then
		let EXTRA=$TWEETLEN-140
		echo "Usage: tweet \"message\" (140 chars or less, you're $EXTRA over)"
	else
		echo "Usage: tweet \"message\" (140 chars or less)"
	fi
	exit 1
else
	curl -u username:password -d status="$1" http://twitter.com/statuses/update.xml
fi
exit 0

Save the file as “tweet” and make sure it’s in the path with executable permissions of 755.

chmod 755 tweet

Filed: Technology // Tagged: , , // 2 Comments

New Music

25 February 2010 20:55

Thanks to a simple link over to audioporncentral from a mate I’ve discovered all sorts of crazy cool music in the last fe days. Now it’s not everyone’s taste, but, it’s damn cool. Mainly mashups of assorted but general high quality. The particular standout winner are The Kleptones. Their website has all their music available, for free, mp3 download… just the way it should be! My favourite so far is Uptime from the uptime/downtime record. It’s awesome, so many tunes so little time! The Bestival live also is worth a play.

Filed: Personal // Tagged: , , // No Comments

Phatnoise

6 February 2010 15:56

First blog post in a while, but, here goes anyway!

I’ve got a Phatnoise MP3 system in my Golf and have had the same music on the cartridge for ages. The problem is the company who make it don’t really seem to be around to much and I think have been acquired by Harmon. Either way if you need the latest version of the Phatnoise music / media manager I suggest you go check out this post on a very handy forum!

Filed: Technology // Tagged: , , , , // No Comments

Asynchronous Tracking with Google

2 December 2009 13:43

Google Analytics has had its latest update by now allowing asynchronous tracking cools. Pretty neat and also useful if you’re suffering or concerned on page load times. Interesting to see how it would work with multiple GA accounts, but, in theory should be easy to tweak.

http://code.google.com/apis/analytics/docs/tracking/asyncTracking.htm

Filed: Technology // Tagged: , , , // 1 Comment

Ruby Enterprise Install

9 November 2009 13:31

Trying to install Ruby Enterprise on a fresh RHEL5 64 bit box this morning and hit a few issues. Initially just the standard install requests for gcc, gcc-c++, readline-devel, openssl-devel and zlib-devel. They all installed fine, but, when I tried running the installer I got an error like this:

In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/algorithm:65,
from src/tcmalloc.cc:112:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:64:28: error: bits/c++config.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:69,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/algorithm:65,
from src/tcmalloc.cc:112:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:45:29: error: bits/c++locale.h: No such file or directory
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:46:25: error: bits/c++io.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/memory:54,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_tempbuf.h:64,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:66,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/algorithm:68,
from src/tcmalloc.cc:112:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/allocator.h:52:31: error: bits/c++allocator.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:45,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/string:52,
from src/base/commandlineflags.h:52,
from src/tcmalloc.cc:114:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/atomicity.h:38:30: error: bits/atomic_word.h: No such file or directory
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/allocator.h:82: error: expected template-name before ‘<’ token
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/allocator.h:82: error: expected `{' before ‘<’ token
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/allocator.h:82: error: expected unqualified-id before ‘<’ token
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h: In function ‘void std::random_shuffle(_RandomAccessIterator, _RandomAccessIterator)’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:1906: error: ‘rand’ is not a member of ‘std’
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/atomicity.h: At global scope:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/atomicity.h:44: error: expected constructor, destructor, or type conversion before ‘__exchange_and_add’
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/atomicity.h:48: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:150: error: ‘_Atomic_word’ does not name a type
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h: In member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_dispose(const _Alloc&)’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:232: error: ‘__exchange_and_add’ is not a member of ‘__gnu_cxx’
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h: In member function ‘typename _Alloc::rebind<_CharT>::other::size_type std::basic_string<_CharT, _Traits, _Alloc>::_M_check(typename _Alloc::rebind<_CharT>::other::size_type, const char*) const’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:306: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration of ‘__N’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:306: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h: In member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_M_check_length(typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type, const char*) const’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:314: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration of ‘__N’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h: In member function ‘typename _Alloc::rebind<_CharT>::other::const_reference std::basic_string<_CharT, _Traits, _Alloc>::at(typename _Alloc::rebind<_CharT>::other::size_type) const’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:726: error: tnction ‘typename _Alloc::rebind<_CharT>::other::const_reference std::basic_string<_CharT, _Traits, _Alloc>::at(typename _Alloc::rebind<_CharT>::other::size_type) const’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:726: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration of ‘__N’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h: In member function ‘typename _Alloc::rebind<_CharT>::other::reference std::basic_string<_CharT, _Traits, _Alloc>::at(typename _Alloc::rebind<_CharT>::other::size_type)’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:745: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration of ‘__N’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.tcc: In static member function ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag)’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.tcc:145: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration of ‘__N’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.tcc: In static member function ‘static typename std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type, const _Alloc&)’:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.tcc:533: error: there are no arguments to ‘__N’ that depend on a template parameter, so a declaration

The fix was two steps, first a simple install of libstdc++-devel then follow the instructions to install tcmalloc which is required. Odd that on a 32 bit system it installed straight away.

Filed: Technology // Tagged: , , , // No Comments

Just another day in the office…

30 October 2009 13:34

Halloween 2009, WhiteLabelDating.com style.

Myself, I want to be Frank the Bunny (Donnie Darko) when I grow up.

Photo on 2009-10-30 at 10.45 #2

Filed: General // No Comments

ColdFusion Developers Wanted!

27 October 2009 15:05

Are you looking for a job? Are you a ColdFusion developer? If you are then we’re looking for you!

We’re looking for a ColdFusion developer to join our team of 15 developers and designers at WhiteLabelDating.com. We’re focused on creating the very best online dating platform in the industry. We’re highly profitable, growing quickly and want to recruit the best people to work with our experienced team and be a part of our future.

We’re based at 1 High Street in the centre of Windsor, west of London. We’re easily commutable from London (West from Paddington or South-West direct from Waterloo), Reading, Staines or Slough.

Our core application is written ColdFusion and we’re looking for someone to join the team to help maintain and improve all areas of the code. This would be an ideal role for an intermediate level developer looking to improve their skill set and also diversify into other languages and frameworks such as Ruby on Rails. We are currently investigating architecture changes and someone with an interest in cloud computing, sphinx and highly available database systems would be a great asset.

For the full job spec check out our site: http://www.whitelabeldating.com/jobs/current-vacancies/coldfusion-developer/

Filed: Work // Tagged: , // No Comments

 
What's ianteresting?   •   Twitter   •   About   •   Contact
©2010 Ian Winter. All Rights Reserved.   •   Powered by WordPress   •   Hosted at Memset