Here are some shell/term tips I use on a day to day basis.
When typing a command, using esc-.
inserts the last argument of the previous command.
$ ls aaa.txt bbb.txt ccc.txt
...
$ ls <esc-.>
$ ls ccc.txt
from fabric.api import env, run, sudo, local, runs_once | |
# Uncomment this two lines if you need debug mode | |
# import paramiko | |
# paramiko.common.logging.basicConfig(level=paramiko.common.DEBUG) | |
# gce conf | |
GCE_PROJECT = 'my-project' | |
GCE_ZONE = 'europe-west1-b' | |
GCE_HOSTMATCH = 'frontend.*' | |
GCE_GS_URL = 'gs://bucket/dir/' |
# Ruby is our language as asciidoctor is a ruby gem. | |
lang: ruby | |
before_install: | |
- sudo apt-get install pandoc | |
- gem install asciidoctor | |
script: | |
- make | |
after_success: | |
- .travis/push.sh | |
env: |
# Assuming an Ubuntu Docker image | |
$ docker run -it <image> /bin/bash |
M[16],X=16,W,k;main(){T(system("stty cbreak") | |
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i | |
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M | |
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<< | |
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k) | |
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d | |
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X] | |
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4; | |
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4|| | |
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2 |
DEBUG=True | |
SOUTH_TESTS_MIGRATE = True | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. | |
'NAME': 'geo', # Or path to database file if using sqlite3. | |
'USER': 'postgres', # Not used with sqlite3. | |
'PASSWORD': 'postgres', # Not used with sqlite3. | |
'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3. |
FROM ubuntu | |
MAINTAINER Eric Mill "[email protected]" | |
# turn on universe packages | |
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list | |
RUN apt-get update | |
# basics | |
RUN apt-get install -y nginx openssh-server git-core openssh-client curl | |
RUN apt-get install -y nano |
DEBUG=True | |
LOG_FILE_SIZE=1024*1000 | |
LOGGING = { | |
'version' : 1, | |
'disable_existing_loggers':True, | |
'formatters' : { | |
'simple' : { | |
'format' : '%(levelname)s %(name)s %(message)s' | |
}, |