Skip to content

Instantly share code, notes, and snippets.

@serjs
serjs / README.md
Created November 11, 2011 20:45 — forked from atomic-penguin/README.md
multi-knife-howto

Overview

Here is an example shared configuration for knife. You can drop this off in your chef-repo/.chef/ directory, and multiple developers can use the same knife configuration to interact with more than one Chef server, or the Opscode platform.

By using Bash functions and environment variables we can change the chef server, which knife is configured to use, on the fly.

NOTE: knife will probably ignore your ~/.chef/knife.rb once you begin using a shared knife.rb in your chef-repo directory.

Preparation

@serjs
serjs / gist:1376097
Created November 18, 2011 10:22 — forked from yetanothernguyen/gist:1196492
unicorn init script
#!/bin/bash
### BEGIN INIT INFO
# Provides: says-dot-com-production
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the says-dot-com-production unicorns at boot
# Description: Enable says-dot-com-staging at boot time.
### END INIT INFO
@serjs
serjs / ideal ops.md
Created June 5, 2012 17:33 — forked from bhenerey/ideal ops.md
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

#!/bin/bash
set -u
set -e
bold=$(tput -T ${TERM:-xterm} bold)
normal=$(tput -T ${TERM:-xterm} sgr0)
PYTHON_BIN='python3'
[error]: controllers.BootstrapController$ - Could not rebuild Meta DB:
Migration V1__create_reference.sql failed
-----------------------------------------
SQL State : 42704
Error Code : 0
Message : ERROR: role "gestaltdev" does not exist
Location : db/migration/V1__create_reference.sql (/opt/docker/file:/opt/docker/lib/com.galacticfog.gestalt-meta-repository_2.11-0.3.3-SNAPSHOT.jar!/db/migration/V1__create_reference.sql)
Line : 34
Statement : ALTER TABLE data_type OWNER TO gestaltdev
version: '2'
services:
blog_backend:
image: serjs/blog_backend
environment:
- MONGO_HOST=db
depends_on:
- db
environment:
BLOG_BACKEND_HOST=blog_backend
BLOG_BACKEND_PORT=9292
В демо-сценарии мы выполним установку и настройку группы инстансов с простым приложением, которое выполняя опрации вычисления при получении запроса отдает ответ пользователю о успешности выполнения, и текущей нагрузке на CPU. В зависимости от нагрузки на сервер (по умолчанию в группе он один), количество инстансов может увеличиваться по правилам обработки автомасштабирования, которое мы настроим.
Для того чтобы трафик из вне обрабатывался через одну точку входа (в нашем случае IP), мы создадим Load Balancer, для управления обработки запросов на ряд инстансов. Это позволит выравнивать нагрузку в пиковые периоды посещения нашего ресурса, таким образом сервер сможет обрабатывать запросы пользователей и не дать сбой.
1. Создаем шаблон виртуальной машины
```gcloud compute instance-templates create python-app --boot-disk-size=10GB --image=ubuntu-1604-xenial-v20170815a --image-project=ubuntu-os-cloud --tags http-server --machine-type=f1-micro --restart-on-failure --metadata startup-script='wget -O - https://gist.g
---
- hosts: reddit_app
remote_user: root
tasks:
- name: Clone project repo
git:
repo: 'https://github.com/Artemmkin/reddit'
dest: /srv/reddit-app
@serjs
serjs / keybase.md
Created October 5, 2017 11:10
keybase.md

Keybase proof

I hereby claim:

  • I am serjs on github.
  • I am serj (https://keybase.io/serj) on keybase.
  • I have a public key ASA8iXjKl2iUloTLSWiooxJl3xcLSki1DF1SGDGbVvxZcwo

To claim this, I am signing this object: