A useful library of various scripts that can be ran with the runbook
CLI.
Make your own library by installing runbook and writing your first runnable markdown file!
Which process is using a specific port?
lsof -i tcp:{{ port }}
Encoding a string to a base64 string
console.log(Buffer.from('{{ input }}', 'utf8').toString('base64'))
Decoding a base64 string to the original string
console.log(Buffer.from('{{ input }}', 'base64').toString('utf8'))
Generate a random password
runbook run generate password --length 20
const { randomFillSync } = require('crypto')
const generatePassword = (
length = {{ length }},
wishlist = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@-#$'
) => Array
.from(randomFillSync(new Uint32Array(length)))
.map(x => wishlist[x % wishlist.length])
.join('')
console.log(generatePassword())
Runbook logo party
runbook run print runbook logo --times 3
Prints the runbook logo X times to the terminal.
import terminal from './src/features/terminal'
function print (times: number) {
for (let i = 0; i < times; i++) {
console.log(terminal.ascii.art.logo)
}
}
print({{ times }})