Skip to content

Instantly share code, notes, and snippets.

View hexfusion's full-sized avatar
🐀
scampering

Sam Batschelet hexfusion

🐀
scampering
  • Red Hat
  • gRPC stream
View GitHub Profile
@hexfusion
hexfusion / gist:8170886
Last active January 1, 2016 16:29
Installing git perl modules in camps
1.) Install module only using git into base directory dev-modules
2.) for each module symlink lib $ cp -as --remove-destination "$PWD/dev-modules/interchange6-schema/lib/"* local/lib/perl5/
3.) for each module symlink bin $ cp -as --remove-destination "$PWD/dev-modules/interchange6-schema/bin/"* local/bin/
4.) for each module install deps only $ cpanm --installdeps --force -L /home/sam/repos/local Interchange6::Schema
cpanfile.dev proposed format
requires 'Interchange6' => 'git@github.com:interchange/Interchange6.git', '0.010';
requires 'Interchange6::Schema' => 'git@github.com:interchange/interchange6-schema.git'
requires 'Dancer::Sessions::DBIC' => 'git@github.com:interchange/Dancer-Session-DBIC.git'
# podman hammer
ps aux | grep podman | grep -v grep | awk '{print $2}' | xargs -r sudo kill -9
# zombie killer
kill -9 $(ps -A -ostat,ppid | awk '/[zZ]/ && !a[$2]++ {print $2}')
# benchmark with perf
go test -benchmem -run=^$ -bench ^BenchmarkGetValidatorSet$ github.com/ava-labs/avalanchego/snow/validators/gvalidators -memprofile benchvset.mem -cpuprofile benchvset.cpu
go test -run=X -bench=. -count=10 -benchmem | tee /tmp/zeropool.bench && benchstat -col .name /tmp/zeropool.bench
package Interchange6::Schema::Populate::UPSZone;;
use strict;
use warnings;
use Moo;
use Business::UPS;
=head Description
@SysPete
SysPete / gist:b8c3c0e13d02b307de06
Last active August 29, 2015 14:06
overloading Interchange6 schema result classes
use utf8;
package Interchange6::Schema;
use strict;
use warnings;
use base 'DBIx::Class::Schema';
use Interchange6::Schema::Result::Order;
use Interchange6::Schema::Result::Product;
@dennisschaaf
dennisschaaf / A tool for Renaming fonts to solve Multiple font-face rules issue with wkhtmltopdf.md
Last active August 17, 2021 22:42
Renaming fonts to solve Multiple @font-face rules issue with wkhtmltopdf

The Problem

wkhtmltopdf is broken and cannot render multiple fonts because of some issues around names. See wkhtmltopdf/wkhtmltopdf#2435

Workaround

  1. Pick an 8 or less char name for each font and variation e.g. HelvBold, HelvLite, TimeReg
  2. Every variation needs to be a separate font file, with all the details renamed in Font Forge using the short name determined before.
  3. Give the font files the same short name (e.g. HelvBold.ttf)
@hexfusion
hexfusion / add_user.sh
Created May 4, 2018 12:50
etcd v3 gRPC gateway authentication and add new user example in bash.
#!/bin/bash
newuser=$1
read -s -p "Enter password for $newuser" newpass
user=root
pass=toor
host=127.0.0.1
port=2379
# routes
oc get routes --all-namespaces
# get the image shas from a release
oc adm release info quay.io/openshift-release-dev/ocp-release:4.14.10-x86_64 --pullspecs | awk '{print " - " $2}'
# use butane for machine configs
https://docs.openshift.com/container-platform/4.8/installing/install_config/installing-customizing.html
# p&f issues
admin-kubeconfig-ca-bundle.crt kube-apiserver-localhost-signer.crt
aggregator-ca-bundle.crt kube-apiserver-localhost-signer.key
aggregator-ca.crt kube-apiserver-service-network-ca-bundle.crt
aggregator-ca.key kube-apiserver-service-network-server.crt
aggregator-signer.crt kube-apiserver-service-network-server.key
aggregator-signer.key kube-apiserver-service-network-signer.crt
apiserver.crt kube-apiserver-service-network-signer.key
apiserver.key kube-apiserver-to-kubelet-ca-bundle.crt
apiserver-proxy.crt kube-apiserver-to-kubelet-client.crt
apiserver-proxy.key kube-apiserver-to-kubelet-client.key
[ storage ]
* https://haydenjames.io/linux-server-performance-disk-io-slowing-application/
[ fsync ]
* Usually you need 99% < 10ms, 99.9% < 100ms (99.999% < 1s).
# sniff hypervisor
dmesg | grep Hypervisor
[ 0.000000] Hypervisor detected: KVM
# get key in bytes
etcdctl get $key -w fields | grep -oP "(?<=Value\" : \").*" | wc -c
# defrag status in MB
cat etcd_info/endpoint_status.json | jq '(.[0].Status.dbSize - .[0].Status.dbSizeInUse)/1000/1000'