Skip to content

Instantly share code, notes, and snippets.

View isaaguilar's full-sized avatar

Isa Aguilar isaaguilar

View GitHub Profile
<h1>Hello, HTMX User</h1>
from machine import Pin, Timer, PWM
import random
import time
import math
maxPWM = 255 # 65535 max PWM value (When max is reached, the power is off)
# Define a function that takes n and m as parameters
def f(n, m):
# Calculate the angle based on n and m
@isaaguilar
isaaguilar / tf.sh
Last active March 28, 2023 18:18
test
#!/bin/bash -e
function join_by {
local d="$1" f=${2:-$(</dev/stdin)};
if [[ -z "$f" ]]; then return 1; fi
if shift 2; then
printf %s "$f" "${@/#/$d}"
else
join_by "$d" $f
fi
@isaaguilar
isaaguilar / anypy-uuid.sh
Created November 17, 2022 14:41
gen a uuid anywhere python is
python3 -c 'import uuid; print(uuid.uuid4())'
@isaaguilar
isaaguilar / manjaro-server-setup.md
Last active November 14, 2022 04:11
personal playbook for new arch-linux with manjaro

Setup Manjaro New System

This is not a complete setup nor is it meant to run unattended. Requires the user to have a user and be a sudoer.

sudo echo "`whoami` ALL=(ALL) NOPASSWD:ALL" |sudo tee -a /etc/sudoers
sudo pacman -Syu
sudo pacman -S docker
sudo systemctl start docker.service
sudo systemctl enable docker.service
@isaaguilar
isaaguilar / podcast-rss.xml
Created November 1, 2022 03:53
podcast rss example from Matthew Dickens http://matthewdickens.me/files/podcastfeed.txt
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<atom:link href="http://linktoyourpodcast.com/feed.xml" rel="self" type="application/rss+xml"/>
<title>Title of Your Podcast</title>
<description>This is where you will put the full description of your podcast--who creates this podcast and what it's about.</description>
<copyright>Copyright 2019 Your Name</copyright>
@isaaguilar
isaaguilar / hello-world.sh
Last active January 11, 2023 03:14
Echo something
#!/bin/bash
pwd
echo "Hello $TFO_TASK"
@isaaguilar
isaaguilar / rkind.sh
Last active January 8, 2021 03:35 — forked from anapsix/rkind.sh
Rancher in KIND (Rancher in Kubernetes-in-Docker)
#!/usr/bin/env bash
#
# RKIND is a naive helper script to start KIND and Rancher Management Server
#
set -u
set -o pipefail
RANCHER_CONTAINER_NAME="rancher-for-kind"
RANCHER_HTTP_HOST_PORT=$[$[RANDOM%9000]+30000]
@isaaguilar
isaaguilar / README.md
Created September 1, 2020 21:00
Spotinst Log Query Service

spotinst-log query service

Install this next to your spotinst-controller to print logs from the Spotinst Ocean. This service simply spits out logs to stdout in JSON format. Then your log aggregation service can use the container logs and publish them to your own logging platform.

Install

kubectl apply -f spotinst-log.yaml --namespace kube-system

sed tricks

Remove all except digits

... | sed 's/[^0-9]*//g'