Skip to content

Instantly share code, notes, and snippets.

Avatar
😃
Coding hard

Alex Berber junoteam

😃
Coding hard
View GitHub Profile
@junoteam
junoteam / terraform-ssh-remote-exec.tf
Created Apr 28, 2021 — forked from toshimaru/terraform-ssh-remote-exec.tf
How to connect to server via SSH and use remote-exec provisioner.
View terraform-ssh-remote-exec.tf
resource "digitalocean_droplet" "web" {
image = "ubuntu-16-04-x64"
name = "web-1"
region = "sgp1"
size = "512mb"
ssh_keys = [12345]
connection {
type = "ssh"
user = "root"
@junoteam
junoteam / web-app-ingress.yml
Last active Apr 13, 2020
web-app-ingress.yml
View web-app-ingress.yml
# webapp-ingress
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: webapp
annotations:
kubernetes.io/ingress.class: nginx
# # type of authentication
# nginx.ingress.kubernetes.io/auth-type: basic
# # name of the secret that contains the user/password definitions
View jenkins-ingress.yml
# jenkins-ingress
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: jenkins
annotations:
kubernetes.io/ingress.class: nginx
# type of authentication
nginx.ingress.kubernetes.io/auth-type: basic
# name of the secret that contains the user/password definitions
@junoteam
junoteam / jenkins-deployment.yml
Last active Apr 13, 2020
jenkins-deployment.yml
View jenkins-deployment.yml
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Service
metadata:
name: jenkins
labels:
app: jenkins
spec:
@junoteam
junoteam / simpleWebApp.yml
Created Mar 27, 2020
Kubernetes deployment file for Go application
View simpleWebApp.yml
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Service # K8s Service
metadata:
name: simple-web-app-svc
labels:
app: simple-web-app
spec:
@junoteam
junoteam / README.md
Created Feb 9, 2020 — forked from tomazzaman/README.md
Kill supervisor on Docker when any of the services fail
View README.md

Killing supervisor if any of it's child processes fail

The trick is to only register the listener for events that indicate failure, namely

  • PROCESS_STATE_STOPPED
  • PROCESS_STATE_EXITED
  • PROCESS_STATE_FATAL

Once they do, we should send a SIGQUIT to Supervisor.

@junoteam
junoteam / diskinfo.go
Created Jan 9, 2019 — forked from lunny/diskinfo.go
Disk Info for Golang
View diskinfo.go
package main
import (
"fmt"
"syscall"
)
type DiskStatus struct {
All uint64 `json:"all"`
Used uint64 `json:"used"`
@junoteam
junoteam / README.md
Created Jan 8, 2019 — forked from rantav/README.md
Find slow queries in mongo DB
View README.md

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@junoteam
junoteam / README.md
Created Jul 6, 2017 — forked from mariotacke/README.md
Default nginx log format (combined) and grok pattern
View README.md
@junoteam
junoteam / nginx.conf
Created May 23, 2017 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048