Skip to content

Instantly share code, notes, and snippets.

@kgorskowski
kgorskowski / coreos-efs-cloud-config
Created July 10, 2015 10:37
coreos cloud-config file for dynamically mount aws efs in the right availability zone
#cloud-config
write-files:
- path: /etc/conf.d/nfs
permissions: '0644'
content: |
OPTS_RPC_MOUNTD=""
users:
- name: XYZ
groups:
@lgg
lgg / run_letsencrypt
Created January 10, 2016 05:16
Let's encrypt auto authenticator runner for multiply domains
#!/bin/bash
#Vars
web_service='nginx'
config_path='/usr/local/letssl/'
le_path='/opt/letsencrypt'
exp_limit=20;
#Func
function check_ssl {
@mlapida
mlapida / EC2-Tag-Assets-Lambda.py
Last active January 17, 2024 08:10
A lambda function that will copy EC2 tags to all related Volumes and Network Interfaces. A full writeup can be found on my site https://empty.coffee/tagging-and-snapshotting-with-lambda/ - Thank you to the community for keeping this updated!
from __future__ import print_function
import json
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
/*
* This file was autogenerated by puppet. Do not edit manually!
*
* snowflake Varnish Configuration for APT Cache
*/
/*
* Backend Servers (APT Repositories)
*/
@s-fujimoto
s-fujimoto / cloudfront-logstash.conf
Created April 27, 2016 11:02
Logstash configuration file for throwing CloudFront logs to Amazon ES
input {
s3 {
bucket => "<CLOUDFRONT_LOG_BUCKET>"
prefix => "<CLOUDFRONT_LOG_KEY_PREFIX>"
region => "<BUCKET_REGION_NAME>"
}
}
filter {
@rmoff
rmoff / gist:0b7866b7e17059920a9ab1a80ea18eb4
Created January 18, 2017 19:49
Metricbeat / Timelion / Kibana anomaly detection expression
$thres=0.02, .es(index='metricbeat*',metric='max:system.cpu.user.pct').lines(1).if(eq, 0, null).holt(0.9, 0.1, 0.9, 0.5h).color(#eee).lines(10).label('Prediction'), .es(index='metricbeat*',metric='max:system.cpu.user.pct').color(#666).lines(1).label(Actual), .es(index='metricbeat*',metric='max:system.cpu.user.pct').lines(1).if(eq, 0, null).holt(0.9, 0.1, 0.9, 0.5h).subtract(.es(index='metricbeat*',metric='max:system.cpu.user.pct')).abs().if(lt, $thres, null, .es(index='metricbeat*',metric='max:system.cpu.user.pct')).points(10,3,0).color(#c66).label('Anomaly').title('max:system.cpu.user.pct / @rmoff')
1. Create the KV config:
docker run traefik \
storeconfig \
--consul \
--consul.prefix="traefik" \
--consul.watch \
--consul.endpoint="CONSUL_IP:8500" \
--consulcatalog=true \
--consulcatalog.endpoint="CONSUL_IP:8500" \

kops cluster config

kubeAPIServer:
  authorizationMode: RBAC
  authorizationRbacSuperUser: admin
  oidcCAFile: /srv/kubernetes/ca.crt
  oidcClientID: example
  oidcGroupsClaim: groups
  oidcIssuerURL: https://dex.example.com
  oidcUsernameClaim: email
@Neo23x0
Neo23x0 / wannacry-vaccine.reg
Last active March 15, 2021 19:49
WannaCrypt Ransomware Immunisation
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskdl.exe]
"Debugger"="taskkill /F /IM "
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskse.exe]
"Debugger"="taskkill /F /IM "
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\wannacry.exe]
"Debugger"="taskkill /F /IM "
@tallclair
tallclair / restricted-psp.yaml
Last active April 16, 2024 07:46
Restricted PodSecurityPolicy
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: restricted
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
spec: