Skip to content

Instantly share code, notes, and snippets.

@seamus-45
seamus-45 / partman.py
Created July 24, 2020 08:19
partman-auto: calculate size of partitions
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ported from: https://github.com/xobs/debian-installer/blob/master/doc/devel/partman-auto-recipe.txt#L303
# size in megabytes
free_space = 500*1024
recipe = [
# efi
{ 'min': 512,
@seamus-45
seamus-45 / root-ro
Created May 21, 2020 06:59
Read only rootfs for debian derivatives
#!/bin/sh
#
# Read-only Root-FS for Raspian
#
# Modified 2016 by Stefan Bonfert to make it compatible with Raspbian
# Jessie (vanilla).
#
# Modified 2015 by Pascal Rosin to work on raspian-ua-netinst with
# overlayfs integrated in Linux Kernel >= 3.18.
#
@seamus-45
seamus-45 / upload.php
Last active October 5, 2023 21:12
Example image hosting uploader script for Flameshot
<?php
// Description: Dumb uploader for flameshot software fork.
// https://github.com/seamus-45/flameshot/tree/custom-upload-hosting
// Settings
$config = [
'max_upload_size' => 16*1024*1024,
'upload_path' => './files',
'shorten_url' => true,
'base_url' => sprintf('http://%s/files/', $_SERVER['SERVER_NAME']),
@seamus-45
seamus-45 / root-ro
Created June 14, 2018 06:33 — forked from sbonfert/root-ro
Read-only Root-FS with overlayfs for Raspian
#!/bin/sh
#
# Read-only Root-FS for Raspian
#
# Modified 2016 by Stefan Bonfert to make it compatible with Raspbian
# Jessie (vanilla).
#
# Modified 2015 by Pascal Rosin to work on raspian-ua-netinst with
# overlayfs integrated in Linux Kernel >= 3.18.
#
@seamus-45
seamus-45 / mpd.lua
Last active November 17, 2017 08:31
utf8 = require 'utf8'
lib = require 'lib'
widget = {
plugin = 'mpd',
opts = {
hostname = '/home/seamus-45/.mpd/socket',
events = {'player', 'mixer', 'options'}
},
cb = function(t)
@seamus-45
seamus-45 / udiff.sh
Created August 28, 2015 09:35
Binary/Source USE flag diff tool
#!/bin/bash
# usage
if [[ $# -lt 1 ]];
then
echo -e "Show USE difference from binary & source package\n"
echo "Usage: $0 category/pkg"
exit 1
fi