# in one terminal
docker run -it --rm -p 27017:27017 mongo:7
This file contains 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
git log -S 'this string changed in this file' -- main.sh |
# in one terminal
docker run -it --rm -p 27017:27017 mongo:6
This file contains 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
#!/usr/bin/env bash | |
set -e | |
# check if disk is attached | |
sda1_attached=false | |
sdb1_attached=false | |
if lsblk | grep -q "sda1"; then | |
sda1_attached=true |
This file contains 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
// from chatgpt | |
// list all event listeners on process | |
const eventNames = process.eventNames(); | |
eventNames.forEach((eventName) => { | |
const listeners = process.listeners(eventName); | |
console.log(`Event: ${eventName}`); | |
console.log(`Listeners:`); | |
listeners.forEach((listener, index) => { | |
console.log(` Listener ${index + 1}: ${listener.toString()}`); | |
// Note: listener.toString() might not always give meaningful information, |
This file contains 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
docker run -it --rm --init "${DOCKER_IMAGE}" |
This file contains 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
kill -STOP "${PID}" | |
kill -CONT "${PID}" |
This file contains 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
const Benchmark = require('benchmark'); | |
suite | |
.add('test1', function() { | |
console.log('stuff'); | |
}) | |
.add('test2', function() { | |
console.log('stuff'); | |
}) | |
.on('cycle', function(event) { |
This file contains 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
asdf plugin add gcloud https://github.com/jthegedus/asdf-gcloud | |
echo "gcloud 410.0.0" >> ~/.tool-versions | |
asdf install | |
gcloud auth login | |
gcloud projects list | |
gcloud config set project $GCP_PROJECT_ID | |
# pull logs from cloudbuild | |
# add grep to this command for specific hash.. then cut -d' ' -f1 for the ID.. maybe can filter directly |
If you're using AWS EKS and for some reason you get:
no space left on device: unknown
Check if:
- you're using XFS
- your disk usage is < 85% (At 85%, k8s triggers GC)
- you're pulling large 2GB docker images OR docker images with node_modules with hundreds of thousands of files
Then consider inode contiguous fragmentation issue:
NewerOlder