Assorted Notes

Many random notes (some for my own reference), each of which is too short to warrant a full blog post:

PSA: remote tab completion

If you have set up passwordless SSH login to some host, then bash-completion in Debian/Ubuntu (which is enabled by default, I think) automatically completes remote paths as arguments to scp. For example, pressing TAB after the following does exactly what it ought to, namely, display files within /path/to/whatever on the host example.com:

scp example.com:/path/to/whatever/
Emacs: dired-jump

Ever find yourself wanting to rename or move a file while you're editing it? M-x dired-jump brings up a dired view of the directory containing the current file (you may need to (require 'dired-x) first). Press R ("Rename") and type the new path.

The best part is that the original editing buffer gets its path updated automatically (and its buffer name too, if you changed the basename), so you can get straight back to work— no need to close and reopen the file.

Suspending from the command line

On Ubuntu 10.04 Lucid, you can suspend the machine programmatically by installing acpitool and then running the following:

gnome-screensaver-command --lock # Optional- locks the screen
sudo /usr/bin/acpitool -s

To avoid having to enter my password every time for acpitool, I whitelisted that command in sudo for use without a password. You can do this by running sudo visudo and adding the following line at the end of the file:

%admin ALL = NOPASSWD: /usr/bin/acpitool -s

Sources: Linux Living. Also see: instructions for previous Ubuntu versions; pm-suspend(8).

VirtualBox

I've been using VirtualBox (aptitude install virtualbox-ose) to run virtual machines of various GNU/Linux flavors (for me, it's primarily useful for making sure Zeya works on different platforms and configurations), and I am generally pleased with it. A couple of tips for setting up VMs for maximum effectiveness:

  • The virtualbox-ose-guest-x11 package, when installed on the guest, provides a driver for the virtual display device. This seems to be necessary (and sufficient) to get not-crappy graphics performance.
  • Configuring your VM to use bridged networking makes the VM appear as a device on the host's network, for example, it will pick up an IP address from your local DHCP server.

No comments:

Post a Comment