Skip to content

Instantly share code, notes, and snippets.

J. Elliot Taylor jaytaylor

Block or report user

Report or block jaytaylor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jaytaylor
jaytaylor / delete-from-v2-docker-registry.md
Last active Dec 12, 2019
One liner for deleting images from a v2 docker registry
View delete-from-v2-docker-registry.md

One liner for deleting images from a v2 docker registry

Just plug in your own values for registry and repo/image name.

registry='localhost:5000'
name='my-image'
curl -v -sSL -X DELETE "http://${registry}/v2/${name}/manifests/$(
    curl -sSL -I \
        -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
@jaytaylor
jaytaylor / react-unexpected-use-of-location.md
Created Jul 12, 2017
Solution for "Unexpected use of 'location'" React error.
View react-unexpected-use-of-location.md
React: Unexpected use of 'location';

Solution: Use window.location instead of bare location.

@jaytaylor
jaytaylor / ._README.md
Last active Dec 3, 2019
Use google.com timestamp to set Linux system clock (useful when proxies prevent NTP
View ._README.md

set_system_clock_from_google.sh

Sets system time based on what is reported by google.com. Useful for cases where it is not possible to use the standard ntpdate command. For eample, if a Linux machine is on a network which is only able to reach the internet through an HTTP proxy.

Inspired by ryenus' answer @ https://superuser.com/a/807326/72342

Installation

# Download latest set_system_clock_from_google.sh script.
@jaytaylor
jaytaylor / zfs-on-oracle-linux-7.md
Last active Nov 16, 2019 — forked from RulerOf/zfs-on-oracle-linux-7.md
Installing ZFS on Linux on Oracle Linux 7
View zfs-on-oracle-linux-7.md

Installing ZFS on Linux on Oracle Linux 7

We're going to add ZFS support to our Oracle Linux installation. We'll just add the ZFS on Linux Repo, verify the binary signature from GitHub, install the files, ensure the driver loads properly, and verify that it's functional. We'll save things like array creation for another document.

This is mostly a transcription of the process from the CentOS/RHEL ZoL installation manual.

Install the repo file

Add the ZFSonLinux repo and verify the fingerprint.

Note — manual fingerprint verification is atypical but we'll do it anyway just for kicks.

@jaytaylor
jaytaylor / ubuntu-18.04-web-server-init.sh
Created Nov 3, 2019
Common Ubuntu server setup for LAMP-ish configuration.
View ubuntu-18.04-web-server-init.sh
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
if [ "$1" = '-v' ] ; then
set -o xtrace
shift
fi
@jaytaylor
jaytaylor / java-format-cleanup.sh
Created Oct 8, 2019
Perl-based Java codebase aesthetics format scrubber.
View java-format-cleanup.sh
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
for f in $(find . -name '*.java'); do
perl \
-0 \
-i \
@jaytaylor
jaytaylor / camel_case_to_snake_case.py
Created Sep 6, 2012
Convert camel-case to snake-case in python.
View camel_case_to_snake_case.py
#!/usr/bin/env python
"""
Convert camel-case to snake-case in python.
e.g.: CamelCase -> snake_case
Relevant StackOverflow question: http://stackoverflow.com/a/1176023/293064
"""
@jaytaylor
jaytaylor / pgLogArchiver.sh
Last active Sep 20, 2019
Postgres log file compressor which compresses and uploads files to s3 before deleting them.
View pgLogArchiver.sh
#!/usr/bin/env bash
##
# @author Jay Taylor [@jtaylor]
#
# @date 2013-10-02
#
# Postgres log file compressor which compresses and uploads files to s3 before deleting them.
# This script must be located in the same directory as the log files.
#
@jaytaylor
jaytaylor / thrift-configure-mac-osx-20170504.md
Last active Aug 22, 2019
Thrift compilation advice for mac OS-X, particular ./configure QT errors and openssl errors.
View thrift-configure-mac-osx-20170504.md
@jaytaylor
jaytaylor / math.sh
Created Aug 8, 2019
Math functions from python as bash "builtins".
View math.sh
#!/usr/bin/env bash
##
#
# @author Jay E. Taylor <jay@jaytaylor.com>
#
# @description Math functions for bash!
#
##
You can’t perform that action at this time.