misc
miscellaneous tips and usages
- 1 2007-06-11 Google Maps How to find latitude and longitude
- 2 2007-06-11 Google Maps look up an address by supplying latitude and longitude
- 3 2007-06-12 symbolic computation in linux
- 4 2007-07-26 how to use scanner under linux
- 5 2007-07-28 firewall under linux. several solutions
- 6 vi/vim
- 6.1 2007-11-06 autocompletion
- 6.2 2007-11-06 copy a set of columns using visual block(AKA column-wise selection).
- 6.3 2007-12-04 spell check (command 'aspell -c filename' has similar function)
- 6.4 2008-03-16 group patterns by \( \).
- 6.5 2008-4-2 substitute using a register
- 6.6 2008-05-30 taglist
- 6.7 2008-05-30 word_complete
- 6.8 2009-2-4 binary/hexdecimal mode
- 7 2007-12-09 change user info
- 8 2008-04-12 dl324b-1 sound ( microphone / earphone ) jack position
- 9 2008-05-14 linux plotting softwares
- 10 2008-05-14 linux audio/video editor
- 11 2008-05-22 cluster solution on ubuntu
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
- http://wiki.axiom-developer.org/axiom--test--1/src/doc/Rosetta gives an overview.
- maxima
- axiom
- mathomatic
- GiNaC
- maple, mathematica(commercial)
- python-sympy http://code.google.com/p/sympy/
- 2008-04-29 swiginac python library for symbolic computation
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
- script firewall1 in repositary shell, add 'pre-up firewall1 eth0' below line indicating dhcp of eth0
- package guarddog
- 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:
- download 4.5 from http://vim.sourceforge.net/scripts/download_script.php?src_id=7701
- unzip in /tmp/
- cp /tmp/plugin/taglist.vim /usr/share/vim/vim71/plugin/
- cp /tmp/doc/taglist.txt /usr/share/vim/vim71/doc/
caveat:
- 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.
- 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
- download word_complete.vim and put it in /usr/share/vim/vim71/plugin/.
- type :call DoWordComplete() in vi
6.8 2009-2-4 binary/hexdecimal mode
edit the file in binary mode (dos carriage return would be visible):
vim -b datafile
Many characters in the file will be unprintable. To see them in Hex format:
:set display=uhex
hexdecimal mode:
open the file in binary mode:
vim -b datafile
Now convert the file to a hex dump with xxd:
:%!xxd
convert it back with:
:%!xxd -r
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.
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".
7.2 2008-05-05 add an existing user to a group
http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/
add user tony to group ftp:
usermod -a -G ftp tony
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).
10 2008-05-14 linux audio/video editor
read this: http://liquidweather.net/howto/index.php?id=88
- pitivi http://pitivi.sourceforge.net/
- diva http://diva-project.org/
- lives http://www.xs4all.nl/~salsaman/lives/
- kdenlive http://kdenlive.sourceforge.net/index.html
- jokosher http://www.jokosher.org/
- cinelerra http://heroinewarrior.com/cinelerra.php3
- kino http://kino.schirmacher.de/
- mainactor http://www.mainconcept.com/site/?id=954
kino is good. cinelerra is good. mainactor better (but commercial), worth money.
vnc2swf 2008-05-20 used in bluefish screenshot
11 2008-05-22 cluster solution on ubuntu
install package redhat-cluster-suite