Skip to content

Instantly share code, notes, and snippets.

View developer-guy's full-sized avatar
🐾
Every artifact can be verifiably traced to Source Code and Hardware

Batuhan Apaydın developer-guy

🐾
Every artifact can be verifiably traced to Source Code and Hardware
View GitHub Profile
@developer-guy
developer-guy / brew-list.sh
Created October 5, 2020 06:30 — forked from eguven/brew-list.sh
List all packages installed using Homebrew and their sizes
brew list | xargs -n1 -P8 -I {} \
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \
sort -h -r -k2 - | column -t
@developer-guy
developer-guy / .gitlab-ci.yml
Created October 6, 2020 12:10 — forked from alediaferia/.gitlab-ci.yml
GitLab CI example snippet for building and releasing images to Heroku
stages:
- build
- release
build_image:
only:
- master
image: registry.gitlab.com/majorhayden/container-buildah
stage: build
variables:
@developer-guy
developer-guy / docker-for-mac.md
Created October 8, 2020 07:31 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker for Mac Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Moby VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@developer-guy
developer-guy / kustomize-deploy.sh
Created October 13, 2020 07:55 — forked from colinjfw/kustomize-deploy.sh
Kubernetes deployment strategy using Kustomize and a few basic tools. Replaces helm charts with simple tooling solutions.
# Kustomize based apply workflow. Requires jq, yq, kubectl, kustomize, mustache.
#
# Expected variables
# - namespace Namespace for all resources.
# - release A unique name to give to this collection of manifests.
# - revision Release revision.
# - images Image replacements.
# - variables Variable replacements.
#
# Example inputs:
@developer-guy
developer-guy / Dockerfile
Created October 14, 2020 12:47 — forked from alkrauss48/Dockerfile
Running a docker container as a non-root user
# By default, Docker containers run as the root user. This is bad because:
# 1) You're more likely to modify up settings that you shouldn't be
# 2) If an attacker gets access to your container - well, that's bad if they're root.
# Here's how you can run change a Docker container to run as a non-root user
## CREATE APP USER ##
# Create the home directory for the new app user.
RUN mkdir -p /home/app
@developer-guy
developer-guy / pair-program-tmux.md
Created October 15, 2020 10:09 — forked from shrayasr/pair-program-tmux.md
Pair programming with Tmux

Pair programming with Tmux

Using the same user

User 1

  1. SSH into the box

     user1@user1-machine$ ssh user@host
    
@developer-guy
developer-guy / README.md
Created October 21, 2020 09:59 — forked from aojea/README.md
upgrade kind kubernetes cluster
@developer-guy
developer-guy / KIND_Networking.md
Created October 21, 2020 10:00 — forked from aojea/KIND_Networking.md
Use KIND to emulate complex network scenarios

Networking scenarios [Linux Only]

KIND runs Kubernetes cluster in Docker, and leverages Docker networking for all the network features: port mapping, IPv6, containers connectivity, etc.

Docker Networking

KIND uses a docker user defined network.

It creates a bridge named kind

package main
import (
"bytes"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"os"
ctrl "sigs.k8s.io/controller-runtime"
)
package main
import (
"bytes"
cryptorand "crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"