Skip to content

Instantly share code, notes, and snippets.

# Installs Maven 3.1.1
node.override['maven']['3']['version'] = "3.1.1"
node.override['maven']['3']['checksum'] = "077ed466455991d5abb4748a1d022e2d2a54dc4d557c723ecbacdc857c61d51b"
include_recipe 'maven'
@andrewfraley
andrewfraley / gist:fee28eaa91002f73c249
Last active August 29, 2015 14:23
Puppet loop scope
$letter = 'z'
$list = ['a', 'b', 'c']
$list.each |$item| {
if $item == 'b' {
$letter = 'b'
notify{"Letter: ${letter}": }
}
}
notify{"Letter: ${letter}": }
def organization = 'IT-Puppet'
def github_url = 'https://your-github-enterprise.local'
def page = 1
def linkHeader = 'rel="next"'
def pages = []
while (linkHeader =~ /.*rel="next"/ ) {
repoApi = new URL("${github_url}/api/v3/orgs/${organization}/repos?page=${page}")
bash 'extract_module' do
cwd ::File.dirname(src_filepath)
code <<-EOH
mkdir -p #{extract_path}
tar xzf #{src_filename} -C #{extract_path}
mv #{extract_path}/*/* #{extract_path}/
chown -R #{jboss_user}:#{jboss_user} #{extract_path}
find #{extract_path}/ -exec chmod g+w {} \;
EOH
not_if { ::File.exists?(extract_path) }
ark "zabbix_agent" do
name "zabbix"
url node['zabbix']['agent']['prebuild']['url']
owner node['zabbix']['agent']['user']
group node['zabbix']['agent']['group']
action :put
path "/opt"
strip_leading_dir false
has_binaries [ 'bin/zabbix_sender', 'bin/zabbix_get', 'sbin/zabbix_agent', 'sbin/zabbix_agentd' ]
notifies :restart, "service[zabbix_agentd]"
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection
Section "Files"
EndSection

Dashing dashboard for zabbix trigger

zabbix trigger zabbix trigger

This will provide the total number of alerts on triggers status

  • flash when there's an alert/triggers (color based on the zabbix trigger color format)
  • trigger = Warning, Average, High & Disaster
  • unacknowledge triggers
@andrewfraley
andrewfraley / ubuntu_template_cleanup.sh
Last active January 17, 2022 23:52
Used to do final cleanup on a Ubuntu 20.04 image template
# Apply updates and clear apt cache
echo "Applying updates and clearing apt cache"
apt update && apt -y upgrade && apt -y autoremove && apt clean
# Clear this to regen this file (you can't delete it). Otherwise DHCP will give the same IP to every system built with this
echo "Clearing /etc/machine-id"
truncate -s0 /etc/machine-id
echo "Running cloud-init clean"
cloud-init clean
@andrewfraley
andrewfraley / autohotkey_osx_shortcuts_for_windows.ahk
Last active March 31, 2023 01:32
add windows terminal alt+~ shortcut
; https://medium.com/@andrew.fraley/osx-like-keyboard-shortcuts-for-windows-10-113cfd532699
; https://gist.github.com/andrewfraley/1055b7411e0215c98a43fda25bb085d0
; alt = !
; win = #
#SingleInstance force
; Make ctrl-a and ctrl-e go to the end and beginning of lines by sending home and end keys
$^a::send {Home}
$^e::send {End}

Enable / Disable additional 3rd party cooling on the Dell r630 - by default a 3rd party pcie card will ramp up the fans

apt install ipmitool

Set Third-Party PCIe Card Default Cooling Response Logic To Disabled

ipmitool -I lanplus -H <IPADDRESS> -U <USERNAME> -P <PASSWORD> raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x00

Set Third-Party PCIe Card Default Cooling Response Logic To Enabled