Skip to content

Instantly share code, notes, and snippets.

View LotharKAtt's full-sized avatar

Pavel Čižinský LotharKAtt

  • Prague, Czech Republic
View GitHub Profile
@LotharKAtt
LotharKAtt / rootfscopy.sh
Created April 29, 2020 07:25
rootfscopy.sh
#!/bin/bash -e
DESTDIR="/rootfs"
error() {
echo "$*" 1>&2
exit 1
}
copy() {
version: "3"
services:
grafana:
image: "grafana/grafana"
ports:
- "3000:3000"
environment:
- "GF_SECURITY_ADMIN_PASSWORD=cloudlab"
user: "104"
volumes:
sudo DEBIAN_FRONTEND=noninteractive apt install -yq \
software-properties-common \
apt-transport-https \
ca-certificates \
curl \
wget \
gnupg-agent \
nmap \
software-properties-common \
git \
// Get list of user from mysql
select user from mysql.user;
CREATE USER nova WITH PASSWORD 'cloudlab';
CREATE USER cinder WITH PASSWORD 'cloudlab';
CREATE USER glance WITH PASSWORD 'cloudlab';
CREATE USER keystone WITH PASSWORD 'cloudlab';
CREATE USER neutron WITH PASSWORD 'cloudlab';
CREATE DATABASE cidner;
@LotharKAtt
LotharKAtt / wait-for-it.sh
Created November 17, 2018 10:58
Wait-for-it.sh (POSIX Shell) for alpine
#!/usr/bin/env sh
# Use this script to test if a given TCP host/port are available
set -e
cmdname=$(basename "$0")
echoerr() {
if [ "$QUIET" -ne 1 ]; then
printf "%s\n" "$*" 1>&2;
root@sdp-vslogv-01:/var/lib/elasticsearch# curl -XGET http://10.25.12.101:9200/_cluster/health?pretty=true
{
"cluster_name" : "elasticsearch",
"status" : "red",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 2,
"active_primary_shards" : 345,
"active_shards" : 415,
"relocating_shards" : 0,
@LotharKAtt
LotharKAtt / ceph
Created September 20, 2017 08:14
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
@LotharKAtt
LotharKAtt / Aptly
Last active July 18, 2018 13:02
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:
@LotharKAtt
LotharKAtt / Galera.md
Last active July 18, 2018 13:02
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
@LotharKAtt
LotharKAtt / 0_reuse_code.js
Created November 17, 2016 15:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console