Skip to content

Instantly share code, notes, and snippets.

View michaellihs's full-sized avatar

Michael Lihs michaellihs

View GitHub Profile
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active May 6, 2024 08:10
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@BretFisher
BretFisher / docker-swarm-ports.md
Last active April 4, 2024 22:19
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

# BREW with xcode
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
sudo xcodebuild
brew update
brew install caskroom/cask/brew-cask
# BROWSERS
brew cask install firefox google-chrome
# JAVA
@subfuzion
subfuzion / curl.md
Last active May 9, 2024 18:17
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@alces
alces / ansible_via_proxy_server.yml
Created December 25, 2015 08:40
Ansible playbook demonstrating easy_install, pip, and yum working via HTTP proxy
#!/usr/bin/env ansible-playbook
---
- name: test how easy_install, pip, and yum modules works via proxy
hosts: all
environment:
http_proxy: http://192.168.1.10:3128
https_proxy: http://192.168.1.10:3128
tasks:
- name: Install easy_install
yum:
@cyrille-leclerc
cyrille-leclerc / jenkins-cloudfoundry-cli-workflow.groovy
Last active January 24, 2017 17:25
Jenkins Workflow with Cloud Foundry CLI
node {
git 'https://github.com/CloudBees-community/spring-petclinic.git'
env.PATH = "${tool 'Maven 3.2.2'}/bin:${env.PATH}"
sh 'mvn package'
wrap([$class: 'CloudFoundryCliBuildWrapper',
apiEndpoint: 'https://api.hackney.cf-app.com',
skipSslValidation: true,
@tknerr
tknerr / README.md
Last active January 23, 2024 16:42
Vagrant with Ansible Provisioner on Windows

Vagrant with Ansible Provisioner on Windows

Long story short, ansible does not work on a Windows control machine, so you basically have to:

  • either run ansible --connection=local ... in the target vm
  • set up a separate control vm where ansible is installed via shell provisioner

Below are Vagrantfile examples for both approaches

Within the Target VM

@eeichinger
eeichinger / jenkins_list_git_tags_and_branches.groovy
Created March 25, 2014 13:35
Groovy script to list git tags and branches using jenkins' Dynamic Choices Parameter plugin
def gettags = ("git ls-remote -t -h ssh://jenkins@<mygitpath>/repo/some.git feature/*").execute()
return gettags.text.readLines()
.collect { it.split()[1].replaceAll('refs/heads/', '') }
.unique()
.findAll { it.startsWith('<some more pattern>') }
@soarez
soarez / ca.md
Last active May 3, 2024 00:04
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@kylemanna
kylemanna / connmanctl.md
Last active June 27, 2023 23:12
Connmanctl Cheat Sheet