Skip to content

Instantly share code, notes, and snippets.

@hellt
hellt / vifmove.sh
Last active April 1, 2022 00:06
Virsh interface move
#!/bin/bash
# usage ~/vifmove.sh <virsh_domain_name/id> <interface_name> <new_bridge_name>
tmpxml=$(mktemp /tmp/ifcfg.XXX)
macaddr="$(virsh domiflist $1 | awk "/$2\s/ {print \$NF}")"
cat > "$tmpxml" <<EOF
<interface type='bridge'>
<mac address='$macaddr'/>
<source bridge='$3'/>
<model type='virtio'/>
</interface>
@stefansundin
stefansundin / openssh-7.3.sh
Last active September 13, 2022 21:03
Install OpenSSH 7.3 in Ubuntu 16.04
# WARNING: Use this at your own risk. It will probably break your other packages and cause other havoc.
# These days you should just upgrade to Ubuntu 18.04.
$ ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016
wget https://launchpadlibrarian.net/277739251/openssh-client_7.3p1-1_amd64.deb
wget https://launchpadlibrarian.net/298453050/libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453058/libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453060/libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
#!/usr/bin/env bash
# Loads and mounts an ISO over SMB via the
# SuperMicro IPMI web interface
#
# usage: supermicro-mount-iso.sh <ipmi-host> <smb-host> <path>
# e.g.: supermicro-mount-iso.sh 10.0.0.1 10.0.0.2 '\foo\bar\windows.iso'
set -x