install GDAL in virtualenv

Posted by Dan on Friday the 1st of December, 2017

On Ubuntu

apt-get install Gdal
pip install GDAL --global-option=build_ext --global-option="-I/usr/include/gdal"

Dump/Restore Postgres DB to/from archive

Posted by Dan on Saturday the 18th of March, 2017

Dump a Postgres DB to a Gzip archive:

pg_dump db -U user | gzip > db.sql.gz

Restore dumped Gzip:

gunzip -c db.sql.gz | psql -U user db

Remove all files or directories except one

Posted by Dan on Thursday the 28th of April, 2016

To remove all directories except one specified:

ls | grep -v directory_name | xargs rm -rf

remove all files except one specified:

ls | grep -v file_name | xargs rm

  • « Previous
  • 1
  • Next »