Skip to content

Instantly share code, notes, and snippets.

@BigNerd
BigNerd / k9s.txt
Last active May 16, 2024 15:38
K9s column descriptions
View: Pods(<namespace>)[number of pods listed]
NAME pod name
READY number of pods in ready state / number of pods to be in ready state
RESTARTS number of times the pod has been restarted so far
STATUS state of the pod life cycle, such as Running | ... | Completed
CPU current CPU usage, unit is milli-vCPU
MEM current main memory usage, unit is MiB
%CPU/R current CPU usage as a percentage of what has been requested by the pod
%MEM/R current main memory usage as a percentage of what has been requested by the pod
@voidIess
voidIess / nix_env_unstable_guide.md
Last active February 24, 2024 15:19
Adding the nix unstable channel

Using the nipkgs unstable channel

Motivation

There a times when you need to build something from the nix unstable channel. For example the master contains a new package you need, but the next nixpkgs release is somewhere in the future, and you need this package now. In this guide I want to show how to install packages from unstable by using nix-env. Furthermore I hope to give a basic understanding of the channels concept.

What are nix channels?

A channel is a set of expressions which includes severall build, installation and configuration instructions for packages, services and the system itself. The repository normaly used here is nixpkgs. It is developed at https://github.com/NixOS/nixpkgs.

What is the nix unstable channel?

The unstable channel is a copy of the NixOS/nixpkgs master. It is pulled from github once in a while and will be available from a mirror under https://nixos.org/channels/nixpkgs-unstable. Since NixOS uses half-anual released stable channels, some changes (especially new f

package main
import (
"net/http"
"net/url"
"runtime"
"strings"
"context"
"bytes"
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
@ThinGuy
ThinGuy / 00-dell-firmware-01-all.sh
Created February 1, 2019 19:18
Commission Dell 740xd
#!/bin/bash -x
# --- Start MAAS 1.0 script metadata ---
# name: 00-dell-firmware-00-all
# type: commissioning
# title: Firmware Update for PowerEdge R740xd
# description: Dell PowerEdge R740xd Firmware Updates
# script_type: commissioning 
# tags: commissioning update_firmware
# for_hardware: mainboard_product:00WGD1
# may_reboot: True
@superseb
superseb / get_kubeconfig_custom_cluster_rancher2.sh
Last active October 13, 2023 05:51
Get kubeconfig for custom cluster in Rancher 2.x
#!/bin/bash
# Usage: ./get_kubeconfig_custom_cluster_rancher2.sh cluster_name
# Needs to be run on the server running `rancher/rancher` container
# Check if jq exists
command -v jq >/dev/null 2>&1 || { echo "jq is not installed. Exiting." >&2; exit 1; }
# Check if clustername is given
if [ -z "$1" ]; then
echo "Usage: $0 [clustername]"
@ThinGuy
ThinGuy / hp-raid-cfg
Last active November 28, 2023 20:30
Example MaaS Commissioning script to configure HP RAID
#!/bin/bash -x
# --- Start MAAS 1.0 script metadata ---
# name: 00-hp-array-01-config
# type: commissioning
# title: Configure HP Smart Array controllers on HP systems
# description: Configure HP Smart Array Controllers
# script_type: commissioning
# destructive: True
# tags: configure_hba commissioning
# --- End MAAS 1.0 script metadata ---
package main
import (
"net/http"
"net/url"
"runtime"
"strings"
"context"
"bytes"
@leodotcloud
leodotcloud / get_image_manifest.sh
Created August 3, 2017 22:33 — forked from alex-bender/get_image_manifest.sh
Docker Registry v2 get manifest and push\pull
#!/bin/bash
#
# Shell scripts for get image manifest from v2 registry
#
# Tested on Debian 8, curl 7.38.0, jq-1.5
#
set -e -u
# Default tag is latest
@BretFisher
BretFisher / docker-for-mac.md
Last active May 15, 2024 05:19
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1