Skip to content

Instantly share code, notes, and snippets.

View nlamirault's full-sized avatar

Nicolas Lamirault nlamirault

View GitHub Profile
@nlamirault
nlamirault / gist:38cfc46682eaeb28709e
Created September 21, 2014 14:00
offlineimap-notify.sh
#!/usr/bin/bash
#
# Script to notify user for new mails.
# Crontab ex:
# */3 * * * * ~/bin/offlineimap-notify.sh
#
#run OfflineIMAP once, with quiet interface
offlineimap -o -q -u quiet
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: external-dns
namespace: dns
spec:
chart:
spec:
chart: external-dns
@nlamirault
nlamirault / chart-values.yaml
Last active December 4, 2020 20:29
Flux v2
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: external-dns
namespace: flux-system
spec:
values:
provider: cloudflare
resources:
### Keybase proof
I hereby claim:
* I am nlamirault on github.
* I am nlamirault (https://keybase.io/nlamirault) on keybase.
* I have a public key whose fingerprint is C399 18B3 EBDE 35C2 3B8D 0B8E 5F99 269A 6FCA 437C
To claim this, I am signing this object:
@nlamirault
nlamirault / teleinfo.py
Created October 15, 2017 09:33
Home Assistant Teleinfo platform
"""
Support for Teleinfo sensors.
Teleinfo is a French specific protocol used in electricity smart meters.
It provides real time information on power consumption, rates and current on
a user accessible serial port.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.teleinfo/
"""
$ molecule init role -d gce -r foobar
--> Initializing new role foobar...
Initialized role in /tmp/foobar successfully.
$ $ tree foobar/
Permissions Size User Date Modified Name
drwxr-xr-x - nicolas 28 Mar 14:55 foobar
.rw-r--r-- 296 nicolas 28 Mar 14:55 ├── .yamllint
drwxr-xr-x - nicolas 28 Mar 14:55 ├── defaults
.rw-r--r-- 31 nicolas 28 Mar 14:55 │ └── main.yml

Arch Linux

Removing orphaned packages :

$ pacman -Rns $(pacman -Qtdq)

To list explicitly installed packages available in the official repositories:

$ pacman -Qen
$ kubectl get ingress --all-namespaces
NAMESPACE NAME HOSTS ADDRESS PORTS AGE
hypriot hypriot-ingress hypriot.jarvis 192.168.1.20,... 80 2h
kube-system kubernetes-dashboard-ingress dashboard.jarvis 192.168.1.20,... 80 72d
monitoring prometheus prometheus.jarvis 192.168.1.20,... 80 17d
$ cat /srv/docker/coredns/Corefile
.:53 {
kubernetes jarvis {
endpoint https://192.168.1.36:6443
$ ansible -vvvvvvv 192.168.1.20 -m ping -i inventory No config file found; using defaults
Loading callback plugin minimal of type stdout, v2.0 from /usr/local/lib/python2.7/dist-packages/ansible/plugins/callback/__init__.pyc
META: ran handlers
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/system/ping.py
<192.168.1.20> ESTABLISH SSH CONNECTION FOR USER: pirate
<192.168.1.20> SSH: ansible.cfg set ssh_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<192.168.1.20> SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<192.168.1.20> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=pirate)
<192.168.1.20> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=1
@nlamirault
nlamirault / gist:181c7ca710c054d4f2f7
Created September 16, 2015 12:10
openssl certificates K8s
# Master IP
IP=$1
# Output directory
DIR=$2
echo "--> Generate CA.key"
openssl genrsa -out ${DIR}/ca.key 2048
echo "--> Generate CA crt"
openssl req -x509 -new -nodes -key ${DIR}/ca.key -subj "/CN=${IP}" -days 10000 -out ${DIR}/ca.crt