Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am acidprime on github.
  • I am acidprime (https://keybase.io/acidprime) on keybase.
  • I have a public key whose fingerprint is 9829 92A9 FDE7 8A1F 22ED E632 629C F2D6 FC72 3376

To claim this, I am signing this object:

@acidprime
acidprime / configuration.yaml
Last active February 20, 2021 03:34
Razor Server Cloud Init Broker
---
certname:
description: "Cloud-init key"
apt_sources:
description: "Cloud-init key"
apt_update:
description: "Cloud-init key"
groups:
description: "Cloud-init key"
@acidprime
acidprime / .README.md
Last active February 10, 2021 23:53
Getting GDM to open ssh:// links that resolve to docker containers (or any other ssh link).

Docker Exec SSH Passhthrough

User Clicks SSH Link

This is an example of setting up a Ubuntu 18.04 and a GDM3 installation to allow test users the ability to click on ssh links to automatically login to docker containers running on the users local system.

Test Environment

I used a vagrant file here for testing, you can use it via the following commands.

@acidprime
acidprime / ca.sh
Last active February 12, 2021 18:16
Centos 7 Puppet Kickstart file
#!/bin/bash -x
rm -rf ca
rm -rf certs
mkdir -p ca
openssl genrsa -out ca/ca_key.pem 2048
openssl rsa -in ca/ca_key.pem -pubout -out ca/ca_pub.pem
openssl req \
-x509 \
-new \
-nodes \
@acidprime
acidprime / install_docker_mac.sh
Last active July 24, 2018 18:20
Install docker on mac
#!/bin/bash
if [ ! -d /Applications/Docker.app/ ] ; then
curl https://download.docker.com/mac/stable/Docker.dmg -o /tmp/docker.dmg
hdid /tmp/docker.dmg
cp -Rvp /Volumes/Docker/Docker.app /Applications/
umount /Volumes/Docker
open /Applications/Docker.app
else
echo "Docker is already installed"
fi
@acidprime
acidprime / deploy.yml
Created August 18, 2017 18:38
A simple ansible script to deploy a custom docker image to synology
#!/usr/bin/env ansible-playbook -vvv -i mute.wallcity.org, --ask-pass --ask-become-pass
################################################
# Manual steps to get this working on synology
# Get around sftp chroot
# ln -s /var/services/homes /homes
# Trust the internet far too much
# wget https://bootstrap.pypa.io/get-pip.py
# sudo python get-pip.py
# Install the actual dependacy
# pip install docker-py
@acidprime
acidprime / list_unifi_names.rb
Last active July 31, 2017 07:45
FIrst stab at listing, then eventually replacing unifi names in the database.
#!/usr/bin/env ruby
require 'mongo'
begin
conn = Mongo::Connection.new('localhost', 27117,{})
db = conn['ace']
db.collections.each do |collection|
if collection.name == 'user'
#puts collection.find(name: 1).inspect
#!/bin/bash
CERTNAME=$(puppet master --configprint certname)
# Revoke
curl \
--verbose \
-X PUT \
-H "Content-Type: text/pson" \
@acidprime
acidprime / build_scripts.rb
Created April 10, 2017 16:37
Build shell scripts out of markdown code fences
#!/usr/bin/env ruby
DEBUG = false
require 'kramdown'
@markdown_file = ARGV[0]
text = File.read(@markdown_file)
doc = Kramdown::Document.new(text, input: 'GFM')
@acidprime
acidprime / puppet_classes.rb
Created March 16, 2017 20:49
A fact for showing the classes in classes.txt
#!/usr/bin/ruby
# curl -G http://localhost:8080/v3/facts/puppet_classes
require 'facter'
require 'json'
hostname = Facter.value(:hostname)
classes_txt = '/var/opt/lib/pe-puppet/classes.txt'
Facter.debug(classes_txt)
if File.exists?(classes_txt) then