Skip to content

Instantly share code, notes, and snippets.

View qubitrenegade's full-sized avatar
☂️
Building castles of abstractions

qubitrenegade

☂️
Building castles of abstractions
View GitHub Profile
@qubitrenegade
qubitrenegade / Freenas 11.2 Setup.md
Last active August 23, 2021 01:25 — forked from zenxedo/TrueNAS Setup.md
Ultimate FreeNAS 11.2 Setup

FreeNAS 11.2

WARNING This page contains incomplete and possibly incorrect info. The page is constantly being edited and worked on. Many of these should work but some may be broken. Read the code carefully to understand what you are doing, stuff may be nedd to be changed for your use. Use at your own risk.

Credit for IOCAGE setup goes to https://forums.freenas.org/index.php?resources/fn11-1-iocage-jails-plex-tautulli-sonarr-radarr-lidarr-jackett-ombi-transmission-organizr.58/

*** QBRD note: I have chosen different names for my zvol and so. I HAVE TRIED TO USE THE NAMES DESCRIBBED IN "Setup" SECTION! Please be aware of copy/paste errors where my actual zvol name may be used.

@qubitrenegade
qubitrenegade / gist:06da3bae5d09ccadc4522b1162790c21
Created September 21, 2019 03:19 — forked from TeWu/gist:1234573
TCP client and multithreaded server in 14 lines of Ruby code

TCP client and multithreaded server in 14 lines of Ruby code

Server:

require "socket"
server = TCPServer.open(2626)
loop do
	Thread.fork(server.accept) do |client| 
 client.puts("Hello, I'm Ruby TCP server", "I'm disconnecting, bye :*")
@qubitrenegade
qubitrenegade / .config
Created August 14, 2019 05:18
fedora 30 kernel 5.2.8 config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.2.8 Kernel Configuration
#
#
# Compiler: gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1)
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=90101
@qubitrenegade
qubitrenegade / prepend.rb
Created August 7, 2019 05:07
Prepend example of "safe" monkeypatching
class Foo
def initialize
puts '[*] In Foo#initialize'
@foo = ['Added in intialize in Foo']
end
def foo
puts '[*] In Foo#foo: '
pp @foo
puts "[*] foo.class: #{@foo.class}"
@qubitrenegade
qubitrenegade / homeserver.yaml
Last active August 1, 2019 06:23
Configuring Matrix and Riot for Private Chat
## Server ##
# When running as a daemon, the file to store the pid in
pid_file: "/var/run/matrix-synapse.pid"
public_baseurl: https://matrix.example.com/
allow_public_rooms_without_auth: true
allow_public_rooms_over_federation: true
#federation_domain_whitelist:
# - lon.example.com
@qubitrenegade
qubitrenegade / vfio-pci-override.sh
Last active July 17, 2019 03:16
VFIO Setup Scripts
#!/bin/sh
set -u
for boot_vga in /sys/bus/pci/devices/*/boot_vga; do
echo "Found vga device: ${boot_vga}"
if [ $(<"${boot_vga}") -eq 0 ]; then
echo "Found Boot VGA Device - false: ${boot_vga}"
dir=$(dirname -- "${boot_vga}")
@qubitrenegade
qubitrenegade / my-hab.te
Created August 26, 2018 10:07
Habitat Type Enforcement for SELinux on Fedora 28 - THIS IS UNVERIFIED!!! DON'T USE THIS!
module my-hab 1.0;
require {
type init_t;
type tmp_t;
type default_t;
type http_port_t;
class sock_file { create write };
class process setpgid;
class file { create execute execute_no_trans map open read rename setattr unlink write };
# frozen_string_literal: true
# The MIT License (MIT)
#
# Copyright:: 2017, QubitRenegade
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@qubitrenegade
qubitrenegade / Consul Semaphore Example
Created January 22, 2018 20:24
This bash script attempts to create and lock a Semaphore using Consul's session and KV Store
# This is an example based on: https://www.consul.io/docs/guides/semaphore.html
# And https://github.com/hashicorp/consul/issues/1940
# we want to see how our variables resolve to URLs
set -x
# Set up some variables
SERVICE=foobartest
PREFIX=service/${SERVICE}/lock
LOCK=${PREFIX}/.lock
@qubitrenegade
qubitrenegade / default.rb
Created September 13, 2017 17:57
Testing an Ohai Plugin generated from Template using burtlo/chefspec-ohai to test
# recipes/default.rb
ohai_plugin 'consul' do
resource :template
variables config_var: node['my_cookbook']['some_important_var']
end