Skip to content

Instantly share code, notes, and snippets.

@giannoug
giannoug / gist:325587d0a48b325795bd59e1fd9c2bf3
Created May 6, 2017 22:54
GitLab docker container, docker executor
docker run -d --name gitlab-runner --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner:alpine
docker exec -it gitlab-runner gitlab-runner register
@giannoug
giannoug / gist:ce07f79693a2e8c7a728da373c60c695
Created August 17, 2018 20:29
Delete Kerberos.io Docker capture files older than 7 days
find /etc/opt/kerberosio/capture -type f -name '*.*' -mtime +7 -exec rm {} \;
package lib
import java.io.InputStream
import java.security.KeyFactory
import java.security.interfaces.{RSAPrivateKey, RSAPublicKey}
import java.security.spec.{PKCS8EncodedKeySpec, X509EncodedKeySpec}
import javax.inject.Inject
import play.api.Environment
@giannoug
giannoug / gist:7aba3883107d21715341f12c6889c3ac
Last active August 17, 2021 09:04
Extend an Ubuntu VMs LVM after you resize its disk
sudo fdisk -l
sudo parted /dev/vda
GNU Parted 3.3
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resizepart
Warning: Not all of the space available to /dev/vda appears to be used, you can fix the GPT to use all of the space (an
extra 67108864 blocks) or continue with the current setting?
sudo ./scripts/stop
sudo rm ~/umbrel/lnd/!(lnd.conf)
sudo rm ~/umbrel/db/user.json
sudo ./scripts/start
@giannoug
giannoug / tor.go
Created August 1, 2021 22:59
Read Tor node's traffic information using Go (can be turned into a telegraf plugin)
package main
//https://gitweb.torproject.org/torspec.git/tree/control-spec.txt
import (
"fmt"
"net"
"net/textproto"
"os"
"time"
@giannoug
giannoug / rename.sh
Created August 11, 2021 19:26
Migrate media from Dropbox to OneDrive
#!/usr/bin/env bash
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/
# This script was used to migrate photos and videos saved
# from Dropbox to OneDrive. Since both services use their
# own naming scheme, I wanted to maintain consistency between
# the newly uploaded files (automatically from my devices) and
# the old ones migrated from Dropbox.
cd ~/cloudbox && git fetch && git reset --hard @{u}
sudo ansible-playbook cloudbox.yml --tags cloudbox
cd ~/community; git fetch &> /dev/null; git checkout master &> /dev/null; git reset --hard @{u} &> /dev/null
sudo ansible-playbook community.yml --tags delugevpn
@giannoug
giannoug / reveille.yaml
Created December 2, 2023 13:22
Sample ESPHome configuration file for Sinilink USB Computer Remote (XY-WPCL)
# Sinilink USB Computer Remote (XY-WPCL)
esphome:
name: reveille
friendly_name: reveille
esp8266:
board: esp8285
# Enable logging
@giannoug
giannoug / doorbell.yaml
Created January 19, 2024 19:19
A simple doorbell implementation using LC Technology AC90V-250V 1 Channel Relay Board (ESP32_Relay X1)
esphome:
name: doorbell
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger: