Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| sudo add-apt-repository ppa:pitti/postgresql | |
| sudo apt-get update | |
| sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2 | |
| sudo su -l postgres | |
| psql -d template1 -p 5433 | |
| CREATE EXTENSION IF NOT EXISTS hstore; | |
| CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | |
| service postgresql stop | |
| /usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf" |
| access_key_id: xxx | |
| secret_access_key: yyy |
##Google Interview Questions: Product Marketing Manager
| f = open('user.yaml') | |
| dataMap = yaml.load(f) | |
| f.close() | |
| print "" | |
| print "=-----------=" | |
| print "dataMap is a ", type(dataMap), dataMap | |
| print "=-----------=" | |
| print "main items are", type(dataMap['main']), dataMap['main'] |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| # First attempting to use Capybara directly, you will ran into issues when trying to set HTTP header. | |
| # Using Basic HTTP Authentication requires that we needed to set the header. | |
| # Also we need to set the Content-Type and Accept headers to ensure that Rails handles the input and output correctly. | |
| # When using Rack, Capybara delegates request and response handling down to Rack::Test. | |
| # So I used Rack::Test directly in my step definitions, and it works. | |
| # Rack::Test has a module called Rack::Test::Methods that can be mixed into a class to provide it | |
| # with methods for get, post, put, delete as well as last_request, last_response, header and more. | |
| # I mixed Rack::Test::Methods into the Cucumber world at the top of our API steps file like so: | |
| ############################## |
| #!/bin/sh | |
| START=`date +%s%N` | |
| # Do stuff here | |
| END=`date +%s%N` | |
| ELAPSED=`echo "scale=8; ($END - $START) / 1000000000" | bc` |
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
git config --global alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all"
git config --global alias.mylog "log --pretty=format:'%h %s [%an]' --graph"
To check that they've been added correctly, first run git config --list. You should see something like this in the midst of all your other configuration:
alias.hist=log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
| #!/usr/bin/env python | |
| # | |
| # Copyright 2012 Patrick Hetu <[email protected]> | |
| # | |
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, |