Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
cd /usr/local/build/postgresql-9.4.6/contrib
git clone https://github.com/plv8/plv8 pg_plv8
cd pg_plv8
sudo make static
sudo make install
sudo -u postgres psql -c "CREATE EXTENSION plv8;"
curl -X POST "https://stage.cloud66.com/api/3/stacks/STACK_UID/service_yaml" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" --data '{"service_yaml":"---\nservices:\n web:\n git: REPOSITORY\n git_branch: master\n command: bundle exec rails server -e _env:RAILS_ENV\n build_command: /bin/sh -c \"RAILS_ENV=_env:RAILS_ENV bundle exec rake db:schema:load\"\n deploy_command: /bin/sh -c \"RAILS_ENV=_env:RAILS_ENV bundle exec rake db:migrate\"\n build_root: \".\"\n ports:\n - container: 3000\n http: 80\n https: 443\n env_vars:\n RAILS_ENV: production\n RACK_ENV: production\n volume:\n - \"/tmp:/log\"\n health:\n type: inbound\n endpoint: \"/\"\n protocol: http\n timeout: 45s\ndatabases:\n- mysql","comments":"test\n"}'
production: # Environment
first_thing: # Hook point
command: apt-get install freetds-bin freetds-dev nodejs -y
target: any # Hook fields
execute: true
sudo: true
staging: # Environment
after_bundle: # Hook point
- command: cd $STACK_BASE/releases/$(ls -1 -t $STACK_BASE/releases/ | head -n1) && RAILS_ENV=$RAILS_ENV RAILS_GROUPS=assets bundle exec rake assets:precompile > /tmp/assets.log 2>&1
target: rails # Hook fields
run_on:
execute: true
run_as: cloud66-user
@ciavashkh
ciavashkh / checking_functions
Last active April 26, 2017 16:22
functions to check server
function c66_test_website {
curl -w "
time_namelookup: %{time_namelookup}
time_connect: %{time_connect}
time_appconnect: %{time_appconnect}
time_pretransfer: %{time_pretransfer}
time_redirect: %{time_redirect}
time_starttransfer: %{time_starttransfer}
-------------------
time_total: %{time_total}
@ciavashkh
ciavashkh / k8s-shell-config
Last active June 23, 2020 13:18
kubectl apply
apiVersion: v1
kind: Pod
metadata:
name: shell-demo
spec:
volumes:
- name: shared-data
emptyDir: {}
containers:
- name: shell-demo
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs: