Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Download recent kubectl CLI versions
set -u
BIN_PATH="$HOME/bin"
RELEASES_URL="https://kubernetes.io/releases/"
OS=$(uname -o | tr -s '[A-Z]' '[a-z]' )
@ameiji
ameiji / jq-cheetsheet.md
Created November 12, 2021 12:07 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@ameiji
ameiji / openssl_commands.md
Last active October 26, 2021 09:24 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

openssl 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
---
version: '3.7'
services:
rabbitmq1:
image: rabbitmq:nox
container_name: rabbit1
hostname: rabbit1
ports:
@ameiji
ameiji / glc.py
Last active October 17, 2024 14:14
git log command wrapper with day by day blocks and colors
#!/usr/bin/python3
"""
Show git log output in a compact way with colors.
MMM. .MMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMM ___________________________________
MMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMM | Emergency plan: git out |
@ameiji
ameiji / gist:aefd9bb18c404ee8438b4ec62ea8642d
Created January 12, 2021 15:08 — forked from mneedham/gist:3803604
Script to get upstart out of a start/killed state (http://heh.fi/tmp/workaround-upstart-snafu)
#!/usr/bin/env ruby1.8
class Workaround
def initialize target_pid
@target_pid = target_pid
first_child
end
def first_child
@ameiji
ameiji / HP-ssacli-smart-storage-admin.md
Last active December 23, 2020 07:34 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

[Unit]
Description=DNS Local Resolver
After=network.target
Wants=nss-lookup.target
Before=nss-lookup.target
ConditionPathExists=/usr/sbin/dnsmasq
[Service]
ExecStartPre=/usr/sbin/dnsmasq --test
ExecStart=/usr/sbin/dnsmasq -a 127.0.0.1 -i lo -z -D -R -N -S 8.8.8.8 -S 1.1.1.1 -S 9.9.9.9
[skin]
description = Nice and Dark Custom MC theme
[Lines]
horiz = ─
vert = │
lefttop = ┌
righttop = ┐
leftbottom = └
rightbottom = ┘
"""Misc. Text readers
Public methods return <list> of strings."""
import json
import yaml
class Reader:
def _get_content(self, fname):
'''Open file'''