====== Code Snippets ======
===== Delete all drafts =====
paster --plugin=ckan dataset list -c /etc/ckan/production.ini|grep \(draft\)\$|cut -f 1 -d ' '|xargs -I {} -P 3 paster --plugin=ckan dataset delete {} -c /etc/ckan/production.ini
===== Purge all datasets marked as deleted on CKAN =====
paster --plugin=ckan dataset list -c /etc/ckan/production.ini|grep \(deleted\)\$|cut -f 1 -d ' '|xargs -I {} -P 3 paster --plugin=ckan dataset purge {} -c /etc/ckan/production.ini
Credits: https://www.mishari.net/
===== Update odm_theme CKAN extension on PP =====
Instead of doing git pull
pip install --upgrade git+https://github.com/OpenDevelopmentMekong/ckanext-odm_theme.git
or
docker exec -it ckan bash
pip install --upgrade git+https://github.com/OpenDevelopmentMekong/ckanext-odm_theme.git
git clone https://github.com/OpenDevelopmentMekong/ckanext-odm_theme.git
cp -av ckanext-odm_theme/ckanext/odm_theme/* /usr/local/lib/python2.7/dist-packages/ckanext/odm_theme/
rm -rf ckanext-odm_theme
exit
docker restart ckan
===== Update odm_library CKAN extension on PP =====
Instead of doing git pull
pip install --upgrade git+https://github.com/OpenDevelopmentMekong/ckanext-odm_library.git
or
docker exec -it ckan bash
pip install --upgrade git+https://github.com/OpenDevelopmentMekong/ckanext-odm_library.git
git clone https://github.com/OpenDevelopmentMekong/ckanext-odm_library.git
cp -av ckanext-odm_library/ckanext/odm_library/* /usr/local/lib/python2.7/dist-packages/ckanext/odm_library/
rm -rf ckanext-odm_library
exit
docker restart ckan
===== Image + links for wordpress temporary sites =====