Skip to content

Instantly share code, notes, and snippets.

@mgoodness
mgoodness / helm-rbac.md
Last active October 30, 2021 17:04
Helm RBAC setup for K8s v1.6+ (tested on minikube)
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
@Malet
Malet / to_utf8.rb
Last active December 31, 2015 05:49
Prevent invalid UTF-8 byte sequences for Ruby 2.0 / 2.1 (1.9 untested)
class String
REPLACE_INVALID_WITH = '�'
def to_utf8
self.encode('utf-8', invalid: :replace, undef: :replace, replace: REPLACE_INVALID_WITH).
chars.map{ |i| i.valid_encoding? ? i : REPLACE_INVALID_WITH }.join
end
end