Skip to content

Instantly share code, notes, and snippets.

View andresrinivasan's full-sized avatar

André Srinivasan andresrinivasan

View GitHub Profile
@andresrinivasan
andresrinivasan / sometimes-fail.py
Created December 28, 2022 06:12
Create and sometimes raise iTerm window
#!/usr/bin/env python3
import sys
import iterm2
async def main(connection):
w = await iterm2.Window.async_create(connection)
await w.async_activate() # Not sufficient to always raise the window
@andresrinivasan
andresrinivasan / always-works.py
Created December 28, 2022 06:12
Create and raise iTerm window
#!/usr/bin/env python3
import sys
import iterm2
async def main(connection):
w = await iterm2.Window.async_create(connection)
await w.async_activate() # Not sufficient to always raise the window
#!/usr/bin/env python3
import json
import iterm2
async def get_most_profiles(c):
all = await iterm2.PartialProfile.async_query(c)
return [p for p in all if p.all_properties["Name"] != "Hotkey Window"]
@andresrinivasan
andresrinivasan / rec.yaml
Created November 17, 2022 04:39
REC resource with a spec.certificates.proxyCertificateSecretName key
apiVersion: app.redislabs.com/v1
kind: RedisEnterpriseCluster
metadata:
name: rec1
spec:
nodes: 3
uiServiceType: LoadBalancer # No tunneling to the UI needed
redisEnterpriseNodeResources:
limits:
cpu: 4 # Assumes at least 6 cores/node
@andresrinivasan
andresrinivasan / cheatsheet.md
Last active December 21, 2022 08:41
One and Two Liners

One and Two Liners Cheat Sheet

Python JSON formatter

python3 -m json.tool

Convert multi-line file into single line with literal "\n" seperators

awk '{printf "%s\n", $0}' <./license.txt

@andresrinivasan
andresrinivasan / cheatsheet.md
Created July 15, 2022 17:58
Kafka and Confluent

export C_INCLUDE_PATH=/opt/homebrew/Cellar/librdkafka/1.8.2/include export LIBRARY_PATH=/opt/homebrew/Cellar/librdkafka/1.8.2/lib

@andresrinivasan
andresrinivasan / cheatsheet.md
Last active August 12, 2022 16:17
Docker and Docker Compose Cheetsheet

DOCKER_BUILDKIT=0 docker build . BUILDKIT_PROGRESS=plain docker build .

EXPOSE vs ports

CMD and ENTRYPOINT

docker run -it --name=myubuntu ubuntu:latest bash

apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-bank
labels:
app: redis-bank
spec:
replicas: 3
selector:
matchLabels:
@andresrinivasan
andresrinivasan / openshift.sh
Last active May 22, 2021 01:02
OpenShift manual commands
## See https://github.com/RedisLabs/redis-enterprise-k8s-docs#installation-on-openshift
oc new-project my-project
oc apply -f openshift/scc.yaml
oc adm policy add-scc-to-group redis-enterprise-scc system:serviceaccounts:my-project
oc apply -f openshift.bundle.yaml
oc apply -f openshift/rec_rhel.yaml