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
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 \ |
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
// dropshadow | |
box-shadow: 0 0 10px #000; |
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
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 |
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
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'; |
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
\dx - list of installed extensions | |
CREATE EXTENSION pg_stat_statements; | |
select | |
pg_terminate_backend(pid) | |
from | |
pg_stat_activity | |
where | |
pid <> pg_backend_pid() |
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
<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({ |
NewerOlder