Instantly share code, notes, and snippets.
- LiveCode
- Edinburgh, UK
- http://blog.peter-b.co.uk/
peter-b /PasswordDemo.livecodescript
Last activeJuly 18, 2025 17:28
HMAC-SHA-1 password storage using LiveCode This file contains hidden or 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
/* Compute a hash-based message authentication code | |
using the SHA-1 hash. This is broken; it should correctly | |
follow RFC 2104.*/ | |
privatefunctionhmacSha1 pKey, pMessage | |
returnsha1digest(pKey&sha1digest(pKey&pMessage)) | |
endhmacSha1 | |
/* Constant time string comparison algorithm. This | |
prevents against timing attacks on the hashed password | |
comparison.*/ |
peter-b /install-buildbot.ps1
CreatedFebruary 21, 2017 16:13
PowerShell script for installing a buildbot worker on Windows This file contains hidden or 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
# PowerShell script for installing BuildBot 0.8.12 on Windows Server 2016 | |
# Datacenter Edition | |
# For full explanation of everything in this script, see: | |
# http://blog.peter-b.co.uk/2017/02/deploying-buildbot-workers-on-windows.html | |
# Copyright (C) 2017 LiveCode Ltd. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal |
This file contains hidden or 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
importrequests | |
importsys | |
defensembl_get(ext): | |
uri='http://rest.ensemblgenomes.org'+ext | |
r=requests.get(uri, | |
headers= {"Content-Type":"application/json" }) | |
ifnotr.ok: | |
r.raise_for_status() |