JFS_BASE=/Users/yujunz/JuiceFS
JFS_NAME=rogerz-s3-cn-east-1-qiniu
BUNDLE=TimeMachine.sparsebundle
VOLUME=/Volumes/TimeMachine
# Mount JuiceFS
juicefs mount --cache-dir $JUICEFS_BASE/cache --batch 10 --writeback --metacache --opencache $JFS_NAME $JFS_BASE/$JFS_NAME
# Create sparse bundle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Open S3 service in AWS, create bucket and get the access point, like this: https://${bucket-name}.s3.us-west-2.amazonaws.com | |
2. Go to https://tidbcloud.com and register a new free TiDB instance (10G), get a MySQL endpoint, and make sure the traffic filter is properly configured to allow public access. | |
3. Install the juicefs client locally in Distributed Mode (https://juicefs.com/docs/community/getting-started/for_distributed) | |
4. initialize and mount FUSE according to the following two lines: | |
# juicefs format --storage s3 \ | |
--bucket https://${bucket-name}.s3.us-west-2.amazonaws.com \ | |
--access-key ${aws-access-key} \ | |
--secret-key ${aws-secret} \ | |
mysql://${mysql-user}:${mysql-password}@\(your-cloud-tidb.prod.aws.tidbcloud.com:4000\)/juice \ |
Because I use Cloudflare to manage my domains and Backblaze for backups, it only made sense to take advantage of their Bandwidth Alliance for creating my own CDN. This has been incredibly helpful for image hosting for this knowledge base, however, I recently noticed that caching wasn't working as it should.
The overall problem started when I was adding a parking page for a domain I recently purchased. The background image was hosted on B2 and the image was supposed to be cached by Cloudflare. However, each time the page loaded, it would pull the image from the origin instead of the cache. I checked this on my knowledge base and found it was doing the same thing.
- Using a ready-to-use Ubuntu image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* nginx日志文件分析。 | |
* 根据配置的nginx日志格式,分析对应的日志内容。各变量 | |
*/ | |
class NginxLog { | |
protected static $br = "\n"; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opkg install wireguard bash coreutils-stat | |
mkdir /etc/wireguard | |
ln -s /proc/self/fd /dev/fd # fix /dev/fd/63 error: ... < (...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
********************** | |
*** Pre-requisites *** | |
********************** | |
1. Set up Windows 2016 password: | |
gcloud beta compute --project <project_id> reset-windows-password <instance_name> --zone <zone_name> | |
ip_address: <ip_address> | |
password: <defult_password_generated> | |
username: <username> | |
3. Installing Docker: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Weekly Fail2Ban Report | |
# Be sure to sudo chmod +x script_name.sh to make it executable | |
# Original script from https://www.mopar4life.com/fail2ban-weekly-report-script/ | |
FAIL2BAN_PATH="/var/log/fail2ban*" | |
LOGFILE="/var/log/custom_fail2ban_report_$(date +%m%d%Y).log" | |
MAILTOADDRESS="your@domain.tld" | |
SUBJECT="$HOSTNAME Weekly Fail2Ban Report" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
networks: | |
kong-net: | |
driver: bridge | |
services: | |
####################################### | |
# Postgres: The database used by Kong |