Skip to content

Instantly share code, notes, and snippets.

@dominic-p
dominic-p / failure.log
Created June 12, 2021 06:12
Trow authorization issue logs
Command
$ sudo crictl --debug pull --creds test:test trow-svc.trow.svc.cluster.local:8000/test/nginx:alpine
DEBU[0000] get image connection
DEBU[0000] connect using endpoint 'unix:///var/run/crio/crio.sock' with '2s' timeout
DEBU[0000] connected successfully using endpoint: unix:///var/run/crio/crio.sock
DEBU[0000] PullImageRequest: &PullImageRequest{Image:&ImageSpec{Image:trow-svc.trow.svc.cluster.local:8000/test/nginx:alpine,Annotations:map[string]string{},},Auth:&AuthConfig{Username:test,Password:test,Auth:,ServerAddress:,IdentityToken:,RegistryToken:,},SandboxConfig:nil,}
DEBU[0000] PullImageResponse: nil
FATA[0000] pulling image: rpc error: code = Unknown desc = unable to retrieve auth token: invalid username/password: unauthorized: authentication required
@dominic-p
dominic-p / duplicate-ids.txt
Last active April 15, 2020 18:27
Torture test for flake-idgen
2 6656223438904049664
2 6656223438904049665
2 6656223438904049666
2 6656223438904049667
2 6656223438904049668
2 6656223438904049669
2 6656223438904049670
2 6656223438904049671
2 6656223438904049672
2 6656223438904049673
@dominic-p
dominic-p / zfs-dkms-fix.sh
Last active September 1, 2023 18:25
A simple script to automate rebuilding ZFS related DKMS modules after a kernel upgrade. USE WITH CAUTION.
#!/bin/sh
#
# --- zfs-dkms-fix.sh ---
#
# This script automates the process of fixing ZFS after a kernel
# update. See: https://github.com/zfsonlinux/zfs/issues/3801
###################################################################
# Get the current ZFS and SPL module versions
modversion=$(dkms status | cut -d , -f 2 | tail -n 1 | xargs)
var head = document.getElementsByTagName('head')[0];
var script_1 = document.createElement('script');
script_1.src = "http://udacity-crp.herokuapp.com/time.js?rtt=1&a";
head.appendChild(script_1);
var script_2 = document.createElement('script');
script_2.src = "http://udacity-crp.herokuapp.com/time.js?rtt=1&b";
head.appendChild(script_2);
@dominic-p
dominic-p / query-string-update.js
Last active August 29, 2015 14:01
JavaScript Query String Parameter Update and Test Suite
/**
* JavaScript Query string replacement function and test suite.
*
* The function is designed to add or update a query string parameter in a given
* URL. If all of the tests pass, the function should be pretty good.
*/
var test_val = 'new',
test_uris = [
[ 'http://example.com/', 'http://example.com/?param=' + test_val ],
[ 'http://example.com/?', 'http://example.com/?param=' + test_val ],
@dominic-p
dominic-p / website-checker.sh
Last active April 13, 2022 16:03
This is a shell script to check a provided list of URLs to see if the websites are working or not. It was based on the answers provided to this question: http://stackoverflow.com/q/21391776/931860
#!/bin/sh
# ---- website-checker.sh ----
# Pings a list of websites using cURL to see if they are up and
# there are no errors. If there are problems, we send an email using mailx
# to let ourselves know about the problem.
################################################################################
# Recipient of the errors email
admin_email=youremail@host.com
@dominic-p
dominic-p / functions.php
Last active December 17, 2015 01:09
Filter to hide protected pages in the admin list table from users who aren't qualified to edit them.
/*
List some protected pages and then prevent unqualified
users from seeing them.
*/
function admin_hide_protect_pages( $q ) {
global $pagenow, $wpdb;
// Bail out if we have the proper permissions or we aren't on the right page
if ( !is_admin()
|| 'edit.php' != $pagenow
@dominic-p
dominic-p / jquery.colorfade.js
Last active July 29, 2016 19:53
A super simple jQuery plugin to fade one color into another on selected elements. It seems to work, but there are some things I'd like to improve:- Add transparency (rgba) handling in an intelligent way, right now it defaults to white, but it would be nice if it could default to transparent without sacrificing old browser support and without blo…
/*
Color Fade
Requires: jQuery 1.7.1+ (probably much lower)
Description: Simple color animation. Fades one color into another on the selected element(s)
Arguments:
- target (object) The target color in this format [r,g,b] defaults to white or yellow if fade_settings.flash is true
- fade_settings (object) See code for documentation