Skip to content

Instantly share code, notes, and snippets.

@ciiqr
ciiqr / oof.ps1
Created May 23, 2019 00:05
Big oof
$wshell = New-Object -ComObject wscript.shell;
# $wshell.AppActivate('title of the application window')
while($TRUE)
{
Sleep 2
$wshell.SendKeys('~')
}
@ciiqr
ciiqr / 0-instructions.sh
Created May 14, 2019 16:24
vault broken authorized addrs
# start
docker-compose up -d
# curl from whitelisted container
docker-compose exec test-whitelisted curl 172.16.238.2:8300/v1/sys/health
# curl from blacklisted container
docker-compose exec test-blacklisted curl 172.16.238.2:8300/v1/sys/health --max-time 5
# curl from whitelisted container again (this will fail)
@ciiqr
ciiqr / helmify.sh
Created May 10, 2019 13:57
helmify .yaml files (for helmfile). CURRENTLY NOT WORKING DUE TO BuildDeps, and a few other issues
#!/usr/bin/env bash
cmd="$1"
chart="$2"
chart=${chart#*/}
prepare() {
mkdir -p "$chart/templates"
@ciiqr
ciiqr / main.tf
Created April 27, 2019 00:16
GCP private Cloud SQL minimal broken config
terraform {
required_version = ">= 0.11.13"
}
provider "google" {
project = "${local.project}"
region = "${local.region}"
}
provider "google-beta" {
@ciiqr
ciiqr / ansible.yml
Last active February 10, 2019 21:33
Ansible: Conditional Roles
- hosts: all
gather_facts: no
roles:
# Platforms
- { role: linux, when: platform == 'linux' }
- { role: osx, when: platform == 'osx' }
- { role: windows, when: platform == 'windows' }
# OS
- { role: ubuntu, when: distribution == 'ubuntu' }
- { role: void, when: distribution == 'void' }
@ciiqr
ciiqr / ansible.yml
Created February 10, 2019 04:43
Ansible: Optional role include
- name: Check for optional role
stat:
path: '{{ item }}/optional'
register: role_exists
loop: "{{ lookup('config', 'DEFAULT_ROLES_PATH') }}"
- include_role:
name: optional
when: true in role_exists.results | map(attribute='stat.exists')
# git commit with "branch: " prefix
git config --global alias.cmb '!f() { \
git cm "$(git rev-parse --abbrev-ref HEAD): $1" "${@:2}"; \
}; f'
@ciiqr
ciiqr / Jenkinsfile
Created September 27, 2018 12:46
Outline of a jenkins file that includes an automated deploy step with manual approval
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Build'
}
post {
always {
echo 'Build Cleanup'
@ciiqr
ciiqr / thrizen.grid
Last active September 7, 2018 13:04
Thrizen - Three column layout for GridMove
; thrizen
; Three column layout for GridMove.
[Groups]
NumberOfGroups = 5
; 2 wide - left [x|x| ]
[1]
TriggerTop = [Monitor1Top]
TriggerBottom = [Monitor1Height] * 1/16
@ciiqr
ciiqr / example-setup.php
Last active January 17, 2017 18:38
A very quick hack of this following to work with tideways and to be a standalone script that takes the raw output from tideways in json format https://github.com/tlevi/xh2cg
<?php
// This is just an example of how you could generate that json file in the first place (this is likely more complicated that you need, but is what I need)
if (PROFILE_MEMORY && function_exists('tideways_enable')) {
// Start profiler
tideways_enable(TIDEWAYS_FLAGS_MEMORY);
// Stop profiler on shutdown
register_shutdown_function(function() {