How 2 install memcached on Linux (debian)

June 3rd, 2009

Found this great article on how to install memcached

– cut and paste from original poster –

I have installed an instance of memchached version 1.2.2 on one of our servers (Debian etch) today and to keep you from spending a whole afternoon, see my everything-step-by-step instruction below.

Memchached is a distributed hash map, which can be used for example to speed up any kind of web application, see website for details. In our case, we want to use it as temporary data store. I will report about the experiences in a latter post.

introduction

Always refer to this page for details, but I created a version with less text but including steps to really start from scratch.

All lines starting with # are command lines, i.e. you need to type into a linux shell.
Output of any kind is always surrounded by ” even if it is multiline output.

content

a. get libevent (needed to install memcached)
b. get memcached and verify installation
c. use and test memcached within Java with junit/ant

a. installing libevent 1.3

a.1. check for current version of libevent

a.1a.

Log in as root or get super user rights by calling su

# updatedb
# locate libevent

If there is output including “libevent1″ and/or “libevent-1″ (ignore package files like *.deb) -> a.1b, otherwise a.2

a.1b. removing old libevent version

# apt-get remove –purge libevent1
# Y

# updatedb
# locate libevent
Should now return nothing or package files only, i.e. you are ready for installation

a.2. installing libevent 1.3

a.2a downloading and unpacking

# cd /usr/local/src
# wget http://monkey.org/~provos/libevent-1.3b.tar.gz
# tar zxvf libevent-1.3b.tar.gz
# cd libevent-1.3b

a.2b. configuring

# ./configure
check the output, if it contains something like “configure: error: no acceptable C compiler found in $PATH” -> a.2c. otherwise a.2d.

a.2c. compiling

# apt-get install gcc

Redo a.2b.
I got output like “C compiler cannot create executables”, reading file ‘config.log’ did not help me at all. Googling finally did, as I found a forum entry, pointing out a missing lib.
So try this:

# apt-get install libc-dev

Redo a.2b.
If that did  not solve it… sorry … google on, there is no sense in going on without solving this issue. :-/

a.2d. make it!

# make && make install

If you get something like “-bash: make: command not found” -> A.2e, otherwise A.3.

a.2e.

# apt-get install make

Redo a.2d.

a.3. configuration

Press the Esc key as you read [esc] in the commands below.

# vim /etc/ld.so.conf.d/libevent-i386.conf
# i/usr/local/lib/[esc]:wq
# ldconfig

b. install memchached and verify installation

b.1. download, unpack and install memchached

# cd /usr/local/src
# wget http://danga.com/memcached/dist/memcached-1.2.2.tar.gz
# tar zxvf memcached-1.2.2.tar.gz
# cd memcached-1.2.2
# ./configure
# make && make install

After installing gcc and libc-dev in section a, this one went easily for me – if you skipped section a and run in problems here, please install gcc and libc-dev (see a.2c).

b.2. verify installation of memchached

b.2a. start memchached server

# memcached -u www-data -vv

Output should end with line “<3 server listening”. Perfect! :)

b.2b test server

I will refer to this shell in front of you as server shell below. Now, open another shell on the same machine, I will refer to it a client shell.

# telnet localhost 11211

You should see something like “<7 new client connection” on the server shell, switch back to client shell.

# set test1 1 10000 1
# a

You should see “STORED” on client shell and the two following lines on server shell
“<7 set test1 1 10000 1
>7 STORED”

Perfect!
You did it, your memcached is up and running :)

c. memcached and Java

I wrote a little test package using a Java client library for memcached from here, together with junit and ant. You can download it to have a look how simple using memcache is and to verify you installation with an included  junit test, automated with an ant build file.

– end of cut and paste —

ORIGINAL article can be view here

Tips Sharing

June 1st, 2009

After (1 month or more) you have submitted your mdec application, they will email you to attend the evaluation presentation.

So prepare your slides…. put effort on it with ‘Wow’ effect and the most important .. unique yet workable idea…

What i got inside my mail.. might be useful for those who want to apply

Pitching Tips

- Please rehearse your presentation within 10 minutes time frame.

- Focus your presentation on the below areas: -

  • What your idea is all about (Problem statement and your product/services as the solution for the problems)
  • Business model & Revenue Stream
  • Marketing strategy
  • Competitive Analysis
  • Technology Plan
  • Financial Projection

- Limit your slides to not more than 10 slides as there will be another 10 minutes Q&A session after your pitch.

- Please note:

  • The first bell will indicate that you have one more minute to wrap up your presentation
  • The second bell will indicate that the 10 minutes pitch is up
  • The third bell will indicate that the Q&A session is up

Reminder

- You need to be on standby one hour before the time slot provided.

- The attendance of both primary and secondary applicants is COMPULSORY.

- You may bring you registered team member (as in application form) in the meeting

- PLEASE BE ON TIME.

wrap : Do rehearse your presentation within 10 minutes  time.. make sure you speak clearly and sound convincing

tell the truth, my presentation fall this friday. anyway i will keep this post updated.

Dead or Alive (DOA)

June 1st, 2009

My first post on Gawai.. (1st of June)
Found this old image .. somewhere inside the box..
It flashed back lots of memories.
I’m not quite sure when was this taken.. probably end of 2001 or early 2002.

00000361

Andrew.. are you still eating Japanese girls food ?
Tye .. hear nothing from you.. in Malaysia ?
Me…. ‘&(’Kk)D&DD%&$#
Lim… found your lenglui already ? my or jp ?
Seng chye… i know you still breathing ;) somewhere out there
Eddy… hang kat manaq , back to kedah ??
Ramesh yo yo yo.. we play yo yo.. ok .. ramesh where you now ?

With WWW or without WWW

May 12th, 2009

I would say with WWW for better SEO.
Well the decision is up to you.

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.yourdomain.com$
RewriteRule ^(.*)$ http://www.yourdomain.com [R=301,L]

Create and put these code inside .htaccess {root folder} , make sure to replace yourdomain.com with your own domain name

For more tips, type .htaccess tips in your browse and start googling.

May the google with you.

wet saturday

January 12th, 2009

“Rain rain go away little children want to play”. it’s been raining for 1 day straight since 11th jan 2009 flooded a few areas in kuching and samarahan division. Not forgetting kampung hilir in serian. Heavily affected with few houses flooded until the rooftop.

Some people getting profits from this disaster (name it.. car puller truck, juice seller?, boat service provider) while other grieving, cursing due to no shelter, no food, no dry bed to make love, burden with repairing expenses and most of all no place to sleep..

God, if you happen to read this post. Please improve my PR on google. Amen

where the hell?

October 26th, 2008

Hehh… what da hell.. been browsing a lot of hours and even google earth’ing this Komplek CIDB, jalan sultan tengah..

where the hell is this location situated ? Please, and please for easy assessment in future.. please include map in the website so that it’s user friendly and user like me dont have to shed anymore hairs.. again map.. (things that show the location) .. the only  clues that i’ve  is “old ITM situated” .. (after reading, decrypted a blog! ) .

Well tomorrow, the day that i’ll venture and hit my pedal all the way from batu kawa to jalan sultan tengah..!

will give the report soon.

Withdrawn paypal money to tunecard.

October 21st, 2008

Yes, it’s working. I have personally tried it out and walaaa.. i got pretty good amount for buying few can of beers today.
It take only 2 days (including weekend) or less to debit your paypal money to tunecard.

How to withdraw money from tunecard ?
Go to any ATM that accept visa, withdraw your money using the given PIN number from tunemoney. (They will send by mail, snail mail after your registration.) Don’t worry.. i haven’t got mine. Their customer service is so suck.. i sent them 4 emails but yet no solution, until customer service call me and tell me the PIN number by phone… terrible!

Code snippet for wordpress meta hack.

October 16th, 2008

Hope this snippet will help to improve your wordpress SEO.

<title><?php
$title=trim(wp_title(”,false));
if ($title) {
echo “$title – “;
bloginfo(’name’);
} else {
bloginfo(’name’);
echo ” – “;
bloginfo(’description’);
}
?></title>

Click to continue reading “Code snippet for wordpress meta hack.”

Cisco Simulator – Dynamips installation for window

October 13th, 2008

Recently i just busy myself to learn more about networking & IP subnetting. A few steps to refresh and preparing myself for some certs with actual cisco IOS. Here are the tips to install cisco simulator on your windows platform OS. *personally i’m using Boson netsim.

There are many installation tips on Internet, but this would be a easiest way to install Dynamips.
This installation tips for window PC only.

1. Download below s/w

- Dynamips latest version from http://www.ipflow.utc.fr/index.php/Cisco_7200_Simulator
- Dynagen from http://www.dynagen.org/
- Libpcap from http://www.winpcap.org/install/default.htm

** If you download Dynagen / “dynagen-0.10.1_dynamips-0.8.0-RC1_Win_XP_setup”. It comes with latest Dynamips s/w.

Click to continue reading “Cisco Simulator – Dynamips installation for window”

Set language for netbeans IDE 6.1

October 6th, 2008

Currently using windows XP japanese version to do most of my online and offline works. So most of my installed programs run on japanese language by default.

Installed netbean IDE 6.1 on my laptop is not an exception,

this solution will fix the problem for those who want to change english language by default not matter what language of your windows.

Permanent Solution

Go to Netbeans installation directory, for example,

C:\Program Files\NetBeans 6.0.1\etc

Open “netbeans.conf” and find netbeans default option line

netbeans_default_options=”-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true”

Add “-J-Duser.language=en -J-Duser.region=US” to the end of this line

netbeans_default_options=”-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Duser.language=en -J-Duser.region=US