Skip to content

Instantly share code, notes, and snippets.

View osowski's full-sized avatar

Rick Osowski osowski

View GitHub Profile
@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
@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 \
@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} ] }]'
@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
#!/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
@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 March 26, 2024 14:35
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 May 6, 2024 04: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
@niksumeiko
niksumeiko / git.migrate
Last active May 10, 2024 02:41
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.