Skip to content

Instantly share code, notes, and snippets.

View miminar's full-sized avatar

Michal Minář miminar

  • ETH Zürich
  • Switzerland
  • 18:19 (UTC +02:00)
View GitHub Profile
@miminar
miminar / cVimrc
Last active July 10, 2016 06:53
A config file for cVimrc google-chrome plugin
set localconfig
set autoupdategist
let configpath='~/.config/google-chrome/cVimrc'
let vimport=8001
let nextmatchpattern='((?!first)(next|older|more|>|→|›|»|forward|další|dále|následující|starší|více| )+)'
let prevmatchpattern='((?!last)(prev(ious)?|newer|back|«|less|<|←|‹|předchozí|novější|méně| )+)'
" default insert keybindings
@miminar
miminar / config.yml
Created October 7, 2016 16:34
Docker registry config to access swift storage
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
swift:
# Access object store container at http://qeos.centralci.eng.rdu2.redhat.com/
# Project -> Compute -> Access & Security -> Identity
@miminar
miminar / docker-and-registry.log
Last active October 13, 2016 08:32
Logs for origin issue #11337
sudo journalctl -u docker -e --since=-1h
...
Oct 13 09:38:55 f24-ose.vm docker[4241]: time="2016-10-13T09:38:55.958654078+02:00" level=info msg="{Action=push, Username=vagrant, LoginUID=1001, PID=17124}"
Oct 13 09:38:55 f24-ose.vm docker[4241]: time="2016-10-13T07:38:55.961106686Z" level=debug msg="authorizing request" go.version=go1.6.3 http.request.host=registry.f24-ose.vm http.request.id=a2511965-e841-45da-a2f6-a4c140f931d4 http.request.method=GET http.request.remoteaddr=192.168.100.80 http.request.uri="/v2/" http.
Oct 13 09:38:55 f24-ose.vm docker[4241]: time="2016-10-13T07:38:55.961300887Z" level=error msg="error authorizing context: authorization header required" go.version=go1.6.3 http.request.host=registry.f24-ose.vm http.request.id=a2511965-e841-45da-a2f6-a4c140f931d4 http.request.method=GET http.request.remoteaddr=192.168
Oct 13 09:38:55 f24-ose.vm docker[4241]: 172.17.0.1 - - [13/Oct/2016:07:38:55 +0000] "GET /v2/ HTTP/1.1" 401 87 "" "docker/1.10.3 go/go1.6.3 kernel/4.7.6-200.fc24.x86_64 os/linux a
@miminar
miminar / README.md
Last active February 27, 2017 20:56
Print image layout in the namespace

About

The script attempts to collect what images are used in current (or given namespace) and what objects reference them.

Requisities

jq utility needs to be installed on machine running this command

Usage

@miminar
miminar / ose-migrate-images.sh
Last active February 10, 2017 10:35
Reduce OpenShift's etcd size by removing manifests from etcd.
#!/bin/bash
set -iuo pipefail
IFS=$'\n\t'
readonly AUDITOR_ROLE='system:image-auditor'
readonly USAGE="Usage: $(basename ${BASH_SOURCE[0]}) [OPTIONS]
It fetches manifests of images from OpenShift integrated registry forcing it to
#!/bin/bash
function get_ip() {
for intf in enp0s8 eth1 eth0 enp0s3 net0; do
ip=`ip addr show $intf | sed -n 's,^\s\+inet\s\+\(\([0-9]\+\)\.[^/]\+\)/.*brd.*,\1,p'`
if [[ -n "$ip" ]]; then
echo "$ip"
return 0
fi
done
@miminar
miminar / prune-unreferenced-registry-blobs.sh
Last active May 18, 2017 13:19
A script to remove unreferenced blobs from registry storage
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
readonly AUDITOR_ROLE='system:image-auditor'
readonly DEFAULT_DAYS=3
readonly DEFAULT_STORAGE_PATH_ROOT="/registry"
readonly DEFAULT_CONFIG_PATH="/config.yml"
@miminar
miminar / add-scc-to-sa.sh
Created September 20, 2017 09:07
Add scc to nfs-provisioner
saname=`oc get -o jsonpath=$'{.metadata.namespace}:{.spec.serviceAccount}\n' pod nfs-provisioner`
oc adm policy add-scc-to-user scc-nfs-provisioner \
'system:serviceaccount:<serviceaccount_namespace>:<serviceaccount_name>'
@miminar
miminar / README.md
Last active September 29, 2017 11:46
Print image layout in OpenShift namespace

About

The script attempts to collect what images are used in current (or given namespace) and what objects reference them.

Requisities

jq utility needs to be installed on machine running this command

Usage

@miminar
miminar / INSTANCE_NAME_PREFIX
Last active October 18, 2017 05:51
Jenkins params for AWS cluster
dev-miminar-sap-vora-cluster