Skip to content

Instantly share code, notes, and snippets.

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

Diego Arce arcezd

🏠
Working from home
View GitHub Profile
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: 1B21 F334 A6BE BE95 8764 3872 04DB 4179 81CA E6A9
Comment: Diego Arce (Zuora) <darce@zuora.com>
Comment: Diego Arce <Diego.arce@bits.cr>
Comment: Diego Arce <Diego@arce.cr>
xsFNBGAWyoQBEACpw+HzPPDz4sc9NGj/TjbZMfA2hRV9myU451EQql2+/641h/9t
IPsIo921jvpGxs6GTAuoAx6XGNIKMMI2opsZ0HzH2SqTsj6BnPEp1dhFF+zcsJdN
FHWQDjvThBdac8duzuO7T5C+utrUo3pshENjkipwBYhgHiamy0Z6yByoEGPEaCpI
tKbJjWtMWNnSWyXfzRbbhbF1oxDODTyIN3ohFlQyftjcrQ/7XFabD25jUL7qFG48
@arcezd
arcezd / .amethyst.yml
Created September 1, 2023 00:20
AzD.Terminal
# Default settings for amethyst
# Repo: `https://github.com/ianyh/Amethyst`
#
# Note due to issue 1419 (https://github.com/ianyh/Amethyst/issues/1419) some
# config values may conflict and not work if they are the same as the default
# values for amathyst. You can see these values on github at
# https://github.com/ianyh/Amethyst/blob/development/Amethyst/default.amethyst
# If you're experiencing conflicts and the settings are the same as the default,
# comment out the commands in this file.
#
@arcezd
arcezd / led.py
Last active April 8, 2023 00:38
Ender 3 BIGTREETECH SKR Mini v2.0 - Klipper
import board
import neopixel
pixels = neopixel.NeoPixel(board.D18, 19)
#pixels[0] = (255, 0, 128)
#pixels.fill((255, 0, 255)) ## all yellow
#pixels.fill((255,0,128))
#for x in range(7, 12):
# pixels[x] = (255, 255, 0)
@arcezd
arcezd / public_private_subnets_ipv4_only
Last active December 23, 2021 02:20
Terraform AWS Network Templates
locals {
main_vpc_cidr_block = "10.0.0.0/16"
public_subnets = {
"PublicSubnetA" = {
cidr_block = "10.0.1.0/24",
availability_zone_id = "use1-az4"
},
"PublicSubnetB" = {
cidr_block = "10.0.2.0/24",
availability_zone_id = "use1-az6"
@arcezd
arcezd / Dockerfile
Created June 24, 2020 23:44
Dockerfile Typescript
FROM node:12-alpine AS builder
# Use build directory
WORKDIR /build
# Copy app files
COPY ./ /build/
# Install node dependencies
RUN npm install
@arcezd
arcezd / guide.raspbian.root.lvm.md
Last active March 18, 2024 23:15
Guide to move root Raspbian to LVM partition

Prepare the installation with LVM drivers

DISCLAIMER: Copied from [https://raspberrypi.stackexchange.com/questions/85958/easy-backups-and-snapshots-of-a-running-system-with-lvm/85959]

Moving the installation isn't the problem but the LVM drivers must be loaded on boot up so the root partition can be mounted and used for booting. Fortunately the Raspberry Pi supports loading a ramdisk for initrd so we have to do an additional step to create the initram containing drivers for LVM.

The following is only for a quick setup an initramfs where you have to monitor kernel updates by yourself. To use a more automated setup an initramfs you can look at How can I use an init ramdisk (initramfs) on boot up Raspberry Pi?.

If you are unexperienced with linux please try it first with a new image how I did for this How To. You can loose all data.

For reference I use Raspbian Buster with Desktop 2020-02-13, flashed it to a SD Card and boot it in a RasPi. First do an upgrade to get the latest software versions and instal

@arcezd
arcezd / docker-swarm-status.sh
Created February 26, 2019 20:30
Check docker swarm status
#!/bin/bash
if [ "$(docker info --format '{{.Swarm.LocalNodeState}}')" = "inactive" ]; then
echo "Node is not in a swarm cluster"
exit 0
elif [ "$(docker info --format '{{.Swarm.LocalNodeState}}')" = "active" ]; then
echo "Node is in a swarm and healthy"
elif [ "$(docker info --format '{{.Swarm.LocalNodeState}}')" = "pending" ]; then
echo "Node is in a swarm but no quorum"
elif [ "$(docker info --format '{{.Swarm.LocalNodeState}}')" = "locked" ]; then
@arcezd
arcezd / startup-centos-docker.sh
Created February 25, 2019 20:02
Install docker to CentOS7
#!/bin/bash
yum -y update
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
@arcezd
arcezd / .bash_profile
Last active April 3, 2018 21:08
Bash profile [MacOS]
# Homebrew EXPORT
export PATH="$PATH:$HOME/.local/bin"
# NVM EXPORT
export NVM_DIR="$HOME/.nvm"
source $(brew --prefix nvm)/nvm.sh
# PYENV EXPORT
export PYENV_ROOT=/usr/local/var/pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi