August 31, 2009, 9:35 am
First upload your public key to the server you want to log in:
scp .ssh/id_rsa.pub user@1.2.3.4:/home/user
On the server, add the public key file to the authorized_keys file:
cat id_rsa.pub >> .ssh/authorized_keys
Now you can login using public key authentication and you don’t have to enter a password anymore.
August 28, 2009, 9:47 am
To find which servers handle mail for a particular domain use dig:
;; QUESTION SECTION:
;google.com. IN MX
;; ANSWER SECTION:
google.com. 561 IN MX 100 google.com.s9a1.psmtp.com.
google.com. 561 IN MX 100 google.com.s9a2.psmtp.com.
google.com. 561 IN MX 10 smtp1.google.com.
google.com. 561 IN MX 10 smtp2.google.com.
google.com. 561 IN MX 10 smtp3.google.com.
google.com. 561 IN MX 10 smtp4.google.com.
August 24, 2009, 7:28 pm
To display hidden files in Finder type the following commands in the Terminal:
$ defaults write com.apple.finder AppleShowAllFiles TRUE
$ killall Finder
August 23, 2009, 5:27 pm
To add new packages to your Mactex installation follow these steps:
$ mkdir ~/Library/texmf/tex/latex/newpackage/
$ cp newpackage.sty ~/Library/texmf/tex/latex/newpackage/
That’s it. No need to re-index package list or something.
August 13, 2009, 1:13 pm
I’m using Doxygen to document some C source code. This tool generates multiple sections in the Latex document (one for each variable). These sections are empty (i.e. they only have a title, no text). The problem is that Latex doesn’t automatically break the page when it should, and the section titles go beyond the margins (in fact many titles are not displayed at all).
To solve the issue add the following code to the document’s preamble:
1
2
3
| \makeatletter
\renewcommand\@afterheading{}
\makeatother |
August 12, 2009, 1:01 pm
Doxygen generates collaboration diagrams in EPS format. If you want to include these graphics in a Latex document that produces PDF output, you have to convert them, for example, to PNG format. To make the conversion we’re going to use Convert. Convert provides image conversion between different formats and belongs to the ImageMagick suite of tools. Just navigate to the directory containing the EPS files and type this command:
for var in `ls|grep eps`;do convert $var ${var}.png;done
This produces PNG images with an .eps.png extension. If you want to leave just the png extension run this python script:
1
2
3
4
| #!/usr/bin/python
import os
for fname in os.listdir(os.getcwd()):
os.rename(fname, fname.replace('.eps.png','.png')) |
August 9, 2009, 4:34 pm
To merge and/or remove PDF pages we need the sidebar so press the sidebar button (see first figure). You can switch from thumbnails to table of contents from the button located at the bottom right corner (see second figure).


Merge PDFs.
Open the first PDF and then just drag & drop the second PDF to the sidebar, between the pages where you want it to appear (see figure).

Delete a page.
Select the page you want to delete (in the sidebar) and type Command (The key with an apple) + Backspace.
Add a blank page.
Select Edit -> Insert Blank Page.
Crop an image or file.
First click the select tool. Then select an area of your document or image and hit Command + k.

Now you can save the cropped page or image with Command + s.
