Personal tools
You are here: Home log misc
Document Actions

misc

miscellaneous tips and usages

1   2007-06-11 Google Maps How to find latitude and longitude

http://www.tech-recipes.com/rx/2403/google_maps_get_latitude_longitude_values

look up an address (duh), but this trick only works if the address is centered (it's centered by default). So, moving the map around will not make this work.

copy and paste this code into your browser bar:

javascript:void(prompt('',gApplication.getMap().getCenter()));

2   2007-06-11 Google Maps look up an address by supplying latitude and longitude

open the google maps page

input latitude and longitude separated by comma(,), like 41.32, -86.26 gives you somewhere in Indiana, USA

3   2007-06-12 symbolic computation in linux

3.1   2007-08-05 maxima

don't omit * for multiplication when it comes to multiplication between parenthesis. otherwise, it'll be regarded as function. for example:

a*(b+c) ; this is the correct form to express multiply a with b+c.
a(b+c) ; this is calling a function, a() with b+c as argument.

comment in maxima begins with a semi-colon (;). same as lisp.

2008-04-29 solve quadratic equation:

solve(Hw = s*(1/2*Hw+1/2)+(1-s)*Hb, Hw);
ev(Hb=1/N*((1-u)^2*1/2+1/2*(1-u)^2*Hw)+(1-1/N)*(1-u)^2*Hb, Hw: (1/2*s+(1-s)*Hb)/(1-1/2*s));  (or ev(Hb=1/N*((1-u)^2*1/2+1/2*(1-u)^2*Hw)+(1-1/N)*(1-u)^2*Hb, %o1);
solve(%o2, Hb);

4   2007-07-26 how to use scanner under linux

packages to install

xsane (for program xsane)

gocr and ocrad, optical character recognition program

unpaper, post-processing tool for scanned pages

sane (program xscanimage)

sane-utils (program scanimage). scanimage -L tells you the device.

scanbuttond, without this daemon running, only scanimage works. get this tip from https://bugs.launchpad.net/sane-backends/+bug/85488 .

gscan2pdf (http://gscan2pdf.sourceforge.net/), GUI program to make multiple image into one pdf or deja vu image. depends on most previous packages.

scan.sh in repository shell. similar function as gscan2pdf (written by me before i knew gscan2pdf)

4.1   2007-09-20 use gscan2pdf to add one missing page into a pdf file

import the old pdf file

scan the missing page

save that single missing page into a pdf

import that single page pdf and delete the old scanned page

save all into one pdf

Note: the reason to save that one single page out as pdf is that if you don't do that, that scanned page ends up with a much smaller size compared to other pdf-imported pages. It might be caused by the fact that old pages were scanned in color mode and new page was scanned in gray mode.

5   2007-07-28 firewall under linux. several solutions

  1. script firewall1 in repositary shell, add 'pre-up firewall1 eth0' below line indicating dhcp of eth0
  2. package guarddog
  3. package kmyfirewall

6   vi/vim

6.1   2007-11-06 autocompletion

While still in insert-mode, one can auto-complete a word by either searching forwards(hit Ctrl-N) or backwards(Ctrl-P).

6.2   2007-11-06 copy a set of columns using visual block(AKA column-wise selection).

<C-V> then select "column(s)" with motion commands (win32 <C-Q>) then c,d,y,r etc. (http://rayninfo.co.uk/vimtips.html)

6.3   2007-12-04 spell check (command 'aspell -c filename' has similar function)

enable spell check by ':set spell', disable by ':set nospell', get help by ':help spell'

']s': Move to next misspelled word after the cursor.

'zg': Add word under the cursor as a good word to the first name in 'spellfile'.

'zG': Like "zg" but add the word to the internal word list.

'z=': find suggestions for words (not just bad/highlighted words)

2007-12-21 vim quick references http://tnerual.eriogerg.free.fr/vimqrc.html

6.4   2008-03-16 group patterns by \( \).

Following line is to repeat content on each line 3 time and append C, T.:

g/\(.*\)$/s//\1\t\1\t\1\tC\tT/

6.5   2008-4-2 substitute using a register

examples:

:s/fred/<c-r>a/g            : sub "fred" with contents of register "a"
:s/fred/<c-r>asome_text<c-r>s/g  
:s/fred/\=@a/g              : better alternative as register not displayed

setup a register by visual-selecting a region and then press "ay to put the region into register a.

6.6   2008-05-30 taglist

vim-taglist provides an overview of the structure of source code files and allows you to efficiently browse through source code files in different programming languages.

installation:

  1. download 4.5 from http://vim.sourceforge.net/scripts/download_script.php?src_id=7701
  2. unzip in /tmp/
  3. cp /tmp/plugin/taglist.vim /usr/share/vim/vim71/plugin/
  4. cp /tmp/doc/taglist.txt /usr/share/vim/vim71/doc/

caveat:

  1. run ctags in the working directory to have the tags file setup so that TlistToggle would work. however the vimplugin in eclipse seems doesn't need this ctags step.
  2. not sure the other plugin directory, /usr/share/vim/addons/plugin/ has the same effect or not.

6.7   2008-05-30 word_complete

http://www.vim.org/scripts/script.php?script_id=73

  1. download word_complete.vim and put it in /usr/share/vim/vim71/plugin/.
  2. type :call DoWordComplete() in vi

6.8   2009-2-4 binary/hexdecimal mode

  1. edit the file in binary mode (dos carriage return would be visible):

    vim -b datafile
    
  2. Many characters in the file will be unprintable. To see them in Hex format:

    :set display=uhex
    
  3. hexdecimal mode:

    1. open the file in binary mode:

      vim -b datafile
      
    2. Now convert the file to a hex dump with xxd:

      :%!xxd
      
    3. convert it back with:

      :%!xxd -r
      
  4. to replace the dos carriage return and line feed (rn) with just unix line feed (n). g/\r\n/s//\n/ doesn't work.:

    :g/.$/s///
    
    or
    
    :g/\r/s///
    
    ``dos2unix`` is another alternative.
    
  5. to replace the dos carriage return (r) (all lines are on one line in vi or less) with unix line feed (n) (separating stuff jammed in one line into multi-line) .:

    :g/\r/s//\r/g
    

7   2007-12-09 change user info

7.1   2007-12-09 change user id

need to change the user id of crocea to avoid the id clash between crocea and diradmin from papaya::
usermod -u 10000 crocea

usermod will automatically change the id of all files in the home directory but others outside have to be changed manually.

cron and/or mail daemon(exim4) might need to restart to ensure the new user id is used. otherwise, /var/log/exim4/paniclog might give out errors as "Failed to get user name for uid 1000".

8   2008-04-12 dl324b-1 sound ( microphone / earphone ) jack position

The middle one is earphone jack.

The outer pink one is microphone.

9   2008-05-14 linux plotting softwares

http://octaviz.sourceforge.net/
Octaviz is a visualization system for Octave. It is a wrapper that makes all VTK classes accessible from within Octave using the same object-oriented syntax as in C++ or Python. Octaviz also provides high-level functions for 2D and 3D visualization. Using those functions, most common visualization tasks (3D surface plots, contour plots, meshes etc) can be accomplished without any knowledge about VTK.
http://www.vtk.org/
The Visualization ToolKit (VTK) is an open source, freely available software system for 3D computer graphics, image processing, and visualization used by thousands of researchers and developers around the world. VTK consists of a C++ class library, and several interpreted interface layers including Tcl/Tk, Java, and Python
http://octplot.sourceforge.net/
OctPlot is free open source software under the terms of the GNU General Public License (GPL). OctPlot is a handle graphics package for Octave, the free alternative to MATLAB(TM). OctPlot provides quality postscript(TM) and screen graphics.
http://soft.proindependent.com/qtiplot.html
Scientists often need to use data analysis and plotting software. For Windows systems there is a well known and widely used software called Origin, which is not free, of course. The purpose of this project is to develop a free (open source), platform independent alternative to Origin. QtiPlot can be successfully used for teaching as well as for complex data analysis and visualisation and is being used in companies, universities and reseach institutes all over the world. QtiPlot is being actively improved, all your suggestions to our "wish to" list and all your contributions are most welcome!
http://www.ggobi.org/ (supercedes xgobi/xgvi)
GGobi is an open source visualization program for exploring high-dimensional data. It provides highly dynamic and interactive graphics such as tours, as well as familiar graphics such as the scatterplot, barchart and parallel coordinates plots. Plots are interactive and linked with brushing and identification.
http://plasma-gate.weizmann.ac.il/Grace/
Grace is a WYSIWYG 2D plotting tool for the X Window System and M*tif. Grace runs on practically any version of Unix-like OS. As well, it has been successfully ported to VMS, OS/2, and Win9*/NT/2000/XP (some minor functionality may be missing, though).

11   2008-05-22 cluster solution on ubuntu

install package redhat-cluster-suite

« November 2009 »
Su Mo Tu We Th Fr Sa
1234567
891011121314
15161718192021
22232425262728
2930
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: