Skip to content

Instantly share code, notes, and snippets.

View zanloy's full-sized avatar

Zan Loy zanloy

  • Charleston, SC
View GitHub Profile
@zanloy
zanloy / user-script.js
Last active September 2, 2021 02:03
A GM Script To Select "Amazon WebGov Cloud"
// ==UserScript==
// @name GotoGovCloud
// @version 1
// @grant none
// @include https://prod.adfs.federation.va.gov/adfs/ls/idpinitiatedsignon.aspx
// @require https://code.jquery.com/jquery-latest.min.js
// ==/UserScript==
(function() {
$('#idp_OtherRpRadioButton')[0].checked = true;
@zanloy
zanloy / download-va-certs.yaml
Last active February 21, 2020 16:59
[Install VA Root Certificates] This ansible playbook will download and install the VA root certificates. #va #work #ansible
---
- hosts: localhost
gather_facts: true
gather_subset: distribution
become: true
vars:
ca_path:
Alpine: /usr/local/share/ca-certificates
Ubuntu: /usr/local/share/ca-certificates
@zanloy
zanloy / movey.rb
Created January 3, 2020 13:25
[Movey] A simple ruby script to move a movie file to the correct location. #ruby
#!/usr/bin/ruby
require 'colorize'
require 'fileutils'
require 'highline/import'
require 'optparse'
exts = ['.avi', '.m4v', '.mkv', '.mp4', '.srt', '.sub']
# Loop through each ARGV
@zanloy
zanloy / caps_lock_to_control.reg
Last active June 26, 2018 20:07
Remap CapsLock to CTRL
# This will remap your capslock key to control in Windows.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
@zanloy
zanloy / db.rake
Created March 11, 2017 14:13 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
@zanloy
zanloy / disks.rb
Created September 10, 2013 16:58
To add a simple noatime to each ext3 mount point in Puppet.
require 'facter'
require 'augeas'
Facter.add('fstab_missing_noatime') do
list = []
Augeas::open do |aug|
aug.match("/files/etc/fstab/*[label()=~regexp('[0-9]+') and vfstype='ext3' and count(opt[.='noatime']) = 0]").each do |match|
list.push(match)
end
end
@zanloy
zanloy / body.html.erb
Created November 3, 2014 13:15
Systems Engineering MONitoring Script (SEMON)
<html>
<head>
<style>
ul {
margin: 0px;
list-style-type: none;
}
li {
margin: 0px;
}
@zanloy
zanloy / gensshkey.sh
Created September 24, 2014 11:27
Regenerate SSH host keys
#!/bin/bash
#Tested in RedHat but should work in other distros.
#set -x
rm -f /etc/ssh/ssh_host_key
rm -f /etc/ssh/ssh_host_key.pub
rm -f /etc/ssh/ssh_host_rsa_key
rm -f /etc/ssh/ssh_host_rsa_key.pub
rm -f /etc/ssh/ssh_host_dsa_key
@zanloy
zanloy / setup_git.rb
Created September 22, 2014 15:44
Setup git aliases
#!/usr/bin/env ruby
require 'optparse'
options = { :realm => :local }
OptionParser.new do |opts|
opts.on('-g', '--global', 'Set aliases globally') do
options[:realm] = :global
end