Skip to content

Instantly share code, notes, and snippets.

@Damienfr666
Damienfr666 / gitlab-docker-caddy-portainer.md
Created November 16, 2023 19:40 — forked from swrogers/gitlab-docker-caddy-portainer.md
Run Gitlab Docker behind Caddy reverse proxy via Portainer stack (with an XWiki bonus!)

Gitlab Docker / Caddy / Portainer (plus bonus XWiki)

This is how I was able to get Gitlab CE Docker to run behind a Caddy reverse proxy, created from Portainer stack.

This has taken quite a lot of searching, so I figured that I'd write it up in a location that I could easily refer to it in the future.

There are a handful of items that are initially needed here:

  • Caddy and its network
  • Portainer
@Damienfr666
Damienfr666 / hid_device_manager.rs
Created June 2, 2022 08:26 — forked from craigzour/hid_device_manager.rs
MSP firmware update in Rust
use hidapi::HidApi;
use updatable_device::UpdatableDevice;
const BSL_VENDOR_ID: u16 = 0x2047;
const BSL_PRODUCT_ID: u16 = 0x200;
pub struct HIDDeviceManager {
hid_api: HidApi
}
@Damienfr666
Damienfr666 / README.md
Created June 1, 2022 07:51 — forked from lbussy/README.md
External Button Shutdown for Raspberry Pi

Shutdown Raspberry Pi with a Single Button

There are two methods:

  1. Scripted Method
  2. Boot Overlay Method (also below as "tl;dr")

tl;dr Version

Add the following to your /boot/config.txt and reboot:

@Damienfr666
Damienfr666 / i2c_sw.c
Created April 14, 2022 09:43 — forked from ksvbka/i2c_sw.c
I2C Bit-Bangging - MSP430
/********************************************************************************
Module : I2C_SW
Author : 05/04/2015, by KienLTb - https://kienltb.wordpress.com/
Description : I2C software using bit-banging.
********************************************************************************/
/*-----------------------------------------------------------------------------*/
/* Header inclusions */
@Damienfr666
Damienfr666 / i2c_hw.c
Created April 14, 2022 09:43 — forked from ksvbka/i2c_hw.c
I2C Hardware for MSP430
/********************************************************************************
Product: I2C - Hardware - Block
Module: I2C
Created: 12/04/2015, by KIENLTB
Description: I2C Driver for MSP430
********************************************************************************/
/*-----------------------------------------------------------------------------*/

Creating an AWS IoT Thing from Command Line

Use this script to create a new AWS IoT Thing from the command line.

@Damienfr666
Damienfr666 / journal.go
Created March 8, 2022 12:01 — forked from corny/journal.go
SQLite journal in Go (golang)
/*
Stores entries in a local SQLite database
until they have been processed by a submit function.
*/
package journal
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
"sync"
@Damienfr666
Damienfr666 / install_CUPS_all_defaults.sh
Created December 18, 2021 14:29 — forked from aweijnitz/install_CUPS_all_defaults.sh
Installing CUPS printer on Debian and add PDF printer
#!/bin/bash
sudo apt-get -y install cups
sudo apt-get -y install cups-pdf
# add pdf printer to cups
# - named files end up in ~/PDF/
# - unnamed files are stored in /var/spool/cups-pdf/ANONYMOUS/, such as PDF:s created by streaming bytes over an API
sudo lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/ppd/cups-pdf/CUPS-PDF.ppd
# install fsarchiver
# In Fedora/RedHat system's :: yum install fsarchiver sfdisk dd
# In Debian/Ubuntu System :: apt-get install fsarchiver sfdisk dd
DEVICE_TO_BACKUP=/dev/sdb # assuming /dev/sda is where you have booted ur primary OS
mkdir ./backup_with_fsarchiver # create a directory
cd ./backup_with_fsarchiver # enter into newly created directory
# only get the first 512 bytes # read mbr in wiki for more details
dd if=$DEVICE_TO_BACKUP of=mbr count=1 bs=512
sfdisk -d $DEVICE_TO_BACKUP > partition.sfdisk