Skip to content

Instantly share code, notes, and snippets.

View fengxsong's full-sized avatar
🤓

fengxsong fengxsong

🤓
  • Guangzhou,China
  • 23:41 (UTC +08:00)
View GitHub Profile
@cheethoe
cheethoe / gist:49d9c1d0003e44423e54a060e0b3fbf1
Last active April 14, 2022 21:01
Rook v0.8.0 device/osd removal
# 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`
@detiber
detiber / README.md
Last active April 16, 2023 02:21
Using CFSSL as an external CA for kubeadm

CFSSL as an external CA for non-ha kubeadm intialized clusters

Using cfssl to Create an External CA Infrastructure

Install cfssl

# This requires an existing Go environment with GOPATH set
go get -u github.com/cloudflare/cfssl/cmd/...
@bobrik
bobrik / README.md
Last active January 19, 2024 08:45
CFS hiccups
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/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
@rtmie
rtmie / ceph permissions
Last active August 20, 2018 16:07
Configuration for CephRBD dynamic provisioning on kubernetes 1.7
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
@fengxsong
fengxsong / check_http.go
Last active November 23, 2017 04:53
check_http tracing http request. notice! some function comes from davecheney's httpstat
package main
import (
"bytes"
"context"
"crypto/tls"
"encoding/base64"
"encoding/json"
"encoding/pem"
"flag"
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ 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
@dedy-purwanto
dedy-purwanto / gist:11312110
Created April 26, 2014 05:00
Bulk remove iTerm2 color schemes.
# 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
@cedricvidal
cedricvidal / backup.sh
Last active January 17, 2022 16:26 — forked from nherment/backup.sh
ElasticSearch log index backup & restore scripts
#!/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