Skip to content

Instantly share code, notes, and snippets.

View JamesAtIntegratnIO's full-sized avatar
😶‍🌫️

James D. JamesAtIntegratnIO

😶‍🌫️
View GitHub Profile
@JamesAtIntegratnIO
JamesAtIntegratnIO / configuration.nix
Created March 13, 2023 16:37
udev rules for power profile switching for laptops
services.udev.extraRules = ''
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set power-saver"
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set performance"
'';
@JamesAtIntegratnIO
JamesAtIntegratnIO / 1subnets.tf
Created May 27, 2022 16:49
GCP Subnet output with secondary IP Ranges example
locals {
subnets = {
subnet1 = {
name = "subnet1"
ip_cidr_range = "10.0.0.0/24"
description = "description for subnet1"
region = "region1"
log_config = {
aggregation_interval = "interval1"
@JamesAtIntegratnIO
JamesAtIntegratnIO / gcloud_subnets_with_secondaries.sh
Last active May 16, 2022 16:27
List gcloud subnetworks with their secondary ranges to csv
gcloud compute networks subnets list-usable --flatten="secondaryIpRanges[]" \
--format="csv(
ipCidrRange:label=RANGE,
subnetwork.segment(-1):label=SUBNET_NAME,
secondaryIpRanges.ipCidrRange:label=SECONDARY_RANGE,
secondaryIpRanges.rangeName:label=Secondary_RANGE_NAME
)"
name = {
"example-pods" = "10.1.1.0/18"
"example-services" = "10.1.2.0/23"
}

Tmux Cheat Sheet

Splitting

Ctrl-b %                                # Vertical Split
Ctrl-b "                                # Horizontal Split
Ctrl-b o                                # Switch between Panes"

Windows

Vim Cheat Sheet

Basic File/Dir work

:pwd                        # List current Directory
:cd ${/some/dir}            # Change to some dir
:e ${/some/file}            # Edit some file
:term                       # Open a terminal
## List Docker CLI commands
docker
docker container --help
## Display Docker version and info
docker --version
docker version
docker info
## Execute Docker image
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"strconv"
)