The goal of efficiency is more slack.

Friday, August 18, 2017

My temporary development environment

Here is how I set up my tools on a computer I'm temporarily using, such as one at the library.

Putty

  1. Download putty from www.chiark.greenend.org.uk
  2. Putty > Window > Colours > ANSI Blue > Red: 60, Green: 60, Blue: 255
  3. Putty > Session > Default Settings > Save
  4. Save a new session with the following set:
    1. Session > Host Name
    2. Connections > Data > Auto-login username.

 Vim

~/.vimrc:
syntax enable
set ic
set expandtab shiftwidth=4 smarttab autoindent
Note: Superseded by Vim for Python, which is more comprehensive.

 Screen

~/.screenrc:
shell -$SHELL
termcapinfo * ti@:te@
startup_message off

Bash

~/.bash_profile
# EDITOR
export EDITOR=vim


Websites

https://www.blogger.com for note taking
https://github.com

Creating paths in Python

Let's say you had this tree:
/home/me/example.com/passenger_wsgi.py
/home/me/example.com/virtualenv
In the Python script, to refer to the directory that is sibling to the script:
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'virtualenv')
Note that this will yield the same result even if the script is a symlink to a file located elsewhere, i.e. __file__ refers to the location of the symlink and not the original file.

Popular Posts

Recent Posts

Unordered List

Text Widget

Pages

Powered by Blogger.
Scroll To Top