Skip to content

Instantly share code, notes, and snippets.

View jangaraj's full-sized avatar
💭
Devopsing, Dockerising, Grafanasing, Keycloaking, Clouding, Lambdasing,...

Jan Garaj jangaraj

💭
Devopsing, Dockerising, Grafanasing, Keycloaking, Clouding, Lambdasing,...
View GitHub Profile
#!/usr/bin/python
# www.jangaraj.com
# Creating of submodules for https://github.com/zabbix/zabbix-community-repos
import os
import commands
# format of file
# https://github.com/jangaraj/Zabbix-Template-App-Zenoss Template App Zenoss (jangaraj)
with open('repos.txt') as f:
@jangaraj
jangaraj / errcron.sh
Last active January 29, 2019 10:02
Basic cron wrapper
#!/bin/bash
# Reporting nonzero RC executions to syslog
# * * * * * root /usr/local/bin/errcron.sh <command>
# Installation: wget -O /usr/local/bin/errcron.sh https://gist.githubusercontent.com/jangaraj/c4c9262fe04156a40b02/raw/580ab988f9ff28c01cc9ee729ac9f0fe175b3a80/errcron.sh
OUT=$("$@" 2>&1)
RESULT=$?
if [ $RESULT -ne 0 ]
then
@jangaraj
jangaraj / gist:64b88b6eed7f8d0221e6
Created April 22, 2015 13:40
Zenoss 4 - Chrome zooming issue
# dirty, not tested hack http://www.zenoss.org/forum/8806
# it will solve issue with Chrome, but question is what is broken after this hack?
sed -i -e "s# request.setHeader('Content-type', mimetype)# if mimetype == 'image/png':\n mimetype = 'application/javascript'\n request.setHeader('Content-type', mimetype)#g" /opt/zenoss/Products/ZenRRD/zenrender.py
# or edit /opt/zenoss/Products/ZenRRD/zenrender.py
original:
request.setHeader('Content-type', mimetype)
edited:
if mimetype == 'image/png':
mimetype = 'application/javascript'
kubectl config set-cluster default-cluster --server=https://master_ip --certificate-authority=ssl/ca.pem
kubectl config set-credentials default-admin --certificate-authority=ssl/ca.pem --client-key=ssl/admin-key.pem --client-certificate=ssl/admin.pem
kubectl config set-context default-system --cluster=default-cluster --user=default-admin
kubectl config use-context default-system
# obviously you need the CA used to bootstrap your cluster and all the certificates
include kubernetes
include kubernetes::master
include kubernetes::node
include kubernetes::node::kubelet
include kubernetes::node::kube_proxy
class { 'kubernetes::master::apiserver':
service_cluster_ip_range => '10.0.0.0/24',
admission_control => [
'NamespaceLifecycle',
'NamespaceExists',
@jangaraj
jangaraj / k8s
Last active December 16, 2015 18:16
mkdir /root/.ssh/
wget https://github.com/jangaraj.keys -O /root/.ssh/authorized_keys
apt-get update
apt-get install -y --force-yes gcc golang-go curl git wget make apt-transport-https python bridge-utils
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y --force-yes docker-engine
docker pull golang:1.4
@jangaraj
jangaraj / docker.txt
Last active January 29, 2016 10:08
docker
curl -k -s -X GET https://gcr.io/v2/google_containers/kube-apiserver/tags/list | jq -r '.tags[]'
https://github.com/coreos/coreos-kubernetes/blob/meghanschofield-patch-1/multi-node/generic/controller-install.sh
https://github.com/kubernetes/kubernetes/issues/19738
autocmd BufWritePre *.pp :s/\s\+$//e
set tabstop=2 shiftwidth=2
set autoindent
set expandtab
set ruler
filetype plugin on
autocmd FileType python set tabstop=4 shiftwidth=4
@jangaraj
jangaraj / metais.py
Last active March 4, 2017 17:08
metais.py
#!/usr/bin/env python
import json, requests
debug = 0
'''
Examples:
# time ./metais.py > /tmp/metais.stats
real 16m57.925s
user 6m4.204s
BITS 32
org 0x05000000
db 0x7F, "ELF"
dd 1
dd 0
dd $$
dw 2
dw 3
dd 0x0500001B