Skip to content

Instantly share code, notes, and snippets.

View swedgwood's full-sized avatar

Sam Wedgwood swedgwood

View GitHub Profile
@swedgwood
swedgwood / post.md
Created September 14, 2023 13:57
running sytest against live dendrite

First run a dendrite instance in vscode debugger (or other debugger of choice)

docker run --rm -it \
    -v "$PWD:/sytest" \
    -v "$PWD/../dendrite:/dendrite" \
    -e TIMEOUT_FACTOR=1000000 \
    matrixdotorg/sytest:local \
    /bin/bash -c "cd /sytest && \
 ./install-deps.pl && \
@swedgwood
swedgwood / test-changes.py
Created September 14, 2023 13:30
Script for checking differences between two sytest tap files
#!/usr/bin/env python3
import re, sys
if len(sys.argv) != 3:
print("Given two tap files, print out any changes in the result of tests (e.g. ok -> not ok)")
print("Usage: ./test-changes.py [before_tap_file] [after_tap_file]")
exit(-1)
before_logs_file = sys.argv[1]
@swedgwood
swedgwood / update-and-reboot.service
Created November 6, 2022 19:25
Update and reboot systemd
[Service]
ExecStart=/root/update-and-reboot/update-and-reboot.sh

Keybase proof

I hereby claim:

  • I am swedgwood on github.
  • I am wedg (https://keybase.io/wedg) on keybase.
  • I have a public key ASADx4114p2ZtuiUheafdzq2rUr7SiBA5FJYfTCMrFttngo

To claim this, I am signing this object:

@swedgwood
swedgwood / ansible_discord_webhook.py
Created October 31, 2018 17:20
Ansible module for sending messages using discord webhooks.
#!/usr/bin/python
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
@swedgwood
swedgwood / open_objectivity.py
Last active October 18, 2018 20:00
Script for challenge 'OpenObjectivity' from the CSAW'18 RTC Qualifiers.
import jwt
import requests as rq
key = "dId_you_r3aLly_think_I_w0u1dnt_s3t_a_key"
payload = {
'exp': 99999999999,
'iat': 0,
'sub': 1,
@swedgwood
swedgwood / wrapper.py
Last active October 3, 2018 17:13
Script for Clicker 2.0 from CSAW'18 RTC Qualifiers.
import json
import requests
url = "http://web.chal.csaw.io:10106"
session = requests.Session()
session.headers = {
"Authorization": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1Mzg2NjU1NTQsImlhdCI6MTUzODU3OTE0OSwic3ViIjozMjUsImFkbWluIjpmYWxzZX0.IkOmi9FAQiUPALecHbMogRfmVEt9END6UhCwc3n3zpM"
}
@swedgwood
swedgwood / adrift.py
Created October 3, 2018 14:47
Script for challenge 'Adrift' from the CSAW'18 RTC Qualifiers.
import requests as rq
url = "http://web.chal.csaw.io:10106"
headers = {
"bring_back_random_click": "aaaaaaaaaa"
}
while True:
req = rq.get(url+"/default/", headers=headers)
if req.status_code != 404:
@swedgwood
swedgwood / PixelPerfect.gd
Last active May 19, 2018 20:42
A GDScript AutoLoad for creating a pixel perfect view.
extends Node
onready var game_size = OS.get_window_size()
func get_scale(window_size):
var scalex = max(floor(window_size.x/game_size.x), 1)
var scaley = max(floor(window_size.y/game_size.y), 1)
return min(scalex, scaley)
func get_size(scale):