My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
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
<?php | |
/* | |
Plugin Name: Enable/Disable plugins when doing local dev | |
Plugin URL: https://gist.github.com/pbiron/52bb63042cf220256ece89bc07fb57b0 | |
Description: If the WP_LOCAL_DEV constant is true, enables/disables plugins that you specify | |
Version: 0.1 | |
License: GPL version 2 or any later version | |
Author: Paul V. Biron/Sparrow Hawk Computing | |
Author URI: https://sparrowhawkcomputing.com | |
*/ |
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
FROM alpine | |
COPY configure-node.sh configure-node.sh | |
CMD ["/bin/sh", "configure-node.sh"] |
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
Tags: | |
- Key: Name | |
Value: | |
!Join ['_', [ ec2, "Fn::ImportValue" : {"Fn::Sub":'${BaseStackName}-Environment'}, test2]] | |
#This will create a name tag with value: ec2_<yourValueFromOtherStack>_test2 |
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
package de.tdlabs.idm.keycloak.ext.authentication; | |
import static java.time.LocalDateTime.now; | |
import static java.util.Arrays.asList; | |
import java.util.List; | |
import org.jboss.logging.Logger; | |
import org.keycloak.Config.Scope; | |
import org.keycloak.authentication.RequiredActionContext; |
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
# How to build docker images (NIX_PATH and hydra cache required when building off master branch) | |
# export NIX_PATH=$HOME/dev | |
# nix-build --option extra-binary-caches http://hydra.nixos.org/ test-docker.nix | xargs -n1 docker load -i | |
with import <nixpkgs> {}; | |
rec { | |
# 1. basic example | |
bash = dockerTools.buildImage { | |
name = "bash"; |
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
#!groovy | |
# Best of Jenkinsfile | |
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins | |
node { | |
} |
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 python | |
import sys | |
import argparse | |
import ansible.constants as C | |
import ansible.inventory | |
import subprocess | |
def get_inventory(subset_pattern): |
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
from ansible.inventory.ini import InventoryParser | |
import os | |
from pycommand.command import Command, SubCommand | |
# | |
_CHECK_SESSION = "tmux has-session -t {session} 2> /dev/null " | |
_NEW_SESSION = "tmux new-session -d -s {session} '{ssh}'" | |
_NEW_WINDOW = "tmux new-window -t {session} '{ssh}'" | |
_ATTACH_SESSION = "tmux attach-session -t {session}" |
This example splits namespaces into different files, but that's likely overkill for most uses. Shoving everything in a Rakefile
would work fine too.
To use this:
cd /tmp
mkdir raketest
cd raketest
touch Rakefile
mkdir rakelib
NewerOlder