Example: Postgres, which runs on port 5432:
lsof -Pn | awk '/:5432..LISTEN/ {print $2}' | xargs -t kill
Does anyone know if Brew or something has the equivalent of good old Linux fuser -k 5432 ?
Showing posts with label xargs. Show all posts
Showing posts with label xargs. Show all posts
Wednesday, July 20, 2016
Thursday, March 24, 2016
UPDATED: quickly download lots of Python packages
This trick downloads Python packages up to 9x faster than normal:
egrep -o '^([A-Za-z].*==[^ ]+)' requirements.txt | xargs -n1 -P9 pip download
egrep -o '^([A-Za-z].*==[^ ]+)' requirements.txt | xargs -n1 -P9 pip download
After things are downloaded, actually build and install the packages:
pip install -r requirements.txt
EDIT: original code gave `egrep: Invalid range end` -- fixed. Also added "-n1" to xargs so it'll download in parallel, vs sequentially.
EDIT: original code gave `egrep: Invalid range end` -- fixed. Also added "-n1" to xargs so it'll download in parallel, vs sequentially.
Subscribe to:
Posts (Atom)