Skip to content

Instantly share code, notes, and snippets.

View dacbd's full-sized avatar
💭
Fitting 🟥 into 🟢

Daniel Barnes dacbd

💭
Fitting 🟥 into 🟢
View GitHub Profile
@dacbd
dacbd / cmds.sh
Last active March 30, 2022 17:56
cml runner GCP failure debugging
cat /var/log/syslog | awk 'match($0, /GCEMetadataScripts: startup-script:/){print substr($0,RSTART+36) }' | more
@dacbd
dacbd / problem.md
Created March 21, 2022 19:40
Vega help

example snippet that produces the following json:

          dvc metrics show --all-tags data/output/metrics_eval.yaml --show-json > all_metrics.json
          export METRICS_JSON=$PWD/all_metrics.json
          node .github/prep_metrics.js
          echo "## Plots" >> report.md
          echo "### Precision History" >> report.md
          vl2png precision-vega.json | cml publish --md >> report.md
@dacbd
dacbd / ssh_keys
Last active October 20, 2021 16:49
ssh public keys
ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBDYd3ssa6L15jQC5bckJ2viWlA1tBygxeWoy3s0S14ZHMxUMfp7u2yqficpHO5b+pjgg7Lz+80Ibw157waTZPM+xbF2/KGqS7aYV0L/R8VbWjVEpzxZEeoxSCwFA1tHWUg==
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDAZjq1VTtQKrqg4y5pPGWsv2RNE0I7rGoJKlnX9Y2QndG++vTECR9JJDRuqDg6HlCPwfCHELx9WVmsrczjNJfkw8AKq4vOilcuhPsWV3ijvire+CdjuqJDpKw1pvf7UaiApqijl1MmDdVHRgVl6V92QxykT2kJeBR0EuKC82uE0vV59DtmVYbeg4XnX/ubA81M+coZRR5i3aCJNF7S8+3QEJUTGCDsMiPwJhTKNzMXCtdUbE/gGa5j/yPIHviSfoA7eM0p0rBQuMz4PzRUpxM6gPD59Q+d2K6kGn89HLLaWH82QitUsmeGzhEE8/AsNGYXCQYjzIjZF8dFWNXR/1/1aFShXHJj1qJLprVQ6FF+8qtYqDsnA5CXmU/EB1pxIMkzGS2PQCIWvtw7+SRs/va13jdw1IrMaHgLe9UNZhiFb9nWv0u6yfik0yyfJxvJdJnnCcNhiATbx4YGf+LopoJzoVSSkEObJzkxzxhMdnID6QiAI1ys9BcX9uzSqwT0ke4y3xbez4OhNvz07zuSdQTWD5DdrSOTUKhKbghU5lPWKstq6I1Zd40zQPM5NUGjxW/FESaVQt6irhBJX9RhOfPrNVCaLS6q5XE2w91loq4yZN6EQebiLGXPIB6jzHkNu+2ELHi6Ena7yM7/qhN2k2iIKeHrd2AdO0mCixvbJjLguQ==
@dacbd
dacbd / example.yml
Created September 29, 2021 02:42
DVC Github actions cache
- name: Get dvc cache directory
id: dvc-cache-dir
run: |
echo "::set-output name=dir::$(dvc cache dir)"
- uses: actions/cache@v2
id: dvc-cache # use this to check for `cache-hit` ==> if: steps.dvc-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.dvc-cache-dir.outputs.dir }}
key: ${{ runner.os }}-dvc-${{ hashFiles('*') }}
restore-keys: |
@dacbd
dacbd / action.yml
Last active September 22, 2021 21:52
CML Runner trouble shoot
deploy-runner:
runs-on: ubuntu-latest
steps:
- uses: DanielBarnes/setup-cml@2970b7282efdade5a071a7be526162a4edcb149b
- uses: actions/checkout@v2
- name: Deploy runner on GCP # https://cml.dev/doc/self-hosted-runners#cloud-compute-resource-credentials
env:
GOOGLE_APPLICATION_CREDENTIALS_DATA: ${{ secrets.GCP_CML_RUNNER_KEY }}
run: |
cml-runner \
@dacbd
dacbd / problem.md
Last active September 21, 2021 16:28
A Data Science Riddle

A 50-year-old patient, no symptoms participates in a routine Cancer screening. They test positive and want to know for sure or what their chances are of having Cancer.

Aside from the test results, you know nothing else about this Patient.

  • The rate of Cancer for patients of this age is 1%
  • The test is 90% Effective/Sensitive in/to detecting Cancer
  • However, the test results in 9% FPR (False Positive Rate)

A) 9 in 10

{
"eb247a85d65aa5f509a8cad701e3fb214f0198fe10ab9a4f9b5f225f": {
"C2": "0x92d222351e0c01ad3a969156acd42b6d3a9b3b01a54c854f31be371819154fc81d4866033c760445eaefce48f37cf6abcfea43ab176ef6abdd5330809f40438e5ae1afae6a85c38",
"N0": "0xef3ca809e52bbeaaadca0dac8110e34394f5de47b4881a82a52c838fddd0887dcedd5d9d0f158501a7962d9057d973f49e29bbc842e2cbf878d037bf0bd318e814a1d63efa91098cbe1887c072c671e1cdd0fce9d3be2b6c1bb346a3533aee83bbc711a8ba3ff7ae8382972a77f0e17686e955a986c89967c17a6e84b95d0bfb",
"N1": "0xd01738daafa2957d2f190d352492b56b04480f7f0b156a7b2a335fb6b11a805298c2a5ac5c9cbe30b61cdd8a16288ff1b5f9185b2b5caf1ec49a7fdd3c9cc9493367970d661d108d6eb56d9547a9ed05e4c461ee4eedcfacb638ae86205eaee0a1b4c01e13c8b03955bb864a9daa62fbaccc2d14a615673c97b54cfc5d1bba2b",
"N2": "0xa7ee787bcdf9cc586cafb12bf62f6600b1939b16ba4d004f95dc02f268799d0a41e4561f63455791d83b179d654a085d1b8b44e371852dd7a53760f60562c93c5cc4fdbaeca324149e1b9db5a27ab5e1d72016b01a23688120a03b2caec470a7a98e88d07a27fcd9886c5d9c9cd75fbc2c15cd17fe5720f
#!/usr/bin/env nodejs
var fs = require('fs');
var file = fs.readFileSync(process.argv[2]);
//console.log(file);
console.log(file.length);
var offset = 0;
var gheader = function (){
var gheaderbytes = [];
while(gheaderbytes.length !== 24) {
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJDV04iOiJ7bm90X3RoZV9yZWFsX3Bhc3N3b3JkfSJ9.MWM-V0lWSCO4UcH0PnjrCyCnJEXkPel-3a0YkiPJSG8
#!/usr/bin/env nodejs
var fs = require('fs');
var file = fs.readFileSync(process.argv[2]);
var filetext = file.toString('ascii');
var passwords = filetext.split('\n');
//console.log(passwords);
var checks = [function hasUpper(password) {