Skip to content

Instantly share code, notes, and snippets.

View arlando's full-sized avatar

Arlando Battle arlando

View GitHub Profile
@arlando
arlando / schema.json
Created May 23, 2024 14:54
coredns schema
{
"addonName": "coredns",
"addonVersion": "v1.10.1-eksbuild.7",
"configurationSchema": "{\"$ref\":\"#/definitions/Coredns\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"definitions\":{\"Coredns\":{\"additionalProperties\":false,\"properties\":{\"affinity\":{\"default\":{\"affinity\":{\"nodeAffinity\":{\"requiredDuringSchedulingIgnoredDuringExecution\":{\"nodeSelectorTerms\":[{\"matchExpressions\":[{\"key\":\"kubernetes.io/os\",\"operator\":\"In\",\"values\":[\"linux\"]},{\"key\":\"kubernetes.io/arch\",\"operator\":\"In\",\"values\":[\"amd64\",\"arm64\"]}]}]}},\"podAntiAffinity\":{\"preferredDuringSchedulingIgnoredDuringExecution\":[{\"podAffinityTerm\":{\"labelSelector\":{\"matchExpressions\":[{\"key\":\"k8s-app\",\"operator\":\"In\",\"values\":[\"kube-dns\"]}]},\"topologyKey\":\"kubernetes.io/hostname\"},\"weight\":100}]}}},\"description\":\"Affinity of the coredns pods\",\"type\":[\"object\",\"null\"]},\"computeType\":{\"type\":\"string\"},\"corefile\":{\"description\":\"Entire core
@arlando
arlando / ansible-cheatsheet.md
Last active March 11, 2017 18:55
Ansible cheat sheet

Notes from Ansible

List All Hosts in the Inventory File

A quick way to get a list of all the servers Ansible is aware of:

ansible -i hosts all --list-hosts

Execute Arbitrary Commands On Servers

@arlando
arlando / split.js
Created February 19, 2015 17:45
split.js
#!/usr/bin/env node
var split = require('split');
var crypto = require('crypto');
var md5 = require('MD5');
var Transform = require('stream').Transform;
var util = require('util');
var fs = require('fs');
var wstream = fs.createWriteStream('filtered3.tsv');

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@arlando
arlando / twittersample.js
Last active August 29, 2015 14:13
twit sample
var Twit = require('Twit');
var config = {
//my config
};
var T = new Twit(config);
var filterStream;
function filter() {
filterStream = T.stream('statuses/filter', openStreamOptions);
var
Connection = require('../lib/Connection');
var c = new Connection();
c.on('connect', function() {
console.log('Connection :: connect');
});
c.on('ready', function() {
var promptDataCallCount = 0;
console.log('Connection :: ready');
@arlando
arlando / Bind.js
Created December 5, 2014 19:30
How to bind collection/model events to a Backbone.View
//TODO
@arlando
arlando / bus.js
Created December 5, 2014 19:13
How to extend Node's EventEmitter
'use strict';
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var Bus;
var bus;
Bus = function () {
EventEmitter.call(this);
var self = this;
#!/bin/bash
#
# initd-example Node init.d
#
# chkconfig: 345 80 20
# description: Node init.d example
# processname: node
# pidfile: /var/run/initd-example.pid
# logfile: /var/log/initd-example.log
#
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28