$ cd /path/to/Dockerfile
$ sudo docker build .
View running processes
| import os | |
| import sqlite3 | |
| import google.generativeai as genai | |
| # from: https://gist.github.com/slushman/34e60d6bc479ac8fc698df8c226e4264 | |
| from wordle.five_letter_words import words | |
| GEMINI_API_KEY = os.getenv("GEMINI_API_KEY") | |
| GEMINI_MODEL = "gemini-1.5-flash" |
| # create new EC2 instance with ubuntu 14.04 LTS | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| sudo apt-get install build-essential | |
| sudo apt-get install ruby1.9.3 | |
| sudo apt-get install libpq-dev | |
| sudo gem install mosql |
| import config | |
| import redis as _redis | |
| redis = _redis.Redis(host=config.REDIS_HOST, port=int(config.REDIS_PORT)) | |
| REDIS_KEY_PATTERN = "feed:%s:%s" | |
| feed_key = lambda _type, _id: REDIS_KEY_PATTERN % (_type, _id) | |
| DEFAULT_MAX_LENGTH = 1000 | |
| DEFAULT_LIMIT = 50 |
| brew install gdal | |
| sudo npm install -g topojson | |
| sudo npm install -g http-server | |
| mkdir -p /socratic/geojson | |
| cd /socratic/geojson | |
| mkdir static static/shp static/json static/scripts | |
| wget http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_land.zip -P static/shp/ | |
| unzip static/shp/ne_110m_land.zip -d static/shp/ne_110m_coastline | |
| ogr2ogr -f GeoJSON static/json/landgeo.json static/shp/ne_110m_land/ne_110m_land.shp | |
| topojson -o static/json/landtopo.json static/json/landgeo.json |
| from jinja2.environment import create_cache | |
| # blah blah blah | |
| app.jinja_env.cache = create_cache(1000) | |
| # blah blah blah | |
| app.run() |
| """ | |
| This module provides a simple WSGI profiler middleware for finding | |
| bottlenecks in web application. It uses the profile or cProfile | |
| module to do the profiling and writes the stats to the stream provided | |
| To use, run `flask_profiler.py` instead of `app.py` | |
| see: http://werkzeug.pocoo.org/docs/0.9/contrib/profiler/ | |
| and: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvi-debugging-testing-and-profiling | |
| """ |
| Standard Tuning | |
| Intro: C Am C Am | |
| C Am | |
| I heard there was a secret chord | |
| C Am | |
| That David played and it pleased the lord | |
| F G C G | |
| But you don't really care for music, do you? |
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| body { | |
| background: #00AEA0; | |
| padding: 0px; | |
| margin: 0px; | |
| } |
via: services-engineering