Skip to content

Instantly share code, notes, and snippets.

# Remove specific named folders
find ex-cosmwasm/ -type d -name "target" -exec rm -r {} +
@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.
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'
conda env list | grep -v "^$\|#" | awk '{print $1;}' | xargs -I{} -d "\n" sh -c 'printf %-20s "{}"; conda list -n {} | grep "^python\s"'
ps uxa | grep .vscode-server | awk '{print $2}' | xargs kill -9
@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 -auxf |grep --color -z '[SearchString]'
-exec -enable-pretty-printing
-exec e [VarName]
-exec p [VarName]
@nutrino
nutrino / gist:0468e041522fe010a22b330180feeddf
Last active April 16, 2022 13:14
List files older/later than specific time diff
# https://unix.stackexchange.com/a/10043
# List files later than 1 day diff
find . -maxdepth 1 -mtime -1
# List files older than 1 day diff
find . -maxdepth 1 -mtime +1
@nutrino
nutrino / gist:ccd53f8cc08684dd6d547fe179ae9ddd
Created January 18, 2022 10:00
python install pkg : conda with pip
[requirements.txt]
while read requirement; conda install --yes $requirement;or pip install $requirement; end < requirements.txt