Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jwhonce's full-sized avatar
🏠
Working from home

Jhon Honce jwhonce

🏠
Working from home
View GitHub Profile
@jwhonce
jwhonce / pprof.go
Created March 22, 2023 16:05
Podman API pprof endpoint
// setupPprof enables pprof default endpoints
// Note: These endpoints and the podman flag --cpu-profile are mutually exclusive
//
// Examples:
// #1 go tool pprof -http localhost:8889 localhost:8888/debug/pprof/heap?seconds=120
// Note: web page will only render after a sample has been recorded
// #2 curl http://localhost:8888/debug/pprof/heap > heap.pprof && go tool pprof heap.pprof
func (s *APIServer) setupPprof() {
if s.PProfAddr == "" {
return
@jwhonce
jwhonce / pods.go
Created April 28, 2022 20:25
Using json.RawMessage
// Remove deletes a Pod from local storage. The optional force parameter denotes
// that the Pod can be removed even if in a running state.
func Remove(ctx context.Context, nameOrID string, options *RemoveOptions) (*entities.PodRmReport, error) {
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
var params url.Values
if options != nil {
@jwhonce
jwhonce / image_delete.sh
Created May 20, 2016 17:05
Example script for how to delete image from docker repositry 2.4
#!/bin/bash -ex
name='kubernetes/pause'
docker stop registry && docker rm -v registry ||:
rm -rf /var/registry/* ||:
ENV='-e REGISTRY_STORAGE_DELETE_ENABLED=true -e REGISTRY_LOG_LEVEL=debug'
docker run -d -p 5000:5000 --restart=always $ENV --volume /var/registry:/var/lib/registry --name registry registry:2.4
docker pull $name
@jwhonce
jwhonce / announce.py
Created September 30, 2015 19:37
Send NOTICE message to IRC server
#!/usr/bin/python
import socket
import sys
from datetime import datetime
try:
import json
except:
import simplejson as json
@jwhonce
jwhonce / README.writing_cartridges.md
Created November 19, 2012 23:41
New Cartridge Documenation

How To Write An OpenShift Origin Cartridge 2.0

OpenShift cartridges provide the necessary command and control for the functionality of software that is running user's applications. OpenShift currently has many language cartridges JBoss, PHP, Ruby (Rails) etc. as well as many DB cartridges such as Postgres, Mysql, Mongo etc. Before writing your own cartridge you should search the current list of Red Hat and OpenShift Community provided cartriges.