Skip to content

Instantly share code, notes, and snippets.

View paulanunda's full-sized avatar

Paul Anunda paulanunda

View GitHub Profile
TARGET="mysite.example.net"; \
RECIPIENT="[email protected]"; \
DAYS=7; \
echo "checking if $TARGET expires in less than $DAYS days"; \
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \
| openssl x509 -text \
| grep 'Not After' \
|awk '{print $4,$5,$7}')" '+%s'); \
in7days=$(($(date +%s) + (86400*$DAYS))); \
if [ $in7days -gt $expirationdate ]; then \
// dropshadow
box-shadow: 0 0 10px #000;
require 'aws-sdk'; AWS.config(access_key_id: '...', secret_access_key: '...', region: 'us-east-1')
############################################################
# glacier
############################################################
# https://forums.aws.amazon.com/message.jspa?messageID=508743
glacier = AWS.glacier
glacier.vaults
vc = AWS::Glacier::VaultCollection.new
function format_date(date) {
d = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear() + " " + formatAMPM(date);
console.log(date + " : " + d);
return d;
};
function formatAMPM(date) {
var hours = date.getHours();
var minutes = date.getMinutes();
var ampm = hours >= 12 ? 'PM' : 'AM';
@paulanunda
paulanunda / psql
Last active December 27, 2015 15:28
\dx - list of installed extensions
CREATE EXTENSION pg_stat_statements;
select
pg_terminate_backend(pid)
from
pg_stat_activity
where
pid <> pg_backend_pid()
<script style="text/javascript">
$(document).ready(function(){
// resize bg
$(window).resize(function(){
$('#wrap').css('height', $(window).height()-55)
}).trigger('resize');
// scroll down animation
$('.down-btn').click(function(){
$('html, body').animate({