Skip to content

Instantly share code, notes, and snippets.

View nezed's full-sized avatar
🇺🇦

D. Naumov nezed

🇺🇦
  • 20:46 (UTC +01:00)
View GitHub Profile
http://plasmasturm.org/log/chromepwstore/
@nezed
nezed / ingress.yaml
Created April 23, 2020 17:58
Helm basic auth with Kubernetes Ingress
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 December 25, 2018 20:40
Run any clickhouse built-in util from its docker image
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 December 25, 2018 20:35
Runs clickhouse-obfuscator from docker image, which randomizes your dataset to make its data not sensetive
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 August 21, 2016 23:54
EXIF image orientation CSS transform fix / fix orientation of image picked from local FS without canvas
/*
* 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) ]

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

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

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

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

@nezed
nezed / gist:6086fd74db2b5b9d1a2d
Created January 19, 2016 08:02 — forked from afilhodaniel/gist:09a1df8eafeabe1584c6
Upload photos to Instagram via private API with Ruby
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()

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: