Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View versionsix's full-sized avatar
🦖
Using modern software.

Frank Meeusen versionsix

🦖
Using modern software.
  • Belgium, Antwerp
View GitHub Profile
@versionsix
versionsix / Makefile
Created January 27, 2022 04:23
pcie naming root devices and such, dump
# Just completions
# just --completions zsh | sudo tee /usr/local/share/zsh/site-functions/_just
# zinit creinstall -q /usr/local/share/zsh/site-functions/
export http_proxy := "http://172.31.100.7:3128/"
# https://uk.lxd.images.canonical.com/images/
# https://cloud-images.ubuntu.com/impish/current/
# 537M Ubuntu Server Cloud Image Builds
#!/bin/bash
#####################################################################################################
# Script_Name : xrdp-installer-1.2.2.sh
# Description : Perform xRDP installation on Ubuntu 16.04,18.04,20.4,20.10 and perform
# additional post configuration to improve end user experience
# Date : December 2020
# written by : Griffon
# WebSite :http://www.c-nergy.be - http://www.c-nergy.be/blog
# Version : 1.2.2
# History : 1.2.2 - Changing Ubuntu repository from be.archive.ubuntu.com to archive.ubuntu.com
@versionsix
versionsix / gcp-iam-restrict-user-bucket.sh
Created November 13, 2021 14:04 — forked from pydevops/gcp-iam-restrict-user-bucket.sh
Google Cloud Platform example to add IAM role restricting user to specific storage buckets with conditions
#!/usr/bin/env bash
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workload identity domain
export GCP_REGION="us-central1"
export GCP_ZONE="us-central1-a"
@versionsix
versionsix / vpn
Created October 4, 2021 08:36 — forked from alyssais/vpn
A tiny command line interface to Viscosity
#!/usr/bin/env bash
run_list() {
osascript <<OSA
tell application "Viscosity"
repeat with theConnection in connections
set theName to name of theConnection
set theState to state of theConnection
log theName & ": " & theState
end repeat
@versionsix
versionsix / bluetooth_sleep.lua
Created September 23, 2021 14:11 — forked from ysimonson/bluetooth_sleep.lua
Hammerspoon script to disable bluetooth when the computer is put to sleep. Requires `blueutil` to be installed (`brew install blueutil`).
require "string"
function checkBluetoothResult(rc, stderr, stderr)
if rc ~= 0 then
print(string.format("Unexpected result executing `blueutil`: rc=%d stderr=%s stdout=%s", rc, stderr, stdout))
end
end
function bluetooth(power)
print("Setting bluetooth to " .. power)
@versionsix
versionsix / generate_directory_index_caddystyle.py
Last active April 28, 2021 18:42 — forked from glowinthedark/generate_directory_index_caddystyle.py
Generate directory index (recurse subfolders with `-r` or `--recursive`). Use `-h` or `--help` for all options
#!/usr/bin/env python3
# ---
# Copyright 2020 glowinthedark
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
@versionsix
versionsix / docker_l3_routed_ipvlan.md
Created April 10, 2021 05:26
Docker ipvlan use a routed subnet.
❯ multipass launch \
  -m 8G \
  -c 4 \
  -d 30G \
  --name dockrr \
    focal
Launched: dockrr
@versionsix
versionsix / HowTo
Created December 14, 2020 14:51 — forked from s3rj1k/HowTo
Ubuntu 20.04.1 AutoInstall
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
wget https://ubuntu.volia.net/ubuntu-releases/20.04.1/ubuntu-20.04.1-live-server-amd64.iso
# Create ISO distribution dirrectory:
@versionsix
versionsix / pa-example-config.xml
Created November 14, 2019 12:55
Palo alto example config. mgmt: 192.168.123.99/24 admin | P@ssw0rd
<config version="8.0.0" urldb="paloaltonetworks">
<mgt-config>
<users>
<entry name="admin">
<phash>$1$l2.doqhj$Vri/RkbGRnVW2yjB.xV6O0</phash>
<permissions>
<role-based>
<superuser>yes</superuser>
</role-based>
</permissions>
@versionsix
versionsix / legacy-free-ubuntu.sh
Created August 7, 2019 11:09
Legacy free openstack images
wget -O /var/lib/libvirt/images/ubuntu-bionic.qcow2 https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
cat <<EOF > 51-vga.cfg
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0 vga=789"
EOF
virt-copy-in -a /var/lib/libvirt/images/ubuntu-bionic.qcow2 51-vga.cfg /etc/default/grub.d
virt-customize -v -a /var/lib/libvirt/images/ubuntu-bionic.qcow2 \
--run-command "update-grub" \
--run-command "apt -yqq update && apt -yqq upgrade" \
--run-command "apt -y -qq --no-install-recommends install jq dnsutils && apt -y autoremove" \
--run-command "mkdir -p /etc/systemd/system/getty@tty1.service.d && mkdir -p /etc/systemd/system/serial-getty@ttyS0.service.d && mkdir -p /etc/cloud/cloud.cfg.d/"