Skip to content

Instantly share code, notes, and snippets.

View miketheman's full-sized avatar

Mike Fiedler miketheman

View GitHub Profile
flip(inputInt) {
return inputInt = 1 - inputInt;
}
void main() {
print(flip(0));
print(flip(1));
}
@miketheman
miketheman / _how_to.md
Last active June 4, 2020 20:44
Mike's Super Janky Manual GitHub Vuln Alert Query

How To

Prerequsites:

  • GitHub account with admin-level rights to repos, possibly even org-level admin.
  • Command Line familiarity
  • jq tool

Note: Commands have been written assuming a macOS machine, they may work on other platforms, but I haven't tested those.

@miketheman
miketheman / installer.log
Last active February 22, 2020 18:53
chefdk-0.7.0-rc.2-1.dmg failure log
Jul 11 10:16:27 wing Installer[99257]: LSExceptions [0x7f857ac0cbb0] loaded
Jul 11 10:16:27 wing Installer[99257]: @(#)PROGRAM:Install PROJECT:Install-1000
Jul 11 10:16:27 wing Installer[99257]: @(#)PROGRAM:Installer PROJECT:Installer-852
Jul 11 10:16:27 wing Installer[99257]: Hardware: MacBookAir6,1 @ 1.70 GHz (x 4), 8192 MB RAM
Jul 11 10:16:27 wing Installer[99257]: Running OS Build: Mac OS X 10.11 (15A215h)
Jul 11 10:16:27 wing Installer[99257]: Env: __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
Jul 11 10:16:27 wing Installer[99257]: Env: TMPDIR=/var/folders/78/3jyqdny925n348fpr6wh23bc0000gn/T/
Jul 11 10:16:27 wing Installer[99257]: Env: HOME=/Users/miketheman
Jul 11 10:16:27 wing Installer[99257]: Env: SHELL=/bin/bash
Jul 11 10:16:27 wing Installer[99257]: Env: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.C1W3TcCVzf/Listeners
@miketheman
miketheman / linux_entropy.py
Created December 31, 2015 21:11
Datadog Agent Linux Entropy Available
from checks import AgentCheck
class LinuxEntropyCheck(AgentCheck):
def check(self, instance):
with open('/proc/sys/kernel/random/entropy_avail', 'r') as procfile:
data = procfile.read().strip()
self.gauge('system.kernel.entropy_available', int(data))
@miketheman
miketheman / main.dart
Last active January 18, 2020 15:02
round duration to closer second, for a countdown clock - https://dartpad.dartlang.org/2a08161c5f889e018938316237c0e810
void main() {
Duration duration = new Duration(minutes: 1, seconds: 59, milliseconds: 99);
print(secondRounder(duration));
}
// Rounds Duration to seconds based on milliseconds
// This is semi-equivalent to a non-existing `Duration.ceil(milliseconds)`
Duration secondRounder(Duration duration) {
int roundedDuration;
@miketheman
miketheman / datadog-role-delegation.tf
Last active August 12, 2019 19:38
Datadog AWS Integration Automated Setup
# Read more about variables and how to override them here:
# https://www.terraform.io/docs/configuration/variables.html
variable "aws_region" {
type = "string"
default = "us-east-1"
}
variable "shared_secret" {
type = "string"
default = "SOOPERSEKRET"
@miketheman
miketheman / datadog-role-delegation.json
Created May 18, 2016 22:22
Datadog AWS Integration Automated Setup - CloudFormation
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"SharedSecret": {
"Default": "SOOPASEKRET",
"Description": "Shared Secret, aka External ID",
"Type": "String",
"NoEcho": "true"
}
},
@miketheman
miketheman / datadog-agent-pi-setup.sh
Last active September 2, 2018 03:32
Datadog Agent 5.x Service on Raspberry Pi
DD_API_KEY=<REPLACE> sh -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/setup_agent.sh)"
sudo mkdir /opt/datadog-agent
sudo cp -r ~/.datadog-agent/* /opt/datadog-agent
path=$HOME
path=${path//\//\\\/}
sedcmd="s/$path\/.datadog-agent/\/opt\/datadog-agent/g"
for i in /opt/datadog-agent/venv/bin/*; do echo $i; sudo sed -i $sedcmd $i; done
@miketheman
miketheman / clouddns_to_route53.rb
Created May 24, 2015 15:05
Tool to migrate DNS records from Rackspace Cloud DNS to AWS Route53
require 'aws-sdk'
require 'fog'
require 'pry'
# The top-level domain name/hosted zone
TOP_DOMAIN = 'example.org'
# A simple Change class, repsenting a single change to end up in Route53
class Change
attr_accessor :name
@miketheman
miketheman / user.sh-session
Last active March 22, 2018 11:43
Show direct URL to a pacakge without the repo being enabled, using `repoquery` - http://linux.die.net/man/1/repoquery
$ sudo yum install yum-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.ash.fastserv.com
* extras: mirror.lug.udel.edu
* updates: mirrors.seas.harvard.edu
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.30-17.el6_5 will be installed