To get these settings to take effect, I run xrdb ~raphael/.Xdefaults from my X startup script.
set editor="vim -X" set attribution="On %d, %n wrote:\n>" macro pager \CA 'r^m^m^m^m' macro index \CA 'r^m^m^m^m'Now when I want to respond to mail, I just type <control-A>. Whether I am looking at the list of messages ("index" mode) or a particular message ("pager" mode), the macro expands to the r command, which means "reply", followed by answers to the questions that mutt will ask about whether I want a particular subject and other questions.
map , 0!+extractSender.pl^Mjwhere the ^M is an embedded carriage return. This macro gives me a command invoked by the comma character that replaces the first line of the message with the result of my extractSender.pl program. (If you like it, you can find it in ~raphael/cs/bin/extractSender.pl.) This program knows how to extract names from the "from" line of a message based on the attribution setting in the .muttrc file, as shown above. So if the attribution line says:
On Fri, Sep 01, 2006 at 08:25:17AM -0400, Alfred E. Neuman wrote:The "," command replaces that line with
Alfred,and I am ready to continue editing my response.
Alfred E. Neuman => Big Aland extractSender.pl will use what you have specified instead of its usual behavior.
application/msexcel;gnumeric %s application/powerpoint;soffice %s text/html; firefox %s; application/ms-tnef; tnef -w %s application/pdf;xpdf %sThese lines allow me to view spreadsheets with gnumeric, presentations with OpenOffice, HTML with firefox, winmail.dat attachments (MicroSoft) with tnef, and PDF files with xpdf. If I want to see an HTML attachment without directing it to firefox, I give mutt this command:
| lynxnowThe lynxnow script, which I put in ~/bin, just has this line, which is too hard to remember and type each time:
lynx -force_html -stdin
:0H # If it has a very high spam score, toss it * SpamScore: \$\$\$\$\$ /dev/nullThe first line says, “Here is a rule (:) that looks at the message header (H) and is helpfully commented to refer to spam scores (# ...)”. The next line says, “Here is a condition (*) that matches the pattern SpamScore \$\$\$\$\$, that is, the word SpamScore with at least five dollar signs.” The third line says, “If that condition matches, put the mail in /dev/null, that is, discard it and don't consider any more rules.”
Here is a pair of rules I have found very useful:
:0hw EXTERNAL=| perl /homes/raphael/bin/checkMail.pl :0 * EXTERNAL ?? bad /dev/nullThe first rule sets an internal variable EXTERNAL to the result of passing the header to my checkMail program. This program either prints "good" or "bad". The second rule sees if checkMail said "bad", in which case it discards the mail. I update checkMail periodically to notice spam that is not filtered out by the department's spam-scoring software.
You can use procmail to sort your incoming mail into mailboxes based on information in the header. I don't find that useful, but many people like this idea.
\usepackage{epsf} ... \epsfbox{fileName.eps}If you are using pdflatex, you will also need to
\usepackage{epstopdf}.
\scalebox{number}{\epsfbox{fileName.eps}}where number is smaller than 1.0 for reducing or greater than 1.0 for enlarging. Alternatively, you can specify exact size with
\resizebox{hlength}{vlength}{\epsfbox{fileName.eps}}Either length can be simply ! to use the same scale factor for both dimensions.
:set encoding=utf-8 fileencodings=utf-8,latin1to tell the editor that it should use UTF-8 as its display encoding and that it should assume that files it reads in are in UTF-8 unless that fails, in which case it should fall back to Latin encoding.
:digraphsTo enter a digraph, type control-K followed by the two letters. For instance, to get "ę", type "<control-K>e;".
xterm*utf8: 1in your ~/.Xdefaults file, as described elsewhere in this file. For gnome-terminal, adjust Terminal->Set Character Encoding.
xterm*font4: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1 xterm*Font5: -misc-fixed-bold-r-normal--20-0-100-100-c-0-iso10646-1 xterm*Font6: -misc-fixed-bold-r-normal--24-0-100-100-c-0-iso10646-1and I generally use font 4. (Click on the right mouse button in the xterm window and select "Medium" font.) For gnome-terminal, edit your default profile to set the font to one that understands Unicode, such as Bitstream Vera Sans Mono.
alias spelltext 'ispell -l < \!\!$ | sort -u | less'
alias spellpdf 'pdftotext \!\!$ - | ispell -l | sort -u | less'Given those aliases, you can find all the questionably spelled words in a PDF document like this:
spellpdf whatever.pdf
GOAL = slides SOURCES = insert.tex EPS = fig1.eps fig2.eps PUBLISHAS = conf.2006.02 include /homes/raphael/cs/papers/Makefile.texThe GOAL definition specifies the main TeX source file, in this case, slides.tex. If you have subsidiary TeX source files, list them in the SOURCES specification. If you have encapsulated PostScript figures, list them in the EPS specification. If you want to place the processed document in PDF form on your web page at /homes/yourUserName/HTML/private/foo.pdf , specify foo in the PUBLISHAS line. You may omit any of these specifications except GOAL.
Once you have built such a Makefile, you can now try the following commands:
make dvi | calls latex to create GOAL.dvi, converting .xfig files to .eps if needed. |
make seeDVI | builds GOAL.dvi and then runs xdvi to view it |
make ps | builds GOAL.ps |
make seePS | makes GOAL.ps and then runs gv to view it |
make pdf | builds GOAL.pdf |
make seePDF | makes GOAL.pdf and then runs xpdf to view it |
make publish | makes GOAL.pdf and then copies it to /homes/USER/HTML/private/ |
make spell | displays a list of possibly misspelled words (using ispell and less) |
ps2pdf14 -DPDFSETTINGS=/prepress -dEmbedAllFonts=true input.ps output.pdfYou can see what fonts a PDF file uses with
pdffonts filename.pdf
find . -type f -print
find . -type d -print
find . -follow -name '*.java' -type f -exec grep -l 'myVar' {} \;
alias rgrep "echo find . -follow \\ -name \'\!\!:2\' -type f -exec grep -l \'\!\!:1\' {} '\;' "I use it this way:
rgrep myVar '*.java'I then copy and paste the resulting find command.
/homes/raphael/bin/local.i686/afind "the string" ~/.filefind.data
30 3 * * * /homes/raphael/cs/public/localdumpThat command will run localdump every morning at 3:30am to save a copy of your incoming mail and all your recently created or modified files in /localdisk/home/saved.YOURLOGNAME.
rm -f ~/.mozilla/firefox/*/{lock,.parentlock}
complete cd 'n/*/d/' # first arg of cd must be a directory complete 'dvips' 'n/*/f:*.dvi/' # only dvips the right files complete 'xdvi' 'n/*/f:*.dvi/' # only xdvi the right files complete 'xpdf' 'n/*/f:*.pdf/' # only xpdf the right files bindkey -v # use vi-style commands to edit command lines
alias view 'vi +/\!\!:1/ `grep -l \!\!*`' | Edit files containing a given string. |
alias ls 'ls -F' | List files with suffixes showing type. |
alias lst 'ls -Llt \!\!* | less' | List files newest first. |
alias rm 'rm -i' | Remove files carefully. |
alias pd 'pushd' | Switch directory, saving old directory on a stack. |
alias nd 'mkdir \!\!$ ; cd \!\!$' | Create a new directory and switch to it. |
alias showtar 'gunzip -c < \!\!* | tar tf - ' | Display the contents of a tar.gz file. |
alias showbtar 'bunzip2 < \!\!* | tar tf - ' | Display the contents of a tar.bz2 file. |
alias maketar 'tar cf - \!\!* | gzip > \!\!$.tar.gz' | Create a tar.gz file. |
alias makebtar 'tar cf - \!\!* | bzip2 > \!\!$.tar.bz2' | Create a tar.bz2 file. |
alias untar 'gunzip -c < \!\!* | tar xf - ' | Unpack a tar.gz file. |
alias unbtar 'bunzip2 < \!\!* | tar xf - ' | Unpack a tar.bz2 file. |
sshfs -C -o idmap=user -o follow_symlinks cor.cs.uky.edu: ~/ukIf ssh usually prompts you for your department password, then sshfs will, too. To unmount the department files from your home machine, run this command:
fusermount -u ~/ukYou might want to introduce shell aliases for these two commands; I use sshuk and usshuk.
vncserver :4 -localhost -geometry 1600x1400 -depth 24You might want to adjust the geometry (the size of the virtual screen) and the depth (the number of bits used to represent color). The :4 parameter says that the new virtual screen is the fourth X-Windows screen; it is very likely that this number works fine for you if the department machine is your own; you might need to find another number if you use a shared machine. You may set up the server at any time and just leave it running. It will ask you to establish a password. It will only accept connections from the department machine on which you start it.
ssh -L5904:127.0.0.1:5904 machine.cs.uky.eduThen in a shell on your home machine, run
vncviewer :4vncviewer will ask you for the screen password you set when you started vncserver.
vncviewer -via machine.cs.uky.edu :4directly from your home machine; it will set up the ssh connection for you.
wine myProgram