Skip to content

Instantly share code, notes, and snippets.

@jlengelbrecht
jlengelbrecht / gist:69cdbf91237c62ad9d93883e84622b49
Created December 5, 2023 04:54
ansible automation playbook with discord notifications
---
- hosts: all
gather_facts: true
become: true
become_user: root
serial: 1 # Ensures the playbook runs on one server at a time
vars:
update_results_file: "/home/semaphore/automation-updates.txt"
discord_webhook_url: "my-webhook"
ansible_command_timeout: 900
@sudo-battlekafer
sudo-battlekafer / docker-setup.sh
Last active June 30, 2022 21:36
Docker install/configure for Ubuntu with NFS or SMB storage
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
#prep for media mount
apt-get update
apt-get install -y nfs-common cifs-utils
@egg82
egg82 / apt_cacher_ng.md
Last active January 22, 2024 08:15
AptCacherNg Apt Proxy Setup

More techniques - caching apt packages network-wide

This guide runs through setting up AptCacherNg on a proxy/server to provide apt caching to clients. The client proxy scripts allow for multiple proxies, and account for proxies being offline.

Note that, for obvious reasons, this only works on Debian-based machines (Ubuntu and derivatives as well).

Server (the cache/proxy)

Note: you will need port 3142 open to the clients using this cache/proxy

@swuecho
swuecho / proxmox-import-disk-image.txt
Created August 12, 2020 00:56
Add import existing disk image into Proxmox
#
# The official PVE docs on how to prepare cloud-init templates:
# https://pve.proxmox.com/wiki/Cloud-Init_Support#_preparing_cloud_init_templates
#
# Additional guides and resources:
# https://dae.me/blog/2340/how-to-add-an-existing-virtual-disk-to-proxmox/
# https://pve.proxmox.com/pve-docs/qm.1.html
# use the Qemu/KVM Virtual Machine Manager to import the disk
qm importdisk 107 Univention-App-kopano-core-KVM.qcow2 local-lvm
@tarnacious
tarnacious / build-qcow2.nix
Last active May 1, 2024 02:21
Build a bare bones bootable nixos qcow2 image suitable for running with libvirt/qemu/kvm.
{ config, lib, pkgs, ... }:
with lib;
{
imports =
[
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
./machine-config.nix
];
@vidia
vidia / nginx-unificontroller.conf
Last active May 6, 2024 12:41
Example, working, NGINX config for proxying to Unifi Controller software and using letsencrypt. Includes websocket fix.
# I had a bit of trouble getting my unifi controller (hosted offsite) to use a proxy/letsencrypt. So here are the fruits of my labor.
# The unifi default port is 8443 running on localhost.
# License: CC0 (Public Domain)
server {
# SSL configuration
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
@nraynaud
nraynaud / Readme.md
Last active September 6, 2020 18:49
Unattended installation of Xenserver with iso file

Unattended installation of Xenserver with iso file

  • create answers.xml
  • unpack iso file
    mount sudo mount XenServer-7.1.0-s1-install-cd.iso /mnt
    mkdir newContent
    (cd /mnt; sudo tar cf - .) |  (cd newContent; tar xfp -)
@xbb
xbb / README
Last active April 17, 2024 20:21
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
@crisidev
crisidev / grafana-dashboard-exporter
Created October 7, 2015 20:35
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done
anonymous
anonymous / setup_kiosk.sh
Created November 6, 2014 17:17
create a kiosk user
#!/bin/bash
# This script
# - creates a user (named below)
# - sets up a union (aufs) filesystem on top of the users immutable home
# - creates a cleanup script (/usr/local/bin/cleanup.sh) that empties the aufs
# layer on login/logout/boot
# - replaces the lightdm config
# - replaces rc.local to run the script
#