Skip to content

Instantly share code, notes, and snippets.

View BlackthornYugen's full-sized avatar

John Steel BlackthornYugen

View GitHub Profile
@BlackthornYugen
BlackthornYugen / GameOfLife.js
Last active January 2, 2016 05:59
A JS version of Conway's Game of Life SRC: https://jsbin.com/OqaYefOl/
/*\ A JS version of Conway's Game of Life v0.14
|*|
|*| Revision History
|*| 2013-12-30 - 1605: Setup countElementsFrom to keep track of coords.
|*| 2013-12-30 - 1743: Added statics on hover.
|*| 2014-01-02 - 0433: Began refactoring code to OOP.
|*| 2014-01-02 - 0606: Making signifigent changes to scope on events.
|*| 2014-01-02 - 2157: Changing code logic to optimize speed. Current method is extreamly wastefull. Checking ajacent cells of cells that are no where near living cells.
|*| 2014-01-03 - 1240: Milestone .12 got it mostly working but auto-step needs to be a seperate function.
|*| 2014-01-04 - 1309: Built autostep dealie.

Keybase proof

I hereby claim:

  • I am blackthornyugen on github.
  • I am jsteel (https://keybase.io/jsteel) on keybase.
  • I have a public key whose fingerprint is 9E51 C6A0 D9A7 2863 28EA 1013 A356 539D 1BAA 7B27

To claim this, I am signing this object:

@BlackthornYugen
BlackthornYugen / ocsp_test.md
Last active February 23, 2016 17:57
This is a script that verifies a site's certificate using OCSP via openssl

OCSP Test

Examples

Good certificate

sh ./ocsp_test.sh google.ca
======== Downloading certificates ========
Saving certificate in "ssl_certificate_nAy.pem"...
10.8kB 0:00:00 [ 124kB/s] [   <=>                                                                                                                                                                  ]
Saving certificate chain in "ssl_certificate_chain_kL9.pem"...
2.63kB 0:00:00 [  40kB/s] [   <=>                                                                                                                                                                  ]
@BlackthornYugen
BlackthornYugen / Mail_API.md
Last active October 1, 2015 13:02
API specification for a mail service
@BlackthornYugen
BlackthornYugen / duck.sh
Last active March 28, 2024 15:56
Duckdns cron script
#!/usr/bin/env bash
DUCKPATH=~/duckdns
TOKEN=changeme
DOMAINS=steelcomputers
curl -sSv "https://www.duckdns.org/update?domains=${DOMAINS}&token=${TOKEN}&ip=" \
2>> ${DUCKPATH}/stderr.log \
>> ${DUCKPATH}/stdout.log
printf ' - ' >> ${DUCKPATH}/stdout.log
date >> ${DUCKPATH}/stdout.log
#!/usr/bin/env bash
FILTER_YUBIKEY='/Yubikey/{print;getline;getline;print;getline;print}'
EXPECTED_YUBI_MD5="1a067fac7f6915a0acd5a235876fd33e" # Hash of USB Device
LONG_POLL_TIME=3 # Poll time after locking
SHORT_POLL_TIME=1 # Poll time while waiting for yubikey to disconnect
ARMED=0
DATESTRING=%Y-%m-%d\ %H:%M:%S.000
do_screen_saver() {
echo "`date \"+${DATESTRING}\"` locking screen"
@BlackthornYugen
BlackthornYugen / App.kt
Last active May 27, 2024 16:55
Sending an email using kotlin and javax.mail
/*
* Sending an email using kotlin and javax.mail
*
* Usage: java -jar app.jar <user> <password> <from> <to> <cc>
*/
package main.kotlin.sendmail
import java.util.*
import javax.mail.*
import javax.mail.internet.*
@BlackthornYugen
BlackthornYugen / gen_random_haproxy_passwords.sh
Created June 16, 2020 13:12
Generate a few passwords for haproxy (or other things that use unix style passwords)
#!/usr/bin/env bash
# Need a recent openssl to use -6 option (sha512). Either update openssl or change to -1 or similar if it doesn't work
shuf -n30 /usr/share/dict/words | tr '\n' ' ' | fold -s -w 48 | tr ' ' ';' | openssl passwd -6 -noverify -table -stdin
# Example Output:
#carrotwood;sacerdotalist;unfallible;homeliness; $6$xGj40hGX9L0NyToC$hqPn25jIFzS2vzfEVpsmzbDe3XeXtUkTJPHKBO7SI6FTkub4gqUWq5dpB8wfqkEoQClTmWkuiuN8K8eYIcfXL1
#schoolteaching;moule;malesherbiaceous; $6$//mFpIknpKEToVt1$cyNLuPOsvPCW5KzJiS86rKKfonl8PBG0B/Xf5bLwiEvdcm64OX0jqwbhIxjOjrTejxUcB0ys.B0kdBLasb8l/.
#hypsophonous;ungroundedness;did;sapek; $6$NA29jYnRwQ1Tstlh$AW0NoJSKXCIiBo86FB9TKmD0aS67fcdtc.x8.VjeGgj287EuREkDWRmh/cxArFs8rGSM5eDPVC0kYyn52DlpX0
#strepsinema;Thackerayana;camelman; $6$tze4YcdZgPo6e18o$PtsCCwvbkEuvfQoOnPH8ZErQeoGE8/PQvOhdkYioP687ZAujRbtK.IpKLSfVPM6tvsTkN9Z1qjrbssioezG1S.
#amyelencephalia;creeded;city;Triodon;oosporic; $6$Jh/vWDP3BM5Wah/X$CVfCUvFVVXQRBdGPo0x8YiIlLm0mm/4uadaHP39tCITxij8T98HMtVD9khCrVce0D.7AaC1cetiOlX/BF3IG..
@BlackthornYugen
BlackthornYugen / can_you_dig_it.log
Created June 17, 2020 01:28
Use yq, jq, and dig +yaml to resolve a bunch of domains with nice output.
# Make a neato jq filter that just gives us question and answer sections.
JQ_FILTER='.[].message.response_message_data | [.QUESTION_SECTION[], ( .ANSWER_SECTION[]? | split(" ")[-1])]'
# What are my name servers for each of these?
for domain in jskw jsteel jsteelkw ; do for tld in ca dev ; do dig ${domain}.${tld} +yaml -tns | yq $JQ_FILTER ; done ; done # SHOW NS
[
"jskw.ca. IN NS",
"ns-cloud-c4.googledomains.com.",
"ns-cloud-c3.googledomains.com.",
"ns-cloud-c2.googledomains.com.",