Skip to content

Instantly share code, notes, and snippets.

View ezodude's full-sized avatar
🦙
Llamas

Ezo Saleh ezodude

🦙
Llamas
View GitHub Profile
@huksley
huksley / mrsk.md
Last active January 12, 2024 17:24
mrsk - the missing manual

MRSK

This documentation adds important additions to the docs for mrsk deploy tool (see github.com/mrsked/mrsk)

Destination flag

You can use mrsk deploy --destination staging

This will read config/deploy.yml and config/deploy.staging.yml files, and also will read .env.staging file if it exists.

@ezodude
ezodude / trace.go
Created November 27, 2020 13:39
Trace Caller - great for debugging Golang code.
func trace(){
pc := make([]uintptr, 10) // at least 1 entry needed
runtime.Callers(2, pc)
f := runtime.FuncForPC(pc[0])
file, line := f.FileLine(pc[0])
fmt.Printf("%s:%d %s\n", file, line, f.Name())
}
@bodhi
bodhi / Dockerfile
Created May 22, 2019 00:18
Burn git commit SHA into docker image
FROM golang:1.12 AS build
COPY ./main.go .
# ARG here is to make the sha available for use in -ldflags
ARG GIT_SHA
# -ldflags "-X main.sha=${GIT_SHA}" allows main.sha to be set at build time
RUN go build -ldflags "-X main.sha=${GIT_SHA}" -o /app
FROM scratch
@yinzara
yinzara / github_bitbucket_multiple_ssh_keys.md
Last active May 2, 2024 23:08
Managing SSH keys and repo cloning using multiple accounts on GitHub and BitBucket

Why Multiple SSH keys?

There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket

You may use the same computer for work and personal development and need to separate your work.

When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.

You may have different projects you're working on where you would like to segregate your access.

@ZenGround0
ZenGround0 / client.go
Last active August 8, 2023 04:55
golang http auto-streaming with transfer-encoding: chunked
package main
import (
"net/http"
"net/url"
"os"
"fmt"
)
@brandoncc
brandoncc / config.yml
Last active October 26, 2018 17:47
nanobox circleci config
version: 2
jobs:
test-job:
machine: true
steps:
- checkout
- run: sudo bash -c "$(curl -fsSL https://s3.amazonaws.com/tools.nanobox.io/bootstrap/ci.sh)"
- run: nanobox evar add local CLOUDINARY_API_KEY=$CLOUDINARY_API_KEY
import (
"database/sql"
"github.com/lib/pq"
)
dbb, _ := sql.Open("postgres", "postgres://Amogh:amogh@localhost:6431/dblog?sslmode=disable")
dbb.SetMaxIdleConns(10)
dbb.SetMaxOpenConns(10)
dbb.SetConnMaxLifetime(0)
a := time.Now()
txn, err := dbb.Begin()
@cschiewek
cschiewek / x11_docker_mac.md
Last active May 15, 2024 08:26
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@bvis
bvis / README.md
Last active April 12, 2024 04:21
Docker Env Vars expanded with secrets content

Variables by Secrets

Sample script that allows you to define as environment variables the name of the docker secret that contains the secret value. It will be in charge of analyze all the environment variables searching for the placeholder to substitute the variable value by the secret.

Usage

You can define the next environment variables:

@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active May 5, 2024 10:12
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites