Skip to content

Instantly share code, notes, and snippets.

@ppetko
ppetko / oc command lines
Created November 17, 2021 13:58 — forked from sudhirpandey/oc command lines
openshift command line with Go templating and others
#expose console from 443
oc create route reencrypt master --service kubernetes --port 443 -n default
#nested loops , tags count in IS
oc get is --template='{{range $i, $is:=.items}}{{ $total :=0 }}{{ range $index, $element :=$is.status.tags }}{{if eq $element.tag "latest"}}{{$is.metadata.name}}{{"\t"}}{{ $index }}{{end}}{{end}}{{"\n"}}{{end}}'
get complex labels
oc get nodes --template='{{ with $i := index .items 0 }}{{ index $i.metadata.labels "failure-domain.beta.kubernetes.io/region" }}{{ end }}'
#patchin resource limits
@ppetko
ppetko / Makefile
Created February 28, 2019 15:16 — forked from aprxi/Makefile
Makefile_docker_20190214
# --------------------------------------------------------------------
# Copyright (c) 2019 LINKIT, The Netherlands. All Rights Reserved.
# Author(s): Anthony Potappel
#
# This software may be modified and distributed under the terms of the
# MIT license. See the LICENSE file for details.
# --------------------------------------------------------------------
# If you see pwd_unknown showing up, this is why. Re-calibrate your system.
PWD ?= pwd_unknown
@ppetko
ppetko / main.go
Created August 24, 2017 16:16 — forked from mschoebel/main.go
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling