Skip to content

Instantly share code, notes, and snippets.

View ep4sh's full-sized avatar
👊

Pasha Radchenko ep4sh

👊
View GitHub Profile
# Happy hack!
FROM python:slim
ENV APP=/data/app
WORKDIR $APP
COPY *.py $APP
COPY requirements.txt $APP
RUN pip3 install --upgrade pip && pip3 install -r requirements.txt
CMD ["python3","script.py"]

Keybase proof

I hereby claim:

  • I am ep4sh on github.
  • I am ep4sh (https://keybase.io/ep4sh) on keybase.
  • I have a public key ASAVnvsr0jCIS-v3CAJ0SWs2btwBjynXFT46TNgf1m1FOgo

To claim this, I am signing this object:

#!/bin/bash
#
# Init script for Artifactory service (currently systemd)
#
# chkconfig: 345 86 14
# description: Artifactory Tomcat Servlet Engine
# processname: artifactory
# pidfile: /var/opt/jfrog/run/artifactory.pid
#
### BEGIN INIT INFO
[Unit]
Description=Setup Systemd script for Artifactory in Tomcat Servlet Engine
After=network.target
[Service]
Type=forking
GuessMainPID=yes
Restart=always
RestartSec=5
PIDFile=/var/opt/jfrog/run/artifactory.pid
@ep4sh
ep4sh / cf.md
Created October 2, 2020 11:30
Cloudflare HTTP 403 when specific plan exists.

Without plan option:

$ cat main.tf 
resource "cloudflare_zone" "qa" {
  zone = var.cloudflare_zone_name
}


$ terraform apply --var-file=variables/qa_vars.tf  
@ep4sh
ep4sh / cf.md
Last active October 2, 2020 16:04
debug-log.md
$terraform apply --var-file=variables/qa_vars.tf

2020/10/02 18:43:13 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2020/10/02 18:43:13 [INFO] Terraform version: 0.12.29
2020/10/02 18:43:13 [INFO] Go runtime version: go1.12.13
2020/10/02 18:43:13 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply", "--var-file=variables/qa_vars.tf"}
2020/10/02 18:43:13 [DEBUG] Attempting to open CLI config file: /Users/me/.terraformrc
@ep4sh
ep4sh / check.md
Created October 6, 2020 19:39
Worker Mem consumption with/without pointers

The approximated result is:

without pointer:
Alloc = 1082 KiB	TotalAlloc = 3301 KiB	Sys = 71040 KiB	NumGC = 1
Alloc = 1112 KiB	TotalAlloc = 3311 KiB	Sys = 71552 KiB	NumGC = 1
Alloc = 1110 KiB	TotalAlloc = 3302 KiB	Sys = 71296 KiB NumGC = 1


with pointer (less mem consumption)
Alloc = 1048 KiB	TotalAlloc = 3325 KiB	Sys = 71808 KiB	NumGC = 1
$ cat vagrant.log
INFO global: Vagrant version: 2.3.0
INFO global: Ruby version: 2.7.6
INFO global: RubyGems version: 3.1.6
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.3.0/gems/vagrant-2.3.0/bin/vagrant"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
@ep4sh
ep4sh / main.go
Last active May 25, 2024 17:38
Kubernetes cluster ID
package main
import (
"context"
"fmt"
"log"
"os"
"path/filepath"
"github.com/google/uuid"
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: ep4sh-ru-cert-dev
namespace: ehome
spec:
# Secret names are always required.
secretName: ep4sh-ru-tls-dev
# secretTemplate is optional. If set, these annotations and labels will be
# copied to the Secret named example-com-tls. These labels and annotations will