Skip to content

Instantly share code, notes, and snippets.

View holms's full-sized avatar

Roman Gorodeckij holms

View GitHub Profile

Creating scaleway vms from Makefile

scaleway:
        -docker-machine create -d scaleway \
                --scaleway-token= \
                --scaleway-organization= \
                --scaleway-name="swarm-primary" \
                --scaleway-region=ams1 \
                --scaleway-commercial-type=C2S \
                scale-primary
LC_ALL=C find ./ -type f -exec sed -i '' -e 's/phoneNumber/phonenumber/g' {} \;
@holms
holms / Makefile
Last active July 6, 2016 23:34
OpenVPN chaining with docker-compose
all:
docker-compose run --rm openvpn-server ovpn_genconfig -u udp://VPN.SERVERNAME.COM
docker-compose run --rm openvpn-server ovpn_initpki
docker-compose run --rm openvpn-server easyrsa build-client-full MYVPN nopass
docker-compose run --rm openvpn-server ovpn_getclient MYVPN > MYVPN.ovpn
@holms
holms / Docker
Created March 4, 2016 03:16 — forked from mitchwongho/Docker
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@holms
holms / task.yml
Last active December 13, 2016 12:49 — forked from maxim/task.yml
Adding github to known_hosts with ansible
- name: ensure github.com is a known host
lineinfile:
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
regexp: "^github\\.com"
mysql:
# Manage databases
database:
- foo
- bar
schema:
foo:
load: True
source: salt://mysql/files/foo.schema
bar:
nginx:
rootdir: /data/installer
server-name: dev.domain.com
1 [program:celery]
2 environment =
3 {% for envvar in celery_env_vars %}
4 {{ envvar['name'] }}="{{ envvar['value'] }}"{% if not loop.last %},{% endif %}
5 {% endfor %}
6
; ==================================
; celery worker supervisor example
; ==================================
[program:celery]
; Set full path to celery program if using virtualenv
environment =
CELERYD_OPTS="-Q:notifications_w notifications -Q:statistics_w statistics -Q:reports_w reports --concurrency=8",
CELERYD_NODES="notifications_w statistics_w reports_w",
DATABASE_URL="pgsql://xxx:xxx@db.xxx.com/xxx", SECRET_KEY="_uy0(ey)#9x1i)xxxx!dp8a3l+z!#2)#@1bzep&ne7r9+", DJANGO_SETTINGS="xxx.settings.prod", RABBITMQ_USER="api", RABBITMQ_PASSWORD="xxx"
@holms
holms / gist:00f40cb0e9cdd328b563
Last active June 22, 2023 17:33
if domain's ip changed
1) Sync the files and databases with the new server.
2) Perform a re-sync just before cut-off.
3) Change the DNS to point to the new server.
4) Forward the request coming to the old ip to the new server until DNS propagation completes.
Here's how I would do the step 4: