go test -v ./tests | sed ''/PASS/s//$(printf "\033[32mPASS\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/''
cd ~
tar -cvpzf backup.tar.gz --exclude=./backup.tar.gz --exclude=./.local/share/io.parity.ethereum/chains/ --one-file-system .
Let's get python serial module
nix-shell -p python3Packages.pyserial
Replace txt
with your extention
find . -name "*.txt" -type f -print0 | xargs -0 -n 50 perl -pi -e 's/Hello/Greetings/g'
For Python 2.x use SimpleHTTPServer
instead of http.server
python3 -m http.server 8000
With nix-shell
nix-shell -p python3 --command "python -m http.server"
Or Haskell
nix-shell -p haskellPackages.hserv --command hserv
From willurd/web-servers.md gist.
watch -n 10 ipfs --api=/ip4/127.0.0.1/tcp/5001 swarm connect /dns4/lighthouse.aira.life/tcp/4001/ipfs/QmdfQmbmXt6sqjZyowxPUsmvBsgSGQjm4VXrV7WGy62dv8
From Risan article.
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "a.khssnv@gmail.com"
cat ./slice_160.urs | nc -q 1 192.168.56.4 30002 >/dev/null
Per network interface. Numbers are kb, -d
- download, -u
- upload.
wondershaper -a eth0 -d 1024 -u 1024
Disable shaping
wondershaper -c -a eth0
prlimit --pid 12345 --nofile=128:128
grep -B 3 -A 2 foo README.txt
or
grep -C 3 foo README.txt
git fetch origin master:master
patch -r - -b -p0 --forward hello.txt hello.txt.patch
where -r -
instrusts to not save *.rej
file, -b
do the same for backup *.orig
file and --forward
tells it to continue in case patch
finds a problem.
sources: one, two
Create appropriate default.nix
package and run
nix-build -E '((import <nixpkgs> {}).callPackage (import ./default.nix) { })' --keep-failed --no-out-link
grep -R foo | grep -a -v -e '[^\ ]\{500,\}'