Skip to content

Instantly share code, notes, and snippets.

View shaposhnikoff's full-sized avatar
🏠
Working from home

Shaposhnikoff shaposhnikoff

🏠
Working from home
View GitHub Profile
sudo qemu-system-aarch64 \
-kernel /Volumes/data/qemu/openwrt-23.05.05-armsr/openwrt-23.05.2-armsr-armv8-generic-initramfs-kernel.bin \
-drive file=/Volumes/data/qemu/openwrt-23.05.05-armsr/openwrt-23.05.2-armsr-armv8-generic-squashfs-rootfs.img.work,if=virtio,format=raw \
-append root=/dev/vda \
-cpu cortex-a57 -m 2048 -smp 2 -machine virt \
-nographic \
-device virtio-net-pci,netdev=net0 -netdev vmnet-host,id=net0,net-uuid=86d5e2de-594c-421e-be0d-8a3ac19dc207 \
-device virtio-net-pci,netdev=net1 -netdev vmnet-bridged,ifname=en0,id=net1
@mitchellh
mitchellh / merge_vs_rebase_vs_squash.md
Last active May 17, 2024 10:38
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:

@vi7
vi7 / alertmanager_templates_howto.md
Last active April 8, 2024 14:50
Alertmanager templates testing

Render Alertmanager templates locally

Normally to test Alertmanager templates you need to restart running Alertmanager and wait for alerts to arrive to Slack or email. To speed up this process parts of templates could be rendered locally using predefined alerts data without the need of the actual Alertmanager.

What you still need in this case is amtool which is a part of Alertmanager delivery which could be downloaded here https://github.com/prometheus/alertmanager/releases

Some examples of templates rendering:

# navigate to the templates dir
@alpeb
alpeb / flat-network.sh
Last active May 9, 2024 11:26
2 k3d clusters with 3 nodes each, using the same flat network
#!/usr/bin/env bash
zones=(a b c)
cluster_cidr() {
echo "apiVersion: networking.k8s.io/v1alpha1
kind: ClusterCIDR
metadata:
name: new-cidr
spec:
@sushaanttb
sushaanttb / sample-webhook-template.yaml
Created August 4, 2023 07:44
Template for ArgoCD webhook service, subscription trigger template and trigger condition
service.webhook.mypythonapp:
url: <your_application_base_url>
headers:
- name: Content-Type
value: application/json
subscriptions:
- recipients:
- <your_webhook_name>
triggers:
- on-status-changed
@cGandom
cGandom / RaspberryPi4-qemu.md
Last active May 17, 2024 17:06
Emulating Raspberry Pi 4 with Qemu

Emulating Raspberry Pi 4 with Qemu

Just a quick update before we dive in: what we're actually doing here is running Raspberry Pi OS (64-bit) on a QEMU virtual ARM setup. This isn't full-blown hardware emulation of the Raspberry Pi 4, but more about creating a virtual environment for the OS. It doesn't mimic all the specific hardware features of the Pi 4, but it's pretty useful and great for general testing. I turned to this solution mainly to extract a modified sysroot from the Raspberry Pi OS, something not readily available in other resources. For those looking into detailed emulation of the actual Raspberry Pi 4's hardware in QEMU, check out this link for the latest updates: https://gitlab.com/qemu-project/qemu/-/issues/1208.

Hope it helps! :D

Shortcomings: No GUI yet, only console.

Steps

@barbietunnie
barbietunnie / ansible-variable-precedence.md
Last active March 19, 2023 20:25
Ansible Variable Precedence

Ansible Variable Precedence

Here is the order of precedence from least to greatest (the last listed variables override all other variables):

  1. command line values (for example, -u my_user, these are not variables)
  2. role defaults (defined in role/defaults/main.yml) [1]
  3. inventory file or script group vars [2]
  4. inventory group_vars/all [3]
  5. playbook group_vars/all [3]
  6. inventory group_vars/* [3]
@olijf
olijf / Raspberry-pi-qemu.md
Created December 21, 2022 14:22
Raspberry PI in qemu emulation

preperation

install qemu pamac install qemu-system-aarch64

unpack raspios xz -d 2022-09-22-raspios-bullseye-arm64.img.xz

check in fdisk partitions fdisk -l 2022-09-22-raspios-bullseye-arm64.img

@brikis98
brikis98 / terraform-environments-comparison.md
Last active May 30, 2023 23:52
How to manage multiple environments with Terraform comparison table
Workspaces Branches Terragrunt
Minimize code duplication ■■■■■ □□□□□ ■■■■□
See and navigate environments □□□□□ ■■■□□ ■■■■■
Different settings in each environment ■■■■■ ■■■■□ ■■■■■
Different backends for each environment □□□□□ ■■■■□ ■■■■■
Easy to manage multiple backends □□□□□ ■■■■□ ■■■■■
Different versions in each environment □□□□□ ■■□□□ ■■■■■
Share data between modules ■■□□□ ■■□□□ ■■■■■
Work with multiple modules concurrently □□□□□ □□□□□ ■■■■■
@Madh93
Madh93 / Raspberry_Pi_with_Packer_and-QEMU.md
Last active March 24, 2024 10:11
Raspberry Pi with Packer and QEMU

Raspberry Pi with Packer and QEMU

Creates a Raspberry Pi image using Packer and using QEMU to test it.

Tested with Raspberry Pi OS Lite 5.10 (March 4th 2021).

Requirements (Arch Linux)

yay -S curl go packer qemu qemu-arch-extra qemu-user-static-bin