Commits

Mike Steder committed 8778e30 Merge

Pulled in changes from work to support virtual envs and subversion tunnels.

Comments (0)

Files changed (5)

 alias status='svn st | grep -Ev "?*resources"'
 alias conflicts='svn st | grep "^[ ]*C"'
 alias whichpkg='dpkg -S'
+alias tun="ssh -f -N "
+complete -F _ssh tun
 #alias kill=skill
 #alias kill=pkill
 #pgrep - process grep, 'pgrep python' returns the process ids for all running pythons
     . /etc/bash_completion
 fi
 
-#
-# tapp configuration
-#
-EMAIL=michael.steder #youremailusername - for database scrubbing
-export TEXTURA_APPDIR=$HOME/TexturaWD                # so that you don't have to tell tapp where your environment is
-export TEXTURA_TTOOLS_VERBOSE=1                                  # display every command that dbmigration and tapp run along with its output
-export TEXTURA_DATABASE_PATH=$HOME/TexturaWD # where dumps are stored (defaults to home directory)
-export T=https://dev1.texturallc.net/svn/textura
-
-export TSVN_BASE=~/bugs
-export TSVN_ARGS="--base-relative --ignore-externals"
-
-export EMAIL
-source /opt/ttools/home/bashrc
-
 VIMRUNTIME=/usr/share/vim
 export VIMRUNTIME
 
     PATH=~/bin:"${PATH}"
 fi
 
-PATH=.:/opt/ttools/bin:"${PATH}"
-PYTHONPATH=$HOME/lib/python:"${PYTHONPATH}"
-
-export PATH
-export PYTHONPATH
-
 # COMBINATOR:
 #eval `/usr/bin/python ~/UQDS/Divmod/trunk/Combinator/environment.py`
 alias combinator='eval `/usr/bin/python ~/UQDS/Divmod/trunk/Combinator/environment.py`'
 export GOROOT=$HOME/go
 export GOOS=linux
 export GOARCH=amd64
-export GOBIN=$HOME/bin
+export GOBIN=$HOME/bin
+
+REPO=svn+app1://mike@localhost/vol/srv/svn/main
+export REPO
+
+export WORKON_HOME=$HOME/VirtualEnvs
+if [ -e /usr/local/bin/virtualenvwrapper.sh ]; then
+    source /usr/local/bin/virtualenvwrapper.sh
+fi
+""" User configuration file for IPython
+
+This is a more flexible and safe way to configure ipython than *rc files
+(ipythonrc, ipythonrc-pysh etc.)
+
+This file is always imported on ipython startup. You can import the
+ipython extensions you need here (see IPython/Extensions directory).
+
+Feel free to edit this file to customize your ipython experience.
+
+Note that as such this file does nothing, for backwards compatibility.
+Consult e.g. file 'ipy_profile_sh.py' for an example of the things 
+you can do here.
+
+See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed
+description on what you could do here.
+"""
+
+# Most of your config files and extensions will probably start with this import
+
+import IPython.ipapi
+ip = IPython.ipapi.get()
+
+# You probably want to uncomment this if you did %upgrade -nolegacy
+# import ipy_defaults    
+
+import os   
+
+def main():   
+
+    # uncomment if you want to get ipython -p sh behaviour
+    # without having to use command line switches  
+    # import ipy_profile_sh
+
+    # Configure your favourite editor?
+    # Good idea e.g. for %edit os.path.isfile
+
+    #import ipy_editors
+    
+    # Choose one of these:
+    
+    #ipy_editors.scite()
+    #ipy_editors.scite('c:/opt/scite/scite.exe')
+    #ipy_editors.komodo()
+    #ipy_editors.idle()
+    # ... or many others, try 'ipy_editors??' after import to see them
+    
+    # Or roll your own:
+    #ipy_editors.install_editor("c:/opt/jed +$line $file")
+    
+    
+    o = ip.options
+    # An example on how to set options
+    #o.autocall = 1
+    o.system_verbose = 0
+    
+    #import_all("os sys")
+    #execf('~/_ipython/ns.py')
+
+
+    # -- prompt
+    # A different, more compact set of prompts from the default ones, that
+    # always show your current location in the filesystem:
+
+    #o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#>'
+    #o.prompt_in2 = r'.\D: '
+    #o.prompt_out = r'[\#] '
+    
+    # Try one of these color settings if you can't read the text easily
+    # autoexec is a list of IPython commands to execute on startup
+    #o.autoexec.append('%colors LightBG')
+    #o.autoexec.append('%colors NoColor')
+    #o.autoexec.append('%colors Linux')
+    
+    # for sane integer division that converts to float (1/2 == 0.5)
+    #o.autoexec.append('from __future__ import division')
+    
+    # For %tasks and %kill
+    #import jobctrl 
+    
+    # For autoreloading of modules (%autoreload, %aimport)    
+    #import ipy_autoreload
+    
+    # For winpdb support (%wdb)
+    #import ipy_winpdb
+    
+    # For bzr completer, requires bzrlib (the python installation of bzr)
+    #ip.load('ipy_bzr')
+    
+    # Tab completer that is not quite so picky (i.e. 
+    # "foo".<TAB> and str(2).<TAB> will work). Complete 
+    # at your own risk!
+    #import ipy_greedycompleter
+    
+    # If you are on Linux, you may be annoyed by
+    # "Display all N possibilities? (y or n)" on tab completion,
+    # as well as the paging through "more". Uncomment the following
+    # lines to disable that behaviour
+    #import readline
+    #readline.parse_and_bind('set completion-query-items 1000')
+    #readline.parse_and_bind('set page-completions no')
+
+
+# some config helper functions you can use 
+def import_all(modules):
+    """ Usage: import_all("os sys") """ 
+    for m in modules.split():
+        ip.ex("from %s import *" % m)
+
+def execf(fname):
+    """ Execute a file in user namespace """
+    ip.ex('execfile("%s")' % os.path.expanduser(fname))
+
+main()
+execf("~/.ipython/virtualenv.py")
+Host proxy1
+    User mike
+    Hostname www.accuenbi.com
+    HostKeyAlias proxy1
+    CheckHostIp no
+
+# app1
+    LocalForward 22179 app1:22
+
+Host app1
+    User mike
+    Hostname localhost
+    Port 22179
+    HostKeyAlias app1
+    CheckHostIp no

subversion/config

 ### use a forward slash (/) or a paired backslash (\\) as the
 ### path separator.  A single backslash will be treated as an
 ### escape for the following character.
+app1 = ssh -p 22179
 
 ### Section for configuring miscelleneous Subversion options.
 [miscellany]
+import site
+from os import environ
+from os.path import join
+import sys
+
+if 'VIRTUAL_ENV' in environ:
+    virtual_env = join(environ.get('VIRTUAL_ENV'),
+                       'lib',
+                       'python%d.%d' % sys.version_info[:2],
+                       'site-packages')
+
+    # Remember original sys.path.
+    prev_sys_path = list(sys.path)
+    site.addsitedir(virtual_env)
+
+    # Reorder sys.path so new directories at the front.
+    new_sys_path = []
+    for item in list(sys.path):
+        if item not in prev_sys_path:
+            new_sys_path.append(item)
+            sys.path.remove(item)
+    sys.path[1:1] = new_sys_path
+
+    print 'VIRTUAL_ENV ->', virtual_env
+    del virtual_env
+
+del site, environ, join, sys