ImageMagick Convert
crop
convert -geometry 50% -crop 600x360+45+150 a.tif a_50.tif
differe/subtract
differe/subtract two images using ImageMagick convert
convert -compose difference
CVS
set CVS_ROOT in tcsh
setenv CVS_ROOT
check out, update, add/commit
checkout(co): cvs -d
update(up): cvs -d
add fold: cvs -d /HPS/projects/repository/ag4app add AutoDiff
add files: cvs -d /HPS/projects/repository/ add ag4app/AutoDiff/*.tex
commit: cvs -d /HPS/projects/repository/ commit ag4app/AutoDiff
create cvs repository
- cvs -d /usr/local/cvsroot init
- cd testproj
- cvs import -m "My initial project message" testproj username start
Emacs
reformat *.txt file
for each paragraph, first Esc, then q
select the whole buffer
Ctrl+x h
go the end of the buffer
Alt+shift+>(<) mark a region
use mouse;
Ctrl+space at the beginning of the region; move the cursor to the end of the region; the region between them are selected.
Copy/paster
use left mouse button to select; click middle mouse button to paste
mark the region; Ctrl+w to cut; Ctrl+y to paste
open/save/close a buffer
open: Ctrl+x Ctrl+f
save: Ctrl+x Ctrl+s
close: Ctrl+x Ctrl+c
kill a line
Ctrl+k
delete a word
Alt+d
search and replace
search: Ctrl+s
reverse search: Ctrl+r
replace: Alt+shift+% , Space to replace, Delete to continue
abort command
Ctrl+g
iproc
copy channels
iproc a.raw.gz -f copyChannels from = 8 to = 8 -o b RAW bz2
toAscii
iproc a.raw.gz -f toAscii format = 1 -o bla RAW
s412ToFloat
iproc file.tif -f s412ToFloat -o bla RAW
iproc test.tif -f toFloat -o a
multiply, jet256
iproc a.raw.gz -f copyChannels from = 1 to = 1 -f multiply factor = 0.5 -f toByte -f jet256 -o ch1_jet TIFF
Crop
iproc a.raw.gz -f Crop pos = 309 274 size = 68 68 -o b RAW
Normalize, Gamma, toByte
iproc a.raw.gz -f Normalize -f Gamma gamma = 0.45 -f toByte -o b TIFF
white balance
iproc a.raw.gz -f applyWB wb = 1 0.9 0.6 -o b TIFF
RAW to PIC
iproc
Latex
Graphics in LaTeX\usepackage{graphicx}If you need a graphic or tabular material to be part of the text, you can just put it inline. It will not have a caption or any fancy formatting.
\includegraphics{subdivision}If you need it to appear in the list of figures or tables, it should be placed in the floating environment.
\begin{figure}[h]
\caption{A Figure}
\centering
% DO NOT ADD A FILENAME EXTENSION TO THE GRAPHIC FILE
\includegraphics{subdivision}
\label{subd}
\end{figure}
You can control the position of the figure on the page or within the chapter by including letters between the brackets after the \begin{figure} declarations. The options are h = right here, t = top of the page, b = bottom of the page, and p = separate page of figures. You can also place the letters in order of your preference and you can add an exclamation mark to make it try hard. An example of this is: \begin{figure}[h!tbp]. With this example, LaTeX will try REALLY hard to place it at that exact point in the text. If that does not work, it will place it at the top of the next page. If that also does not work, it will attempt to place it at the bottom of the page. The last resort will be placing it on a separate page (even if it will not take up a whole page) right before the start of a new chapter or section. Rotating and Scaling Graphics
You can also do some minor editing to your figures in LaTeX. The following example shows how you can rotate and scale your graphic:
\section{More Figure Stuff}
\begin{figure}[h!]
\caption{A Smaller Figure, Flipped Upside Down}
\centering
% DO NOT ADD A FILENAME EXTENSION TO THE GRAPHIC FILE
\includegraphics[scale=0.5,angle=180]{subdivision}
\label{subd2}
\end{figure}
\section{Even More Yet Figure Stuff}
Remember, the angle must be in degrees without any unit information. Scaling does not use percentages but decimals. If you divide the percentage you want by 100, you will get the decimal value to use. One will keep the image the original size. Cropping With some clever work you can crop a figure, which is handy if (for instance) your EPS or PDF is a little graphic on a whole sheet of paper. The viewport arguments are the lower-left and upper-right coordinates for the area you want to crop.
\begin{figure}[h!]Ten Most Common Mistakes in Math Theses
\caption{A Cropped Figure}
\centering
% DO NOT ADD A FILENAME EXTENSION TO THE GRAPHIC FILE
\includegraphics[clip=true, viewport=.0in .0in 1in 1in]{subdivision}
\label{subd3}
\end{figure}
- To typeset {a | a>0}, try $\{a\mid a>0\}$. The point is to use \mid instead of |. The latter has spacing problems.
- To typeset f: X -> Y, try $f\colon X\to Y$. Use \colon instead of : to get the correct spacing.
- Consider typing "there exists" instead of "\exists" and "for all" instead of "\forall". They take about the same amount of typing, and it's often easier on the reader.
- After a period, TeX adds space. To remove that space, include "\ ", a backslash followed by a blank space. For example: "Dr. No" should be written "Dr.\ No" and "i.e." should be written "i.e.\ ".
- To typeset the variable x, remember the dollar signs: $x$.
- To typeset cos, log, etc., use \cos, \log, etc. Use \operatorname to define your own "math operators". For example, \newcommand{\span}{\operatorname{span}} causes \span to act like \cos. Both the font and spacing are modified.
- Know the difference between - (hyphen, used to hyphenate words), -- (en dash, used for ranges, e.g., 1--10), and --- (em dash, used for parenthetical phrases).
- Use a ~ to avoid bad linebreaks. Example: Joe Shmoe~\cite{schmoe} or Theorem~\ref{myTheorem}. (Learn to use labels and refs, by the way.) You should also use ~ to avoid having a linebreak that causes the next line to begin with a number.
- $\int_0^1x\,dx$ is better than $\int_0^1x dx$. The \, adds a bit of space.
- Maybe nine is enough, for now.
Linux Commands
Change password
yppasswd
Copy from different machine
scp -r unnilpentium:/mnt/sdb/bssrdf/schwein ./
check the status of printer
lpq
check file size
du -h *
check free disk space
df
search the content by "less"
/
find a string using grep
grep -i 'abc' test.txt >> ./temp
count lines in a file
wc -l
animate images
animate *.tif
qiv *.tif
go to last directory
cd -
lookup a word
dict
switch among the shells
Shift + \u2192(\u2190)
switch the desktop
Ctrl+Shift+Tab
edit shell command line
Alt+d: delete a word
mount/unmount
mount cdrom
unmount cdrom
find a file
find -name "string"
chmod
chmod +x(wr) [filename]
chmod g0= [filename] : set group and other user no rights
chmod 777 [filename] :set all rights
chmod -R +x [directory name] : recursively change a fold's mode
check graphics card information
gkrellm
monitor the computer
dmesg
get device information
tiffinfo
get information of a tiff image
matlab
start matlab, locations: /opt/matlab/bin/matlab or /usr/local/bin/matlab
diff two files
vimdiff a b
wget download
wget -q -O /dev/null 'http://halma.mpi-sb.mpg.de//ExportOpenAgent'
mp3 player
xmms
OFF file viewer
geomview
iv viewer
ivview
SSH security
public keys lie in .ssh/authorized_keys
bash setting in .bashrc
e.g.,
export FILTER_PATH=/home/proj/IBR/filter/single/Debian3.1_max
alias ll="ls -l"
miscellane
Helpdesk
United States Coinage
Penny(1 cent), Nickle(5 cents), Dime(10 cents), Quarter(25 cents), Half-dollar, Dollar
rename a file in windows
click on a file, F2 the filename while be editable
IE/Firefox automatically close
why did IE/Firefox automatically close when we I browsing some webpage(e.g. the webpage with Bezier curve demo.)?
The solution:
The reason of that problem is the MS Java runtime is out of order. (probably because the counter in the virtual machine) So just go to Sun's Java webpage and download the newest Java Runtime Environment and replace the old one on my computer.
But I did it in a different way. I just went to Control panel and then Add/Remove programs. There is one item call J2SE Runtime Environment 5.0 Update 6.0. I clicked "change" and then follow the installation windows. After this update, my web browser can stably browse interactive web pages.
plot
sort
sort in gnuplot, also for: awk, sed, paste
pl [][1e-4:] '<>
video
images to DivX
mencoder mf://\*.png -mf w=152:h=172:fps=2:type=png -ovc lavc -oac lavc -ffourcc DX50 -o out.avi
vim
recording
- qq # start recording and use the register q
- i # enter insert mode
- ... # some editing
- Esc # back to the normal mode
- 10 # the time of repeating
- @q # q is the register used
- u # undo
- dd # delete one line
- :quit # quit
- :wq #write and quite
- :q! #forced quit
No comments:
Post a Comment