Showing posts with label configuration. Show all posts
Showing posts with label configuration. Show all posts

Sunday, May 17, 2009

.gdbinit file

Personal settings for gdb -- nothing too elaborate

# color prompt
set prompt \001\033[1;36m\002(gdb) \001\033[0m\002

# history across invocations
set history save on
set history filename ~/.gdb_history

Friday, April 20, 2007

Feisty Fawn customization

Here are the things I did after I installed Feisty Fawn Ubuntu 7.04 off of the alternate install CD on my Compaq X1000 laptop/other systems.

If on an AMD64 processor system
  • Follow these instructions (and run the script) to get mplayer, flash and java support for firefox. Update all launchers and shortcuts to launch firefox32 instead of firefox
  • Skip the remaining instructions that are italicized

Install add-on packages (by the way, all except the first can be done in one command... just append all the packages you want to install after "install")

  • Edit /etc/apt/sources.list following these instructions to add extra repositories
  • Install full Vim support (without this, no help, syntax highlighting, etc.) sudo aptitude install vim-full
  • Install Flash sudo aptitude install flashplugin-nonfree
  • Install media codecs sudo aptitude install gstreamer0.10-ffmpeg gstreamer0.10-gl gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse w32codecs
  • Install Amarok sudo aptitude install amarok
  • Install Java sudo aptitude install sun-java6-jre sun-java6-plugin sun-java6-fonts
  • Install Azureus sudo aptitude install azureus (or, alternatively, ktorrent)
  • Enable DVD support
  • Possible user programs: xmms, xchat, mplayer plugin, vlc, skype, picasa, eclipse, google earth, beagle, clipboard manager
  • Security programs: sudo aptitude install nmap kismet wireshark airsnort aircrack-ng john
  • Install Beryl (nVidia) (I also find it convinient to add a sessions entry for beryl-manager so the stone shows up in the tray)
Trick out Firefox
Trick out the Terminal (and partners in crime)
  • Either create a new profile or edit the current profile
  • Disable General->Show menubar by default in new terminals
  • Set Colors to aesthetically pleasing values
  • Set Effects->Transparent background and set the bar about 2/3 of the way to Maximum
  • Set Scrolling->Scrollback to 2000 lines
  • Edit ~/.bashrc
  • Edit ~/.vimrc
  • Put the line set editing-mode vi in ~/.inputrc (the configuration file for readline... this also makes the set -o vi in the .bashrc redundant)
Trick out GNOME
  • Fix the Right Alt key System->Preferences->Keyboard->Layout Options->Third level choosers->Press Menu Key to Choose 3rd Level
  • Change the Desktop Background by right clicking on it (good backgrounds here (OSX Tiger) and here (fractals) and at DeviantArt)
  • Map the Windows keys to do something cool in System->Preferences->Keyboard Shortcuts (I think "Run a terminal" and "Hide all windows and focus desktop" are good candidates)
  • Enable visual system beep System->Preferences->Sound->System Beep->Flash Window Titlebar
  • Make the panels transparent Right Click on Panel->Properties->Background->Solid Color and adjust the slider appropriately (about halfway looks good)
  • Add the system monitor to the panel Right Click on Panel->Add to Panel->System & Hardware->System Monitor->Add to Panel (I enable all but "Load"... wtf is load?)
  • Disable launching of unnecessary programs at startup (such as Evolution Alarm Notifier) Preferences->Sessions->Startup Programs
  • Save your session in a desireable state: gnome-session-save (don't use the automatic option in Prefs->Sessions... it causes problems!)
  • Put the panels in a desirable place by dragging them across the screen
  • Get 4 workspaces Right Click on Workspaces on Panel->Preferences->Number of Workspaces
  • Disable Rhythmbox launching upon iPod detection (Amarok rulez!) System->Preferences->Removable Drives and Media->Multimedia->Uncheck "Play Music Files when Connected" and also Uncheck Storage->"Browse removable media when inserted"
  • Enable the text-based location bar in Nautilus (in favor of the button-based one) by hitting the notepad button on the top left in a Nautilus window
If on a laptop...
So what's so different about Feisty (as opposed to Edgy)?
  • All the latest stable versions of software in the repos, obviously
  • GNOME network manager manages wireless devices by default (and keyring support to boot)
  • Fool-proof support for installing restricted drivers, media codecs, etc.
  • Nice command line assistance if you try and run software that's not installed (prints a "use this repository and this command to get the software"-type message)
  • Easy enabling of "Desktop Effects"
  • And more

Friday, April 06, 2007

My .exrc file (vi/m) and then some

What follows is my .exrc file for various versions of vi, and some more related stuff. I have yet to look through the vim documentation exhasutively to see if there are any more useful options -- this is just stuff I have gleaned from random places on the Internet and from friends.

Plain vanilla vi (as on Solaris)
set nu " show line numbers
set ts=4 " tabs take up four columns
set sw=4 " set shiftwidth (>> or <<) to 4 columns set showmatch " show matches of ()'s, {}'s, and []'s
set showmode " show what mode (e.g. INSERT) you're in
set autoindent " indent to the extent of the previous line

Vim:
syntax enable " enables syntax highlighting
set nu " show line numbers
set ts=4 " tabs take up four columns
set sw=4 " set shiftwidth (>> or <<) to 4 columns
set title
" sets title of terminal in menubar to that of file currently being edited
set expandtab " tabs aren't really tabs, but many spaces
set softtabstop=4 " delete four spaces when you delete a "tab"
set ignorecase " perform case-insensitive searches...
set smartcase " ... unless there are capitalized characters in the search pattern
set mousehide " hide the mouse when editing
set exrc " eliminates the possibility of another .exrc getting confused with mine on multi-user systems
set backspace=indent,eol,start "explicitly makes the backspace work when at the beginning of a line
set bg=light "this almost always looks better -- take this out or set it to dark if things look funny
set nohlsearch "no annoying search highlighting

" for common typos
command! Q quit
command! W write
command! Wq wq

Vim Python
set autoindent " indent to the extent of the previous line

Vim C/C++/Java
set cindent " indenting for C-style languages
set showmatch " show matches of ()'s, {}'s, and []'s

For Text (Vim 7.0 only)
setlocal spell spelllang=en_us " English(US) spellcheck on (Vim 7.x only)
set tw=0 wrap linebreak " don't split words between lines, only wrap at end of word
"lots of abbreviations (varies depending on the subject material)
ab STIA Science, Technology and International Affairs

How to produce nicely formatted C code in Vim (From p.221 of Learning the vi editor):
set nocp incsearch
set cinoptions=:0,p0,t0
set cinwords=if,else,while,do,for,switch,case
set formatoptions=tcqr
set cindent
syntax on
source ~/.exrc

Options set when vim 6.4/7 starts on my system (Ubuntu Linux):
helplang=en " language to display help in
ruler " show row and column in bottom right
ttyfast " indicates a fast terminal connection
viminfo='20,"50 " configuration info
history=50 " number of : commands and previous search patters to be remembered
scroll=32 " number of lines to scroll with CRTL-U and CTRL-D commands
ttymouse=xterm2 " mouse codes
backspace=indent,eol,start "explicitly makes the backspace work when at the beginning of a line
fileencodings=ucs-bom,utf-8,latin1 " list of character encodings considered when starting to edit a file
printoptions=paper:letter " controls format and output of printing
runtimepath=~/.vim,/usr/share/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vimcurrent,/usr/share/vim/vimfiles/after,/usr/share/vim/addons/after,~/.vim/after " list of directories which will be searched for runtime files
suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc " Files with these suffixes get a lower priority when multiple files match a wildcard.

Cool stuff that I have seen various places but I didn't find particularly useful (maybe someone else will):
set list "replaces all EOLs and TABs with $ and ^I
"auto-complete of brackets
inoremap [ [] <left>
inoremap ( () <left>
inoremap { {} <left>
inoremap " "" <left>
inoremap ' '' <left>

To see the options vi(m) has enabled, enter :set
To get help with options in Vim, enter :help set or :set all for regular vi
Or just :help for the help contents... Vim has excellent documentation

Links

My .bashrc file

export TERM="xterm-color" # xterm terminal emulation (with color -- be sure to put at top of file on Ubuntu)
export PYTHONSTARTUP="$HOME/.pythonrc.py" # python startup file
set -o vi # sets vi command-line editing mode
bind -m vi-command -r 'v' # so that every time you hit v in command mode, an editor doesn't launch
ulimit -c unlimited # dump core files, no matter how big they are
export EDITOR="vi" #use vi as the default editor for some commands, like "fc"

alias screen='TERM=screen screen' # workaround for screen backspace bug

alias d="date '+%r -- %A, %D'" # human-readable date output

alias ll="ls -lh" # long listing (with human-readable file sizes)
alias lr="ls -ltrh" # list by reverse modification time
alias la="ls -Ah" # list hidden files (except implied . and ..)

alias <name>="cd <important>" # get to important directories fast
alias <name>="ssh <login>@<important>" # log into oft-used remote machines fast

# prevent myself from doing stupid things with vi
function vi {
if [ ! -e "$1" ]; then
if [ "$1" == "" ]; then
vim
else
vim "$1"
fi
elif [ -d "$1" ]; then
cd "$1"
elif [[ -c "$1" || -b "$1" || -p "$1" || -S "$1" || ! -r "$1" ]]; then
file "$1"
else
vim "$1"
fi
}

The following I only enable on Solaris systems:
export PAGER="less" #uses less to view manpages instead of more

Links:

Sunday, August 06, 2006

Server Building, Part 4 (vsftpd configuration)

Here is some information on configuring vsftpd 2.0.3 on Ubuntu 5.10 (Breezy Badger):

The settings for this program are in /etc/vsftpd.conf There is a short manpage for vsftpd ("man vsftpd" is the command) but the manpage for the file ("man vsftpd.conf") gives a more exhaustive description of options that vsftpd offers. Options are set in option=value form in the config file (example: "anonymous_enable=YES"). Most settings are not enabled if they are not found in the config file but there is some default behavior if some settings are not found. Check the manpage and FAQ for details. I'm mostly concerned with setting up access so that only I can get access to this machine. There are a few types of users in the FTP server paradigm: local users (that have an account on the machine), anonymous users (just anyone on the net) and root. Here are some simple options to set to achieve what I want to do:

Anonymous users:
  • anonymous_enable -- allows anonymous login, on by default
  • anon_upload_enable -- allows anonymous users to upload files... keep this off unless you want a lot of porn on your server (so they say)
  • anon_mkdir_write_enable -- allows anonymous users to use any form of the ftp write command
  • no_anon_password -- allow anonymous users to login without a password... probably a good idea to enable this, since the password is just "anonymous" otherwise

Local users:
  • local_enable -- allows local users to log in... I enable this so I can log in as myself
  • chroot_local_user -- restrict local users to their home directories (apparently a security risk... read the vsftpd FAQ for details)
  • chroot_list_enable -- enables a list of users that can use the chroot() command
  • chroot_list_file -- the location of the file that specifies the users that can use the chroot() command... with my settings, the users listed in this file have full access to the system whereas the users not listed are restricted to their home directories

Other:
  • ftpd_banner -- the message users see when they login
  • write_enable -- enable any form of FTP write (allow users to put stuff on server)

To restart vsftpd with an edited config file (that is, to see the changes you just made to the file put into effect) use this command: /etc/init.d/vsftpd restart