Skip to content

Instantly share code, notes, and snippets.

Working from home

Chris Fidao fideloper

Working from home
View GitHub Profile
View twitterFollowerCuratorBot.php
// File: twitterFollowerCuratorBot.php
// Created: May 2021
// License: MIT
fideloper /
Last active Dec 30, 2020
Find, format, and mount an AWS Ephemeral NVMe disk within ec2 in user data
#!/usr/bin/env bash
## This mounts a (single) ephemral NVMe drive in an EC2 server.
## It's meant to be run once, within user-data
## For EBS drives (non-ephemeral storage), see:

Each query in MySQL is running as its own transaction, assuming you didn't change this default configuration, and unless you're starting a transaction manually and running multiple deletes in that one transaction.

Because every query is a transaction, MySQL has to save the data being deleted in case of a rollback. Large deletes means saving a TON of data for that potential case.

Additionally, deletes cause a LOT of writes to the binary log. When the delete completes, the query/results of the delete are committed to the binary log,

fideloper / client.hcl
Created Aug 5, 2020
Nomad job spec for jippi/go-metadataproxy
View client.hcl
# Nomad 0.12.0+ requires volumes to be enabled
# within the client configuration
plugin "docker" {
config {
volumes {
enabled = true

The pipeline could use a selection of pre-set features.


  1. Give the pipeline more polish by allowing users to "build" their pipeline (preset items they can run)
  2. Make Chipper feel more integrated with services such as AWS, Forge, Envoyer, Vapor
  3. Make it easier to script more complex items such as conditional actions, or creating build artifacts

It might be nice to have a way to have icons for each as well - PHP, NodeJS, Composer, Dusk, Vapor, etc etc etc.

View prom.yml
- name: node_rules
- record: instance:node_cpu:avg_rate5m
expr: 100 - avg (irate(node_cpu_seconds_total{job="helpspot-cloud", mode="idle"}[5m])) by (instance) * 100
View coverage.php
#!/usr/bin/env php
// coverage-checker.php
$inputFile = $argv[1];
$percentage = min(100, max(0, (int) $argv[2]));
if (!file_exists($inputFile)) {
throw new InvalidArgumentException('Invalid input file provided');
fideloper /
Last active Nov 17, 2019
update sqlite on ubuntu 18.04 to version 2.30
#!/usr/bin/env bash
# Reference:
# Go to a known directory so we can cleanup files later
cd ~
# Download
fideloper / .zshrc
Created Jun 21, 2019
Defer loading of NVM to increase new terminal init speed
View .zshrc
# Thanks to, modified
# for zsh as "type -t" works in bash but not zsh
# Add this to your .zshrc ...
# Defer initialization of nvm until nvm, node or a node-dependent command is
# run. Ensure this block is only run once if .bashrc gets sourced multiple times
# by checking whether __init_nvm is a function.
if [ -s "$HOME/.nvm/" ] && [ ! "$(type -w __init_nvm | awk '{print $2}')" = function ]; then
fideloper /
Created Dec 19, 2018
Quick and dirty monitoring of mysql connections
#!/usr/bin/env bash
# 5 minutes between alerts
# Track when we sent the last alert
while true; do
NUMBER_CONNECTIONS=$(mysql --defaults-extra-file=/data/.prod.cnf -sNe "select count(*) as connection_count from INFORMATION_SCHEMA.PROCESSLIST;")