Skip to content

Instantly share code, notes, and snippets.

View roshnet's full-sized avatar
🏎️
working from cache

Roshan Sharma roshnet

🏎️
working from cache
View GitHub Profile
@roshnet
roshnet / wallet.js
Last active November 24, 2021 10:55
Implementing the given methods in the Wallet class
/*
Mnemoics used -
quality armor buddy double food laugh tunnel marine lizard west cup what basket lumber walnut link frog rice pigeon abstract nurse volcano curve twice
Generated tpub from iancoleman.io/bip32
tpubDC93eCC1ySXoBp7AKVv9M9uRi4evZjwgd8LbmYuhXs6NnarvhHsNFPcrzwPqsrUa3y5E5FjnbGE4Li55Y5G96aaPJsb2DKagQC8zgpcRcMQ
Generated Account extended private key from iancoleman.io/bip32
tprv8fT1Vn9mq4r8JM5NRrFYwkFK938zQQkn3pjpV2sQ7bHyx6cA4u3n4tzzpn9vJysFzvbLW2VSUDgG9bPQhxGKhfxvyc8wVMahKNFVPL8aMqv
@roshnet
roshnet / main.js
Created April 23, 2022 11:10
uCrypt encryption module reference
const crypto = require('crypto')
const fs = require('fs')
const ALGO = 'aes-256-ctr'
// const message = Buffer.from('Enemies incoming!', 'binary')
const message = fs.readFileSync('docs.pdf', { encoding: 'binary' })
const password = 'secret'
const key = crypto
.createHash('sha256')
@roshnet
roshnet / veritasium.js
Last active September 4, 2022 11:04
A Node.js script for Veritasium's riddle (youtu.be/iSNsgj1OCLA)
const N = 100
const TO_FIND = 42
const BOXES = {}
let iterations = 0
const trail = []
/**
* @description Return a fresh set of slips on each call.
*/
@roshnet
roshnet / gitlab-runner-local.md
Created September 16, 2022 09:50
Local GitLab CI installation

Run GitLab CI jobs locally

  1. Get runner image - docker pull gitlab/gitlab-runner:latest
  2. Clone & change into source code dierctory (ensure .gitlab-ci.yml exists and is valid) - cd <REPO>
  3. Start a container called gitlab-runner0 -
docker run -d \--name gitlab-runner0 \
   --restart always \
 -v $PWD:$PWD \

From https://ss64.com/pass/command-line.html -

# Bash version
strongpw() {
    read -rs -p 'Encryption key: ' key
    echo '' # line break
    echo -n "$key:$1" | sha256sum | perl -ne "s/([0-9a-f]{2})/print chr hex \$1/gie" | base64 | tr +/ Ea | cut -b 1-20
}