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
@arcezd
arcezd / build.gradle
Created October 2, 2017 16:37
Build Gradle to read yaml properties [Gradle 2.13]
import org.yaml.snakeyaml.DumperOptions
import org.yaml.snakeyaml.Yaml
buildscript{
ext{
springBootVersion = '1.5.7.RELEASE'
}
repositories{
mavenCentral()
}
@arcezd
arcezd / .hyper.js
Last active November 6, 2017 01:15
hyper.is | Config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',
@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
@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 / 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 / guide.raspbian.root.lvm.md
Last active May 19, 2024 17:23
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 / 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 / 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 / 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)