Skip to content

Instantly share code, notes, and snippets.

View robbmanes's full-sized avatar
🎮
pew pew

Robb Manes robbmanes

🎮
pew pew
View GitHub Profile
# sctp_init_timeou_test
Quick method of testing timeouts and connectivity of basic SCTP sockets.
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#define INCORRECT_FD_SET_SIZE 500
int main(int argc, char **argv)
{
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#define IGNORE_ALL_SIGNALS 1
void signal_loop(int sig);
int main(int argc, char **argv)
@robbmanes
robbmanes / robbbmod_sept_7.c
Created September 8, 2016 14:30
Half Day Linux Kernel Module, shows usage of timers in kernel fairly well but otherwise useless
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/time.h>
#include <linux/timer.h>
#define TEN_SECS_IN_MS 10000
#define WORK_BEFORE 1473336000
#define WORK_AFTER 1473350400
# ONLY TWO CELLS IN USE
# CELL1 IS A LOOP COUNTER
# CELL2 IS ASCII VALUE TO PRINT
# YOU ARE CORRECT THAT THIS IS BAD AND UNOPTIMIZED
# I SHOULD HAVE LOOPED MORE INSTEAD OF BASIC COUNTING
# WHATEVER
###############################################################################
# OPERATION: PRINT 'R' AS ASCII 82
@robbmanes
robbmanes / unretire_service.rb
Created January 9, 2018 14:22
ManageIQ Unretire Service Tool
# cd /var/www/miq/vmdb/
# bundle exec rails runner tools/unretire_service.rb <service name>
require 'logger'
module UnretireService
class Cli
attr_accessor :options
def parse(args, env = {})
@robbmanes
robbmanes / join_vmware_providers.rb
Last active September 23, 2020 13:01
Join two Vmware providers in ManageIQ
# GPLv2 License
# =====================
#
# Copyright © 2018 Robb Manes <[email protected]>
#
# join_vmware_providers is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
@robbmanes
robbmanes / ansible_auth_test.rb
Last active September 14, 2018 18:24
Ansible Tower API authentication test
require 'logger'
require 'rest-client'
require 'ansible_tower_client'
require 'json'
module AnsibleTestSuite
class AnsibleTest
TOWER_URL = "https://my-tower-address.com"
TOWER_USER = "admin"
TOWER_PASSWORD = "tower_password"
@robbmanes
robbmanes / miq_add_ansible_tower_prov.rb
Created September 19, 2018 14:55
Add Ansible Tower Provider to ManageIQ or CloudForms
# This script adds an Ansible Tower Automation Manager to an existing CloudForms or ManageIQ instance.
# Fill in the required constansts for both Ansible Tower and CloudForms/ManageIQ
require 'rest-client'
require 'json'
CFME_URL = "https://my-manageiq.com"
CFME_USER = "admin"
CFME_PASSWORD = "smartvm"
TOWER_NAME = "my-ansible-tower-provider"
@robbmanes
robbmanes / running_coredns_as_a_dns_server_in_a_container.md
Last active March 13, 2019 09:20
Running CoreDNS as a DNS Server in a Container
title published description tags
Running CoreDNS as a DNS Server in a Container
true
How to manually configure CoreDNS to serve your own DNS zones and
dns, coredns, container, docker

This article is published at:

If you've ever needed to or wanted to set up your own DNS server, then this is for you. I recently found myself in possession of a Raspberry Pi, and instead of relying on my home router for DHCP and DNS, I decided to serve both from containers on the Pi, so I could resolve all of my hosts with their respective names when I VPN back to my network. I intended to have all other requests forwarded to another server that weren't in my local network, but still service local systems with my customized hostnames.