Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
This is so useless 🐿

Eran Chetz eranchetz

🤠
This is so useless 🐿
View GitHub Profile
@eranchetz
eranchetz / gcp-startup-script
Created Apr 21, 2021
Debian startup script
View gcp-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
View config.xml
<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 →
View deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: echoserver
spec:
replicas: 1
template:
metadata:
labels:
app: echoserver
View mouse.go
package main
import (
"github.com/go-vgo/robotgo"
"time"
)
func main() {
time.Sleep(3 * time.Second)
@eranchetz
eranchetz / clusterrolebinding.yaml
Last active Nov 20, 2018
Cluster role binding that allows to get/list/watch pods in any namespace.
View clusterrolebinding.yaml
# 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
View gist:8da503bd5d61bd8e4f1f22e76fb6ae3e

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)
View keybase.md

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 Mar 29, 2017
Example Chef recipe to install Consul Template
View config.ctmpl
{{
# /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 Aug 26, 2015
init.d/logstash on amazon linux in ec2
View logstash
# 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
View gist:e92c8f3042ea5d0705f7
### 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 C4FE B471 D4ED 322A 637E 81B2 1D34 7381 8715 79D0
To claim this, I am signing this object: