Skip to content

Instantly share code, notes, and snippets.

@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"
@gannino
gannino / sqs_commands.sh
Created March 8, 2019 16:20 — forked from reisjr/sqs_commands.sh
AWS SQS - Working with message using bash
#!/bin/bash
#Setup
SQS_MAX_NUMBER_OF_MESSAGES=1 # Mensagens extraídas da fila por vez
SQS_WAIT_TIME_SECONDS=20 # Esperar quanto tempo por uma mensagem na fila
#Obtain queue URL
QUEUE_URL=$(aws sqs get-queue-url --queue-name "dreis-rampup-queue" --output text)
#Send message
@gannino
gannino / Kali Linux xrdp on AWS.txt
Created January 30, 2019 19:18 — forked from Erreinion/Kali Linux xrdp on AWS.txt
Setting up xrdp on Kali Linux 2016.2 on AWS
Setting up xrdp on Kali Linux 2016.2 on AWS
AWS has an AMI for Kali 2016.2, but being remote, you need VNC or RDP to access the graphical tools.
VNC is easy to set up but very restrictive. RDP is harder to set up, but easier to use. These are the instructions I use to set up xrdp.
I use this config so that I connect to the Kali VM through an Apache Guacamole RDP proxy. This keeps Kali behind the firewall and in my pentesting lab. Guacamole also allows me to access the Kali box on SSH or RDP via a web interface from anywhere and any device.
OS: Kali Linux 2016.2
AMI: Updated 19 Oct 2016