Skip to content

Instantly share code, notes, and snippets.

View IlyaSemenov's full-sized avatar

Ilya Semenov IlyaSemenov

View GitHub Profile
#!/usr/bin/env python
import socket
import subprocess
SYSLOG_HOST = "graylog2.local"
SYSLOG_PORT = 514
LOG_FILE = "/var/log/nginx/access.log"
pipe = subprocess.Popen(["tail", "-n0", "-F", "-q", LOG_FILE], stdout=subprocess.PIPE).stdout
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@IlyaSemenov
IlyaSemenov / crash.log
Last active July 16, 2016 07:54
Terraform: docker_container: crash on invalid syntax in volumes
2016/07/16 13:50:03 [INFO] Terraform version: 0.6.16
2016/07/16 13:50:03 [DEBUG] Detected home directory from env var: /Users/semenov
2016/07/16 13:50:03 [DEBUG] Discovered plugin: atlas = /usr/local/Cellar/terraform/0.6.16/bin/terraform-provider-atlas
2016/07/16 13:50:03 [DEBUG] Discovered plugin: aws = /usr/local/Cellar/terraform/0.6.16/bin/terraform-provider-aws
2016/07/16 13:50:03 [DEBUG] Discovered plugin: azure = /usr/local/Cellar/terraform/0.6.16/bin/terraform-provider-azure
2016/07/16 13:50:03 [DEBUG] Discovered plugin: azurerm = /usr/local/Cellar/terraform/0.6.16/bin/terraform-provider-azurerm
2016/07/16 13:50:03 [DEBUG] Discovered plugin: chef = /usr/local/Cellar/terraform/0.6.16/bin/terraform-provider-chef
2016/07/16 13:50:03 [DEBUG] Discovered plugin: clc = /usr/local/Cellar/terraform/0.6.16/bin/terraform-provider-clc
2016/07/16 13:50:03 [DEBUG] Discovered plugin: cloudflare = /usr/local/Cellar/terraform/0.6.16/bin/terraform-provider-cloudflare
2016/07/16 13:50:03 [DEBUG] Discovered plugin: clou
@IlyaSemenov
IlyaSemenov / fail
Created July 20, 2016 12:57
uwsgi compile fails randomly in Alpine Linux
# docker build .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM alpine:3.4
---> 4e38e38c8ce0
Step 2 : RUN apk add --no-cache build-base linux-headers python3-dev
---> Running in ed7436eec51f
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
(1/32) Installing binutils-libs (2.26-r0)
(2/32) Installing binutils (2.26-r0)
@IlyaSemenov
IlyaSemenov / trace.txt
Created July 21, 2016 09:15
Dokku letsencrypt fails to install the cert
+ case "$(lsb_release -si)" in
++ lsb_release -si
+ export DOKKU_DISTRO=ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
@IlyaSemenov
IlyaSemenov / gist:a2536e140514725b8fb5fea50072f405
Created August 1, 2016 09:01
Dokku certs:add losing https proxy map
root@dokku:~# uname -a
Linux dokku 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
root@dokku:~# free -m
total used free shared buff/cache available
Mem: 3950 363 527 163 3059 3327
Swap: 0 0 0
root@dokku:~# docker version
Client:
Version: 1.11.2
API version: 1.23
@IlyaSemenov
IlyaSemenov / gist:6870737da02f245aab68a32941c54cd6
Created August 2, 2016 09:37
dokku ssh-keys:list output is useless
root@dokku:~# dokku ssh-keys:list
+ case "$(lsb_release -si)" in
++ lsb_release -si
+ export DOKKU_DISTRO=ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
@IlyaSemenov
IlyaSemenov / gist:1c2f308e8ab1a388ea8951453e583804
Created August 8, 2016 10:57
sshcommand make test-in-docker fails
# make test-in-docker
make build-test-container
make[1]: Entering directory '/root/sshcommand'
building test container...
docker build -t sshcommand_test -f Dockerfile.test .
Sending build context to Docker daemon 129.5 kB
Step 1 : FROM gcc:latest
latest: Pulling from library/gcc
357ea8c3d80b: Pull complete
52befadefd24: Pull complete
@IlyaSemenov
IlyaSemenov / console
Created September 20, 2016 14:21
dokku elasticsearch:create fails
# dokku elasticsearch:create test
+ case "$(lsb_release -si)" in
++ lsb_release -si
+ export DOKKU_DISTRO=ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
From d563089d05e75c71e3f62bbc031400a2c07012c7 Mon Sep 17 00:00:00 2001
From: Ilya Semenov <[email protected]>
Date: Tue, 13 Jun 2017 18:49:41 +0700
Subject: [PATCH] Remove proxy
---
charts/builder/templates/builder-deployment.yaml | 5 --
.../templates/controller-deployment.yaml | 5 --
.../templates/registry-proxy-daemon.yaml | 59 ----------------------
requirements.lock | 7 ---
resource "docker_container" "nginx_proxy" {
image = "${docker_image.nginx_proxy.latest}"
name = "nginx_proxy"
restart = "unless-stopped"
ports {
internal = 80
external = 80
}