Synology Letsencrypt DNS-01 cert issue and install

Install the acme.sh Client

  • SSH to Synology DiskStation.
  • sudo -i to root login.
  • Install acme.sh manually.
    $ wget https://github.com/Neilpang/acme.sh/archive/master.tar.gz
    $ tar xvf master.tar.gz
    $ cd acme.sh-master/
    $ ./acme.sh --install --nocron --home /usr/local/sbin/acme.sh
    

Logout and login back again. so install is done :)

  • next step is to do the configuration:
    $ cd /usr/local/sbin/acme.sh
export CF_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
export CF_Email="[email protected]"
  • Issue and install the certs. The code below to reflect your own path and domain name.
./acme.sh  --issue -d YOURDOMAIN.TLD --dns dns_cf --certpath /usr/syno/etc/certificate/_archive/PATH/cert.pem --keypath /usr/syno/etc/certificate/_archive/PATH/privkey.pem --fullchainpath /usr/syno/etc/certificate/_archive/PATH/fullchain.pem --capath /usr/syno/etc/certificate/_archive/PATH/chain.pem --reloadcmd "/usr/syno/etc/rc.sysv/nginx.sh reload"
  • Configure Crontab for root
$ vi /etc/crontab 
Add the following line to the crontab. Remember to use tab for spacing.
0    10    2    *    *    root    root /usr/local/sbin/acme.sh/acme.sh --cron --home /usr/local/sbin/acme.sh/

Continue reading “Synology Letsencrypt DNS-01 cert issue and install”

Synology Cloudflare DDNS Script

Run commands in Synology

  1. Download cloudflareddns.sh from this repository to /usr/local/sbin/cloudflaredns.sh
wget https://raw.githubusercontent.com/joshuaavalon/SynologyCloudflareDDNS/master/cloudflareddns.sh -O /usr/local/sbin/cloudflaredns.sh

If you put the script in other name or path, make sure you use the right path.

  1. Give others execute permission
chmod +x /usr/local/sbin/cloudflaredns.sh
  1. Add cloudflareddns.sh to Synology
cat >> /etc.defaults/ddns_provider.conf << 'EOF'
[Cloudflare]
        modulepath=/usr/local/sbin/cloudflaredns.sh
        queryurl=https://www.cloudflare.com/
EOF

queryurl does not matter because we are going to use our script but it is needed.

Get Cloudflare parameters

  1. Go to your domain overview page and get the Zone ID.
  2. Go to your account setting page and get API Key.
  3. Get record id using Cloudflare API.
curl -s GET "https://api.cloudflare.com/client/v4/zones/[Zone ID]/dns_records" \
	-H "X-Auth-Email: [Email]" \
	-H "X-Auth-Key: [API Key" \
	-H "Content-Type: application/json" \
	| jq '.result[] | {name, id, zone_id, zone_name, content, type}'

You need to replace with [] with your parameter. Then, you get the id in result which is you Record ID.

Setup DDNS

  1. Enter the parameters to the cloudflareddns.sh.
  2. Login to your DSM
  3. Go to Control Panel > External Access > DDNS > Add
  4. Select Cloudflare as service provider. Enter your domain as hostname, your Cloudflare account as Username/Email, and API key as Password/Key

Customize Namecheap DDNS script for Synology

sudo -i
wget https://www.xfelix.com/wp-content/uploads/2017/06/namecheap.zip
unzip namecheap.zip
Extract and move namecheap.php to /usr/syno/bin/ddns/

Grant privilege
sudo chmod 755 /usr/syno/bin/ddns/namecheap.php

Edit DDNS Provider list
sudo vi /etc.defaults/ddns_provider.conf
Insert
[Namecheap]
modulepath=/usr/syno/bin/ddns/namecheap.php
queryurl=https://dynamicdns.park-your-domain.com/

In the DSM web interface, open the DDNS menu
Hostname: example.com
Username/Email: www
Password: nameCheap DDNS passkey

 

Add TransmissionBT task from iOS devices

Till now, there is no official iOS app to add/manage torrent tasks of TransmissionBT. The only working application is iControlbits which is available to Jailbroken iOS users.
So there is not much choice left for non-jailbroken users to manage Tranmission tasks. We can use Safari web browser to view and delete the downloading task but no way to add torrent file as iOS has a very strictly privilege control on file dealing. It is impossible to download a torrent file and upload it via Safari browser.
Continue reading “Add TransmissionBT task from iOS devices”

Disable Adobe Reader Sign In when open a PDF

I do not remember since when Adobe Reader mandatory requires user to login their Adobe ID once open a PDF file. It is quite annoying. Especially, if you are on a slow Internet environment, you have to wait for login page to be fully loaded. And during that time, you cannot scroll down to browse the PDF content. How to get rid of this silly online function? Here is the solution.

Continue reading “Disable Adobe Reader Sign In when open a PDF”

奇葩的ebay

话说前不久为了在ebay上买一台mint拖地机,新注册了个美国ebay的账号。和其他美国购物网站一样,地址、电话当然写的是转运公司的仓储地址。然后就是绑定已经用了很久很久的paypal付钱,收货。卖家很不错,还给了好评。没想到刚买第二天商品就跌价,发了封站内信给卖家,卖家二话不说就把差价打到我paypal了。非常愉快的购物经历。

过了一周,货还没到转运公司呢,却收到了ebay的邮件,MC999,我的ebay账号因为安全原因被无限制禁止了。 Continue reading “奇葩的ebay”

RAID是否适合家用?

随着家庭网络带宽的提速,硬盘容量的剧增,家庭数据量也成倍增加。如今的数字化家庭生活,对网络存储(NAS)的需求也不断增强。

家庭数据无外乎电影、音乐、照片以及一些重要文档。这些数据虽不及企业的数据那么关键和重要,但是珍贵的照片、文档等数据一旦丢失,还是非常的心痛的。于是乎,家庭数据的安全性也逐渐被人们重视。人们想到了企业常用的RAID技术来武装家庭的NAS系统。有用RAID0来提升读写速度、有用RAID1来增加数据的可靠性,也有人用多块硬盘做RAID5或RAID10来确保数据的可用性。提到RAID,人们总是说,现在的硬盘啊,质量参差不齐,纯粹拼人品,建了RAID后,如果不幸哪块硬盘坏了,也不影响数据的完整性,只要再买一块硬盘顶上就行了。但是这仅仅是RAID的好处,大家却忽视的RAID的一些隐患。我的观点是,个人家庭用户不建议使用RAID! Continue reading “RAID是否适合家用?”

给E4200路由器增加SWAP缓存,稳定BT下载

Linksys E4200的内存只有64M,刷了tomatoUSB固件再加载Transmission BT下载后,这么点内存颇为捉襟见肘。BT任务一多,Transmission daemon就会crash,有时甚至影响到整个路由器的稳定性。现在通过在外接到USB硬盘上增加SWAP分区,可以有效的解决E4200内存不够用的问题。这下BT下载稳定、可靠了。 Continue reading “给E4200路由器增加SWAP缓存,稳定BT下载”

Manually create MySQL database in CLI

MySQL is a widely spread SQL database management system mainly used on LAMP (Linux/Apache/MySQL/PHP) projects.

The best way to modify mysql database is going through phpmyadmin webgui. But if you only have local SSH shell access to the database, you will need to confirm the way of create mysql database and user in command line.

Continue reading “Manually create MySQL database in CLI”

VPS初步可以使用了

终于下决心花钱买了个VPS,有了自己的掌控的空间。VPS与传统的webhosting比起来,需要更多的精力和时间去打理,没有多少tech support,全靠自己和google。

不过好在已经为宝贝女儿注册了个域名,加上把自己原先的域名一同host在这个VPS上。只希望能够稳定,好用。