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

Digesting VMDK spec

Particularly, virtual disks types are very confusing. This document is an attempt to disentangle that and make easier the design of an implementation.

Flat or preallocated disk

  • Monolithic or one-file: Single flat extent with separate descriptor file. createType: monolithicFlat
  • Split or multiple files: 2gb preallocated extents or smaller, to account for file system limits. createType: 2GbMaxExtentFlat
  • VMFS (managed):
    • Zeroed: Thick (flat) disk on VMFS, with blocks zeroed on first use. createType: vmfsPreallocated
# 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"
/*
Big Brother File System
The point of this FUSE filesystem is to provide an introduction to
FUSE. It was my first FUSE filesystem as I got to know the
software; hopefully, the comments in this code will help people who
follow later to get a gentler introduction.
This might be called a no-op filesystem: it doesn't impose
filesystem semantics on top of any other existing structure. It
/* This work is licensed under Creative Commons GNU LGPL License.
License: http://creativecommons.org/licenses/LGPL/2.1/
Version: 0.9/modified to conform to commonjs modules pattern
Author: Stefan Goessner/2006
Web: http://goessner.net/
*/
var json2xml = (typeof exports === 'undefined')? {} : exports; // like commonjs
@c4milo
c4milo / yourservice.conf
Created April 25, 2011 18:05
upstart example script
# Ubuntu upstart file at /etc/init/yourservice.conf
pre-start script
mkdir -p /var/log/yourcompany/
end script
respawn
respawn limit 15 5
start on runlevel [2345]

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:
@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');
}),