Skip to content

Instantly share code, notes, and snippets.

@heug
heug / deployAction.sh
Created August 25, 2022 06:16
create a mabl deployment and do something based on the results
#!/bin/bash
####################
# user vars #
####################
API_KEY='MY_API_KEY'
DEPLOYMENT_DATA='{"environment_id":"MY_ENV_ID-e,"application_id":"MY_APP_ID-a"}'
####################
@heug
heug / mablFindElementLazyLoad.js
Last active August 25, 2022 04:58
mabl function to scroll down a page once at a time and search for an element and innerText
/**
* @NOTE - This is a snippet will not work in Internet Explorer.
*/
function mablJavaScriptStep(mablInputs, callback) {
// ## Values that one could parameterize ##
let elementSelector = ".contents-genre-ranking .contents-more--center .btn--emphasis";
let elementText = "ランキング一覧";
// Call the "scrollDown" function once every second
@heug
heug / nomad_logs.sh
Last active December 16, 2019 09:36
Shell script to collect Nomad stderr logs for each job. Recommended to run through cron on a 5-10 minute interval.
# bash script to collect Nomad stderr (aka outer build container) logs
# run via cron on 5-10 minute interval, please ensure you turn off this service after usage
#! /bin/bash
set -eu
output_dir="nomad-stderr-logs"
nomad_log_dir_max_bytes=1073741824
@heug
heug / generate_logs.sh
Created September 27, 2018 18:21
Get all docker logs & replicated logs.
#! /bin/bash
# Please run as root user!
set -eu
output_dir="container-logs"
timestamp=$(date +%s)
generate_logs() {
@heug
heug / README
Last active January 14, 2020 06:53
Hautelook debug
# Hautelook experienced an outage where their services crashed overnight (no particular elevated build volume.
# They attempted a restart and received errors such as:
### - Timeout waiting for event Migrator Finished - VM Service
### - Timeout waiting for event Migrator Finished - Permissions Service
### - Timeout waiting for event Postgresql 9.4 ready-5432
#
# Weirdly enough, the container logs for each of those looked to be just fine. Replicated logs would show the timeout errors, however.
# Doing the Replicated dance did not fix the issue, so I had them nuke all existing images and containers and reinstall Replicated.
# Good to reassure them that no data will be destroyed through all this.
@heug
heug / circleci-database-export
Created January 30, 2018 17:26
circleci ha database export script
#!/bin/bash
##
# CircleCI Database Export Script
#
# This script is for installations running CircleCI server 2.0 or higher.
#
# This script will create a tar ball of the PostgreSQL and Mongo databases.
# This should generally be used when you are planning on switching from
# the default embedded databases to an external database source.
@heug
heug / Dockerfile
Created September 28, 2017 22:45
triggermail
FROM circleci/golang:1.9-browsers
USER root
RUN apt-get update
RUN apt-get install zlib1g-dev \
# mysql
default-libmysqlclient-dev mysql-server \
# lxml
libxml2 libxml2-dev libxslt1.1 libxslt1-dev \
@heug
heug / Dockerfile_node-browsers
Last active August 31, 2017 22:27
ezCater Dockerfiles
FROM heug/ruby-trusty:2.3.3-1
USER root
## BEGIN CIRCLECI PREAMBLE
# make Apt non-interactive
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \
&& echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci
@heug
heug / dockerfile_ruby-2.3.3
Created August 30, 2017 19:26
ezcater dockerfiles
FROM ubuntu:14.04
USER root
## TOOLS
RUN apt-get update && apt-get install wget xz-utils autoconf build-essential zlib1g-dev apt-transport-https libssl-dev curl libreadline-dev -y
## END TOOLS
@heug
heug / config.yml
Last active July 13, 2017 21:17
FundThatFlip
version: 2
references:
container_config: &container_config
working_directory: ~/root
docker:
- image: heug/docker-images:fundthatflip # replace with your dockerhub image
environment:
PGHOST: 127.0.0.1
PGUSER: root