Skip to content

Instantly share code, notes, and snippets.

Last active March 15, 2019 00:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?

Useful commands in Linux

For copying files keeping modtime, easiest to use rsync: rync -trv [source] [target] (times, recursive, verbose) Add -n for dry-run.

For queuing tasks:

  1. Install task spooler sudo apt-get install task-spooler
  2. Queue commands with tsp {command}
  3. To mail result, add TS_MAILTO: export TS_MAILTO=address@domain
  4. Queue with different working directory and mail result: tsp -m bash -c '(pushd /dir/to/enter && {command}; popd)'

Python defaults to ASCII sys.output encoding even if terminal is UTF-8. To fix use: PYTHONIOENCODING=utf-8:surrogateescape python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment