This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is_process_running() { | |
if [ -z "$1" ]; then | |
write_error "shared_functions" "The process ID was not defined as the first parameter." | |
fi | |
if ps -p $1 >/dev/null; then | |
return 0 | |
fi | |
return 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
write_error() { | |
MSG=$2 | |
echo -e "\033[1;31m$1\033[0m \033[0;37m${MSG}\033[0m" 1>&2 | |
return 0 | |
} | |
get_certificate_fingerprint() { | |
if [ -z "$1" ]; then | |
write_error "shared_functions" "The certificate file path was not defined." | |
return 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetAllSheetNames(time) { | |
var out = new Array() | |
var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets(); | |
for (var i=0 ; i<sheets.length ; i++) { | |
if (sheets[i].getName() != "Overview") { | |
out.push( [ sheets[i].getName() ] ) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Use AWS CLI to get the most recent version of an AMI that | |
# matches certain criteria. Has obvious uses. Made possible via | |
# --query, --output text, and the fact that RFC3339 datetime | |
# fields are easily sortable. | |
export AWS_DEFAULT_REGION=us-east-1 | |
aws ec2 describe-images \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map $http_accept $webp_suffix | |
{ | |
default ""; | |
"~*webp" ".webp"; | |
} | |
server | |
{ | |
listen 80; | |
listen [::]:80; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use SilverStripe\Core\Injector\Injector; | |
use SilverStripe\Core\Cache\MemcachedCacheFactory; | |
$cacheClient = new Memcached(); | |
$cacheClient->addServer('your-memcached-server-hostname-goes-here', 11211); | |
$cacheFactory = new MemcachedCacheFactory($cacheClient); | |
Injector::inst()->registerService($cacheFactory, "SilverStripe\\Core\\Cache\\CacheFactory"); | |
Injector::inst()->registerService($cacheFactory, "CacheFactory"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
listen 443 ssl default_server; | |
listen [::]:443 ssl default_server; | |
server_name_in_redirect off; | |
server_name default_server; | |
server_tokens off; | |
charset utf-8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[req] | |
default_bits = 4096 | |
distinguished_name = req_distinguished_name | |
req_extensions = v3_req | |
prompt = no | |
[req_distinguished_name] | |
name = Your Name Goes Here | |
countryName= Your Country Name Goes Here | |
stateOrProvinceName = Your State or Province Name Goes Here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG CUSTOM_BUILD_VERSION | |
ARG CUSTOM_BUILD_DATE | |
ARG CUSTOM_BUILD_UID | |
ARG NGINX_VERSION 1.20.1 | |
FROM nginx:${NGINX_VERSION}-alpine AS builder | |
ARG CUSTOM_BUILD_VERSION | |
ARG CUSTOM_BUILD_DATE |
NewerOlder