Skip to content

Categories:

Linux Configuration

Here are some configuration files for GNU/Linux systems. I use these files myself, and they are provided here for you to use as a reference for making your own. I recommend that you backup everything before experimenting with what’s here since much of what I have is specific to my own setup.


/etc/sysconfig/iptables

  • Allows incoming TCP traffic on port 80 for a web server.
  • Allows incoming traffic from a specific host, such as a laptop connected to the same local network, for a variety of services, such as SSH, NFS, and BitTorrent.
  • Drops stealth scans.

~/.bashrc

  • Sets a variety of environment variables, such as the preferred editor and pager, the location of java, and the CVS root.

~/.tcshrc

  • Sets a variety of environment variables, such as the preferred editor and pager, the location of java, and the CVS root.
  • Protects the user from unintended harm: Limits memory usage, sets the file creation mask, etc.
  • Sets colors for ‘ls’ to display for different file types.
  • Sets prompt to show current directory.
  • Allows vi editing of the command-line.
  • Reads list of shortcut commands (aliases).
  • Sets the caps-lock key to the escape key. The keys are not toggled; the caps-lock key is no more.

~/.aliases.interactive

  • p — Push directory to the stack.
  • P — Pop directory from the stack.
  • pp — Cycle to next directory on the stack.
  • m — Run ‘make’.
  • c — Clear screen.
  • x — Make file executable.
  • ls — Use version of ‘ls’ supplied by tcsh, which is much faster.
  • mntcd — Mount CD drive.
  • umntcd — Unmount CD drive.
  • mntusb — Mount USB thumbdrive.
  • umntusb — Unmount USB thumbdrive.
  • nt — Open new KDE Konsole terminal in the current directory.
  • nf — Open Konqueror file manager in the current directory.
  • xine — Play xine full-screen.
  • bc — Start the ‘bc’ calculator in floating-point mode.
  • mpg2jpg — Convert MPEG video to a sequence of JPEG frames.
  • cpuinfo — Display information about the CPU.

~/.aliases.all

  • rm — User is prompted before file removal.
  • frm — Force file removal. Be very careful with this.
  • mv — User is prompted if file will be overwritten.
  • cp — User is prompted if file will be overwritten.
  • ll — Long directory listing with lots of information.
  • l. — List files starting with ‘.’ only.
  • backspace — Set the backspace key to erase the previous character.

~/.caps-to-esc

  • Sets the caps-lock key to the escape key. See the .tcshrc file for how to use this.

~/.vimrc

  • Lots of personal changes: wordrap, no error bells, 2 spaces per tab character, custom color scheme, etc.
  • Edit previous commands and searches with vi. Hit ‘:’ to enter ex or ‘/’ to enter a search. Now, hit Escape and then ‘k’ to edit a previous command. Hit Enter to do the command, or hit ctrl+c twice to exit the command or search.
  • Many keymaps that are useful for editing C/C++ files:
    • q — Insert a blank line after the current line.
    • Q — Insert a blank line before the current line.
    • C — Comment the current line and move to the next line.
    • T — Uncomment the current line and move to the next line.
    • v — Move words from the next line to the current line until we have 80 characters on the line.
    • ctrl+s — Save file.
    • ctrl+q — Save and quit.
    • [ — Toggle editing between two files.
    • ] — Go to next file in list of open files.
    • } — Go to previous file in list of open files.
    • F2 — Make C-style comment block.
    • F3 — Make C-style comment block with an additional * for Doxygen.
    • F4 — Make a ‘for’ loop to easily iterate across one of my Image objects.
    • F5 — Make a ‘while’ loop with the cursor ready to edit the conditional statement.
    • F6 — Make a ‘for’ loop to easily iterate across an STL vector.
    • F7 — Make a print statement that will exit the program.
    • F8 — Make an ‘if’ statement.
    • F9 — Make a ‘fprintf’ statement.

~/.gvimrc

  • Hide the toolbar (Icons for opening, saving, etc.).
  • Toggle showing and hiding the main menu and toolbar with Shift+F1 and Shift+F2, respectively.

~/.custom_color.vim

  • Highlighting customized for editing C/C++ files on a dark blue background.

/etc/X11/xorg.conf (desktop)

  • Uses NVIDIA adapter for a CRT monitor on a desktop.

/etc/X11/xorg.conf (laptop)

  • Uses NVIDIA adapter for a LCD monitor on a laptop.
  • Uses TwinView for dual-display on laptop display and CRT. To apply dual-display when the laptop is already on, connect the CRT to the laptop’s VGA port, restart X by hitting ctrl-alt-bksp, and log back in. Change resolutions to match your displays in the videocard device section.
  • Optionally configurable for dual-display on laptop display and TV. Comment out the CRT dual-display lines under the videocard device section. Uncomment the TV dual-display lines and change the given laptop resolution to match your own.