intall lua 5.2.1 on scientific linux 6

 

  • download lua
  • unzip
  • check that intel compiler modules are unloaded
  • > make linux
  • > make local
  • > mv install ~/modules/lua/5.2.1
  • edit modfiles:

 

> cat modules/modfiles/lua/5.2.1

#%Module1.0

proc ModulesHelp { } {

  puts stderr “This module sets up lua 5.2.1 in your environment.”

}

 

module-whatis “This module sets up lua 5.2.1 in your environment.”

 

set LUA_DIR /global/home/users/kigumen/modules/lua/5.2.1

setenv LUA_DIR $LUA_DIR

prepend-path PATH       $LUA_DIR/bin

prepend-path MANPATH    $LUA_DIR/man

  • add to .bashrc

if [ -d "/global/home/users/kigumen/modules/modfiles" ] ; then    MODULEPATH=”$MODULEPATH:/global/home/users/kigumen/modules/modfiles”

fi

  • add to .bashrc module load lua

installing latest gcc compiler on scientific linux or centos

  • install zlib
  • add zlib to ld path> export LD_LIBRARY_PATH=”/global/home/users/kigumen/modules/zlib/1.2.7/lib/:$LD_LIBRARY_PATH”
  • download bzr source.
  • extract it.
  • get gsrc:
  1. ./bzr-2.5.1/bzr checkout bzr://bzr.savannah.gnu.org/gsrc/trunk/ gsrc
  1. $ cd gsrc
  2. $ ./bootstrap # to create the configure script
  3. $ mkdir ../gnu
  4. $ ./configure –prefix=$HOME/gnu # directory to install the packages
  5. $ make -C gnu/gcc
  6. $ make -C gnu/gcc install

ssh using connectBot to amazon ec2 (aws)

  1. enable password access to ec2 http://bensnotepad.com/enable-password-access-to-your-amazon-ec2-linux-instance/
  2. (optional) use a public key instead of a password http://www.arbi.se/using-connectbot-for-ssh-with-pubkey-authentication/

use libboost with intel compiler 12.1 under ubuntu 11.10

by default ubuntu installs libboost 1.46 library as libbooost-all-dev. it doesn’t work with icpc, icpc gives errors:

Read more…

Search for text in multiple pdf/ps files and count the occurrence of the text. (ubuntu, linux)

to convert pdf to text use pdftotext from poppler-utils:

sudo apt-get install poppler-utils

this function uses find to locate all *.pdf files in the current directory, converts pdf to text and counts appearance of the search term in the file:

spdf () { find . -name "*.pdf" -print0| while read -d $'' file; do co=$(pdftotext -q "$file" - |grep -c $1); if [ $co -ne 0 ]; then echo $co - "$file" ; fi ; done }

use:

> spdf modes

will list files that contain the word “modes” and will tell you how many times it is mentioned in the file. i’m not sure but may be it just list the lines that contain the word(s).

this would be useful if you search for publications and want to see which one is more relevant. one way to find out is to see which one mentions your term the most.

for ps use

sps () { find . -name "*.ps" -print0| while read -d $'' file; do co=$(ps2txt "$file" |grep -c $1); if [ $co -ne 0 ]; then echo $co - "$file" ; fi ; done }

Running ubuntu 11.04 partition in windows 7 VirtualBox

the title means that you have a dual-boot and you would like to access an existing  linux partition using virtual box.

in short: 1) create .vmdk file using VboxManage.exe. 2) create VM 3) check  ”Use host I/O cache” Read more…

Comment (annotate) and highlight PDF in linux (Ubuntu 11.04)

I was searching for tools that allow easy commenting and highlighting of PDF files.

xournal

Xournal is good but it doesn’t parse the pdf file. xournal creates a layer on top of the pdf, where the user can draw or write annotations. it also doesn’t allow to write comments that can be hidden/expanded. u can get xournal through ubuntu software center

foxit

the linux version doesn’t offer annotations or highlighting. you need to install a windows version with wine. versions that worked

i used Portable Foxit Reader 4.3.1 Build 0323

Update: Acrobat reader 9, which you can get for free, has the functionality to comment, highlight and draw.

Follow

Get every new post delivered to your Inbox.