Skip to content

Instantly share code, notes, and snippets.

View marthydavid's full-sized avatar

David Marthy marthydavid

View GitHub Profile
import elasticsearch from 'elasticsearch';
import config from './config';
export function getClient() {
if (config.get('use_ssl') == true){
if (config.get('es_username')){
var client = new elasticsearch.Client({
hosts: `https://${config.get('es_username')}:${config.get('es_password')}@${config.get('es_host')}:${config.get('es_port')}`,
ssl: {
ca: fs.readFileSync(`${config.get('ca_certs')}`),
@marthydavid
marthydavid / cert-manager.yaml
Last active July 30, 2019 20:24
docker on Pi4
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
labels:
controller-tools.k8s.io: "1.0"
name: certificates.certmanager.k8s.io
spec:
additionalPrinterColumns:
- JSONPath: .status.conditions[?(@.type=="Ready")].status
### Keybase proof
I hereby claim:
* I am marthydavid on github.
* I am marthydavid (https://keybase.io/marthydavid) on keybase.
* I have a public key ASDcg-UzgoZgV4-CfmXLvFi2BOpPyl75bOwAnlTPYySGMwo
To claim this, I am signing this object:
@marthydavid
marthydavid / haproxy.cfg
Created November 28, 2020 15:15
freeipa-haproxy.cfg
frontend https
bind 10.0.0.100:443 tfo ssl crt /etc/pki/tls/certs/haproxy/my.own.domain.pem
mode http
option forwardfor except 127.0.0.0/8
option http-keep-alive
timeout http-request 10s
timeout http-keep-alive 10s
http-response set-header Strict-Transport-Security max-age=1576800
http-response set-header X-Frame-Options sameorigin
http-response set-header X-Forwarded-Proto https
@marthydavid
marthydavid / cloudinit.yaml
Last active August 14, 2022 12:55
reddit-cloudinit
cloud_config:
users:
- name: ansible_user
ssh-authorized-keys:
- "ssh-rsa ..."
sudo: ['ALL=(ALL) NOPASSWD:ALL']
shell: /bin/bash
home: /home/ansible_user
yum_repos:
epel-release:
@marthydavid
marthydavid / output.txt
Created September 27, 2022 13:22
JMX Exporter with exporter-exporter tcpdump output
GET /metrics HTTP/1.1
Host: myhost:9999
User-Agent: Prometheus/2.37.0
Accept: application/openmetrics-text;version=1.0.0,application/openmetrics-text;version=0.0.1;q=0.75,text/plain;version=0.0.4;q=0.5,*/*;q=0.1
Accept-Encoding: gzip
X-Forwarded-For: 1.1.1.1
X-Prometheus-Scrape-Timeout-Seconds: 10
HTTP/1.1 200 OK
Content-encoding: gzip