Packer
-
Packer is used to build image from a base image, perform provisions and store (commit) the final image.
-
We use provisioners and Packer templates to do the actual work to create the final image.
-
We use Ansible for provisioning.
'use strict'; | |
module.exports = (pluginContext) => | |
{ | |
function search(query, res) | |
{ | |
var d = new Date(query * 1000); | |
res.add( | |
{ | |
id: '1', |
dl_require(['puppeteer', 'fs', 'fast-csv']).then(_modules => { | |
const puppeteer = _modules.puppeteer; | |
const fs = _modules.fs; | |
const fast_csv = _modules['fast-csv']; | |
let main_url = 'https://example.com/'; | |
let parsed = []; | |
let parsed_pages = []; | |
let need_parse = [main_url]; | |
let browser = null; |
type T struct { | |
A int | |
B string | |
} | |
t := T{23, "skidoo"} | |
s := reflect.ValueOf(&t).Elem() | |
typeOfT := s.Type() | |
for i := 0; i < s.NumField(); i++ { |
python -c "from random import choice; print ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789%^*(-_=+)') for i in range(32)])" |
#!/bin/bash | |
# | |
## -----------------------------=[ WARNING ]=-------------------------------- ## | |
# | |
# This script is now woefully out of date due to which accounts ESXi allows to | |
# ssh into the box as well as sticky folders/file flags. | |
# I've since ported the whole thing to python with a lot of bells and whistles | |
# and if i get around to making it public, i'll put a link here. | |
# | |
## -------------------------------=[ Info ]=--------------------------------- ## |
# Add this snippet to the top of your playbook. | |
# It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
# gwillem@gmail.com | |
- hosts: all | |
gather_facts: False | |
tasks: | |
- name: install python 2 | |
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |
#! /bin/bash | |
# This script runs on os x. | |
SITES=( "speedtest-lon1.digitalocean.com" \ | |
"speedtest-sfo1.digitalocean.com" \ | |
"speedtest-ams1.digitalocean.com" \ | |
"speedtest-ams2.digitalocean.com" \ | |
"speedtest-nyc1.digitalocean.com" \ | |
"speedtest-nyc2.digitalocean.com" \ |
#!/bin/bash | |
TARGET="mysite.example.net"; | |
RECIPIENT="hostmaster@mysite.example.net"; | |
DAYS=7; | |
echo "checking if $TARGET expires in less than $DAYS days"; | |
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \ | |
| openssl x509 -text \ | |
| grep 'Not After' \ | |
|awk '{print $4,$5,$7}')" '+%s'); | |
in7days=$(($(date +%s) + (86400*$DAYS))); |
Packer
Packer is used to build image from a base image, perform provisions and store (commit) the final image.
We use provisioners and Packer templates to do the actual work to create the final image.
We use Ansible for provisioning.
// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/ | |
// Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work, | |
// but I can't make any promises about the quality of the algorithm's estimates above 40000 K.) | |
function colorTemperatureToRGB(kelvin){ | |
var temp = kelvin / 100; |