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 | |
echo "Starting reboot sequence: $*" | |
echo "" | |
thisHost=False | |
user=root | |
if [ "$*" != "" ] | |
then | |
for i in $* | |
do |
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 | |
if [ ! -d ~/.autologon ] | |
then | |
mkdir -p ~/.autologon | |
fi | |
if [ "$1" == "enable" ] | |
then | |
cat /lib/systemd/system/getty@.service > ~/.autologon/lastexec | |
sed -i '/^ExecStart/s/ExecStart.*/ExecStart=-\/sbin\/agetty --autologin root --noclear %I/' /lib/systemd/system/getty@.service | |
if [ ! "$2" == "" ] |
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
#!/usr/bin/python | |
import argparse | |
parser = argparse.ArgumentParser(description='Libvirt based VM builder') | |
parser.add_argument('--name', '-n', action="store", dest="name", required=True, help='Name of the service') | |
parser.add_argument('--description', '-d', action="store", dest="description", default=None, required=False, help='Descriprion of the service') | |
parser.add_argument('--command', '-c', action="store", dest="command", required=True, help='Bash command to execute') | |
results = parser.parse_args() | |
if results.description == None: | |
results.description = results.name | |
template = ''' |
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
## Onboard SD Card is --------> /dev/disk/by-path/pci-0000:00:1d.0-usb-0:1.3.1:1.0-scsi-0:0:0:0 | |
## Leftmost disk is ----------> /dev/disk/by-path/pci-0000:00:1f.2-ata-1.0 | |
## Center-leftmost disk is ---> /dev/disk/by-path/pci-0000:00:1f.2-ata-1.1 | |
## Center-rightmost disk is --> /dev/disk/by-path/pci-0000:00:1f.2-ata-2.0 | |
## Rightmost disk is ---------> /dev/disk/by-path/pci-0000:00:1f.2-ata-2.1 | |
auth --enableshadow --passalgo=sha512 | |
url --url=http://mirror.centos.org/centos/7/os/x86_64/ | |
#url --url=http://192.168.1.254:8080/CentOS-7-x86_64-Everything-1708.iso | |
repo --name="epel" --baseurl=http://download.fedoraproject.org/pub/epel/7/x86_64 | |
repo --name="mariadb" --baseurl=http://yum.mariadb.org/10.1/centos7-amd64 |
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
auth --enableshadow --passalgo=sha512 | |
url --url=http://mirror.centos.org/centos/7/os/x86_64/ | |
text | |
firstboot --enable | |
keyboard --vckeymap=us --xlayouts='us' | |
lang en_US.UTF-8 | |
rootpw --iscrypted $1$changeme$Gc5uJM96SM5XUZNUcieKS/ | |
services --enabled="chronyd" | |
timezone America/Denver --isUtc | |
reboot |
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 | |
<< COMMENT | |
If you are using lab rPi's or rhel-based/debian-based vagrant machines, | |
this should install the serf binary, install a few support packages as well | |
as a demo tool that uses serf as well as a side-car service. | |
COMMENT | |
## Settings | |
URL=https://releases.hashicorp.com/serf/0.8.1/serf_0.8.1_linux_amd64.zip | |
[[ -f /etc/rpi-issue ]] && URL=https://releases.hashicorp.com/serf/0.8.1/serf_0.8.1_linux_arm.zip |
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
#!/usr/bin/python3 | |
import smbus | |
import time | |
import os | |
import sys | |
import logging | |
logging.basicConfig(filename='/var/log/power-monitor.log', | |
filemode='a', | |
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s', |
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
<html> | |
<body> | |
<script> | |
while(true); | |
</script> | |
</body> | |
</html> |
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
nmcli --terse con show | cut -d':' -f2 | xargs -I {} nmcli con delete {} | |
nmcli con add type bridge con-name bridge0 ifname bridge0 | |
nmcli con add type bond con-name bond0 ifname bond0 bond.options "downdelay=100,miimon=100,mode=active-backup,updelay=100" master bridge0 | |
nmcli device status | awk '/ethernet/{print $1}' | xargs -I {} nmcli con add type ethernet con-name {} ifname {} master bond0 |