Skip to content

Instantly share code, notes, and snippets.

View guilhem's full-sized avatar
Ohai!

Guilhem Lettron guilhem

Ohai!
View GitHub Profile
@guilhem
guilhem / cloudflare-forwarded-port-cm.yaml
Last active October 25, 2021 12:16
fix nginx.ingress.kubernetes.io/force-ssl-redirect="true" with cloudlare
apiVersion: v1
kind: ConfigMap
metadata:
name: cloudflare-forwarded-port
namespace: ingress-nginx
data:
main.lua: |
local ngx = ngx
local _M = {}
[Unit]
Description=Cleanup pod directory on reboot
Before=kubelet.service
Before=docker.service # for rke install
[Service]
Type=oneshot
Environment=KUBELET_DIR='/var/lib/kubelet/'
ExecStart=/usr/bin/find ${KUBELET_DIR} -mindepth 1 -delete
@guilhem
guilhem / gist:6911ac77565890f623f1c6f55c8fdf9f
Last active March 29, 2021 13:29
azure blob io.ReaderAt
package blob
import (
"context"
"io"
"github.com/Azure/azure-storage-blob-go/azblob"
)
type BlobReaderAt struct {
@guilhem
guilhem / log
Created March 29, 2021 12:11
Error linux make
$ make bindeb-pkg
[...]
make[4]: *** No rule to make target 'debian/canonical-certs.pem', needed by 'certs/x509_certificate_list'. Stop.
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:1979: certs] Error 2
make[3]: *** Waiting for unfinished jobs....
[...]
dpkg-buildpackage: error: debian/rules binary subprocess was killed by signal 2
make[1]: *** [scripts/Makefile.package:83: bindeb-pkg] Interrupt
@guilhem
guilhem / log.diff
Created August 14, 2020 17:03
Jupyter notebook log kernel execution and user based on http proxy header
diff --git a/notebook/base/handlers.py b/notebook/base/handlers.py
index 743f7bac7..6d8f478cf 100755
--- a/notebook/base/handlers.py
+++ b/notebook/base/handlers.py
@@ -126,6 +126,8 @@ class AuthenticatedHandler(web.RequestHandler):
self.force_clear_cookie(self.cookie_name)
def get_current_user(self):
+ if "X-AUTH-USER" in self.request.headers:
+ return self.request.headers["X-AUTH-USER"]
@guilhem
guilhem / README.md
Last active May 28, 2022 06:09
Optimization for Dell XPS 13 7390 2-in-1 on Ubuntu 19.10 (2019-10-27)

Bios

Disable:

  • thunderbolt → wakeup from suspend (fix in 5.4)
  • fingerprint → no driver for Goodix Fingerprint
  • camera → no driver for Intel AVStream Camera

Services

Disable:

@guilhem
guilhem / secured-admin.yaml
Created July 2, 2019 15:57
less intrusive rancher admin globalrole
apiVersion: management.cattle.io/v3
description: ""
displayName: Secured Admin
kind: GlobalRole
metadata:
name: secured-admin
newUserDefault: false
rules:
- apiGroups:
- management.cattle.io
@guilhem
guilhem / README.md
Last active April 8, 2019 08:40
Install rancher and all it's parties ;)

helm

kubectl -n kube-system create serviceaccount tiller

kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller

helm init --service-account tiller
@guilhem
guilhem / connect hog
Last active June 6, 2018 08:52
hp elite presenter mouse
juin 06 10:48:54 guilhem-XPS-13-9360 bluetoothd[1309]: src/adapter.c:start_discovery_timeout()
juin 06 10:48:54 guilhem-XPS-13-9360 bluetoothd[1309]: src/adapter.c:start_discovery_timeout() adapter->current_discovery_filter == 0
juin 06 10:48:54 guilhem-XPS-13-9360 bluetoothd[1309]: src/adapter.c:start_discovery_complete() status 0x00
juin 06 10:48:54 guilhem-XPS-13-9360 bluetoothd[1309]: src/adapter.c:discovering_callback() hci0 type 7 discovering 1 method 0
juin 06 10:48:55 guilhem-XPS-13-9360 bluetoothd[1309]: src/adapter.c:device_found_callback() hci0 addr 47:9B:97:65:D1:61, rssi -90 flags 0x0000 eir_len 14
juin 06 10:48:55 guilhem-XPS-13-9360 bluetoothd[1309]: src/device.c:device_set_legacy() legacy 0
juin 06 10:48:55 guilhem-XPS-13-9360 bluetoothd[1309]: src/device.c:device_set_rssi_with_delta() rssi -90 delta 9
juin 06 10:48:55 guilhem-XPS-13-9360 bluetoothd[1309]: src/device.c:device_set_flags() flags 26
juin 06 10:49:00 guilhem-XPS-13-9360 kernel: Bluetooth: hci0: last event is not cmd complete (0x0f
@guilhem
guilhem / node-ssh
Last active May 17, 2018 14:22
kubectl plugin to ssh on internalIP of a node
#!/bin/bash
NODE=${1}
USER=${KUBECTL_PLUGINS_LOCAL_FLAG_USER}
IP=$($KUBECTL_PLUGINS_CALLER get nodes "$NODE" -o=jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}')
CONNECTION="$IP"