Tech:Open Source/Setup/Bash Scripts

From Cyclopath

Jump to: navigation, search
up to: Tech:Open Source > Setup

Contents

[edit] Create or Download Bash Scripts

[edit] Download Cyclopath Bash Scripts

The easiest way to setup your shell is to download some bash configuration scripts stashed on github.

The most important file is ~/.bashrc-cyclopath, which gets loaded by ~/.bashrc. You'll also find some generic configuration in ~/.bashrc-dub, most notably a bunch of convenience aliases and some code to auto-start ssh-agent when you login.

To install the resource files, git the source and install it.

mkdir -p ~/checkout ; cd ~/checkout
git clone git://github.com/landonb/Cyclopath_rc.git
cd Cyclopath_rc
./install.sh

FIXME Don't move .bashrc-private to the backup dir, and add a sample file

The install script backs up your bash resource files and .vimprojects to a backup folder named with the current date, e.g., ~/.Cyclopath_rc-backup-20100101, and then copies its files over.

In addition to installing bash resource scripts, the installer also installs ~/.vimprojects and ~/.vim/plugin/Cyclopath.vim, two files to help with Cyclopath development using Vim.

[edit] Create Cyclopath Bash Script

If you performed the last step, you can skip this step.

[edit] Setup Modules

Core developers, please refer to the following first. VirtualBox users or users with root access can skip this step.

[edit] Paths and Aliases

Create a new resource file named
~/.bashrc-cyclopath
and add the following.

Note that you may have to edit the exported PATHs. FIXME /project/Grouplens/bin probably doesn't apply at all...

## Default mask
 
# Set to r/w/x for owner and group, and just execute for everyone 
# else, which is good for group-based development.
umask 0006
 
## Cyclopath paths
 
# Local Flex compiler
export PATH=/export/scratch/reid/flex/bin:$PATH
 
# Remote GroupLens scripts
export PATH=/project/Grouplens/bin:$PATH
 
## Cyclopath shortcuts
 
# Restart Apache
alias re='sudo /etc/init.d/apache2 restart'
 
# Watch the Server logs
alias logs='sudo tail -F /var/log/apache2/access.log \
                         /var/log/apache2/error.log \
                         /var/log/postgresql/postgresql-8.3-main.log \
                         /tmp/pyserver.apache.log \
                         /tmp/pyserver.routed.log \
                         /tmp/pyserver.tilecache.log'
 
# Watch the Client logs
alias logc='tail -F ~/.macromedia/Flash_Player/Logs/flashlog.txt'
 
# Login to the Database
alias cpdb='psql -U cycling cycling'
 
# Run routed (from $cp/pyserver)
alias rd='sudo -u www-data ./routedctl'

Save the file and add the following lines to the end of ~/.bashrc:

source ~/.bashrc-cyclopath

Close the terminal and open a new one to see the changes take effect, or source your bash configuration from a terminal prompt.

. ~/.bashrc
Personal tools