October 31, 2013

Setting up ElasticSearch on CentOS: plugin, run as a service

Setting up ElasticSearch is straight forward, but there are a few things to note.

CentOS on VM or a physical machine
- Assumptions: sshd is installed.

1. If it's fresh install of CentOS, you're accessing it remotely and you're sure it's in secure network (not directly connected to the internet), then you can turn off the firewall to access ElasticSearch's default port 9200.
$ sudo service iptables save
$ sudo service iptables stop
$ sudo chkconfig iptables off
$ sudo service ip6tables save
$ sudo service ip6tables stop
$ sudo chkconfig ip6tables off

2. Install ElasticSearch
- Download ElasticSearch.
- Uncompress the files on the CentOS server and put it under where you put optional 3rd party software.  I use /opt.

3. Install as a service
# generate wrapper for ElasticSearch
$ curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
$ mv *servicewrapper*/service /usr/local/share/elasticsearch/bin/
$ rm -Rf *servicewrapper*
$ sudo /usr/local/share/elasticsearch/bin/service/elasticsearch install

# Add it as a service
$ sudo chkconfig --add elasticsearch

# check if installed as service
$ sudo chkconfig --list | grep elasticsearch

4. Start it as a service
sudo service elasticsearch start

5. Install the plugins.  The instruction is here.

October 29, 2013


Logo for the PicoLisp programming language.png
I recently found picolisp, anothe lisp dialect - http://picolisp.com (http://en.wikipedia.org/wiki/Picolisp)  Its notable features are: small and fast.  But it's an interpreted environment, it's a "dialect", meaning slightly differnet from common lisp, and fixed point, no floating point support.

It is an MIT open source project and I've compiled it on CentOS 32 and 64 bit environments and also in cygwin.  It runs pretty quick, and I really like its simplicity.  I'm still learning it and so far it looks pretty good.

The author is extremly helpful and the mailing list members respond pretty quickly although the group is small.

Lisp + Emacs + Slime on Windows, Lisp Cabinet

LispBox is very much outdated.  Use Lisp Cabinet:


The small executable will download the packages I select and different lisp, and it's done.  Very convenient.

Neo4j Install on Windows 7 and GUI client

It's been a while since I played with Neo4j -- and this came up today in the discussion with my colleague, so I want to try again.

My main home development system is Windows 7 with lots of linux VMs -- and I have neo4j running on one of VPSs on CentOS, so for local development, I want to install on Windows.

Neo4j currnet version is 2.0.0M06 (community edition), and it has Windows 64 bit with installer.  Nice. (http://www.neo4j.org/download)

Neo4j Manual is here: http://docs.neo4j.org/


Ian Robinson - What is a Graph Database? What is Neo4j? from Neo Technology on Vimeo.

And I also found this nice GUI client (windows only): https://gephi.org/


October 18, 2013

fish shell

I've been using bash shell for a long time.  I looked around for a better shell, and tried a few -- and decided to try fish shell. (http://fishshell.com/)

The compilation failed in my VPS running CentOS 6 64-bit for some reason ("missing ncurses" but all ncurses packages are installed), but found RPM from here, http://rpm.pbone.net/.  This saves a lot of time of mucking around with the source code and make files.

fish user document is here, http://fishshell.com/docs/current/

To change the default shell, issue "chsh" command.

So far it's good.  Try it if you haven't.

October 2, 2013

[Windows] Check your computer time


Amazingly, my Win7 PC was 8 seconds behind.  Windows' default time sync frequency is 7 days.  Here is how to change the frequency:

  1. RedEdit this --> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w32Time\TimeProviders\NtpClient
  2. Click on "SpecialPollInterval" and modify.
  3. Change to "Decimal".  Default is 604800 seconds.
  4. I changed this to 28800 (8 hours).