Skip to content

Instantly share code, notes, and snippets.

@andrearug
andrearug / _README.md
Created May 1, 2018 01:45 — forked from robinsmidsrod/_README.md
Embedded iPXE menu to choose which network adapter to boot from (autodetects up to 10 adapters)

Go into your git checkout folder of ipxe.

Save the below file as nic-menu.ipxe.

Build iPXE like this:

cd src && make EMBED=../nic-menu.ipxe && cd ..

Requirements: current iPXE as of 2013-08-01 (for proper behavior of autoboot with a network device specified, netX feature, PCI vendor/device ID display and inc command)

@andrearug
andrearug / vzdump-hook-script.pl
Created April 27, 2018 16:59
Perl script that uploads backup files to cloud storage using rclone, removes backups older then 1 week.
#!/usr/bin/perl -w
# example hook script for vzdump (--script option)
use strict;
print "HOOK: " . join (' ', @ARGV) . "\n";
my $phase = shift;
@andrearug
andrearug / gist:ca6481a5e57a7ae3df0e263922234257
Created April 19, 2018 03:13 — forked from overplumbum/gist:4473076
OpenVPN server as an LXC container
#!/bin/bash
set -ve
lxc-create -n vpn -t ubuntu
# ln -s /var/lib/lxc/vpn/config /etc/lxc/auto/vpn.conf
perl -i -ple 's/#lxc.aa_profile = unconfined/lxc.aa_profile = unconfined/' /etc/lxc/auto/vpn.conf
perl -i -ple 's/^exit 0/# exit 0/' /etc/rc.local
cat >>/etc/rc.local <<hello
mkdir -p /var/lib/lxc/vpn/rootfs/dev/net/
@andrearug
andrearug / readme.md
Created March 29, 2018 23:59
Private networking on ovh with proxmox

On your proxmox server edit /etc/interfaces and add a vmbr1 interface like so

auto lo
iface lo inet loopback

auto vmbr0
iface vmbr0 inet static
        address  167.114.101.88
 netmask 255.255.255.0
@andrearug
andrearug / promiscous_enable.sh
Created March 18, 2018 01:19 — forked from ryanmaclean/promiscous_enable.sh
Allow VMWare Fusion Promiscuous Mode on macOS Sierra
#!/bin/bash
sudo touch "/Library/Preferences/VMware Fusion/promiscAuthorized"
@andrearug
andrearug / ffmpeg-qsv-compile.md
Created November 16, 2017 02:23
Build FFmpeg with Intel's QSV-based encoders with Intel's Media SDK on Ubuntu 16.04

**

How to compile FFmpeg with Intel's QSV (h264_qsv) encoder(s) with Intel's Media SDK on Ubuntu:

**

Install required dependencies:

apt-get install gcc gobjc pkg-config libpthread-stubs0-dev

#!/bin/sh
# XenServer autostart script
# Use at your own risks
# Do not use with VMs using HA.
# Instructions:
# 1. Put this script in /root
# 2. Give execution permission: "chmod +x /root/xs_autostart.sh"
# 3. Add "@reboot /root/xs_autostart.sh" in root's crontab
# 4. Add the "autostart" to VM needing it
# 5. Add "autostart" in the descriptions of vApps needing it
@andrearug
andrearug / docker-compose-install.sh
Created May 19, 2017 16:32 — forked from marszall87/docker-compose-install.sh
Simple script for installing latest Docker Compose on CoreOS >= 717.0.0
#!/bin/bash
mkdir -p /opt/bin
curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
@andrearug
andrearug / cloud-config-static-ip.yml
Created May 8, 2017 01:17 — forked from raugustinus/cloud-config-static-ip.yml
coreos cloud-config static ip address with docker remote API
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAA.... you@example.com
coreos:
units:
- name: docker-tcp.socket
command: start
enable: yes
content: |