Install cfssl
# This requires an existing Go environment with GOPATH set
go get -u github.com/cloudflare/cfssl/cmd/...
package main | |
import ( | |
"bytes" | |
"context" | |
"crypto/tls" | |
"encoding/base64" | |
"encoding/json" | |
"encoding/pem" | |
"flag" |
ceph auth get-or-create client.kube mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=kubernetes' -o /etc/ceph/ceph.client.kube.keyring |
#!/bin/bash | |
# herein we backup our indexes! this script should run at like 3 AM every first day of the month, after logstash | |
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas, | |
# compress the data files and backs up to whatever long term storage. | |
. ./config.sh | |
echo "Checking that index exist in ES" | |
if [ `curl -sI $ESURL/$INDEXNAME | grep OK | wc -l` -eq 0 ] | |
then |
# This will use osd.5 as an example | |
# ceph commands are expected to be run in the rook-toolbox | |
1) disk fails | |
2) remove disk from node | |
3) mark out osd. `ceph osd out osd.5` | |
4) remove from crush map. `ceph osd crush remove osd.5` | |
5) delete caps. `ceph auth del osd.5` | |
6) remove osd. `ceph osd rm osd.5` | |
7) delete the deployment `kubectl delete deployment -n rook-ceph rook-ceph-osd-id-5` | |
8) delete osd data dir on node `rm -rf /var/lib/rook/osd5` |
We're looking at CPU bandwidth control via CFS:
Program does number of iterations, in each iteration we burn CPU in small chunks until we get 5ms of real time spent. On each iteration we also print how much
#!/bin/bash | |
set -e | |
set -o pipefail | |
# Add user to k8s using service account, no RBAC (must create RBAC after this script) | |
if [[ -z "$1" ]] || [[ -z "$2" ]]; then | |
echo "usage: $0 <service_account_name> <namespace>" | |
exit 1 | |
fi |
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all. | |
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one. | |
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format | |
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files. | |
$ cd /tmp/ | |
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist . | |
$ plutil -convert xml1 com.googlecode.iterm2.plist | |
$ vi com.googlecode.iterm2.plist |
$ git remote rm origin | |
$ git remote add origin git@github.com:aplikacjainfo/proj1.git | |
$ git config master.remote origin | |
$ git config master.merge refs/heads/master |