Software development

  • Connect a USB Drive to Your Cloud
  • Linux Email Notifications for Cron Jobs and Bash Scripts
  • Flask, Docker, Pycharm - Setting up development environment
  • Auto re-mount USB drive on linux server

    This script is especially useful after a server reboot, when the USB drive sometimes fails to mount automatically.

    sudo apt-get install udisks2
    blkid /dev/sdb1
    
    #!/bin/bash
    MOUNT_POINT="/mnt/usb/adata-backup"
    DEVICE_UUID="XXXXXXXXXXXXXXXXXXXXXX"
    
    if ! mountpoint -q "$MOUNT_POINT"; then
        echo "Mounting drive"
         mount /dev/sdb1 /mnt/usb/adata-backup
    fi
    

    And add it to the cron tab to be run every hour.

    #soft #linux #proxmox

    💻 Mac user frustrated with Home/End keys?

    Here is the gist that remaps Home and End to work like on Windows/Linux-jumping to the beginning/end of the line, not the whole document!

    #macos #soft

    This script is useful if you want to see two full weeks at once in the macOS Calendar app, instead of just the standard 7-day week view. I use it every Monday morning to review what I didn’t finish last week and to plan my tasks for the upcoming days.

    Command:

    defaults write com.apple.iCal n\ days\ of\ week $dni
    

    Script

    #soft #macos