Accessing external USB disk attached to my ASUS RT-AC68U router

I have my own cloud storage server using ownCloud for many years now, and love it. It’s like DropBox, only better.

However, even with that, it’s still nice to have a shared storage for my home network. So today I bought a Seatate Ultra Slim USB 3 disk from Costco, with 2TB capacity. It is attached to my router, ASUS RT-AC68U. Here are the steps for:

  • Router set up;
  • Mount a drive on Windows;
  • Mount a drive on Linux;

1. Go to through your browser;
2. USB Application (left side);
3. Media Services and Servers;
4. Network Place (Samba) Share / Cloud Disk;
5. Enable Share. I also enabled Allow guest login. Leave everything and click “Apply”.

Map a drive to \\\Seagate_Backup_Plus_Drive\Seagate

sudo apt install cifs-utils
sudo mkdir /media/routerUSB
Edit /etc/fstab, adding this line:
// /media/routerUSB cifs guest 0 0
Run sudo mount -a

Update: I’m now running Manjaro Arch Linux on my home workstation. cifs-utils is installed by default. I created the routerUSB folder under /mnt. In addition, the entry I added to /etc/fstab is a bit different. To get rid of an error similar to “host not found”, I added the vers=1.0 option:
//RT-AC68U-56E8/Seagate /mnt/routerUSB cifs username=user,password=password,vers=1.0 0 0


Initial impressions of SQL Server v.Next Public Preview

Microsoft announced its SQL Server on Linux public preview yesterday. I’m really excited to check it out. Here are some interesting things I found during my testing. I’ll write more as I play with it further.

  • If you want to play it on Ubuntu, it needs to be 16.04 or above. I didn’t pay attention to that initially, and started installing on Ubuntu 14. Below is a typical message you would get:
    The following packages have unmet dependencies:
     mssql-server : Depends: openssl (>= 1.0.2) but 1.0.1f-1ubuntu2.21 is to be installed
    E: Unable to correct problems, you have held broken packages.

    Running sudo apt-get dist-upgrade brought my Ubuntu to 16.04. The install was smooth afterwards.

  • Instruction for Red Hat Enterprise Linux also works for Fedora. I tested it on Fedora 23. I think it should also work on CentOS, although I didn’t test it myself.
  • The machine needs to have at least 3.25 GB of memory. On Ubuntu, install won’t continue if that condition is not satisfied:
    Preparing to unpack .../mssql-server_14.0.1.246-6_amd64.deb ...
    ERROR: This machine must have at least 3.25 gigabytes of memory to install Microsoft(R) SQL Server(R).
    dpkg: error processing archive /var/cache/apt/archives/mssql-server_14.0.1.246-6_amd64.deb (--unpack):
     subprocess new pre-installation script returned error exit status 1
    Processing triggers for libc-bin (2.21-0ubuntu4.3) ...
    Errors were encountered while processing:
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    On Fedora, installation finishes, but you won’t be able to start the service:

    [hji@localhost ~]$ sudo /opt/mssql/bin/sqlservr-setup 
    Microsoft(R) SQL Server(R) Setup
    You can abort setup at anytime by pressing Ctrl-C. Start this program
    with the --help option for information about running it in unattended
    The license terms for this product can be downloaded from and found
    in /usr/share/doc/mssql-server/LICENSE.TXT.
    Do you accept the license terms? If so, please type "YES": YES
    Please enter a password for the system administrator (SA) account: 
    Please confirm the password for the system administrator (SA) account: 
    Setting system administrator (SA) account password...
    sqlservr: This program requires a machine with at least 3250 megabytes of memory.
    Microsoft(R) SQL Server(R) setup failed with error code 1. 
    Please check the setup log in /var/opt/mssql/log/setup-20161117-122619.log
    for more information.
  • Some simple testing 🙂 From the output below, we learn that: 1)in sys.sysfiles, full file name is presented like “C:\var\opt\mssql\data\TestDb.mdf”; 2) Database name, at least inside sqlcmd, is not case-sensitive. By the way, login is also case-insensitive: SA is sA.
    1> create database TestDb;
    2> go
    Network packet size (bytes): 4096
    1 xact[s]:
    Clock Time (ms.): total       447  avg   447.0 (2.2 xacts per sec.)
    1> use testdb;
    2> go
    Changed database context to 'TestDb'.
    Network packet size (bytes): 4096
    1 xact[s]:
    Clock Time (ms.): total         3  avg   3.0 (333.3 xacts per sec.)
    1> select filename from sys.sysfiles
    2> go
  • I then did a quick testing of advanced feature, like Clustered Columnstore Index (CCI). Yes, it’s available in SQL Server for Linux!
    1> create table Person (PersonID int, LastName nvarchar(255), FirstName nvarchar(255))
    2> go
    Network packet size (bytes): 4096
    1 xact[s]:
    Clock Time (ms.): total        28  avg   28.0 (35.7 xacts per sec.)
    1> create clustered columnstore index Person_CCI on Person;
    2> go
    Network packet size (bytes): 4096
    1 xact[s]:
    Clock Time (ms.): total        25  avg   25.0 (40.0 xacts per sec.)
    Network packet size (bytes): 4096
    1 xact[s]:
    Clock Time (ms.): total         1  avg   1.0 (1000.0 xacts per sec.)

Overall, it looks pretty nice! I’ve got to say, I’m really impressed with Microsoft’s embrace of Linux. By the way, if you use Windows 10, I recommend Bash on Ubuntu on Windows. It’s in beta, but it works for me pretty well so far.

Stay tuned for more. I’ll definitely write more as I play with this new toy!

anacron and defunct logrotate configuration file

I’ve been hacking Linux for years, and today is the first time that I came across anacron. So one lives and learns…

One of my fellow OCEF volunteers keeps receiving the following email message, even after he removed fail2ban:

logrotate_script: 2: logrotate_script: fail2ban-client: not found
error: error running non-shared postrotate script for /var/log/fail2ban.log of '/var/log/fail2ban.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

It turned out this server’s log files rotation is handled by anacron job. Even though fail2ban service has been removed, there is still a configuration file, fail2ban, under /etc/logrotate.d/

/var/log/fail2ban.log {
    rotate 4

	fail2ban-client set logtarget /var/log/fail2ban.log >/dev/null

    # If fail2ban runs as non-root it still needs to have write access
    # to logfiles.
    # create 640 fail2ban adm
    create 640 root adm

Removing this file took care of it.




  1. 到这里下载客户端软件。一般来讲你要下载64位的。目前的文件名是openvpn-install-2.3.8-I601-x86_64.exe
  2. 下载完毕后安装。它可能会问要不要安装一个叫TAP的东西。你需要安装;
  3. 安装完毕,把那个.ovpn文件挪到C:\Program Files\OpenVPN\config之下
  4. Run OpenVPN GUI as administrator。这只是开启了程序,现在还没有连接到openvpn服务器上;
  5. 在屏幕右下角的空间里,找到OpenVPN GUI的图标,然后选择“connect/连接”;
  6. 连接成功。打开浏览器,试试访问以前不能访问的网站,看效果如何。

Windows 10注意事项
我发现一些不是通过安装而是通过升级到Windows 10的机器会碰到一些问题,我猜和IPv6兼容有关。我发现如果我用火狐浏览器,就可以避免这个问题。全新的Windows好像没这个问题。


  1. 打开命令行,安装openvpn:
    apt-get install openvpn
  2. sudo openvpn --config /EnterPathTo/xxx.ovpn
  3. 你可以看到vpn连接的信息。在使用openvpn的时候,你不能中断或关闭这个程序。你可以把这个Window缩小
  4. 连接成功。打开浏览器,试试访问以前不能访问的网站,看效果如何。
  5. 用完了openvpn,按Ctrl-C就可以终止了。


在App Store里安装免费的OpenVPN Connect。之后你可以把爱疯连到iTunes上,用File Sharing,点击OpenVPN,然后把那个profile的.ovpn的文件拖进来。之后打开这个app,你可以看到一个新的profile可以import。之后就可以顺利连接。

在App Store里找OpenVPN Connect后安装。然后把profile的.ovpn文件传到Android上。打开后利用Import功能,把profile引进后就可以很方便的应用。


PS. 本系列其它文章
自建vpn之三:搭建openvpn service和生成客户端Profile

自建vpn之三:搭建openvpn service和生成客户端Profile


我原计划给读者提供一步一步的说明,但那样会太繁琐。前两天注意到github上有人已经把这一切打包成一个shell脚本。我今天看了下,觉得写得很好。经过我成功测试后,推荐给你使用。并且这个脚本对Ubuntu,Debian, CentOS, RedHat啥的都管用。

  1. 请到 下载openvpn-install.sh脚本文件;
  2. 打开命令行,运行:
    bash /EnterRightPathHere/
  3. 脚本程序会自动探测到你的IP网址,按回车键;
  4. 脚本问你用tcp或udp。如果你在大陆,我建议你用udp。udp因为不需要确认数据包安全抵达目的地信息,所以理论上比tcp要快;
  5. 脚本问你port number。我建议你用443。443是https的端口,这样你的vpn和https用同一个端口,我觉得可能更难以堵截;
  6. 脚本程序让你选择DNS。我不建议第一个选项(Current system resolvers)。2和6均可.
  7. 脚本程序让你命名客户端名字。默认是client。我不建议你用默认。建议你根据其所用的设备和数据中心命名,如androidFrankfurt,iphoneFrankfurt,或winPcFrankfurt等等。请用英文字母来命名;
  8. 再敲一次回车,程序就开始运行。运行时间差不多三五分钟,请等待,稍安毋躁。
  9. 运行结束后,openvpn服务器已经搭建完成并开始运行。接下来你要把它产生的.ovpn文件(profile 文件),比如winPcFrankfurt.ovpn输送到你的Windows/MacBook/Linux/Android/iPhone设备上。强烈建议你用WinSCP(Windows)或scp(Linux/Mac)来输送文件,防止在传送途中被偷窥;
  10. 如你需要产生更多的.ovpn文件,只要重新运行
    bash /EnterRightPathHere/


haidong@localhost:~/openvpn-install-master$ sudo openvpn --config /etc/openvpn/server.conf
Options error: --dh fails with 'dh.pem': No such file or directory
Options error: --ca fails with 'ca.crt': No such file or directory
Options error: --cert fails with 'server.crt': No such file or directory
Options error: --key fails with 'server.key': No such file or directory
Options error: --crl-verify fails with 'crl.pem': No such file or directory
Options error: --tls-auth fails with 'ta.key': No such file or directory
Options error: Please correct these errors.
Use --help for more information.



PS. 本系列其它文章