Skip to content

Instantly share code, notes, and snippets.

View rimusz's full-sized avatar

Rimantas (Rimas) Mocevicius rimusz

View GitHub Profile
@rimusz
rimusz / lima-on-m1-mac-installation-guide.md
Created October 8, 2021 11:57 — forked from toricls/lima-on-m1-mac-installation-guide.md
Using Lima to run containers with containerd and nerdctl (without Docker Desktop) on M1 Macs

Lima (Linux virtual machines, on macOS) installation guide for M1 Mac.

Sep. 27th 2021 UPDATED

Now we can install patched version of QEMU via Homebrew (thank you everyone for the info!). Here is the updated instruction with it:

Used M1 Mac mini 2020 with macOS Big Sur Version 11.6.

1. Install QEMU & Lima

@rimusz
rimusz / sh2ju.sh
Created August 25, 2021 16:36 — forked from double16/sh2ju.sh
junit bash commands
#!/bin/bash
### Copyright 2010 Manuel Carrasco Moñino. (manolo at apache.org)
### Copyright 2016 Patrick Double (pat at patdouble.com)
###
### Licensed under the Apache License, Version 2.0.
### You may obtain a copy of it at
### http://www.apache.org/licenses/LICENSE-2.0
###
### A library for shell scripts which creates reports in jUnit format.
@rimusz
rimusz / delete-helm-chart-resources.sh
Created December 30, 2019 16:11 — forked from techmexdev/delete-helm-chart-resources.sh
Deletes the leftover resources after purging a chart. Workaround for: https://github.com/helm/helm/issues/6646
#!/usr/bin/env bash
ENV=dev
APP=cert-manager
NAMESPACE=cert-manager
FILENAME=upgrade-error.txt
while true
do
function upgrade() {
helm upgrade $APP . \
@rimusz
rimusz / inlets-kind.md
Created September 18, 2019 09:35 — forked from alexellis/inlets-kind.md
Expose Kubernetes ClusterIP services with inlets.dev

KinD with inlets.dev

Expose Kubernetes ClusterIP services with inlets.dev

Get KinD:

# Linux

sudo curl -Lo /usr/local/bin/kind \
#!/usr/bin/env bash
set -e
set -o pipefail
kubectl proxy &
proxy_pid="$!"
trap 'kill "$proxy_pid"' EXIT
for ns in $(kubectl get namespace --output=jsonpath="{range .items[?(@.status.phase == 'Terminating')]}{@.metadata.name}{'\n'}{end}"); do
@rimusz
rimusz / kibana.json
Created November 26, 2018 13:56 — forked from guysella/kibana.json
[
{
"_id": "b56f7ce0-e8b4-11e8-a27e-43ccabb473c6",
"_type": "dashboard",
"_source": {
"title": "Error Dashboard",
"hits": 0,
"description": "Error Dashboard",
"panelsJSON": "[{\"panelIndex\":\"1\",\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"1\"},\"embeddableConfig\":{},\"id\":\"31eeecb0-e8b0-11e8-a27e-43ccabb473c6\",\"type\":\"visualization\",\"version\":\"6.3.2\"},{\"panelIndex\":\"3\",\"gridData\":{\"x\":0,\"y\":15,\"w\":24,\"h\":15,\"i\":\"3\"},\"embeddableConfig\":{},\"id\":\"a7c919f0-e8b1-11e8-a27e-43ccabb473c6\",\"type\":\"visualization\",\"version\":\"6.3.2\"},{\"panelIndex\":\"4\",\"gridData\":{\"x\":24,\"y\":0,\"w\":24,\"h\":15,\"i\":\"4\"},\"embeddableConfig\":{},\"id\":\"f1c971d0-e8ac-11e8-a27e-43ccabb473c6\",\"type\":\"visualization\",\"version\":\"6.3.2\"},{\"panelIndex\":\"5\",\"gridData\":{\"x\":24,\"y\":15,\"w\":24,\"h\":15,\"i\":\"5\"},\"embeddableConfig\":{},\"id\":\"5d18b780-e8ac-11e8-a27e-43ccabb473c6\",\"type\":\"visualization\",\"version\
@rimusz
rimusz / README.md
Created October 31, 2018 14:05 — forked from pdanford/README.md
Applescript to launch iTerm2 Version 3+ from OS X Finder via keyboard shortcut or Toolbar

Description

Based on info from http://peterdowns.com/posts/open-iterm-finder-service.html but with modified behavior and fixed to work with iTerm2 version 3 or later. It will not work with older versions of iTerm. The modified behavior is to open a new terminal window for each invocation instead of reusing an already open window. Update - The original author released a build script for the newer iTerm2 versions at https://github.com/peterldowns/iterm2-finder-tools that keeps the original behavior of reusing an open iTerm2 window.

To open iTerm2 at selected folder with keyboard shortcut

  1. Run Automator, select a new Service
  2. Select Utilities -> Double click ‘Run AppleScript’
  3. Service receives selected 'folders' in 'finder.app'
  4. Paste script:
@rimusz
rimusz / update-jekyll
Created September 17, 2018 13:27 — forked from grant-roy/update-jekyll
Bash script to poll Github and rebuild and restart a jekyll site
#!/bin/sh
#This is a simple bash script that will poll github for changes to your repo,
#if found pull them down, and then rebuild and restart a Jekyll site running
#in Nginx. Note, we cannot use cron to schedule a job every 5 seconds, so we create
#a script that executes an infinite loop that sleeps every 5 seconds
#We run the script with nohup so it executes as a background process: $nohup ./update-jekyll
while true
do
@rimusz
rimusz / README.md
Created July 16, 2018 08:52 — forked from alexellis/README.md
Bypass corporate firewall that blocks accessing services high ports

Scenario

Your work involves using a corporate network for Internet access, which blocks accessing anything other than port 22/80/443 on a remote server.

Example

Kubernetes services deployed with NodePorts use a high TCP port range ~ 30000 which is blocked

Solution

@rimusz
rimusz / deployment.go
Created June 25, 2018 13:22 — forked from ipedrazas/deployment.go
From kubectl to GO lang type
// Generated by https://quicktype.io
type Deployment struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Metadata DeploymentMetadata `json:"metadata"`
Spec DeploymentSpec `json:"spec"`
Status Status `json:"status"`