View gym.py
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
import os | |
import pickle | |
import warnings | |
import numpy as np | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
from tensorflow.keras.callbacks import EarlyStopping | |
from tensorflow.keras.layers import Dense | |
from tensorflow.keras.layers import Dropout |
View delete_expired_certs.sh
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
unix_todate=$(date -d "${todate}" "+%s") | |
getDomainName() { | |
echo $1 | cut -d'/' -f 5 | |
} | |
for pem in /etc/letsencrypt/live/*/cert.pem; do | |
if [ $(date --date="$(openssl x509 -enddate -noout -in "$pem"|cut -d= -f 2)" "+%s") -le $unix_todate ]; | |
then | |
domain=$(getDomainName $pem) | |
printf 'deleting cert %s expired: %s\n' \ | |
"$domain" \ |
View expired_certs.sh
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
unix_todate=$(date -d "${todate}" "+%s") | |
for pem in /etc/letsencrypt/live/*/cert.pem; do | |
if [ $(date --date="$(openssl x509 -enddate -noout -in "$pem"|cut -d= -f 2)" "+%s") -le $unix_todate ]; | |
then | |
printf '%s: %s\n' \ | |
"$(date --date="$(openssl x509 -enddate -noout -in "$pem"|cut -d= -f 2)" --iso-8601)" \ | |
"$pem" | |
fi | |
done | sort |
View gist:557d2b50e9c9612bf7c7e40cedd05e52
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
find . -name "node_modules" -type d -prune -mtime +365 | xargs du -chs | |
#find . -name "node_modules" -type d -prune -mtime +365 -exec rm -rf '{}' + |
View stopoverspend.txt
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
/** | |
* | |
* Campaign Budget Overspend Monitoring | |
* | |
* This script labels campaigns whose spend today is more than their daily | |
* budgets. Optionally, it also pauses campaigns whose spend exceeds the | |
* budget by too much. An email is then sent, listing the newly labelled | |
* and paused campaigns. | |
* When spend no longer exceeds budget, the campaigns are reactivated and | |
* labels are removed. |
View nginx_config_cloudfront_real_ips.js
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
var request = require("request"); | |
var fs = require("fs"); | |
var output = "#cloudfront ip ranges\n"; | |
request("https://ip-ranges.amazonaws.com/ip-ranges.json", function(err, res, body) { | |
if (err) { | |
console.error("error", err); | |
} | |
var j = JSON.parse(body); | |
j.prefixes.forEach(function(item) { | |
if (item.service ==='CLOUDFRONT') { |
View shamessages.js
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
let getMessageHash = function(hash, fn) { | |
dm.settings.log("getmessage hash", hash); | |
dm.rcmsg.get("m:"+ hash, function(err, data) { | |
if (err) { | |
dm.settings.log('message hash error', err); | |
} | |
if (!data) { | |
dm.settings.log("message hash not found?!", hash) |
View test.js
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
const puppeteer = require('puppeteer'); | |
(async() => { | |
const browser = await puppeteer.launch({ | |
ignoreHTTPSErrors: true, | |
slowMo: 100, | |
headless: false, | |
args: ["--disable-notifications", "--ash-host-window-bounds 100+200-300x400"] | |
}); | |
View aws_import.sh
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
#place in /etc/letsencrypt/renewal-hooks/post | |
export AWS_ACCESS_KEY_ID=XXX | |
export AWS_SECRET_ACCESS_KEY=XXX | |
#certs must be in us-east-1 to use with cloudfront | |
export AWS_DEFAULT_REGION=us-east-1 | |
#run without --certificate-arn first time then specify arn for updates | |
aws acm import-certificate --certificate file:///etc/letsencrypt/live/site.com/cert.pem --private-key file:///etc/letsencrypt/live/site.com/privkey.pem --certificate-chain file:///etc/letsencrypt/live/site.com/chain.pem --certificate-arn specifyarnforupdate |
View text.php
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 | |
$all_links = file_get_contents("/home/fizz/Downloads/export-links.json"); | |
$post_id = rand(1, 1500); | |
$spin_text = ['Funny', 'Awesome', 'New', 'Cute'] | |
$spin = $post_id % $spin_text.length; | |
$json_puke = json_decode($all_links, true); | |
echo ucwords(strtolower($json_puke[$post_id][0]['title'])) . $spin_text[$spin] .' Chat Stickers' ; //[$post_id]; //[0]['url']; | |
echo '</br>'; |
NewerOlder