This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMAGE_NAME = "bento/ubuntu-16.04" | |
N = 2 | |
Vagrant.configure("2") do |config| | |
config.ssh.insert_key = false | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 1024 | |
v.cpus = 2 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH RECURSIVE traversed (id, name, path, `left`, `right`) AS ( | |
SELECT id, | |
name, | |
CAST(JSON_ARRAY(id) AS JSON), | |
`left`, | |
`right` | |
FROM binary_tree | |
WHERE id = 1 | |
UNION | |
SELECT b.id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
authorized_pubkeys: | |
- ../vars/public_keys/[email protected] | |
- ../vars/public_keys/[email protected] | |
revoked_pubkeys: | |
- ../vars/public_keys/webstores-management-key.pub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
vars_files: | |
- ../vars/public_keys.yml | |
tasks: | |
- name: Linux users authorized public keys | |
authorized_key: | |
user: "{{ ansible_user }}" | |
state: present |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: yes | |
vars_files: | |
- var.yaml | |
tasks: | |
- name: add a admin group | |
group: name=admin state=present | |
- name: add a new user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
Send Redis usage metrics to CloudWatch | |
''' | |
import redis | |
import json | |
import boto3 | |
import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Split the array into halves and merge them recursively | |
function mergeSort(array) { | |
if (array.length === 1) { | |
// Return once we hit an array with a single item | |
return array | |
} | |
// Get the middle item of the array rounded down by creating a variable | |
const middle = Math.floor(array.length / 2) | |
// Create a variable for the items on the left side |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anon=# SELECT | |
anon-# SUM(impressions) | |
anon-# FROM direct_delivery_items; | |
sum | |
-------------- | |
544642902932 | |
(1 row) | |
Time: 19853.941 ms -- base line measurement | |
anon=# SELECT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH params AS ( | |
-- Parameters for down stream queries | |
SELECT | |
15 AS bucket_count, | |
80 AS max_bars | |
), | |
numbers AS ( | |
-- Change this query to select real data. | |
-- For now we make random set of numbers. | |
SELECT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: add users | |
user: | |
name: "{{ item.name }}" | |
state: present | |
groups: "{{ item.groups }}" | |
shell: /bin/bash | |
with_items: "{{ users }}" | |
- name: add authorized keys |
NewerOlder