Blog
-
Synology router “RT1900ac” as an SSH server
How to enable SSH access for user accounts? Log in as root; within /etc/passwd change the default shell entries of the resp. user accounts from /sbin/nologin to /bin/ash.
The resp. user accounts may want to have their public keys get placed in their .ssh/authorized_keys2 .
Of course the firewall needs to get opened a little on the local side for that – there is already a configuration for that, it is called “Encrypted terminal service (includes SFTP)“.
-
Synology router “RT1900ac” as an NFS server
- https://www.synology.com/en-global/products/RT1900ac
- https://en.wikipedia.org/wiki/Network_File_System AKA NFS
- /etc/init/nfsd-adapter.conf – read it, and find out how to start and stop the NFS daemon – it is rather, rather simple, honestly!
- /etc/exports – all this is on one line in your file:
/volumeUSB5/usbshare *(rw,async,no_wdelay,crossmnt,insecure,no_root_squash,insecure_locks,sec=sys,anonuid=1025,anongid=100)
The /etc/fstab entry looks like this (again: all this is on one line in your file):
SynologyRouter:/volumeUSB5/usbshare /media/synologyrouter nfs4 noauto,nouser,dev,exec,suid,hard,rw,bg,sec=sys 0 0
Maybe you want to replace SynologyRouter with its one of its internal IP addresses like 192.168.1.1.
The device service can out of the box serve as a CIFS and Apple file server, but despite it’s sisterhood to the Synology DiskStations the GUI is not prepared to make use of the NFS server. Yet on the command line you can achieve it.
I attached a hard disk through USB-2 (it appears as /volumeUSB5/usbshare), and made it available via /etc/exports. USB-2 has its limitations, but this set-up works perfectly for my needs.
Yes, we have to open the router’s firewall in order to let NFS communication through. I am currently a little relaxed w.r.t. opening the firewall, because I am running “our device” locally i.e. within my LAN. Of course nfsd must not be accessible on the WAN port but only on the LAN ports incl. wifi (Source IP / Specific IP / Select / Subnet / …). I will explain that here a little later.
-
“webp2png” converts WebP images to PNG
And this utility made me finally install Go (as packages) for Mac OS X and (Intel based) Linux.
$ .../bin/webp2png -input ___.webp -output ___.png # 'somewhere' on $GOPATH
“go get” is the Go way of installing a package together with its dependencies.
My search for a webp2jpg command line utility wasn’t quite as successful as for webp2png – I am quite glad I found webp2png finally – there a web sites that serve WebP image files only, but I have not utility yet to view such image files.
-
Stephen Dolan’s “jq” is a lightweight and flexible command-line JSON processor
- https://stedolan.github.io/jq/
- https://stedolan.github.io/jq/tutorial/
- https://stedolan.github.io/jq/manual/
- https://github.com/stedolan/jq
- https://github.com/stedolan/jq/wiki
- https://github.com/stedolan/jq/wiki/Cookbook
- https://stackoverflow.com/questions/tagged/jq
- http://shop.oreilly.com/product/0636920032823.do – o’Reilly “Data Science at the Command Line” – has some examples making use of jq
- https://library.oreilly.com/book/0636920032823/data-science-at-the-command-line/84.xhtml?ref=toc#_jq – behind a paywall
- available as source (portable C) and as executables for various Intel-based platforms, i.e. some Linux distributions, Mac OS X, Windows incl. Cygwin
- https://cygwin.com/packages/x86_64/jq/
- https://www.safaribooksonline.com/library/view/json-at-work/9781491982389/ch06.html#json_search : …,
jq,jqPlay,jq-tutorial, …
“jq” (presumably) stands for “JSON query processor”.
jq helps writing shell scripts processing JSON responses from e.g. RESTful application APIs like Jenkins, Atlassian JIRA, Atlassian Confluence, … – code making use of powerful means like XPath (…) or jq is supposedly far more readable than Python / Perl / … scripts slurping the JSON and processing it (w/o jq resp. XPath) – but there are also Python resp. Perl bindings for jq.
Hope and fear
A couple of weeks ago I had written a shell script querying a Jenkins server’s REST API “à la XML”. Now it looks a little straighter to query the API “à la JSON” and employ jq. But the critical question is, whether the (industrial) customer (I wrote the Jenkins utility for) will like the dependency on a utility like jq. My Jenkins utility might have to serve for quite a couple of years – but who can predict the future and availability of jq?
Update 2016-02-23: Meanwhile I built a shell script with a couple of simple jq queries accessing Jenkins CI. Looks rather impressive to me.
If you do XPath queries from shell scripts, you always have the option to rewrite the shell script as Python or Perl script. But what about JSON queries (…) in Python or Perl?
- https://pypi.python.org/pypi/jq
- https://github.com/spiritloose/JQ — “Perl binding for jq”
By default, jq pretty-prints JSON output.
$ jq . < … > …
-
Synology router “RT1900ac” – my christmas toy
- https://www.synology.com/en-global/products/RT1900ac
- cyberport had an intriguing offer: a demonstration model with a moderate discount – I couldn’t resist
[2015-12-20 00:27:39] johayek@Hayek001 $ ssh root@router.synology.com BusyBox v1.16.1 (2015-10-29 15:37:59 CST) built-in shell (ash) Enter 'help' for a list of built-in commands. SynologyRouter> ./config.guess armv7l-unknown-linux-gnueabihf SynologyRouter> ./config.guessJHn =config.guessJHn,0: $config_unique=>{synology_northstarplus_rt1900ac},$config_buildnumber=>{5781},$config_smallfixnumber=>{2} // ... armv7l-synology-DSM5.2_5781_2Alright … – it’s a Busybox.
ssh-ing into the admin and (better!!!) root account works almost instantly. Use the GUI password for this purpose!
How to enable SSH access for user accounts? Log in as root; within /etc/passwd change the default shell entries of the resp. user accounts from /sbin/nologin to /bin/ash. (I created a separate article on that on this blog.)
I had an old 4GB SD card, that I inserted, and apart from that it seems to have internal 2GB disk volume space. I also attached an old external disk through USB to this device. More on that in my separate NFS article.
My ds115j has a compatible CPU (almost?!?), so I can borrow (extra) utilities from it:
- rsync – as opposed to the “tainted” rsync that Synology provides
- less – as opposed to poor old more
- …
For my 1st steps I attached its WAN port as a client to my VDSL router. Good for updating, good for getting acquainted with its features.
I disconnected that cable, and I attached these sticks / dongles successfully:
- http://www.amazon.de/dp/B00VUATPDC – Huawei K3765 (HSDPA, HSUPA, UMTS, …) – GSM telephony capable (e.g. with the AVM FRITZ!Box 7490 / 7390)
- http://www.amazon.de/dp/B002FP1584 – Huawei K3565-Z (HSDPA, HSUPA, UMTS, …) – not mentioned on the list below so far (2015-12-21)
Here is Synology’s “3G/4G Dongle” compatibility list: