Skip to content

Instantly share code, notes, and snippets.

View c4milo's full-sized avatar
:octocat:

Camilo Aguilar c4milo

:octocat:
View GitHub Profile
#!/bin/env bash
# Before contributing to this file, please make sure your IDE has
# the Shellcheck plugin installed.
# It is also important to keep this script under 1MB since we store it
# in a k8s configmap.
set -o errexit
set -o nounset
set -o pipefail
set -x

Title

The title should be the name of the alert (e.g., Generic Alert_AlertTooGeneric).

Overview

Address the following: What does this alert mean? Is it a paging or an email-only alert? What factors contributed to the alert? What parts of the service are affected? What other alerts accompany this alert? Who should be notified?

Alert Severity

Indicate the reason for the severity (email or paging) of the alert and the impact of the alerted condition on the system or service.

### Keybase proof
I hereby claim:
* I am c4milo on github.
* I am c4milo (https://keybase.io/c4milo) on keybase.
* I have a public key ASANtMIZIWn4tKekhNXgVvegPHByOhtnIR5udnqT0E0lFgo
To claim this, I am signing this object:
# this is a bag of functions sourced by another script
if [[ $BASH_VERSINFO -lt "4" ]]; then
echo "!! Your system Bash is out of date: $BASH_VERSION"
echo "!! Please upgrade to Bash 4 or greater."
exit 2
fi
if [[ $EUID -ne 0 ]]; then
echo "!! This script must be run as root"
#!/bin/sh
if [ "$1" == "initgroups" ]; then
echo "$2"
else
/usr/bin/getent1 "$@"
fi
c4milo at camilompb in ~/work/src/github.com/hooklift/lift on master [!]
$ curl --head -vvv https://github.com/lift-plugins/auth/releases/download/v1.2.2/auth_v1.2.2_darwin_amd64.sha512 --location
* Trying 192.30.253.113...
* TCP_NODELAY set
* Connected to github.com (192.30.253.113) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: github.com
* Server certificate: DigiCert SHA2 Extended Validation Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> HEAD /lift-plugins/auth/releases/download/v1.2.2/auth_v1.2.2_darwin_amd64.sha512 HTTP/1.1
@c4milo
c4milo / httpclient.go
Last active August 3, 2017 05:35
HTTP client with support for read and write timeouts which are missing in Go's standard library.
package httpclient
import (
"context"
"net"
"net/http"
"time"
)
// DialContextFn was defined to make code more readable.
{
"list": {
"node": {
"id": "ubuntu",
"claimed": "true",
"class": "system",
"handle": "DMI:0001",
"description": "Project-Id-Version: lshwReport-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>POT-Creation-Date: 2009-10-08 14:02+0200PO-Revision-Date: 2012-10-07 14:34+0000Last-Translator: lumingzh <flywaterzh@gmail.com>Language-Team: Chinese (Simplified) <zh_CN@li.org>MIME-Version: 1.0Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: 8bitX-Launchpad-Export-Date: 2014-07-07 12:12+0000X-Generator: Launchpad (build 17086)",
"product": "VMware Virtual Platform ()",
"vendor": "VMware, Inc.",
@c4milo
c4milo / component.js
Last active June 4, 2018 00:56
Simple breadcrumb Ember 2 component.
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '', // Does not let Ember inject HTML into the component.
routing: Ember.inject.service('-routing'),
breadcrumbs: Ember.computed('routing.currentRouteName', function () {
let routeName = this.get('routing.currentRouteName');
let routeNames = routeName.split('.');
let len = routeNames.length;
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '', // Does not let Ember inject HTML into the component.
routing: Ember.inject.service('-routing'),
breadcrumbs: Ember.computed('routing.currentRouteName', function () {
console.log('--> current route: %s', this.get('routing.currentRouteName'));
Ember.getOwner(this).lookup('route:' + this.get('routing.currentRouteName')).label;
this.get('routing.router');
}),