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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>jsPDF Example</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js"></script> | |
</head> | |
<body> | |
<button id="generatePDF">Generate PDF</button> |
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 boto3 | |
import csv | |
import calendar | |
from datetime import date, datetime, timedelta | |
from collections import OrderedDict | |
client = boto3.client('apigateway') | |
endDate = date(year=2023, month=3, day=31) |
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 boto3 | |
import csv | |
client = boto3.client('route53domains', region_name='us-east-1') | |
fieldnames = [ | |
'Domain Name', | |
'Domain Registrar', | |
'Expiration Date', | |
'Auto-Renewal', |
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 boto3 | |
import csv | |
client = boto3.client('ec2') | |
regions = [region['RegionName'] for region in client.describe_regions()['Regions']] | |
fieldnames = [ | |
'Certificate', | |
'Common Name', |
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 boto3 | |
from datetime import date, timedelta | |
endDate = date.today() | |
startDate = endDate - timedelta(days=7) | |
tempDate = startDate | |
days = [] | |
while tempDate <= endDate: | |
days.append(tempDate) |
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/bash | |
ADDRESS=`aws ec2 describe-instances --filters 'Name=tag:Name,Values=WebServer' --output text --query 'Reservations[*].Instances[*].PrivateIpAddress'` | |
ssh ec2-user@$ADDRESS |
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 | |
// HMAC-SHA512 signing | |
function get_signature($event, $orderid, $listing_id) { | |
// Hashing algorithm to use | |
$algo = 'sha512'; | |
// Shared key used for signing payloads |
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
vpn() { | |
# Usage: "vpn uk" to connect to UK VPN | |
# Usage: "vpn" to connect to AU VPN | |
REGION="${1:-au}" | |
sudo killall openvpn | |
if [ $REGION == "uk" ]; then | |
sudo openvpn --daemon --config ~/ovpn/vaultre-uk-matthealy.ovpn | |
else | |
sudo openvpn --daemon --config ~/ovpn/vaultre-matthealy.ovpn | |
fi |
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
#!/usr/bin/perl | |
use File::Slurp; # not strictly needed, but nice to have | |
use Data::Dumper; | |
use JSON; | |
use LWP::UserAgent; | |
use HTTP::Request::Common; | |
my $key = ''; | |
my $token = ''; |
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
watch -n 60 "curl -s \ | |
--url 'https://www.amazon.com.au/Thermos-THERMOcafe-Vacuum-Insulated-BOL750R6AUS/dp/B07DHGBNM9' \ | |
--compressed | grep 'priceblock_ourprice' | grep 'priceBlockBuyingPriceString' >> /tmp/amazon.log" |
NewerOlder