Skip to content

Instantly share code, notes, and snippets.

[Map_Base64_Bin]:
MAPPING
LOAD
Text(Base64),
Text(Bin)
INLINE [
Dec,Bin,Base64
0,000000,A
1,000001,B
2,000010,C
systemctl restart kubelet
systemctl enable kubelet
systemctl status kubelet
kubectl get pods -o json | jq -r '.items[] | { name : .metadata.generateName, status: .status.phase, ip: .status.podIP } | [.name,.status,.ip] |@tsv'kubectl get pods -o json | jq -r '.items[] | .metadata.name' | xargs -t -I % kubectl logs % | grep kubectl
kubectl get pods -o json | jq -r '.items[] | { name: .metadata.name, container: .spec.containers[].name } | [ .name, .container ] | @sh' | xargs -l bash -c 'echo Logs for $0/$1: && kubectl logs $0 $1 && echo'
helm del --purge qliksense
watch kubectl get pods
kubectl get pvc -o json | jq -r '.items[] | .metadata.name' | xargs kubectl delete pvc
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
@pouc
pouc / 2019-01 QABDI SKO
Last active March 29, 2019 13:34
Réponses Practize
1 = YES
2 = ./dist/runtime/scripts/qsl_processor/start_qsl_env.sh
3 = alltripssmall
4 = 0
5 = 53
6 = 27
@pouc
pouc / .Nginx proxy single port (https 443) multiplex vhost
Last active March 8, 2019 23:10
Example config for nginx as a mutiplexer for different web servers
server {
listen 443 ssl;
server_name <external server name>;
ssl_certificate /etc/nginx/ssl/cert.crt;
ssl_certificate_key /etc/nginx/ssl/key.key;
sub_filter_once off;
<location tags>
# docker
sudo docker ps
sudo docker exec -it <container> bash
sudo docker restart <container>
# docker cleanup
sudo docker container ls -a
sudo docker container prune
@pouc
pouc / Aws debian instance
Last active April 15, 2019 07:57
Commands to run on a new aws node
sudo su
cd /etc/skel
echo 'mkfile() { mkdir -p "$(dirname "$1")" && touch "$1" ; }' >> ~/.bashrc
mkfile() { mkdir -p "$(dirname "$1")" && touch "$1" ; }
mkfile ./.ssh/authorized_keys
chmod 700 ./.ssh
chmod 600 ./.ssh/authorized_keys
visudo
# %sudo ALL=NOPASSWD: ALL
@pouc
pouc / Install docker, Kubernetes & GlusterFS
Last active May 27, 2019 10:37
Install docker, Kubernetes & GlusterFS on a new node
# Docker install
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
# should match 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
@pouc
pouc / Export QVF
Last active March 4, 2019 19:07
How to export qvf from Qlik Sense using QRS API, JWT and qlik-shell
node --experimental-modules index.mjs uuid | node --experimental-modules index.mjs --config test/proxy.json post "app/24ab12cf-ee11-49b6-8e02-f4b1aa4d357e/export/${prec[0]}" "{}" | node --experimental-modules index.mjs echo "${prec[1].downloadPath}" | node --experimental-modules index.mjs --config test/proxy.json resource "${prec[2]}" | node --experimental-modules index.mjs --trim writebin titi.qvf
@pouc
pouc / Generate JWT key pair
Last active March 4, 2019 19:07
How to generate JWT private/public key & certificate files
ssh-keygen -t rsa -b 4096 -f private.key
openssl rsa -in private.key -pubout -outform PEM -out public.key
openssl req -new -key private.key -out request.csr
openssl x509 -req -sha256 -days 365 -in request.csr -signkey private.key -out certificate.pem