| #!/usr/bin/env bash | |
| # | |
| # Rails console script that can be run on AWS Elastic Beanstalk. | |
| # | |
| # Run this script from the app dir (/var/app/current) as root (sudo script/aws-console) | |
| # | |
| set -xe | |
| EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir) |
| { | |
| "Arts & Entertainment":[ | |
| "Books & Literature", | |
| "Celebrity Fan/Gossip", | |
| "Fine Art", | |
| "Humor", | |
| "Movies", | |
| "Music", | |
| "Television" | |
| ], |
| #!/bin/sh | |
| echo `env` | |
| echo `ls` | |
| git fetch --tags | |
| git checkout master | |
| git pull origin master | |
| git branch release-$PROMOTED_GIT_COMMIT $PROMOTED_GIT_COMMIT | |
| git clean -f | |
| case $INCREMENT_VERSION in |
| =begin | |
| This script uses the AWS v2 API | |
| Gemfile: | |
| source "https://rubygems.org" | |
| gem "aws-sdk", "2.0.17.pre" |
| #!/bin/tcsh | |
| # Grab user information. | |
| echo "PrivateInternetAccess OpenVPN Setup:" | |
| echo " https://www.privateinternetaccess.com/pages/client-control-panel" | |
| echo " -> PPTP/L2TP/SOCKS Username and Password" | |
| echo -n "User: " | |
| set user = $< | |
| echo -n "Pass: " | |
| set pass = $< |
| container_commands: | |
| sync_db: | |
| command: "docker run --env DATABASE_URL=`/opt/elasticbeanstalk/bin/get-config environment | jq -r .DATABASE_URL` aws_beanstalk/current-app:latest lein lobos migrate" | |
| leader_only: true |
If you need to manipulate existing data when your code is deployed, there are two main ways to do it:
- Create a rake task to migrate the data after the code is deployed. This is ideal for more complex data migrations.
- Use ActiveRecord models in a migration. This is acceptable for smaller data manipulations.
Regardless of the method you use, make sure to test your migrations before submitting them.
-
Nielsen Designated Market Area (DMA) is a geographic region where the population can receive the same broadcasts (TV/Radio, Cable/Internet).
-
GeoHex is a world coordinate system expressed by hexagon of various sizes. It's often used in games due to its simple matching nature. It's also useful for proximity/coverage since a hexagon approximates a circular area.
This gist is an exercise in figuring out DMA from a geohex code using opensource tools and data.
The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.
Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.