Tips and Tricks

A collection of contributed tips and tricks for computer users.


Turn off fancy new (and annoying) stuff in Emacs

Kill menu and tool bars. No more colorized parens, colorized region, or kissing braces. Always Fundamental mode.
(menu-bar-mode -1)
(tool-bar-mode -1)
(setq blink-matching-paren nil)
(show-paren-mode -1)
(transient-mark-mode -1)
(setq auto-mode-alist (cons (cons ".*" #'fundamental-mode) nil))
(setq truncate-partial-width-windows nil)

Contributed by Jon Webb


Turn off even more stuff in Emacs

To turn off highlighting during isearch:
(setq isearch-lazy-highlight nil)
To allow mark region highlighting with a more rational color scheme (this assumes reverse video (white on black), which is -r in the Emacs CLI or -rv in the xterm CLI if you run emacs -nw):
(transient-mark-mode 1)
(set-face-foreground 'region "black")
(set-face-background 'region "white")
To turn off the audible beep (you can get the same effect with the -vb CLI argument for xterm):
(setq visible-bell t)
And the all-important cutting back on auto-save madness (this gets Emacs down to just the ~ file and the one live # file):
(setq auto-save-default nil)
(setq auto-save-interval 0)
(setq auto-save-list-file-name nil)
(setq auto-save-list-file-prefix nil)

Contributed by Mike Webb


Save Windows installations using Linux

  1. Partition for dual-boot, and install Linux. (Leave first partition for Windows.)

  2. Determine size of partition in kilobytes...
    # fdisk /dev/hda
    
    Command (m for help): p
    
    Disk /dev/hda: 2161 MB, 2161410048 bytes
    128 heads, 63 sectors/track, 523 cylinders
    Units = cylinders of 8064 * 512 = 4128768 bytes
    
       Device Boot    Start       End    Blocks   Id  System
    /dev/hda1   *         1       218    878944+   6  FAT16
    /dev/hda2           219       489   1092672   83  Linux
    /dev/hda3           490       523    137088   82  Linux swap
    
    Command (m for help): q
    
    From "Units =" line, (8064 / 2) = 4032 kilobytes / cylinder.
    From "/dev/hda1" line, (218 - 1 + 1) = 218 cylinders in partition.
    Thus: (4032 * 218) = 878976 kilobytes in partition.

  3. Zero the partition...
    # dd if=/dev/zero of=/dev/hda1 bs=1024 count=878976
    
    Do this before installing Windows, so all those unwritten zeroes compress nicely.

  4. At this point, install the Windows OS of your choice. May need to use a rescue disk to re-LILO if Win re-writes the MBR.

  5. To save an image, copy the partition to a compressed file...
    # dd if=/dev/hda1 bs=1024 count=878976 |gzip -9 >/tmp/image_hda1.dd.gz
    
  6. To restore an image, copy a compressed file to the partition...
    # gunzip -c /tmp/image_hda1.dd.gz |dd of=/dev/hda1 bs=1024 count=878976
    
Note: I found bs=512 to cause errors, but bs=1024 did not!

Contributed by Jeff Mallatt


Windows Registry

In the below, "ControlSet###" means make the change in all control sets.
Also, some if not all of these changes require a reboot to take effect.

Contributed by Jeff Mallatt


Linux one-liners

bash shell one-liners

Contributed by Jeff Mallatt


Windows NT one-liners

Contributed by Jeff Mallatt


"ls" Hash and Eggs

Un-scramble the complete hash that recent lss make of their listings.
(In other words, revert to the old-fashioned sort order.)

You need to tell ls to use the C locale, by setting the "LC_ALL" environment variable to "C":

export LC_ALL=C

You can do this for ls alone by using an alias:

alias ls='LC_ALL=C ls'

Contributed by Jeff Mallatt


Force Windows 2K to boot Uni-processor on Multi-processor machine

In the root directory of the boot device (e.g. "C:\"), there is a hidden file named "boot.ini". In its [operating systems] section is a line that looks something like:
    multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional" /fastdetect
Duplicate that line, change the "name" and add the "/numproc=1" argument. E.g.:
    multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional - uP" /fastdetect /numproc=1

Contributed by Jeff Mallatt


Mozilla/Firefox configuration

To access a very complete configuration page, use this URL:
    about:config
Some of the more useful (to me) items are:

Preference Name Values Description
browser.chrome.favicons true/false Whether or not to show "favorite" icons.
browser.chrome.site_icons true/false Whether or not to show "site" icons.
browser.chrome.toolbar_tips true/false Whether or not to show toolbar tips.
browser.startup.page integer (0 = don't load) Whether or not to load home page at startup.
image.animation_mode normal, once How many times to show an animated image.

Contributed by Jeff Mallatt


Go to Top of page
Go to Codewell Corporation page
Tips and Tricks /
15 Allen St., No. 2
Arlington, MA 02474-6809
(781) 641-3327
Last Updated: 12 Apr 2007
Valid HTML 4.01!
[ validate ]

Copyright (C) Codewell Corporation, 1995-2007. All Rights Reserved.