Skip to content

Instantly share code, notes, and snippets.

View michaelmcmillan's full-sized avatar
💭
🥃

Michael McMillan michaelmcmillan

💭
🥃
View GitHub Profile
#!/bin/sh
# Google Drive client
DRIVE=/usr/local/bin/drive
# What to backup on local disk.
backup_files="/Users/michaelmcmillan/Prosjekter"
# Where to backup to in Google Drive.
dest="xxxxxxxxx"
from math import sqrt
class Page(object):
def __init__(self, name):
self.name = name
self.auth = 1
self.hub = 1
self.incoming_neighbors = []
self.outgoing_neighbors = []
class Page(object):
def __init__(self, name):
self.name = name
self.auth = 1
self.hub = 1
self.incoming_neighbors = []
self.outgoing_neighbors = []
def points_to(self, other_pages):
from time import sleep
from subprocess import run, PIPE
def fetch():
command = ['curl', 'https://demo.ctf.ninja/challenges/', '-H', 'Cookie: sessionid=*change-me*;']
return run(command, stdout=PIPE).stdout
def notify():
command = ['say', 'New challenge!']
return run(command, stdout=PIPE)
CREATE OR REPLACE FUNCTION distance(
lat1 double precision,
lon1 double precision,
lat2 double precision,
lon2 double precision)
RETURNS double precision AS
$BODY$
DECLARE
R integer = 6371e3; -- Meters
rad double precision = 0.01745329252;
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: C:\positions.yaml
clients:
# - url: http://loki:3100/loki/api/v1/push
- url: http://10.192.177.253:3100/loki/api/v1/push
// The shitty Cloudflare UI does not let you select multiple records to be deleted.
// If you have a huge zone file this takes ages to do manually, so I've created this
// script to run in the console of your browser. It will delete every single record.
setInterval(function () {
Array.from(document.querySelectorAll('button')).filter(el => el.innerText.includes('Edit'))[0].click();
setTimeout(function () { Array.from(document.querySelectorAll('button')).filter(el => el.innerHTML.includes('Delete'))[0].click(); }, 2000);
setTimeout(function () { Array.from(document.querySelectorAll('button')).filter(el => el.innerHTML.includes('Delete'))[1].click(); }, 5000);
}, 8000)