Skip to content

Instantly share code, notes, and snippets.

View osowski's full-sized avatar

Rick Osowski osowski

View GitHub Profile
#!/bin/bash
CLUSTER_HOST="mycluster.icp"
USER=admin
PW=admin
ID=id-mycluster-account
echo -e "Resetting Helm client env ..."
echo -e ""
sudo rm -rf ~/.helm
@fabiogomezdiaz
fabiogomezdiaz / install_cli.sh
Last active July 2, 2018 01:09
Install IBM Cloud CLI, Container Service plugin, Container Registry plugin, Kubernetes CLI, Helm CLI, jq, and yaml
#!/bin/bash
#set -x
# Checking if bx is installed
grn=$'\e[1;32m'
end=$'\e[0m'
BX_PATH=$(command -v bx)
if [[ $? -ne 0 ]]; then
@csantanapr
csantanapr / Dockerfile
Last active July 23, 2020 22:25
dind on Kubernetes
FROM docker:dind
RUN set -eux; \
apk add --no-cache \
git \
iptables \
jq \
bash \
vim \
curl \
@osowski
osowski / generate-ssl-certs-for-confluent-platform.sh
Last active June 3, 2021 18:02
Streamlined version of confluent-platform-security-tools script to generate SSL certificates from a pre-existing CA crt/key.
# Customized version of https://github.com/confluentinc/confluent-platform-security-tools
# Starting with confluentCA.pem & confluentCA.key provided by Administrator (which is created prior to Confluent Platform install)
DNAME="C=UK, ST=LON,L=LON,O=IBMTest,OU=Cloud,CN=confluent-platform-security"
# Create truststore from provided CA certificate
keytool -keystore kafka.cps1.truststore.jks -alias CARoot -import -file confluentCA.pem -noprompt -dname "${DNAME}" -keypass cps-password1 -storepass cps-password1
# Create client keystore containing a key pair and a self-signed certificate
@tkrueger
tkrueger / load-generator.js
Created August 28, 2012 16:57
generate and measure CPU load with node.js
#!/usr/bin/env node
require(__dirname+"/processor-usage.js").startWatching();
var shouldRun = true;
var desiredLoadFactor = .5;
function blockCpuFor(ms) {
var now = new Date().getTime();
var result = 0
@minniel
minniel / slack_history.py
Last active February 28, 2022 22:02 — forked from Chandler/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
from slacker import Slacker
import json
import argparse
import os
import shutil
import copy
from datetime import datetime
# This script finds all channels, private channels and direct messages
# that your user participates in, downloads the complete history for
@Chandler
Chandler / slack_history.py
Last active July 18, 2024 04:21
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active August 8, 2024 11:53
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@lucasrenan
lucasrenan / k8s.sh
Created April 30, 2019 17:50
Kubernetes get all pods/containers resources requests/limits
kubectl get pods --all-namespaces --sort-by='.metadata.name' -o jsonpath='{.items[*].spec.containers[*].resources.limits.memory}'
kubectl get pod --all-namespaces --sort-by='.metadata.name' -o json | jq -r '[.items[] | {pod_name: .metadata.name, containers: .spec.containers[] | [ {container_name: .name, memory_requested: .resources.requests.memory, cpu_requested: .resources.requests.cpu} ] }]'