jq will sort (-S) the whole file (.) and compare STDOUT (<()) with diff
diff <(jq -S . A.json) <(jq -S . B.json)
jq will sort (-S) the whole file (.) and compare STDOUT (<()) with diff
diff <(jq -S . A.json) <(jq -S . B.json)
Ctrl-A | (horizontal) or Ctrl-A % (vertical) to split, arrow key to navigate
Shift+F2 orCtrl+A then |Ctrl+F2 orCtrl+A then %Shift+↑ ↓ ← → or| :w !sudo tee % |
| def rand_string(length): | |
| """ Generates a random string of numbers, lower- and uppercase chars. """ | |
| rand_str = ''.join(random.choice(string.ascii_lowercase | |
| + string.ascii_uppercase | |
| + string.digits) | |
| for i in range(length)) | |
| return rand_str | |
| print(rand_string(10)) |
| """ | |
| example dockerfile for longprocess: | |
| https://github.com/ipan/dockerfiles/tree/master/longprocess | |
| """ | |
| import docker | |
| client = docker.from_env() | |
| lp = client.containers.run("longprocess", "/src/run.sh 5", detach=True) |
| ssh-keygen -t rsa -C "[email protected]" -b 4096 |
| import subprocess | |
| import shlex | |
| cmd = 'ls -lhrt python' | |
| subprocess.call(shlex.split(cmd)) | |
| try: | |
| subprocess.check_output(['ls']) | |
| except subprocess.CalledProcessError as e: |
| import argparse | |
| parser = argparse.ArgumentParser(description="script description") | |
| parser.add_argument('input_names', nargs="*", help="input name(s)") | |
| parser.add_argument('-t', '--target', required=True) | |
| parser.add_argument('-of', '--option-flag', action='store_true', default=False, help="description for option flag") | |
| parser.add_argument('--number', type=int, default=0, help="description for int num") | |
| args = parser.parse_args() |