Saturday, May 29, 2010

GAE domains

How to register a domain with godaddy and enable free hosting on Google:
  • Purchase domain from godaddy
    • This will use the default godaddy nameservers (ns35.domaincontrol.com, ns36.domaincontrol.com, etc)
  • Set up Google Apps for domain
    • Complete signup form and request cname value to verify domain
  • Login to godaddy domain manager (advanced)
    • Add www forwarding to get naked domain to work (use masking)
    • Delete all the default cname values, which point to various services
    • Add google.com cname value and use default TTL
    • Add cname ghs.google.com with alias www
  • Add www sub domain through GAE dashboard
  • To enable email use this service
  • Had to wait 10 minutes before service was active

Monday, May 3, 2010

SSH timeouts

Add this to ~/.ssh/config to avoid ssh timeouts (create file if does not exist):

Host *
    ServerAliveInterval 240

Saturday, May 1, 2010

Call url with CRON

Call URL periodically with CRON, discard HTML, and send all output (including errors) to file:

$ crontab -e
0 * * * * wget URL -O /dev/null 2>> ~/cron.log

Memcached on webfaction

Choose memcached from custom install scripts and set extra info to maximum number of MB (eg 2)

This executes:
memcached start -d -l 127.0.0.1 -m 5 -P $PWD/memcached.pid -p XXXXX

Then can access with gluon.contrib.memcache

Take note of port used

Tuesday, March 16, 2010

Komodo

Run current file with Python: %(python) "%F"

Friday, September 25, 2009

mercurial

.hgrc:
[ui]

username = Richard Baron Penman
verbose = True
merge = internal:merge




Common commands:
hg clone URL # checkout
hg pull # update
hg commit -m "..." # save to local
hg rollback # undo commit
hg push # save to remote

screen

Use ssh to login to server and start screen:
ssh -t $1 'screen -dRR'

screen -S main = create new screen session named "main"
^a d # log out of screen, but leave running
^a c # new window
^a k # close window
^a n # next window
^a p # previous window

Configuration file to paste in ~/.screenrc:
hardstatus on
hardstatus alwayslastline
startup_message off
termcapinfo xterm ti@:te@
hardstatus string "%{= kG}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "
screen -t bash1 1
screen -t bash2 2
screen -t bash3 3
screen -t bash4 4



Good reference