Skip to content

Instantly share code, notes, and snippets.

Building castles of abstractions


Building castles of abstractions
View GitHub Profile
qubitrenegade / gist:06da3bae5d09ccadc4522b1162790c21
Created Sep 21, 2019 — forked from TeWu/gist:1234573
TCP client and multithreaded server in 14 lines of Ruby code
View gist:06da3bae5d09ccadc4522b1162790c21

TCP client and multithreaded server in 14 lines of Ruby code


require "socket"
server =
loop do
	Thread.fork(server.accept) do |client| 
		client.puts("Hello, I'm Ruby TCP server", "I'm disconnecting, bye :*")
qubitrenegade / .config
Created Aug 14, 2019
fedora 30 kernel 5.2.8 config
View .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)
qubitrenegade / prepend.rb
Created Aug 7, 2019
Prepend example of "safe" monkeypatching
View prepend.rb
class Foo
def initialize
puts '[*] In Foo#initialize'
@foo = ['Added in intialize in Foo']
def foo
puts '[*] In Foo#foo: '
pp @foo
puts "[*] foo.class: #{@foo.class}"
qubitrenegade / homeserver.yaml
Last active Aug 1, 2019
Configuring Matrix and Riot for Private Chat
View homeserver.yaml
## Server ##
# When running as a daemon, the file to store the pid in
pid_file: "/var/run/"
allow_public_rooms_without_auth: true
allow_public_rooms_over_federation: true
# -
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 / Freenas 11.2
Last active Jan 9, 2021 — forked from zenxedo/TrueNAS
Ultimate FreeNAS 11.2 Setup
View Freenas 11.2

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

*** 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 / my-hab.te
Created Aug 26, 2018
Habitat Type Enforcement for SELinux on Fedora 28 - THIS IS UNVERIFIED!!! DON'T USE THIS!
View my-hab.te
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 };
View Rakefile
# 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 / Consul Semaphore Example
Created Jan 22, 2018
This bash script attempts to create and lock a Semaphore using Consul's session and KV Store
View Consul Semaphore Example
# This is an example based on:
# And
# we want to see how our variables resolve to URLs
set -x
# Set up some variables
qubitrenegade / default.rb
Created Sep 13, 2017
Testing an Ohai Plugin generated from Template using burtlo/chefspec-ohai to test
View default.rb
# recipes/default.rb
ohai_plugin 'consul' do
resource :template
variables config_var: node['my_cookbook']['some_important_var']