Skip to content

Instantly share code, notes, and snippets.

View ladar's full-sized avatar

Ladar Levison ladar

View GitHub Profile
@ladar
ladar / centos-8-build-chronyd.sh
Last active January 20, 2022 02:06
Build and install chronyd and configure it to use NTP servers with NTS support on RHEL/CentOS and Oracle Linux v8.
#!/bin/bash -e
# Name: centos-8-chronyd-nts.sh
# Author: Ladar Levison
# Gist: https://gist.github.com/ladar/52e2deb0a46272ca0383839f2ec0a618
# Description: A simple script to compile chronyd 4.0 for RHEL, CentOS, or
# Oracle Linux version 8 using a disposable Vagrant box. Then install the
# the resulting RPM file, while configuring chronyd to use NTP servers with
# NTS support.
@ladar
ladar / centos-6-certbot.sh
Created November 5, 2020 12:27
Setup the TLS cert using the certbot, and renew using a cron job.
#!/bin/bash -eux
if [ -z $DOMAIN ]; then
tput setaf 1; printf "\n\nDOMAIN parameter needed by the apache-virthost module.\n\n"; tput sgr0
exit 1
fi
# Install git.
yum --quiet --assumeyes install wget git rsync perl-Git perl-Error
@ladar
ladar / router-graph-setup.sh
Last active January 20, 2022 02:06
Generate bandwidth graphs for an AT&T internet connection.
#!/bin/bash
# Name: router-graph-setup.sh
# Author: Ladar Levison
# Gist: https://gist.github.com/ladar/66d7657e9b88afc00d7f17c06f62bdbb
# Description: A simple script to setup the pieces need to poll a router
# status page, and record the bandwidth/packet statistics. Then generate
# graphs for those values. In other words, this will allow you to generate
# usage graphs for your AT&T internet connection by polling the router.
FILE: generic-alpine35-hyperv-1.9.4.box
CODE: 200
IP: 52.72.245.79
BYTES: 305311422
RATE: 24994795.000
TOTAL TIME: 12.215003
FILE: generic-alpine35-libvirt-1.9.4.box
CODE: 200
IP: 52.72.245.79
[ladar@host vagrant]$ ./simple.sh generic fedora28 vmware
++ dirname ./simple.sh
+ pushd .
++ pwd -P
+ BASE=/home/ladar/Data/vagrant
+ popd
+ cd /home/ladar/Data/vagrant
+ export VAGRANT_HOME=/home/ladar/Data/vagrant/vagrant.d/
+ VAGRANT_HOME=/home/ladar/Data/vagrant/vagrant.d/
[ladar@host vagrant]$ ./simple.sh generic arch vmware
++ dirname ./simple.sh
+ pushd .
++ pwd -P
+ BASE=/home/ladar/Data/vagrant
+ popd
+ cd /home/ladar/Data/vagrant
+ export VAGRANT_HOME=/home/ladar/Data/vagrant/vagrant.d/
+ VAGRANT_HOME=/home/ladar/Data/vagrant/vagrant.d/
@ladar
ladar / packvnc.sh
Created June 10, 2017 03:03
Shell script used to connect with the packer builds currently under construction.
#!/bin/bash
# Sudo is needed to find the vmware-vmx ports.
PORT=`sudo netstat -pnl 2>&1 | grep tcp | grep -E "vmware-vmx|qemu|qemu-kvm" | awk -F':' '{print $2}' | awk -F' ' '{print $1}' | grep -E "^59"`
for p in $PORT; do
#rpm -q virt-viewer &> /dev/null || (printf "\n\nA VNC port was detected, but the Virt Viewer doesn't appear to be available.\n\n" && exit 1)
#remote-viewer vnc://127.0.0.1:$p &> /dev/null &
rpm -q vinagre &> /dev/null || (printf "\n\nA VNC port was detected, but Vinagre doesn't appear to be available.\n\n" && exit 1)
vinagre --vnc-scale vnc://127.0.0.1:$p &> /dev/null &
#!/bin/bash
confirm_reboot() {
read -s -p "Should we reboot and see if the configuration changes worked? [y|N] " -n 1 ANSWER
if [[ $ANSWER =~ [YyNn]$ ]]; then echo $ANSWER;
else echo; fi
}
while true; do
diff -r 5504a985a4e0 -r f59397568d2b Makefile
--- a/Makefile Sat Nov 26 00:47:32 2016 -0600
+++ b/Makefile Sat Nov 26 01:03:59 2016 -0600
@@ -11,11 +11,11 @@
SHLIB_VERSION_HISTORY=
SHLIB_MAJOR=1
SHLIB_MINOR=0.0
-SHLIB_EXT=
-PLATFORM=dist
-OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-libunbound no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-ssl-trace no-ssl2 no-store no-unit-test no-weak-ssl-ciphers no-zlib no-zlib-dynamic static-engine