- Details
I've been figuring out how to block or redirect web traffic in Nginx based on the country geoIP.
NOTES
* You need the package nginx-extras for this because this package has the geoIP Nginx plugin.
* I used Japan (JP) in these examples, so change the country code to whatever you wish.
APPROACH #1 - BASIC
This uses a locally-downloaded GeoIP database.
Read more: Nginx - How to Block or Redirect by GeoIP
- Details
I re-built my LEMP web-server fresh on Ubuntu 20.04, and learned some things along the way. This is my base build outline.
Read more: Ubuntu 20.04 Nginx Build Outline
- Details
PRE-REQUISITES
- Rsync plugin
- User Scripts plugin (if you want to schedule the jobs)
- Unassigned Devices plugin
RSYNC TO UNASSIGNED BACKUP DRIVE
I often configure rsync jobs to backup critical data to an unassigned drive outside the array. My scheduled job looks something like this:rsync --archive --delete /mnt/user/SourceFolder/ /mnt/disks/TOSHIBA_MD05PBA60_1900876554/DestinationFolder/
RSYNC TO ARRAY BACKUP DRIVE
I read about a very interesting alternative backup approach with UnRAID. Instead of creating an unassigned drive to use for the backup, you actually add it to your array. Configure your shares to never use this drive. The idea here is that the backup drive will be a member of the array, but completely excluded from any and all shares. Then setup an rsync job like this:rsync --archive --delete /mnt/user/SourceFolder/ /mnt/disk4/DestinationFolder/
* Where disk4 is your backup disk.
An advantage to this approach is that the backup drive is an array member, so it's protected by parity. A disadvantage is that the drive is an array member, so it's not as easy to just pull the backup drive out if necessary. One scenario that comes to mind is if you want to rotate the backup drive with another one (e.g. off-site). Physically pulling the drive would affect the array and parity would have to be rebuilt. It would be easier to use an unassigned drive in that scenario.
- Details
PRE-REQUISITIES
- Rclone plugin
- User Scripts plugin (if you want to schedule the jobs)
SETUP RCLONE
Rclone is surprisingly easy to use, as it's very similar to Rsync. The major difference is the initial configuration, as you have to register the cloud storage provider connection. Since UnRAID does not have a browser installed, I used the headless setup process, which is very well-documented here:
https://rclone.org/remote_setup/
I first tried my Mac for this, but couldn't get it working. I gave up and succeeded with my Windows 10 PC. I'm not saying that Windows is better--just that this is life in IT. Give up and try another PC, OS, browser, cable, reboot, day. Tomorrow my Mac will work, but Windows won't.
CREATE RCLONE JOB
Here's an example rclone job. As you can see it's very similar to rsync after you have the connection setup.rclone sync /mnt/user/SourceFolder/ onedrive:backup/DestinationFolder/
I recommend running it manually with the --dry-run flag, so you can make sure it's gonna work.
Next, run it manually on a small folder.
Last, run the big guy!
If it's working, then schedule it in User Scripts. Now you're backing up your UnRAID array data to cloud storage!
- Details
I was annoyed recently because my iPhone Gmail app didn't show the latest saved drafts, and I couldn't for the life of me figure out how to clear the app's cache. I couldn't find any obvious "clear cache" option, and completely closing the app and restarting the iPhone didn't help.
This finally worked for me:
- Open the Gmail app.
- Open the sidebar and open the account list.
- Touch "Manage accounts."
- Turn OFF the account with the expired cache problem, wait a minute or so, then turn it back on.
After turning the account OFF then back ON again, the Gmail cache was cleared. It's still funny how almost every IT problem is fixed with "OFF then ON again." The trick these days is figuring out what exactly to turn off, then on.