Skip to content

Instantly share code, notes, and snippets.

View visibilityspots's full-sized avatar

Jan Collijs visibilityspots

View GitHub Profile
@mortensteenrasmussen
mortensteenrasmussen / cleanupManifestsWithoutTags.sh
Last active February 4, 2025 14:39
Clean up untagged manifests in private docker registry
#!/bin/bash
REGISTRY_DIR=YOUR_REGISTRY_DIR/data/docker/registry/v2/repositories
REGISTRY_URL=http://10.10.10.10:5000
#add --insecure to the curl command on line 17 if you use https with self-signed certificates
cd ${REGISTRY_DIR}
count=0
manifests_without_tags=$(comm -23 <(find . -type f -name "link" | grep "_manifests/revisions/sha256" | grep -v "\/signatures\/sha256\/" | awk -F/ '{print $(NF-1)}' | sort) <(for f in $(find . -type f -name "link" | grep "_manifests/tags/.*/current/link"); do cat ${f} | sed 's/^sha256://g'; echo; done | sort))
#!/bin/bash
( echo 'VM|Status|IP|Memory|OS';
for node in `lxc-ls -1`; do
tmpfile=`mktemp -t lxc-info-$node-XXXXXXX`;
lxc-info -n $node | sed 's@[ ]*:[ ]*@:@' > $tmpfile
status=$( cat $tmpfile | grep 'State:' | awk -F: '{print $2}' );
ip=""; mem=""; os=""; osver="";
if [ "$status" == "RUNNING" ]; then
@jedi4ever
jedi4ever / dns tuning ssh login speedup vagrant
Created May 27, 2013 13:37
speeding up DNS/SSH connections in vagrant
- Tune /etc/ssh/sshd_config
UseDNS no # Disable DNS lookups
GSSAPIAuthentication no # Disable negotation of slow GSSAPI
don't forget to restart it, use a script provider to set it , or create it with veewee or snapshot it
- Tune Vagrantfile
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]