Skip to content

Instantly share code, notes, and snippets.

@guelau
guelau / myCustomZsh.zsh
Last active March 9, 2021 20:09
$HOME/.oh-my-zsh/custom/myCustomZsh.zsh
# Kubernetes
alias k="kubectl"
alias kx="kubectl config use-context"
alias kg='kubectl get'
alias kd='kubectl describe'
alias kgp='kubectl get pods'
alias kgns='kubectl get namespaces'
alias kgall='kubectl get ingress,service,deployment,pod,statefulset'
@guelau
guelau / ip.txt
Created September 14, 2020 13:46
Send random calls with curl to server (used to test some stuff)
17.158.227.90
131.184.97.52
190.28.55.204
32.87.1.171
69.167.226.124
77.248.110.206
75.68.162.101
34.157.45.132
38.44.170.174
195.204.33.7
var util = {
has: function (str1, str2) {
if (typeof str1 === 'string') {
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1
} else {
return false
}
},
lowerize: function (str) {
return str.toLowerCase()
@guelau
guelau / delete_host.py
Created November 14, 2018 10:50
Autoregister and remove Host in Zabbix
#!/usr/bin/python
# Based on Samuel Cozannet's script
# Updated by Laurent (laurent@guesttoguest.com)
#
# Note: requires pyzabbix to be installed.
# root@zabbix.local~# pip install pyzabbix
#
from pyzabbix import ZabbixAPI
import argparse
@guelau
guelau / ReadIniFile.sh
Created April 12, 2018 13:45
Reading ini file with Bash
#!/bin/bash
#
# Exemple:
# cat param.ini
# [PREPROD]
# host = masuperconf_preprod
# pass = motdepass_preprod
#
# [PRODUCTION]
# host = masuperconf_prod
@guelau
guelau / secu.conf
Created January 24, 2018 12:22
Some of security directives for Apache
# Send No server's informations
ServerTokens Prod
ServerSignature Off
<IfModule mod_headers.c>
# Forces httpOnly, secure cookies and limit XSS Attacks
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
# Iframes can't come from another site: same url only
Header set X-Frame-Options SAMEORIGIN
@guelau
guelau / keybase.md
Last active October 15, 2019 10:37

Keybase proof

I hereby claim:

  • I am guelau on github.
  • I am tild (https://keybase.io/tild) on keybase.
  • I have a public key ASBHIdGbcetpLnb1p7TBk-sFrXhWcObkx_ajXvfpT4jn8go

To claim this, I am signing this object:

@guelau
guelau / s3cmd-cache
Last active July 11, 2016 21:29
Adding Cache-Control to all objects of a bucket/directory
s3cmd modify --add-header='Cache-Control: max-age=2419200, must-revalidate' s3://BUCKET/dir/path --recursive
@guelau
guelau / default.vcl
Last active November 14, 2018 10:46
Varnish Check
backend default {
.host = "127.0.0.1";
.port = "8080";
}
sub vcl_recv {
if (req.http.host ~ "^cdn\.myapiservice\.com") {
set req.http.host = "api.myapiservice.com";
set req.url = regsub(req.url, "^/", "/v1/images/");
}
@guelau
guelau / hophop
Created March 10, 2016 08:01
New environment?
#!/bin/bash
mkdir .config && cd .config
git clone https://gist.github.com/5765391.git bashrc
echo -e "\nsource `pwd`/bashrc/bashrc\n" >> ~/.bashrc
cd ..
git clone https://gist.github.com/d2b6ccc2c5bb3dd0fdbc.git vimrc
ln -sf ~/.config/vimrc ~/.vimrc