Skip to content

Instantly share code, notes, and snippets.

View robin-collins's full-sized avatar
:shipit:
I may be slow to respond.

Robin Collins robin-collins

:shipit:
I may be slow to respond.
View GitHub Profile
@ajmassi
ajmassi / LXCBindMount.md
Last active September 26, 2024 19:00
Create a bind mount from a Proxmox host on an unprivileged lxc container

Proxmox Assign Bind Mount To Unprivileged Container

In order for the LXC container to have full access the proxmox host directory, a subgid is set as owner of a host directory, and an ACL is used to ensure permissions.

Bind Mount dataset to LXC

Add the following line to /etc/pve/lxc/<CT_ID>.conf

mp0:/mount/point/on/host,mp=/mount/point/on/lxc

Create group on host

In the default Proxmox configuration, unpriviliged container subgids will have the prefix "10" followed by the expected 4-digit gid.

@Danilo-Araujo-Silva
Danilo-Araujo-Silva / tree.sh
Last active February 16, 2024 15:20
tree command, only folders, human readable format, easy way to find large folders
# Command:
sudo tree --du -ahF /path/to/folder | grep "\(files\|/\)$"
# Example from a fresh google colab opt folder:
# Command: !sudo tree --du -ahF /opt | grep "\(files\|/\)$"
# Output:
@amunchet
amunchet / noVNCCopyPasteProxmox.user.js
Last active November 16, 2024 18:02
Copy/Paste for noVNC Proxmox
// ==UserScript==
// @name noVNC Paste for Proxmox
// @namespace http://tampermonkey.net/
// @version 0.2a
// @description Pastes text into a noVNC window (for use with Proxmox specifically)
// @author Chester Enright
// @match https://*
// @include /^.*novnc.*/
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @grant none
@Sieboldianus
Sieboldianus / readme.md
Last active May 2, 2023 06:18
Automate getting monthly PDFs from websites, protected by (simple) credentials, with Selenium and Chromedriver

I have a number of monthly manual tasks that I could not automate so far.

One of them is getting PDF from login-protected websites, saving them in specific folders with naming conventions (renaming etc.) and uploading those to my nextcloud.

The script below is for my Electricity Provider's PDFs. They are behind a simple login form (user & pw) and uploaded for the past 6 months. I always forget to check regularly enough to download all.

Two key takeaways:

  1. Use selenium/standalone-chrome Docker image
@midoriiro
midoriiro / convert-image.psm1
Created November 15, 2023 18:08
Convert OCI image to LXC format
Function Convert-Image
{
Param (
[Parameter(Mandatory = $true)]
[string]$Name,
[Parameter(Mandatory = $true)]
[string]$Tag,
[Parameter(Mandatory = $false)]