Skip to content

Instantly share code, notes, and snippets.

View chanslor's full-sized avatar
😃
Focusing

Mike Chanslor chanslor

😃
Focusing
  • DevOps Engineer
  • Birmingham, ALABAMA
View GitHub Profile
@whiskerz007
whiskerz007 / gist:53c6aa5d624154bacbbc54880e1e3b2a
Last active January 3, 2024 00:08
How to setup a community version of Proxmox VE 5.x-6.x
# Disable Commercial Repo
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/pve-enterprise.list
apt-get update
# Add PVE Community Repo
echo "deb http://download.proxmox.com/debian/pve $(grep "VERSION=" /etc/os-release | sed -n 's/.*(\(.*\)).*/\1/p') pve-no-subscription" > /etc/apt/sources.list.d/pve-no-enterprise.list
apt-get update
# Remove nag
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script
@Decstasy
Decstasy / args_parser.sh
Last active January 16, 2024 18:42
Parse Bash arguments without getopts or getopt
#!/bin/bash
# Dennis Ullrich
# Version 0.1-0 (2017-06-29)
# request@decstasy.de
# Bash Version 3 required (it also works with ksh)
[[ ${BASH_VERSINFO[0]} -lt 3 ]] && exit 1
# Defaults
stdin=0
@jlsherrill
jlsherrill / virt-who hypervisor -guest list.md
Created January 17, 2017 16:50
virt-who hypervisor -guest list
foreman-rake console 
hypervisors = Katello::Host::SubscriptionFacet.all.select{|i| i.candlepin_consumer.consumer_attributes['type']['label'] == 'hypervisor' }

hypervisors.each do |hypervisor|
  guests = hypervisor.candlepin_consumer.virtual_guests
  puts "#{hypervisor.host.name} - #{hypervisor.host.id} - #{guests.count} guest(s)"
 guests.each do |guest|
@drmalex07
drmalex07 / getopt-example.sh
Last active May 3, 2024 03:03
A small example on Bash getopts. #bash #getopt #getopts
#!/bin/bash
#
# Example using getopt (vs builtin getopts) that can also handle long options.
# Another clean example can be found at:
# http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt
#
aflag=n
bflag=n
@jonjensen
jonjensen / rpmdb-compare
Created September 27, 2013 10:29
Script to compare installed RPMs between two servers using ssh and the rpm command.
#!/bin/sh
test -n "$TMPDIR" || TMPDIR=/tmp
tmpfilebase="$TMPDIR/rpmdb-compare.$$"
if test $# -ne 2
then
echo "Usage: $0 [user@]server1 [user@]server2" >&2
echo "Special name localhost means this server, without ssh" >&2
exit 1
@NapoleonWils0n
NapoleonWils0n / meld_over_ssh.sh
Created November 11, 2012 01:16
ssh: meld over ssh
#!/bin/sh
# ==============================================
# = Using meld to compare directories over ssh =
# ==============================================
# Set up a ssh public private key and copy to your server
meld <(ssh 192.168.1.2 ls Desktop) <(ls Desktop)
@devlaers
devlaers / Circle.java
Created October 23, 2011 22:28
This program creates a GUI with 7 rectangels randomly spaced in the window. If a rectangel is outlined in red and you click on it a random shape will appear on that rectangle. If the shape is clicked again it will disapper. If you click on a reactangle
// Name: Rachael Devlaeminck
// Assignment: Lab 06
// Title: Linked Lists in a Graphical Window Manager
// Course: CSCE 270
// Lab Section: Section 1
// Semester: Fall 2010
// Instructor: David Wolff
// Date: 10/20/10
// Sources consulted: Professor Wolff
// Program description: creates windows and lets you add random shapes to the