Skip to content

Instantly share code, notes, and snippets.

annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
External auth with OAuth2: https://kubernetes.github.io/ingress-nginx/examples/auth/oauth-external-auth/#external-oauth-authentication
nginx.ingress.kubernetes.io/auth-url: "https://$host/oauth2/auth"
nginx.ingress.kubernetes.io/auth-signin: "https://$host/oauth2/start?rd=$escaped_request_uri"
Basic auth
nginx.ingress.kubernetes.io/auth-type: basic
@Treydone
Treydone / install
Created April 3, 2017 15:42
Pour Cécile
sudo apt-get update
sudo apt-get upgrade
echo "--- Dev tools..."
sudo apt-get -y install iotop htop subversion maven nmap iftop ncdu lsof ncftp ruby jq glances jmeter vim
sudo apt-get -y install libxml-xpath-perl libapr1-dev libssl-dev make cmake rpm libtolua-dev libtolua++5.1-dev libx11-dev libxft-dev libxdamage-dev libncurses5-dev libxinerama-dev
sudo apt-get -y install mercurial subversion build-essential git-core configure-debian automake autoconf xorg-dev libtool libdrm-dev mesa-common-dev xutils-dev xutils git filezilla apt-file terminator furiusisomount zsh
sudo apt-get -y install g++ flex bison gperf perl libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev libpng-dev libjpeg-dev python libx11-dev libxext-dev libfreetype6-dev python-dev python-imaging
sudo apt-get -y install libglib2.0-dev libusb-dev gnome-media
sudo apt-get -y install shutter keepassx pdfshuffler
@Treydone
Treydone / .gitconfig
Created May 20, 2016 12:06 — forked from shawndumas/.gitconfig
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@Treydone
Treydone / BasicAuthenticationFilter.java
Created May 2, 2016 12:21 — forked from neolitec/BasicAuthenticationFilter.java
HTTP Basic authentication Java filter
package com.neolitec.examples;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Treydone
Treydone / README.md
Created March 30, 2016 10:13 — forked from rantav/README.md
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@Treydone
Treydone / install.sh
Last active September 4, 2016 16:26
Server OVH
sudo apt-get update
sudo apt-get upgrade
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.old
sudo sed 's|Port 22|Port 2222|g' -i /etc/ssh/sshd_config
sudo service ssh restart
NET_IF=`netstat -rn | awk '/^0.0.0.0/ {thif=substr($0,74,10); print thif;} /^default.*UG/ {thif=substr($0,65,10); print thif;}'`
NET_IP=`ifconfig ${NET_IF} | grep -Eo 'inet (addr:|adr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'`
PARTS=(${NET_IP//./ })
@Treydone
Treydone / check_es.py
Last active August 29, 2015 14:24
Icinga
#!/usr/bin/env python
import sys
import json
import pycurl
import optparse
from StringIO import StringIO
import tempfile
from os import getcwd, devnull
from os.path import join, isfile
@Treydone
Treydone / install.sh
Last active August 29, 2015 14:18
DevStack
sudo apt-get install git ruby htop
sudo apt-get install build-essential ruby ruby-dev libxml2-dev libsqlite3-dev libxslt1-dev libpq-dev libmysqlclient-dev
sudo gem install bosh_cli bosh_cli_plugin_micro --no-ri --no-rdoc
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack; ./stack.sh
// Download stemcell
bosh download public stemcell bosh-stemcell-2751-openstack-kvm-ubuntu-trusty-go_agent.tgz
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb
sudo dpkg -i scala-2.11.4.deb
sudo apt-get update
@Treydone
Treydone / boost.sh
Last active June 15, 2016 00:03
Ubuntu tweak
sudo apt-get update
sudo apt-get upgrade
############################ Security
sudo apt-get -y install openssh-server
sudo apt-get -y install gufw
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.old
sudo sed 's|Port 22|Port 2222|g' -i /etc/ssh/sshd_config
sudo service ssh restart