Skip to content

Instantly share code, notes, and snippets.

View epcim's full-sized avatar

Petr Michalec epcim

View GitHub Profile
@epcim
epcim / docker-compose.yml
Created July 18, 2018 13:08 — forked from christophermaier/docker-compose.yml
Habitat testing setup
version: '3.2'
services:
bastion:
image: christophermaier/test-probe:0.1.0-20180509175222
command:
- "run"
- "--listen-ctl=0.0.0.0:9632"
- "--permanent-peer"
hostname: bastion
domainname: habitat.dev
@epcim
epcim / Kafka cheet sheets.md
Created July 18, 2018 13:04 — forked from weldpua2008/Kafka cheet sheets.md
Kafka useful commands

Kafka

get size for all topics on worker

 for topic in $(find   /opt/cloudera/data/*/kafka/ -maxdepth 1 -mindepth 1 -type d -exec basename {} \;| awk -F '-' '{print $1}'| sort |uniq | grep -v consumer_offsets);do

du -csh /opt/cloudera/data/*/kafka/${topic}*| grep total| awk '{print "topic '$topic' "$1}'
done
@epcim
epcim / Galera.md
Created July 18, 2018 13:02 — forked from LotharKAtt/Galera.md
Restoring, Migration, Detach

Galera

Restore MYSQL cluster

  1. Kill all mysql process on whole cluster (check via ps aux| grep mysql)
  2. Remove grastate.data and ib_logfiles
    • rm /var/lib/mysql/grastate.data
    • rm /var/lib/mysql/ib_logfile*
  3. Edit this row in /etc/mysql/my.cnf on `"wsrep_cluster_address="gcomm://""``
  4. Start MySql on this node
@epcim
epcim / Aptly
Created July 18, 2018 13:02 — forked from LotharKAtt/Aptly
Setup aptly with Mirantis CI/CD stacks
aptly mirror list -raw | grep -E '*' | xargs -n 1 aptly mirror update
aptly_mirror_update.sh -s -v
aptly-publisher --architectures=amd64 --timeout=1200 publish -v -c /etc/aptly-publisher.yaml --url http://192.168.104.50:8084 --recreate
aptly-publisher --url http://192.168.104.50:8084 promote --source ubuntu-trusty/nightly --target ubuntu-trusty/testing --force-overwrite -d --timeout 600 --recreate
aptly-publisher --url http://192.168.104.50:8084 promote --source ubuntu-xenial/nightly --target ubuntu-xenial/testing --force-overwrite -d --timeout 600 --recreate
nohup aptly api serve --no-lock &
Add repo:
@epcim
epcim / ceph
Created July 12, 2018 13:27 — forked from LotharKAtt/ceph
Ceph Debug
rbd list -k /etc/ceph/ceph.client.volumes.keyring --user volumes --pool volumes
ceph osd pool ls
ceph auth list
ceph health
ceph -s
@epcim
epcim / docker-ssh-forward.bash
Created July 10, 2018 07:30 — forked from d11wtq/docker-ssh-forward.bash
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@epcim
epcim / tf_ssh_config_gen.rb
Created July 8, 2018 19:10 — forked from gionn/tf_ssh_config_gen.rb
Quick script to generate an ssh_config after a terraform apply on OpenStack, GCE, DigitalOcean
#!/usr/bin/env ruby
# NOTICE: GCE and OpenStack providers only.
require 'json'
require 'erb'
def get_template()
%{
<% hosts.each do |key, entry| %>
Host <%= key %>
@epcim
epcim / ignition_config.yml
Created June 29, 2018 13:19 — forked from Titerote/ignition_config.yml
Ignition problem on coreos
---
systemd:
units:
- name: etcd2.service
enable: true
dropins:
- name: 40-etcd-cluster.conf
contents: |
[Service]
Environment="ETCD_NAME={{.etcd_name}}"
@epcim
epcim / gist:839a58660b1d86869e29dfe7f2fcda36
Last active June 22, 2018 08:32 — forked from npero/gist:3634719
Enable sparse-checkout
Enable sparse-checkout:
git config core.sparsecheckout true
Configure sparse-checkout by listing your desired sub-trees in .git/info/sparse-checkout:
echo some/dir/ >> .git/info/sparse-checkout
echo another/sub/tree >> .git/info/sparse-checkout
Update your working tree:
git read-tree -mu HEAD
@epcim
epcim / merge.sh
Created June 15, 2018 06:40 — forked from lxhunter/merge.sh
Automated merging of branches into master for travis-ci or any other ci
#!/bin/bash
git config --global user.email '[email protected]'
git config --global user.name 'Travis'
git remote set-branches --add origin master
git fetch
git reset --hard
git checkout master
git merge --ff-only "$TRAVIS_COMMIT"
git push git+ssh://[email protected]/${TRAVIS_REPO_SLUG}.git master