We're gonna install the Okla Speedtest (speedtest.net) CLI and a write the results into a Airtables table.
First we're gonna install all required dependecies to run the speedtest CLI.
sudo apt-get install gnupg1 apt-transport-https dirmngr jq| version: 0.2 | |
| phases: | |
| pre_build: | |
| commands: | |
| - aws --version | |
| - echo Logging in to Amazon ECR... | |
| - $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION) | |
| build: | |
| commands: |
| image: docker:latest | |
| variables: | |
| REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME> | |
| REGION: eu-central-1 | |
| TASK_DEFINTION_NAME: <TASK DEFINITION NAME> | |
| CLUSTER_NAME: <CLUSTER NAME> | |
| SERVICE_NAME: <SERVICE NAME> | |
| services: |
| // usage: | |
| // string.format({key: replacement}) | |
| // | |
| // example: | |
| // 'Hello {name}, how are you doing? I am doing {mood}.'.format({name: 'Mike', mood: 'fine'}); | |
| String.prototype.format = function() { | |
| var formatted = this; | |
| if (arguments.length && typeof arguments[0] == 'object') { | |
| var vars = arguments[0]; | |
| for (v in vars) { |
We're gonna install the Okla Speedtest (speedtest.net) CLI and a write the results into a Airtables table.
First we're gonna install all required dependecies to run the speedtest CLI.
sudo apt-get install gnupg1 apt-transport-https dirmngr jq| var AWS = require('aws-sdk'); | |
| var sqs = new AWS.SQS({ | |
| region: process.env.AWS_REGION | |
| }); | |
| var dynamodb = new AWS.DynamoDB(); | |
| var REPEAT_THRESHOLD = process.env.REPEAT_THRESHOLD || 20000; | |
| function receiveSQSMessages(callback) { | |
| var params = { | |
| QueueUrl: process.env.TASK_QUEUE_URL, |
| # Install asyncssh (https://github.com/ronf/asyncssh) via Pip | |
| pip3 install asyncssh | |
| # Install pproxy (https://github.com/qwj/python-proxy) via Pip | |
| pip3 install pproxy | |
| # Start pproxy to connect to remote host via SSH using username and private key, listening on localhost:8080 | |
| pproxy -l http://:8080 -r ssh://<REMOTE HOST IP/HOSTNAME>/#<SSH USER NAME>::<ABSOLUTE PATH TO SSH PRIVATE KEY> | |
| # Start pproxy to connect to remote host via SSH using username and password, listening on localhost:8080 |
| # | |
| # Cookbook Name:: <INSERT COOKBOOK NAME> | |
| # Recipe:: new_relic_agent | |
| # | |
| # Add apt repo | |
| apt_repository 'newrelic' do | |
| uri 'http://apt.newrelic.com/debian' | |
| key 'https://download.newrelic.com/548C16BF.gpg' | |
| components ['non-free'] |
| # this opens a SOCKS tunnel on localhost:1337 | |
| ssh -D 1337 -q -C -N <user@host> |
| docker system prune -a --volumes |
| #!/usr/bin/env bash | |
| if [ "$1" == "" ]; then | |
| echo "Usage: ./push_to_new_remote.sh <git folder> <name of the new git remote>" | |
| exit 1 | |
| fi | |
| if [ "$2" == "" ]; then | |
| echo "Usage: ./push_to_new_remote.sh <git folder> <name of the new git remote>" | |
| exit 1 |