Skip to content

Instantly share code, notes, and snippets.

View solarmicrobe's full-sized avatar

Russell Parks solarmicrobe

View GitHub Profile
#
# Cookbook Name:: apache
# Recipe:: default
#
# Copyright 2012, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
package "apache2" do
#!/usr/bin/bash
# Gentoo prefix installation on Mac OS X (Mar. 2012)
# This script may be outdated soon.
# Please refer: http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml
export EPREFIX="$HOME/gentoo"
export PATH="$EPREFIX/usr/bin:$EPREFIX/bin:$EPREFIX/tmp/usr/bin:$EPREFIX/tmp/bin:$PATH"
curl -o bootstrap-prefix.sh 'http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/scripts/bootstrap-prefix.sh?format=txt'
@solarmicrobe
solarmicrobe / find-duplicate-files.rb
Created December 14, 2015 20:03 — forked from ma11hew28/find-duplicate-files.rb
Ruby script that finds identical (md5) files in all subdirectories (recursive)
require 'digest/md5'
hash = {}
Dir.glob("**/*", File::FNM_DOTMATCH).each do |filename|
next if File.directory?(filename)
# puts 'Checking ' + filename
key = Digest::MD5.hexdigest(IO.read(filename)).to_sym
if hash.has_key? key
@solarmicrobe
solarmicrobe / install.sh
Created January 19, 2016 04:50 — forked from netshade/install.sh
Chef Omnibus Installer w/ Gentoo Support
#!/bin/sh
if ! which chef-solo; then
if [ -e "/etc/gentoo-release" ]; then
mkdir -p /usr/portage
emerge --sync
emerge --oneshot portage
emerge -C perl-core/Module-Metadata
emerge -C perl-core/Parse-CPAN-Meta
emerge -C lang-dev/perl
emerge perl
@solarmicrobe
solarmicrobe / gist:b6c64664dfc665c8902e
Created January 19, 2016 15:40
Create tests for python-docx pytest suite
#!/usr/bin/env python
# Tag list
a = ['w:rStyle',
'w:rFonts',
'w:b',
'w:bCs',
'w:i',
'w:iCs',
'w:caps',
'w:smallCaps',
@solarmicrobe
solarmicrobe / backup_to_local.sh
Created January 19, 2017 01:25
Backup remote /etc/letsencrypt to local
#!/bin/sh
# $1 - [user@]server
rsync -O -e 'ssh -p 22' -rltgoDvz $1:/etc/letsencrypt/ /etc/letsencrypt
#!/bin/bash
# Promethus SuSE system startup script
# Copyright (C) 2017 Russell Parks, Bats Global Markets, Inc.
# /etc/init.d/prometheus
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
### BEGIN INIT INFO
# Provides: prometheus
# Required-Start: $network $remote_fs
@solarmicrobe
solarmicrobe / is_cert_expiring.sh
Last active May 3, 2017 13:46
Determine if SSL cert is about to expire
#!/usr/bin/env sh
# http://stackoverflow.com/questions/21297853/how-to-determine-ssl-cert-expiration-date-from-a-pem-encoded-certificate
# Usage: is_cert_expiring.sh [/path/to/cert/file.pem [seconds]]
1=${1:file.pem} # File path
2=${2:-86400} # Seconds to expiry
if openssl x509 -checkend $2 -noout -in $1; then
echo "Certificate is good for another day!"
else
echo "Certificate has expired or will do so within 24 hours!"
echo "(or is invalid/not found)"
@solarmicrobe
solarmicrobe / add_zerotier.sh
Last active September 13, 2021 17:29
Add zerotier to FreeNAS
#! /usr/bin/env sh
NETWORKS="8056c2e21c000001" # Space seperated list of networks to join, default here is the public network Earth
VERSION=1.2.4
wget http://pkg.freebsd.org/freebsd:11:x86:64/latest/All/zerotier-${VERSION}.txz -O /tmp/zerotier-${VERSION}.txz
pkg add -f /tmp/zerotier-${VERSION}.txz
for n in $NETWORKS; do
zerotier-cli join ${n}
@solarmicrobe
solarmicrobe / marid.sh
Created August 18, 2017 19:27
Marid shell init.d script for SuSE 11SP4
#!/bin/bash
### BEGIN INIT INFO
# Provides: marid
# Required-Start: $network $named $remote_fs $syslog
# Required-Stop: $network $named $remote_fs $syslog
# Should-Start:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: marid
# Description: marid