Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇦

Dmyto Naumov nezed

🇺🇦
View GitHub Profile
@nezed
nezed / ingress.yaml
Created Apr 23, 2020
Helm basic auth with Kubernetes Ingress
View ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: my-basic-auth
nginx.ingress.kubernetes.io/auth-realm: "Authentication Required - ok"
name: my-ingress
spec:
rules:
@nezed
nezed / clickhouse-utils.sh
Created Dec 25, 2018
Run any clickhouse built-in util from its docker image
View clickhouse-utils.sh
docker run --rm --entrypoint /usr/bin/clickhouse yandex/clickhouse-server:latest local
docker run --rm --entrypoint /usr/bin/clickhouse yandex/clickhouse-server:latest client
docker run --rm --entrypoint /usr/bin/clickhouse yandex/clickhouse-server:latest benchmark
docker run --rm --entrypoint /usr/bin/clickhouse yandex/clickhouse-server:latest server
docker run --rm --entrypoint /usr/bin/clickhouse yandex/clickhouse-server:latest performance-test
docker run --rm --entrypoint /usr/bin/clickhouse yandex/clickhouse-server:latest extract-from-config
docker run --rm --entrypoint /usr/bin/clickhouse yandex/clickhouse-server:latest compressor
docker run --rm --entrypoint /usr/bin/clickhouse yandex/clickhouse-server:latest format
docker run --rm --entrypoint /usr/bin/clickhouse yandex/clickhouse-server:latest copier
docker run --rm --entrypoint /usr/bin/clickhouse yandex/clickhouse-server:latest obfuscator
@nezed
nezed / clickhouse-obfuscator.sh
Created Dec 25, 2018
Runs clickhouse-obfuscator from docker image, which randomizes your dataset to make its data not sensetive
View clickhouse-obfuscator.sh
docker run --rm \
--volume "$(pwd)"/seeds:/tmp/seeds \
--entrypoint bash \
yandex/clickhouse-server:latest \
-c '/usr/bin/clickhouse obfuscator --seed "$(head -c16 /dev/urandom | base64)" --input-format TSV --output-format TSV --structure "date Date, datetime DateTime, ab_tag String, client_name String" < /tmp/seeds/rows.tsv' \
> obfuscated_rows.tsv
# 1. stdin pipe was created inside container to prevent "Input must be seekable file (it will be read twice)." error
# 2. UUID, LowCardinality(…) and Enum8/16 data-types are not supported in `--structure`.
# Use FixedString(36) or String instead (See https://github.com/yandex/ClickHouse/blob/881893d/dbms/programs/obfuscator/Obfuscator.cpp#L873-L895)
@nezed
nezed / EXIF image orientation CSS transform fix.js
Created Aug 21, 2016
EXIF image orientation CSS transform fix / fix orientation of image picked from local FS without canvas
View EXIF image orientation CSS transform fix.js
/*
* This gist will help you to fix orientation
* of image picked from local FS
* without canvas.
* CSS-only!
*
* @expample
* const img = document.createElement('img')
* img.src = URL.createObjectURL(file)
* img.style.transform = ORIENT_TRANSFORMS[ getOrientation(file) ]
View Pull, rebase, resolve conflicts.md

В локальной директории своего репозитория нужно добавить как дополнительный ремоут основной репозиторий, куда ты отправляешь задания на проверку

$ git remote add upstream <тут https ссылка на основной репозиторий>

пример ссылки на основной репозиторий: https://github.com/organization-name/project.git

Так, в проекте будет 2 ремоута:

@nezed
nezed / gist:6086fd74db2b5b9d1a2d
Created Jan 19, 2016 — forked from afilhodaniel/gist:09a1df8eafeabe1584c6
Upload photos to Instagram via private API with Ruby
View gist:6086fd74db2b5b9d1a2d
class InstagramPrivateController < ApplicationController
def initialize(username, password, photo, caption)
@username = username
@password = password
@photo = photo
@caption = caption
@cookiepath = Tempfile.new('cookies').path
@user_agent = generate_user_agent()
View keybase.md

Keybase proof

I hereby claim:

  • I am nezed on github.
  • I am nezed (https://keybase.io/nezed) on keybase.
  • I have a public key whose fingerprint is CA24 6E3F FB44 5D62 AD06 ED78 E068 52C4 CD4C D366

To claim this, I am signing this object: