Tuesday, August 05, 2014

Setup Conceptnet 5 Server

Tested on

  1. Server 64GB of Ram
  2. Debian 7

 

Install dependencies

>>> sudo apt-get install java-7-openjdk python-pip curl git libatlas-base-dev gfortran vim
>>> sudo pip install virtualenv

 

Install cnet5-solr (Apache Solr)

>>> wget http://conceptnet5.media.mit.edu/downloads/20120501/conceptnet5-solr-config.tar.gz
>>> wget http://conceptnet5.media.mit.edu/downloads/current/conceptnet5_solr_json_20140415.tar.bz2
>>> tar -xvzf conceptnet5-solr-config.tar.gz
>>> tar -jxvf conceptnet5_solr_json_20140415.tar.bz2
>>> cd cnet5-solr
>>> java -jar start.jar
>>> ./import-solr-json.sh ../conceptnet5_solr_json/*.json


Install conceptnet5 API server (Python)

>>> git clone https://github.com/commonsense/conceptnet5.git
>>> virtualenv conceptnet-env
>>> source conceptnet-env/bin/activate
>>> cd conceptnet5
>>> python setup.py develop
>>> pip install numpy scipy gunicorn
>>> cd data (conceptnet5/data)
>>> wget http://conceptnet5.media.mit.edu/downloads/current/conceptnet5_vector_space_20140415.tar.bz2
>>> tar -jxvf conceptnet5_vector_space_20140415.tar.bz2
>>> mkdir -p assoc/space
>>> mv conceptnet5_vector_space_20140415/* assoc/space/
>>> cd ../
>>> vim conceptnet5/api.py (conceptnet5/conceptnet5/api.py)
 

Line 132: change sharded = True to sharded = False
Line 167: change SOLR_BASE = 'http://salmon.media.mit.edu:8983/solr/select?' to SOLR_BASE = 'http://localhost:8983/solr/select?'


>>> vim gunicorn.sh
 

Line 1 and Line 2 edit path to match your setup path

>>> ./gunicorn.sh

Friday, July 04, 2014

Compile source from SVN

$ apt-get install libtool automake
$ libtoolize --force
$ aclocal
$ autoheader
$ automake --force-missing --add-missing
$ autoconf

Sunday, January 06, 2013

Linux command to replace string in all files in directory

    grep -rl 'string1' * | xargs sed -ie 's/string1/string2/g'

Change string1 to string you want to replace.
Change string2 to replace string. 

Delete all files with same extension in Linux command

    find . -name '*.yourext' -print0 | xargs -0 rm

Replace yourext with extension you want.
Or change *.yourext to pattern that you want.

Tuesday, December 04, 2012

Blue Highlight on Desktop Icon Name Windows XP

Method 1
  1. Right click on Desktop.
  2. Click on "Arrange Icons By".
  3. Uncheck on "Lock Web Items on Desktop".
Method 2
  1. Right click on "My Computer".
  2. Click on "Properties".
  3. Click on "Advanced" tab.
  4. Click on "Settings".
  5. Click on "Visual Effects" tab.
  6. Check on "Custom".
  7. Check on "Use drop shadows for icon labels on the desktop".
Method 3
  1. Right click on Desktop.
  2. Click on "Properties".
  3. Click on "Themes" tab.
  4. Select "Windows XP" theme.
  5. Click on "OK" button.
Method 4
  1. Right click on Desktop.
  2. Click on "Properties".
  3. Click on "Desktop" tab.
  4. Click on "Customize Desktop " button.
  5. Click on "Web" tab.
  6. Delete all item in "Web pages" box except "My Current Home Page".
  7. Uncheck on "My Current Home Page".
  8. Uncheck on "Lock desktop items".
  9. Click on "OK" button.