start new:
tmux
start new with session name:
tmux new -s myname
| # ======================================== | |
| # Testing n-gram analysis in ElasticSearch | |
| # ======================================== | |
| curl -X DELETE localhost:9200/ngram_test | |
| curl -X PUT localhost:9200/ngram_test -d ' | |
| { | |
| "settings" : { | |
| "index" : { | |
| "analysis" : { |
| (env)~/env pip install pycurl | |
| Downloading/unpacking pycurl | |
| Downloading pycurl-7.19.0.tar.gz (71Kb): 71Kb downloaded | |
| Running setup.py egg_info for package pycurl | |
| sh: curl-config: not found | |
| Traceback (most recent call last): | |
| File "<string>", line 14, in <module> | |
| File "/home/eric/env/build/pycurl/setup.py", line 90, in <module> | |
| raise Exception, ("`%s' not found -- please install the libcurl development files" % CURL_CONFIG) | |
| Exception: `curl-config' not found -- please install the libcurl development files |
| import os | |
| from flask import Flask, render_template, request | |
| import stripe | |
| stripe_keys = { | |
| 'secret_key': os.environ['SECRET_KEY'], | |
| 'publishable_key': os.environ['PUBLISHABLE_KEY'] | |
| } | |
| stripe.api_key = stripe_keys['secret_key'] |
| ----- Esc ----- | |
| Quick change directory: Esc + c | |
| Quick change directory history: Esc + c and then Esc + h | |
| Quick change directory previous entry: Esc + c and then Esc + p | |
| Command line history: Esc + h | |
| Command line previous command: Esc + p | |
| View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
| Print current working directory in command line: Esc + a | |
| Switch between background command line and MC: Ctrl + o | |
| Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
rsync (Everyone seems to like -z, but it is much slower for me)
| VERSION=0.20.6 | |
| sudo apt-get update | |
| sudo apt-get install openjdk-6-jdk | |
| wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb | |
| sudo dpkg -i elasticsearch-$VERSION.deb | |
| # be sure you add "action.disable_delete_all_indices" : true to the config!! |
| #! /bin/sh | |
| ### Must have Gcloud sdk installed and configured | |
| ###Create a micro instance as ansible master | |
| gcloud compute --project $PROJECT_NAME instances create "ansible" --zone "us-central1-b" --machine-type "f1-micro" --network "default" --maintenance-policy "MIGRATE" --scopes "https://www.googleapis.com/auth/userinfo.email" "https://www.googleapis.com/auth/compute" "https://www.googleapis.com/auth/devstorage.full_control" --tags "http-server" "https-server" --no-boot-disk-auto-delete | |
| ###or a centos like in the tutorial | |
| gcloud compute --project $PROJECT_NAME instances create "ansible-master" --zone "us-central1-b" --machine-type "g1-small" --network "default" --maintenance-policy "MIGRATE" --scopes "https://www.googleapis.com/auth/userinfo.email" "https://www.googleapis.com/auth/compute" "https://www.googleapis.com/auth/devstorage.full_control" --tags "http-server" "https-server" --image "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20140926" --no-boot-disk-auto-de |
UNLOGGED table. This reduces the amount of data written to persistent storage by up to 2x.WITH (autovacuum_enabled=false) on the table. This saves CPU time and IO bandwidth
on useless vacuuming of the table (since we never DELETE or UPDATE the table).COPY FROM STDIN. This is the fastest possible approach to insert rows into table.time timestamp with time zone is enough.synchronous_commit = off to postgresql.conf.| from __future__ import absolute_import | |
| import os | |
| from subprocess import Popen, PIPE | |
| import datetime | |
| import time | |
| from celery import Celery | |
| from celery import states | |
| from os.path import dirname, join |