Skip to content

Instantly share code, notes, and snippets.

View trapier's full-sized avatar

Trapier Marshall trapier

  • Raleigh, NC USA
View GitHub Profile
@rleap-m
rleap-m / Trace-NetTrafficToContainer.ps1
Last active January 15, 2021 17:39
Captures a network trace (and event logs) from host (node) to container
<#
.SYNOPSIS
Utility captures information while attempting to run test container
.PARAMETER ContainerName
Name of the container to create
.PARAMETER ContainerName
Name of the container image to run
.PARAMETER WaitForContainerStartSec
Number of seconds script should wait for container to start before capturing results
@michalbednarski
michalbednarski / nscd.py
Created March 14, 2020 10:04
/var/run/nscd/socket server in Python, https://github.com/termux/proot/issues/101
#!/data/data/com.termux/files/usr/bin/python3
import ipaddress
import os
import socket
import socketserver
import struct
# version, type, key_len
request_header = struct.Struct("<III")
@jsturtevant
jsturtevant / get-windows-k8s-logs.ps1
Created January 9, 2019 00:27
Collects windows K8s containers logs on a machine and zips them up
$lockedFiles = "kubelet.err.log", "kubelet.log", "kubeproxy.log", "kubeproxy.err.log", "containerd.err.log", "containerd.log"
$netDebugFiles = "network.txt", "endpoint.txt", "policy.txt", "ip.txt", "ports.txt", "routes.txt", "vfpOutput.txt"
$timeStamp = get-date -format 'yyyyMMdd-hhmmss'
$zipName = "$env:computername-$($timeStamp)_logs.zip"
$paths = get-childitem c:\k\*.log -Exclude $lockedFiles
$paths += $lockedFiles | Foreach-Object { Copy-Item "c:\k\$_" . -Passthru }
$scm = Get-WinEvent -FilterHashtable @{logname='System';ProviderName='Service Control Manager'} | Where-Object { $_.Message -Like "*docker*" -or $_.Message -Like "*kub*" } | Select-Object -Property TimeCreated, Id, LevelDisplayName, Message
@TylerLeonhardt
TylerLeonhardt / Init.vim
Created May 24, 2018 16:32
NeoVim PowerShell setup
call plug#begin('~/.local/share/nvim/plugged')
" Handles the fzf popups
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" The LSP client
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
@adamancini
adamancini / readme.md
Last active May 9, 2018 23:39
restore DTR images from registry volume backup
  • log in to DTR from local client
docker login <dtr-url>
  • (optional) create a volume to hold our old images
docker volume create registry
cp -r /path/to/registry/backup/_data /var/lib/docker/volumes/registry/.
@hgross
hgross / gist:26042d052f58feeb6d1b329e8dd2dfcc
Created February 19, 2018 17:42
Change docker_gwbridge subnet address
## Do this on each swarm-node
# store containers attached to the bridge
$ gwbridge_users=$(docker network inspect --format '{{range $key, $val := .Containers}} {{$key}}{{end}}' docker_gwbridge | \
$ xargs -d' ' -I {} -n1 docker ps --format {{.Names}} -f id={})
# stop all containers
# if you have stacks that restart automatically, remove them via docker stack <stackName> rm
$ echo "$gwbridge_users" | xargs docker stop
$ docker network rm docker_gwbridge
$ docker network disconnect -f docker_gwbridge gateway_ingress-sbox
@andyrbell
andyrbell / scanner.sh
Last active April 5, 2024 09:01
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@wsong
wsong / taskdelete.go
Last active October 4, 2017 21:51
Task cleaner for Swarmkit
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/docker/swarmkit/api"
"github.com/docker/swarmkit/ca"
@thebsdbox
thebsdbox / Inline_Upgrade.md
Last active June 19, 2018 05:26
Docker EE Inline upgrade procedure

Docker EE Inline upgrade procedure

This is a guide that details the steps to have in place a duplicate environment to upgrade to, and requires an existing UCP/DTR cluster.

Prerequisites

Ensure that new nodes are all confiured with identical firewall rules and that all of the relevant swarm joins are performed.

  • Create a backup from existing UCP Cluster (UCP Will stop during the backup)

Ensure you use the correct tag to see what is running, check in docker images

@manasthakur
manasthakur / submodules.md
Last active November 15, 2023 17:58
Using git submodules to version-control Vim plugins

Using git-submodules to version-control Vim plugins

If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need. Thus, you should keep the .vim directory along with your .vimrc version-controlled.

But when you have plugins installed inside .vim/bundle (if you use pathogen), or inside .vim/pack (if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.

Creating the repository

Initialize a git repository inside your .vim directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:

cd ~/.vim