docker ps -a|tail -n +2|awk '{print $1}'|xargs docker start
This gives side-by-side diff.
diff -y file_1 file_2
pbpaste|sort|uniq -i|pbcopy
pbpaste|jq .|pbcopy
'pbpaste|xmllint --format -'
pbpaste|base64 --decode|pbcopy
pbpaste|base64|pbcopy
This can be used for quick intranet file sharing. The below command starts an http server in the current folder and the contents will be served at the configured port via HTTP.
python -m SimpleHTTPServer 9090
In languages like python, the Dict representing a JSON will have single quotes, if the dicts are just printed to log and we have to make convert it to JSON, we need to be convert it to double quotes. The below command will be useful.
pbpaste|sed "s/'/\"/g"|jq .|pbcopy
Had to write a small python lib, just curious to know the number of lines it had, the below one lines that I wrote was helpful,
find ./sdk -name '*py' -exec wc -l {} \;|cut -d'.' -f1|awk '{sum+=$1;} END {print sum}'
-
The
find
part will get all the required files and gets the line count. -
Now we will have the total lines for each files available, with
cut
part we will get only the line counts of the files. -
The
awk
part sums all the line counts that we got and prints it. For begineers this part will be bit tricky for beginners. Refer this for more info