Skip to content

Instantly share code, notes, and snippets.

View tairov's full-sized avatar

Aydyn Tairov tairov

  • London, UK
View GitHub Profile
@tairov
tairov / .inventory
Created May 10, 2018 12:50
Ansible vars
k8s-host:
vars:
definition: "definition from k8s-host"
hosts:
k8s-deployment-host:
vars:
definition: "definition from k8s-deployment-host"
k8s-deployment-host:
vars:
@tairov
tairov / ingress_issue.yml
Last active April 29, 2018 20:24
Issues with ingres. Can't access web-app.localhost domain name. UPDATE: resolved, see solution.yml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
namespace: default
name: "dev-simple-web-app-web-app"
spec:
strategy:
type: Recreate
replicas: 1
minReadySeconds: 0
@tairov
tairov / RBAC
Last active May 1, 2018 20:11
minikube / helm / RBAC issue resolve
# resolving problems with RBAC on minikube https://kubernetes.io/docs/admin/authorization/rbac/
minikube delete
minikube start
# check containers status
kubectl get pods --all-namespaces
# wait until all containers will be initialized
kubectl -n kube-system create sa tiller
#Replace nginx default.conf file
RUN rm -f /etc/nginx/conf.d/default.conf
COPY default.conf /etc/nginx/conf.d/
# Expose internally the Docker Socket and run forever
socat "TCP-LISTEN:2375,reuseaddr,fork" "UNIX-CLIENT:/var/run/docker.sock"
#!/bin/bash
# Build a commit frequency list.
ROW_LIMIT=20
git log --name-status $* | \
grep -E '^[A-Z]\s+' | \
cut -c3-500 | \
sort | \
uniq -c | \
mb_internal_encoding('utf-8');
$s = mb_substr($s, 0, 1);
@tairov
tairov / mysql_table_sizes.sql
Created June 19, 2017 15:58
get table sizes in mysql schema
use mysql;
SELECT
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `size_MB`
FROM information_schema.TABLES
WHERE table_schema = "backend"
order by size_MB desc;
Disable foreign keys checking by call this query : "set foreign_key_checks=0;"
Enable back foreign key checking with : "set foreign_key_checks=1;"
@tairov
tairov / gist:8e46761acdc97b6bea0d08ea1bf528b1
Created May 26, 2016 20:30
adding alternatives, ubuntu
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 20 --slave /usr/bin/g++ g++ /usr/bin/g++-5