Skip to content

Instantly share code, notes, and snippets.

@gannino
gannino / install-acme-openwrt.sh
Created August 18, 2024 12:18 — forked from aenniw/install-acme-openwrt.sh
Setup letsencrypt for ocserv on OpenWRT
#!/bin/sh
SINGLE_DOMAIN=${SINGLE_DOMAIN:-my.domain.org}
opkg install ca-certificates ca-bundle curl
hash acme.sh || ( curl https://get.acme.sh | sh && \
ln -s /root/.acme/acme.sh /usr/bin/ )
acme.sh --issue -d ${SINGLE_DOMAIN} --dns --force
@gannino
gannino / guest_wifi.sh
Created August 17, 2024 08:00 — forked from weblogix/guest_wifi.sh
[openwrt cheatsheet]
# Sources
# https://openwrt.org/docs/guide-user/network/wifi/guestwifi/guest-wlan
# https://openwrt.org/docs/guide-user/network/wifi/guestwifi/extras
WIFI_DEV="radio0"
WIFI_PASSWORD="guest"
# Configure network
uci -q delete network.guest
uci set network.guest="interface"
@gannino
gannino / docker-swarm-gpu.md
Created March 24, 2024 22:10 — forked from tomlankhorst/docker-swarm-gpu.md
Instructions for Docker swarm with GPUs
@gannino
gannino / Checking your Raspberry Pi's view of its power supply.md
Created August 7, 2023 06:16 — forked from Paraphraser/Checking your Raspberry Pi's view of its power supply.md
Checking your Raspberry Pi's view of its power supply (sometimes it's not the wall-wart)

Checking your Raspberry Pi's view of its power supply

Sometimes it seems like the first (and sometimes only) advice you get offered for almost any problem with a Raspberry Pi is "check your power supply". You think something like:

"hey, I'm using an official power supply sold as being matched with my Pi so how can there be any problem?"

You look up the specs then stick a controlled load across your supply and confirm that it can deliver the required number of Watts.

Yet your problems persist…

@gannino
gannino / download-vs-code-server.sh
Created September 30, 2021 10:23 — forked from b01/download-vs-code-server.sh
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/bin/sh
set -e
# You can get the latest commit SHA by looking at the latest tagged commit here: https://github.com/microsoft/vscode/releases
commit_sha="08a217c4d27a02a5bcde898fd7981bda5b49391b"
archive="vscode-server-linux-x64.tar.gz"
owner='microsoft'
repo='vscode'
# Auto-Get the latest commit sha via command line.
@gannino
gannino / n8n_overview.erb
Created July 27, 2021 11:59 — forked from TephlonDude/n8n_overview.erb
Smashing dashboard file that created the n8n Overview dashboard
<% content_for :title do %>n8n Overview<% end %>
<div class="gridster">
<H2>n8n Overview</H2>
<ul>
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="npm_final" data-view="Meter" data-title="npm Final" data-height="200" data-width="200" data-min="0" data-max="1" data-suffix="" style="background-color:#CB3837;"></div>
<i class="fas fa-flag-checkered icon-background"></i>
</li>
@gannino
gannino / tag-ami-snap-vol-and-clean-not-used-v2.py
Last active June 1, 2020 13:06
Python script to tag AMI, Snapshot and Volumes the one not used by instances or AMI will get the Name tag with a Prefixed UNUSED at first run, when run again if the TAG start with UNUSED will delete the resource
#!/usr/bin/env python3
# most credit to the original: https://gist.github.com/brandond/6b4d22eaefbd66895f230f68f27ee586 & https://gist.github.com/danpritts/1089d878a76b14393478a7476476f97b
# Python script to tag AMI, Snapshot and Volumes the one not used by instances or AMI
# will get the Name tag with a Prefixed UNUSED at first run
# when run again if the TAG start with UNUSED will delete the resource
# Export the below variable to point Profile and region
# export AWS_PROFILE=aws-profile
@gannino
gannino / xrdpMac.sh
Last active February 28, 2020 20:38 — forked from sgdc3/xrdpMac.sh
Xrdp install script for OSX
#!/bin/sh
echo Controllo stato csrutil....
SIP_status=`/usr/bin/csrutil status | awk '/status/ {print $5}' | sed 's/\.$//'`
if [ $SIP_status = "enabled" ]; then
echo Devo disabilitare il CSR dalla recovery mode per continuare!
echo Adesso si riavviera'' il sistema, premere simultaneamente i tasti Mac e R
echo Una volta avviata la recovery mode aprire il terminale e scrivere
@gannino
gannino / deploy_traefik.sh
Created July 26, 2019 23:40 — forked from waja/deploy_traefik.sh
Deploy Traefik as Frontend Proxy for Docker
#!/bin/bash
DOCKER_BASE=/srv/docker
mkdir -p ${DOCKER_BASE}/traefik/container.conf
cat > ${DOCKER_BASE}/traefik/container.conf/docker-compose.yml <<EOF
version: '3.7'
services:
traefik:
@gannino
gannino / userdata.sh
Created March 12, 2019 10:24 — forked from endofcake/userdata.sh
Check that ecs-agent is running and signal back to CloudFormation
#!/bin/bash
set -euo pipefail
<...>
echo "Checking that agent is running"
until $(curl --output /dev/null --silent --head --fail http://localhost:51678/v1/metadata); do
printf '.'
sleep 1
done
exit_code=$?
printf "\nDone\n"