Posts

Showing posts from July, 2023

Mount StorageBox to the server for backup

  Quickly  solution Install cifs-utils: apt-get install cifs-utils Adjust and add the following lines to   crontab -e   : # reboot # This one should be moved to /etc/fstab @reboot /sbin/mount.cifs -o user=uXXXXXXXX,pass=xxxxxXXXXXX//uXXXXXX.your-storagebox.be/backup /mnt/storagebox_jobsites_backup/ SAMBA/CIFS You can mount your Storage Box via Samba/CIFS. You can use the following UNC path. If you are using your main account, the share name is  backup . If you are using a sub-account, you must use the username of the sub-account as the username and share name. Linux/Unix: //<username>.your-storagebox.de/<share_name> Windows \\<username>.your-storagebox.de\<share_name> If you use a FritzBox Router from AVM, you need to deactivate the NetBIOS filter for Samba/CIFS to work. Please check the AVM knowledge base for more information.  https://en.avm.de/service/knowledge-base/dok/FRITZ-Box-7590/835_Shared-files-and-printers-on-a-computer-are-not-available-over-the-inte

Borg: avoid running out of space ubuntu server

Image
  borg compact --verbose --debug --progress ssh://uXXXXXX@uXXXXXX.your-storagebox.be:23/./borg_backups/jobsites positional arguments   REPOSITORY repository to compact options   --cleanup-commits cleanup commit-only 17-byte segment files   --threshold   PERCENT set minimum threshold for saved space in PERCENT (Default: 10) Common options Description This command frees repository space by compacting segments. Use this regularly to avoid running out of space - you do not need to use this after each borg command though. It is especially useful after deleting archives, because only compaction will really free repository space. borg compact does not need a key, so it is possible to invoke it from the client or also from the server. Depending on the amount of segments that need compaction, it may take a while, so consider using the  --progress  option. A segment is compacted if the amount of saved space is above the percentage value given by the  --threshold  option. If omitted, a threshol

Overriding Templates widget templates: django.template.exceptions.TemplateDoesNotExist

Image
 Zie jobsites > jobfor > widgets.py ( CustomReCaptchaV3) For others who stumble on this and are unable to set the FORM_RENDERER, I did the following which ended up working for me: Subclass the  ReCaptchaV3  and override the  render method() : # myproject/widgets.py from captcha.widgets import ReCaptchaV3 from django.template import loader from django.utils.safestring import mark_safe class CustomReCaptchaV3(ReCaptchaV3): template_name = "recaptcha/widget_v3.html" def render(self, name, value, attrs=None, renderer=None): context = self.get_context(name, value, attrs) template = loader.get_template(self.template_name) ⬅️⬅️⬅️⬅️⬅️ **Used template loader ** return mark_safe(template.render(context)) Then use Subclass the  ReCaptchaField  and override the  widget  and  default_error_messages : # myproject/fields.py from django import forms from django.utils.translation import gettext_lazy as _ from captcha.fields import ReCaptchaField # fro