Skip to content

Instantly share code, notes, and snippets.

View thanad's full-sized avatar

Thanad Pansing thanad

  • King Power Click
  • Bangkok
  • X @thanad
View GitHub Profile
@thanad
thanad / read-only-clusterrole.yaml
Created January 27, 2022 11:03 — forked from just1689/clusterrole.yaml
Read only cluster role for Lens read only users
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: read-only-clusterrole
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
- list
# 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`
@thanad
thanad / docker-compose.yml
Created March 14, 2019 16:07
traefik docker swarm
version: "3.3"
services:
traefik:
image: traefik
command: --web --docker --docker.swarmmode --docker.watch --logLevel=DEBUG
ports:
- "80:80"
- "8080:8080"
- "443:443"
@thanad
thanad / cp_secrets.sh
Last active September 3, 2018 04:48 — forked from danrigsby/gist:8346b842d1446628de5223b600668dca
Copy kubernetes secrets between namespaces
kubectl get secrets -o json --namespace old | jq '.items[].metadata.namespace = "new"' | kubectl apply -f -
@thanad
thanad / gen-ssl.sh
Created January 1, 2018 13:03 — forked from thbkrkr/gen-ssl.sh
Generate Self-Signed SSL Certificate without prompt
# Generate a passphrase
openssl rand -base64 48 > passphrase.txt
# Generate a Private Key
openssl genrsa -aes128 -passout file:passphrase.txt -out server.key 2048
# Generate a CSR (Certificate Signing Request)
openssl req -new -passin file:passphrase.txt -key server.key -out server.csr \
-subj "/C=FR/O=krkr/OU=Domain Control Validated/CN=*.krkr.io"
@thanad
thanad / nginx.conf
Created October 12, 2017 08:51 — forked from jrom/nginx.conf
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@thanad
thanad / .block
Last active September 17, 2017 10:45
fresh block
license: mit
#!/bin/bash
echo "${CI_PULL_REQUESTS}"
echo "${CI_PULL_REQUEST}"
echo "${CIRCLE_PR_NUMBER}"
if [[ ! "${CI_PULL_REQUEST}" =~ /pull/[0-9]+$ ]]; then
exit 0
fi
@thanad
thanad / ubuntu-php7-install.bash
Created November 11, 2016 08:54
Ubuntu 14.04 PHP7 (Install from Source)
#!/usr/bin/env bash
sudo -i;
apt-get update;
apt-get install --yes \
git \
bison \
autoconf \
#!/bin/bash
# /etc/init.d/sentry
# A debian-compatible sentry startup script
#
### BEGIN INIT INFO
# Provides: sentry
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6