Skip to content

Instantly share code, notes, and snippets.

View eranchetz's full-sized avatar
🔧

Eran Chetz eranchetz

🔧
View GitHub Profile
@eranchetz
eranchetz / gcp-security-monitoring.md
Created October 20, 2021 16:30 — forked from mikesparr/gcp-security-monitoring.md
Google Cloud Platform CIS Benchmark Configs For Log Monitoring
@eranchetz
eranchetz / gcp-startup-script
Created April 21, 2021 15:30
Debian startup script
# Install Docker ninja style
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# Install docker compose
curl -L "https://github.com/docker/compose/releases/download/1.29.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# Install git
apt udpate
@eranchetz
eranchetz / config.xml
Created March 16, 2020 10:10
FAHConfig
<config>
<! — Client Control →
<fold-anon v=’true’/>
<! — Folding Slot Configuration →
<gpu v=’true’/>
<! — Slot Control →
<power v=’full’/>
<! — User Information →
<user v=’eranchetz’/>
<! — Folding Slots →
@eranchetz
eranchetz / deployment.yaml
Last active January 31, 2019 16:31
k8s Echoserver
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: echoserver
spec:
replicas: 1
template:
metadata:
labels:
app: echoserver
@eranchetz
eranchetz / mouse.go
Created November 21, 2018 11:28
Super Clicker
package main
import (
"github.com/go-vgo/robotgo"
"time"
)
func main() {
time.Sleep(3 * time.Second)
@eranchetz
eranchetz / clusterrolebinding.yaml
Last active November 20, 2018 16:25
Cluster role binding that allows to get/list/watch pods in any namespace.
# Based on this documentation : https://kubernetes.io/docs/reference/access-authn-authz/rbac/
# Create a Service Account
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: my-service-account
# Create a role that allows API calls for get/list/watch on pods
@eranchetz
eranchetz / gist:8da503bd5d61bd8e4f1f22e76fb6ae3e
Created August 22, 2017 12:52 — forked from tonyc/gist:1384523
Using strace and lsof

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)

Keybase proof

I hereby claim:

  • I am eranchetz on github.
  • I am eranchetz (https://keybase.io/eranchetz) on keybase.
  • I have a public key whose fingerprint is 8ABD 7604 887E D7AD 5839 8B66 724C E217 5F8E 1E1F

To claim this, I am signing this object:

@eranchetz
eranchetz / config.ctmpl
Created March 29, 2017 09:22
Example Chef recipe to install Consul Template
{{
# /opt/my-app/consul.ctmpl
#
# This file is read by Consul Template and rendered onto disk using
# the configuration placed in /etc/consul-template.d.
}}
{{ with vault "postgresql/creds/readonly" }}
[config]
username = "{{ .Data.username }}"
@eranchetz
eranchetz / logstash
Created August 26, 2015 12:50
init.d/logstash on amazon linux in ec2
# description: logstash
# Source function library.
. /etc/init.d/functions
RETVAL=0
prog="logstash"
PIDFILE=/var/run/$prog.pid
LOCKFILE=/var/lock/subsys/$prog
PATH=/sbin:/usr/sbin:/bin:/usr/bin