Skip to content

Instantly share code, notes, and snippets.

View AcckiyGerman's full-sized avatar

Dima German AcckiyGerman

View GitHub Profile
SOURCE_DIR="/absolute/source/dir"
# it is a nextcloud server in the example; in your case see the docs of your webdav server
DESTINATION="https://cloud.2hv.de/remote.php/webdav/target_folder/"
USER='user_name'
PASS='user_password'
cd "${SOURCE_DIR}" || exit
while IFS= read -r -d '' file
do
@AcckiyGerman
AcckiyGerman / .sh .bash
Created May 20, 2019 08:06
yes or no dialog in bash
read -p "Are you sure (y/n)? " -r
# $REPLY is where 'read' store user input by default
if [[ ! $REPLY =~ ^[Yy](es)*$ ]]; then
echo "Bye!"; exit 1;
fi
## loop-based variant:
while true; do
read -p "Do you want to start y/n? " yn
case $yn in
@AcckiyGerman
AcckiyGerman / Django_Joomla_auth_backend.md
Last active January 31, 2019 06:37
Joomla users in Django (Django auth backend, that populates users from Joomla)

Joomla users in Django (Django auth backend, that populates users from Joomla)

Once I was in need to use our existing Joomla users in my new API, written in Django. Problem is that I could not just copy Joomla users into a Django database, because

  • Joomla password hashing system differs from Django one.
  • J-users and D-users had different set of fields (this is easy to fix, but still)

So instead I made a custom auth backend for Django, and now I can confidently say that Django can authenticate users against the Joomla database, without need to decrypt password hashes.