Skip to content

Instantly share code, notes, and snippets.

@koaie
koaie / acme_deploy_ssh_hooks
Last active November 3, 2025 17:31
Openwrt acme ssh-hook install & deployment script. Automatically pushes acme certs via sftp. Uses uci for configuration.
#!/bin/sh
ACME=/usr/lib/acme/client/acme.sh
STATE_DIR=/etc/acme
DEPLOY_PATH=/usr/lib/acme/deploy
VERBOSE=0
DOMAIN=""
while getopts "vd:" opt; do
case "$opt" in
d)
@koaie
koaie / sum-mpi.c
Created July 4, 2023 15:04
rotating sum
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <mpi.h>
int main(void)
{
MPI_Init(NULL, NULL);
MPI_Comm comm = MPI_COMM_WORLD;
int rank, size, sum = 0,buff;
@koaie
koaie / pi.c
Created July 4, 2023 11:32
MPI - Parallel PI
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <mpi.h>
#define N 50003
int main(void)
{
MPI_Init(NULL, NULL);
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
int main()
{
int a=2,b=3,c,i;
#pragma omp target data map(to:a,b,c) map(from:i)
{
@koaie
koaie / step.py
Last active August 24, 2022 18:24
Pi-pico Micropython step motor controller (Made with 28BYJ-48, ULN2003)
import time
from machine import Pin
class motor:
pins: list[int] = []
steps: list[list:int]
currentStep: int = 0
scale: float = 1.0
@koaie
koaie / README.md
Created May 22, 2022 14:10 — forked from ringe/README.md
KVM QCOW2 Live backup

Live backup of KVM virtual machines

This script will let you make backups of live VMs running on KVM, using libvirt.

The backup job will suspend the VM for the time it takes to copy the RAM to disk.

Credits: Luca Lazzeroni

I've made some minor adjustments.