Skip to content

Instantly share code, notes, and snippets.

View michaeljs1990's full-sized avatar

Michael Schuett michaeljs1990

View GitHub Profile
@michaeljs1990
michaeljs1990 / gist:6265916
Last active December 21, 2015 06:39
Shortcode Example
<?php //always use <?php because <? will be depricated in php 6.0
// [defaultButton text="My Button"]
// This would display the bootstrap button with the text My Button inside it.
function bootstrapDefaultBTN( $atts ) {
extract( shortcode_atts( array(
'text' => 'Button',
), $atts ) );
@michaeljs1990
michaeljs1990 / output.txt
Created April 10, 2016 22:27
example dpkg-buildpackage output
dpkg-buildpackage: source package mylittledeb
dpkg-buildpackage: source version 0.0.1-1
dpkg-buildpackage: source distribution trusty
dpkg-buildpackage: source changed by root <root@unknown>
dpkg-buildpackage: host architecture amd64
dpkg-source --before-build mylittledeb
debian/rules clean
dh clean
dh_testdir
dh_auto_clean
#!/bin/bash
#
# Copyright (c) 2014, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@michaeljs1990
michaeljs1990 / output.txt
Last active May 28, 2017 19:30
python ??
False
<type 'NoneType'>
kernel
False
<type 'NoneType'>
instance_profile
False
<type 'unicode'>
root_device_type
False
@michaeljs1990
michaeljs1990 / promql.sh
Created December 10, 2018 17:42
PromQL CLI
#!/bin/bash
# Basic: HOSTNAME=prom.something.com ./promql.sh '(time() - puppet_time{type="last_run"}) > 4801'
# Getting something useful out from this looks like this. Best used in combination with JQ.
# Complete: HOSTNAME=prom.something.com ./promql.sh '(time() - puppet_time{type="last_run"}) > 4801' | jq '.data.result[] | .metric.host'
curl \
-X GET \
-G \
-s \
--data-urlencode "query=$1" \
@michaeljs1990
michaeljs1990 / ipmi.rb
Created January 7, 2019 21:50
Ruby IPMI Collins Script
#!/usr/bin/env ruby
# Fetch root credentials for ipmi login to server
require 'collins_client'
require 'yaml'
@collins_config = Dir.home + "/.collins.yaml"
@hostname = ARGV.shift
@cmd = ARGV.shift
@user_num = ARGV.shift
@michaeljs1990
michaeljs1990 / asset.json
Created February 7, 2019 23:29
GPU Collins Asset
{
"status": "success:ok",
"data": {
"ASSET": {
"ID": 9,
"TAG": "tumblrtag304",
"STATE": {
"ID": 1,
"STATUS": null,
"NAME": "NEW",
@michaeljs1990
michaeljs1990 / Makefile
Created May 13, 2019 04:42
Golang Release Makefile (Gox like with only linux utils)
BINS_DIR = bins
VERSION = $(shell git describe --tag --dirty)
SRC = $(shell find . -type f -name '*.go')
# Set the GOOS and GOARCH here in GOOS_GOARCH format
PLATFORMS = \
linux_amd64
BINS_OUT = $(patsubst %, $(BINS_DIR)/$(VERSION)/jsonnet-%, $(PLATFORMS))
@michaeljs1990
michaeljs1990 / example.proto
Created July 28, 2020 07:25 — forked from miguelmota/example.proto
Golang protobuf marshal and unmarshal example
syntax = "proto3";
message Message {
bytes text = 1;
}
@michaeljs1990
michaeljs1990 / main.go
Created July 17, 2020 05:26
Bleve _source example
package main
import (
"bytes"
"encoding/gob"
"fmt"
"github.com/blevesearch/bleve"
"github.com/blevesearch/bleve/document"
"github.com/blevesearch/bleve/index/scorch"