Skip to content

Instantly share code, notes, and snippets.

-exec -enable-pretty-printing
-exec e [VarName]
-exec p [VarName]
ps -auxf |grep --color -z '[SearchString]'
@nutrino
nutrino / hide_err_img.js
Last active March 17, 2022 23:39
JavaScript to replace broken images
// ==UserScript==
// @name JavaScript to replace broken images
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://127.0.0.1/
// @grant none
// ==/UserScript==
// https://stackoverflow.com/a/40263918
ps uxa | grep .vscode-server | awk '{print $2}' | xargs kill -9
conda env list | grep -v "^$\|#" | awk '{print $1;}' | xargs -I{} -d "\n" sh -c 'printf %-20s "{}"; conda list -n {} | grep "^python\s"'
ssh -4 -x [email protected] -L 16657:localhost:26657 -L 11317:localhost:1317 -L 13060:localhost:3060 'bash /home/quant/house/start_localterra.sh; bash -l'
@nutrino
nutrino / git-sparse-clone.sh
Created May 4, 2022 23:06 — forked from AndrianBdn/git-sparse-clone.sh
git-sparse-clone.sh
#!/bin/sh
#
# This script can clone/checkout a single folder from git repository
# - Might be used for checking out micro-services from monolithic git repository
#
# - You can even do checkout into home directory, for example
# git-sparse-clone.sh [email protected]:readdle/fluix-web.git /home/login login
#
# This will cause the shell to exit immediately if a simple command exits with a nonzero exit value.
# Remove specific named folders
find ex-cosmwasm/ -type d -name "target" -exec rm -r {} +
@nutrino
nutrino / prevent_unmount.sh
Created May 13, 2022 15:45
macOS prevent from accidental unmounting
#!/bin/bash
# https://stackoverflow.com/a/23716566
screen -D -RR test1 -X quit || true
screen -dmS test1
screen -r test1 -p 0 -X stuff $"cd /Volumes/SDUltra ^M"