Skip to content

Instantly share code, notes, and snippets.

@mrsimonemms
mrsimonemms / cert.sh
Created April 12, 2017 10:11 — forked from leanderjanssen/cert.sh
Create Docker certificates
#!/bin/bash
# Retrieve public and private ip of instance
PUBLIC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
PRIVATE_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
mkdir ~/docker-ca
chmod 0700 ~/docker-ca
cd ~/docker-ca || exit 1
@ageis
ageis / systemd_service_hardening.md
Last active April 27, 2024 09:46
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@kjbrum
kjbrum / bash_profile.sh
Last active October 18, 2023 15:36
My personal bash profile
#---------------------------------------------------------------------------------------------------------------------------------------
#
# Author: Kyle Brumm
# Description: File used to hold Bash configuration, aliases, functions, completions, etc...
#
# Sections:
# 1. ENVIRONMENT SETUP
# 2. MAKE TERMINAL BETTER
# 3. FOLDER MANAGEMENT
# 4. MISC ALIAS'
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@Iristyle
Iristyle / Start-Vagrant.bat
Created March 15, 2013 18:35
Windows startup script to fire up a Vagrant VM safely on boot (using Run registry key for instance)
ECHO OFF
cd /d %~dp0
for /f "tokens=2* delims= " %%F IN ('vagrant status ^| find /I "default"') DO (SET "STATE=%%F%%G")
ECHO Close this window if it remains open, and http://localhost:8081 is responsive
IF "%STATE%" NEQ "saved" (
ECHO Starting Vagrant VM from powered down state...
vagrant up
) ELSE (