- lxd: 2.18-0ubuntu6
- lxc --version: 2.18
- host distro: Ubuntu 17.10 (Artful) with Kernel 4.13.0-19-generic
- container distro: Ubuntu 16.04.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euoE pipefail | |
# Redfish commands related to Virtual Media. | |
# Redfish doc reference: https://www.supermicro.com/manuals/other/RedfishRefGuide.pdf | |
export BMC_ADDRESS='' | |
export ISO_IMAGE=http://192.168.117.9:8080/ocp4-rwn-1-small.iso | |
export username_password='Administrator:superuser' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
USB_GPIO=21 | |
DELAY=1 | |
gpio_value="/sys/class/gpio/gpio${USB_GPIO}/value" | |
echo 0 > ${gpio_value} | |
sleep ${DELAY} | |
echo 1 > ${gpio_value} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATE=`date -Idate` | |
USER="root" | |
HOSTS=("<host1>" ... "<hostn>") | |
commit_single_host_to_git () | |
{ | |
local host=${1} | |
local backup_filename="backup-${host}-${DATE}.tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Hotplug trigger script. Put this in /etc/hotplug.d/iface, and ensure this file is backed up over upgrade. | |
[ "$ACTION" = ifup ] || exit 0 | |
[ "$INTERFACE" = wan ] || exit 0 | |
logger -t package_autoinstall "Checking for package autoinstallation due to $ACTION of $INTERFACE ($DEVICE)" | |
cd /root | |
./package_autoinstall.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# remove exited containers: | |
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v | |
# remove unused images: | |
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi | |
# remove unused volumes: | |
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Make sure AggregateImagePropertiesIsolation is enabled in nova.conf | |
scheduler_default_filters=AggregateImagePropertiesIsolation | |
# Restart all nova services on all controllers | |
# Create host aggregates | |
# For example one aggregate for ESX and one for KVM | |
nova aggregate-create ESX-AZ ESX-AZ | |
nova aggregate-create KVM-AZ KVM-AZ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSH agent autostart | |
SSH_ENV="$HOME/.ssh/environment" | |
function start_agent { | |
echo "Initialising new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" | |
. "${SSH_ENV}" > /dev/null | |
/usr/bin/ssh-add $HOME/.ssh/id_rsa; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Working Huawei E3372h-153 SETPORT mappings | |
replacing A1,A2 with FF turns off need for usb_modeswitch | |
AT^SETPORT="A1,A2;12,1,16,A1,A2" | |
^GETPORTMODE: TYPE: WCDMA: huawei,PCUI:0,MDM:1,NDIS:2,CDROM:3,SD:4, | |
AT^SETPORT="A1,A2;1,12,16,A1,A2" |