This file contains hidden or 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
package Mojolicious::Plugin::Pipeline::CSSCompressor; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
use CSS::Compressor 'css_compress'; | |
sub register { | |
my ($self, $app) = @_; | |
# Register "css_compressor" filter | |
$app->filter(css_compressor => sub { css_compress shift }); |
This file contains hidden or 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
<VirtualHost *:80> | |
#this handles sitename.example.com | |
ServerName example.com | |
ServerAlias *.example.com | |
Options -Indexes FollowSymLinks | |
UseCanonicalName Off | |
VirtualDocumentRoot /opt/example/sites/%1/app/webroot |
This file contains hidden or 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
verify_keypair() { diff <(openssl rsa -in $1 -modulus -noout) <(openssl x509 -in $2 -modulus -noout) >/dev/null 2>&1 ; return $?; }; |
This file contains hidden or 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
remote_cert_remaining_days() { cert_remaining_time=$(date -d "$(openssl s_client -connect $1 2>/dev/null </dev/null | openssl x509 -enddate -noout | cut -d'=' -f2)" "+%s"); current_time=$(date "+%s"); echo remaining $((($cert_remaining_time - $current_time) / 60 / 60 / 24)) days; } |
This file contains hidden or 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
debug_keypair() { (openssl s_server -cert $2 -key $1 -CAfile $3 -www -no_ssl2 -accept 4433) & sleep 1; if ! lsof -i:4433; then return 1; fi; jobid=$(jobs %?"openssl s_server" | sed -e 's/^\[\(.\+\)\].*/\1/'); openssl s_client -connect localhost:4433 -showcerts -ssl3 -CAfile $3 </dev/null; kill %$jobid; return 0; } |
This file contains hidden or 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/bash | |
# cron setting example | |
# 5 3 * * * ionice -c2 -n7 nice -n19 /usr/local/sbin/dar-differential-backup.sh >/dev/null 2>&1 | |
# or | |
# ALLNICE="ionice -c2 -n7 nice -n19" | |
# BACKUP_SCRIPT="/usr/local/sbin/dar-differential-backup.sh" | |
# 5 3 * * 0 $ALLNICE $BACKUP_SCRIPT -f >/dev/null 2>&1 | |
# 5 3 * * 1,2,3,4,5,6 $ALLNICE $BACKUP_SCRIPT -d >/dev/null 2>&1 |
This file contains hidden or 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/bash | |
set -e | |
TARGET_DIR=/path/to/target | |
BACKUP_DIR=/path/to/backup | |
RSYNC=/usr/bin/rsync | |
RSYNC_ARGS="-avS --stats --human-readable --delete $CMD_ARGS" | |
ROTATE=3 |
This file contains hidden or 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/bash | |
set -e | |
_plain() { | |
local user=$1 | |
local pass=$2 | |
echo -ne "$user\0$user\0$pass" | openssl enc -base64 | tr -d '\n'; echo |
This file contains hidden or 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/bash | |
MASK=32 | |
SEP='|' | |
IPV4=ipv4 | |
SCRIPT=$(basename $0) | |
DELEGATED_APNIC_LATEST=http://ftp.apnic.net/stats/apnic/delegated-apnic-latest | |
if [ $# -lt 1 ]; then | |
echo "Usage: $SCRIPT CC [DELEGATED_APNIC_LATEST]" |
This file contains hidden or 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/bash | |
set -e | |
SSH=/usr/bin/ssh | |
PGCTL=/usr/bin/pg_ctl | |
failed_node=$1 | |
new_master=$2 | |
cluster_path=$3 |
OlderNewer