Updated: 2020 Sep 01

Useful Tips and Tricks

This page is a collection of random information that I have found useful, perhaps you may find something useful too.


Lookup C Documentation

Recently discovered there is a way to jump to the libc manual (if installed) for a given function. Could potentially work with other languages with info reference manuals, if there are any.

  • 'C-h S' info-lookup-symbol

Display the definition of SYMBOL, as found in the relevant manual. When this command is called interactively, it reads SYMBOL from the minibuffer. In the minibuffer, use M-n to yank the default argument value into the minibuffer so you can edit it. The default symbol is the one found at point.

Nice in conjunction with 'M-x man' which I have bound to 'C-x m'.

Convert between binary and decimal in calc

Source: Xah Lee's page on converting decimal to hexadecimal numbers

  • type 'd2' to binary
  • type 'd6' to hexadecimal
  • type 'd0' to decimal

These only change how numbers are displayed, input numbers are still read in decimal.

To input numbers in the current base type '#'.


Recursively sync directory with FTP

Source: Server Fault: How to upload a directory recursively to an FTP server by just using ftp or lftp?

lftp -e "mirror -R [source [target]]" -u [username],[password] [host]

The -R means reverse, because the mirror command normally works from server to local.

lftp's mirror command has a wide breadth of options that can be used to fit your needs. In my case I was trying to replicate rsync style syncing for a system that I only had FTP access to.