Skip to content

Instantly share code, notes, and snippets.

@socketwench
socketwench / deploy.yml
Created June 22, 2021 13:18
Flight Deck Cluster ingress with HTTPAuth
---
- hosts: stage
vars:
flightdeck_cluster:
namespace: "example-com"
secrets:
- name: "ingress-auth"
data:
- name: "auth"
value: "{{ lookup('file', _run_temp_dir.path + '/.htpasswd' )}}"
@socketwench
socketwench / gist:46b5a3cdbe7d604264ee122619d712b0
Created June 10, 2021 15:34
Flightdeck Cluster snippet to set up a subpath redirect
- name: Create ingress for jquery_countdown_background redirects
include_role:
name: "ten7.flightdeck_cluster"
vars:
flightdeck_cluster_kubeconfig: "{{ _run_temp_dir.path }}/kubectl.yaml"
flightdeck_cluster:
namespace: "ten7-com"
ingress:
name: "jquery-countdown-background-redirects"
permanentRedirect: "https://github.com/ten7/jquery_countdown_background"
@socketwench
socketwench / gist:e71d78c76a9eb85458fbfcc2e2f2d0de
Created June 10, 2021 15:30
Flightdeck Cluster snippet to set up an canonical redirect
- name: Create ingress for redirects
include_role:
name: "ten7.flightdeck_cluster"
vars:
flightdeck_cluster_kubeconfig: "{{ _run_temp_dir.path }}/kubectl.yaml"
flightdeck_cluster:
namespace: "deninet-com"
ingress:
name: "deninet-redirects"
permanentRedirect: "https://deninet.com$request_uri"
@socketwench
socketwench / Dockerfile
Created May 8, 2021 03:16
Install MySQL python lib on Ansible k8s operator
FROM quay.io/operator-framework/ansible-operator:latest
COPY requirements.yml ${HOME}/requirements.yml
RUN ansible-galaxy collection install -r ${HOME}/requirements.yml \
&& chmod -R ug+rwx ${HOME}/.ansible
COPY watches.yaml ${HOME}/watches.yaml
COPY roles/ ${HOME}/roles/
COPY playbooks/ ${HOME}/playbooks/
@socketwench
socketwench / yourtheme.theme
Created November 9, 2020 04:37
Drupal 8: Add view_mode to block templates, add view mode to template suggestions.
/**
* Implements hook_preprocess_HOOK().
*/
function yourtheme_preprocess_block(&$variables) {
$content = $variables['elements']['content'];
if (isset($content['#block_content']) && $content['#block_content'] instanceof BlockContentInterface) {
$variables['view_mode'] = $content['#view_mode'];
}
}
@socketwench
socketwench / docker-compose.yml
Created June 24, 2020 20:29
A hacky way to add Min.io as a container for locally run Flight Deck
version: '3'
services:
minio:
image: minio/minio
container_name: minio
networks:
default:
aliases:
- flightdeck.minio
volumes:
@socketwench
socketwench / MyNodeWithField.php
Created March 6, 2018 16:34
Drupal 8 migration source to pull a node if a field is set or not
<?php
namespace Drupal\my_migrate_common\Plugin\migrate\source;
use Drupal\migrate\Row;
use Drupal\node\Plugin\migrate\source\d7\Node as D7_Node;
/**
* Source for node content depending on if a field is set or not.
*
autoload -Uz compinit promptinit
compinit
# Path to your oh-my-zsh installation.
ZSH=/usr/share/oh-my-zsh/
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.

Blog ideas

Space realism movies Compared

This would be a comparison of several "space realism" movies, such as 2001, Moon, Gravity, Interstellar, Europa Report. If I've seen Life by then, I'll throw that in too.

"Interstellar" review three years later

I did a podcast of the film when it originally came out, now I revisit it. How does it hold up? Did the recent changes in the US political situtation affect my perception of the film? Why Mann being the anti-progressive strawman was a huge missed opportunity for a more nuanced message.

@socketwench
socketwench / php.ini
Created October 7, 2016 16:04
Docker for Mac make PHPStorm Debugging Work
zend_extension = /usr/local/lib/php/extensions/xdebug.so
xdebug.remote_enable=On
#
# Create an alias on your local for this to work.
#
# sudo ifconfig lo0 alias 10.254.254.254
#
xdebug.remote_host=10.254.254.254
xdebug.remote_port=9000
xdebug.max_nesting_level = 400