Skip to content

Instantly share code, notes, and snippets.

View gist:0702fb4238c8cf1aaf9ef8c96044b071
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)
View HITS_with_normalization.py
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 = []
View HITS_without_normalization.py
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):
View backup.sh
#!/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"
You can’t perform that action at this time.