synology interview questions
Top synology frequently asked interview questions
I operates a Synology NAS device and the unit includes that over 600 users data.
The users backup data are tax accounting data.
So, approximately one user's folder has 200,000 files.
I have to provide their backup data usage informations to each users, but since there are so many directories and files, the du
command takes too long to execute.
Could someone provide me a way to check each user's disk usage in a faster way?
Source: (StackOverflow)
How can i install a actual jdk on my Synology DS213 air,
I have installed IPKG,JAMVM and JIKE that i can start a RMI-Server on my NAS but when i start the java I get this error:
DiskStation> jikes -cp /opt/lib/rt.jar RunRmiRegistry.java
Found 1 semantic error compiling "RunRmiRegistry.java":
42. for (String string : list) {
^
Semantic Error: Enhanced for loops (also known as foreach loops) are only supported for `-source 1.5' or greater.
On my PC i have installes jdk 8.45.
Source: (StackOverflow)
I have a working installation of GitLab via the official GitLab Package on my Synology NAS (DSM 5.2) in a Docker container.
I now like to access the Webinterface via https instead of just http. I have seen in several posts that it is possible to do with some docker magic, but
did not find any detailed instructions.
Can anyone please explain how to achieve this?
It's a pity that this is not default.
Source: (StackOverflow)
I am trying to create a .sh script that checks if some IP/Domain like "teamspeak.com" exists in /etc/hosts and if it does not then I want to add something to the hosts file.
Right now I am trying this with:
if ! grep -q "teamspeak.com == teamspeak.com" /etc/hosts; then
echo "Exists"
else
echo "Add to etc host ting here" >> /etc/hosts;
fi
Source: (StackOverflow)
I get "ImportError: No module named django.core.wsgi" in my Apache2 log, when trying to run a Django site. When I do run the wsgi.py from command line or try to import django.core.wsgi in a python command line everything just works fine. What could be the source of this problem?
Source: (StackOverflow)
I bought 2-3 months ago a Synology 213air NAS for programing purpose.
Then before trying to set up git manually on my NAS, I heard that DSM4.3 will propose Synology's official package. So I decided to wait.
The DSM4.3 with Git package is now out : http://www.synology.fr/dsm/dsm_app.php#Git, but there is no tutorial for beginners like me to set up Git.
So :
- How do we do to set up this official package ?
- How can I create a repo with one of my projects on my NAS ?
- Finally, how will I do to "interact" with my project ?
Source: (StackOverflow)
Is there a .NET library/project that implements the Synology Download Station API?
The Download Station is an add-on package that allows the user to schedule/queue downloads. It comes with an API (over HTTP(s)).
I found the documentation, but there's no official 'wrapper' for it for .NET.
Is there a .NET wrapper for Synology's Download Station API anywhere for use?
Source: (StackOverflow)
Please help me.
I try to compile hello world package written c++.
My environment is
OS : Ubuntu 14.4,and
synology toolchain is bromolow 64bit compiler,
But I cannot get helloworld.cgi. I don't know the reason.
Source code are
#include "webman.h"
#include <string>
#include <stdio.h>
#include <synosdk/proc.h>
using namespace std;
int main(int argc, char* argv[]) {
WebMan _cgi;
Json::Value out;
out["uname"] = "helloworld";
out["ret"] = true;
out["success"] = true;
_cgi.WriteHeader();
_cgi.WriteBody(out);
return 0;
}
and make file is
.PHONY: all clean
.SUFFIXES: .cgi
CXXFLAGS=$(shell pkg-config libdsm --cflags)
LDFLAGS+=$(shell pkg-config libdsm --libs)
CXXFLAGS+=-I/usr/syno/nclude/gpl \
-I/usr/syno/include/synocgi \
# source files
SRC=${cgi_name}.cpp
CGI=$(SRC:%.cpp=../%.cgi)
all: $(CGI)
../%.cgi: %.cpp
echo $(CXX) -o $@ $^ $(CFLAGS) $(LDFLAGS)
$(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
clean:
rm -f core *~ *.o $(CGI)
I got such error
======= Run build script =======
make: *** No rule to make target `distclean'. Stop.
==> cgi
==> js
<== js
/usr/local/i686-linux-gnu/bin/i686-linux-gnu-ccache-g++ -o ../helloworld.cgi helloworld.cpp -I/usr/local/i686-linux-gnu/include -DSYNO_X64 -O2 -I/usr/syno/include -g -DSYNO_PLATFORM=X64 -g -DSDK_VER_MIN_REQUIRED=400 -L/usr/local/i686-linux-gnu/lib -L/usr/syno/lib -Wl,-rpath-link -Wl,/usr/syno/lib -L/usr/local/i686-linux-gnu/lib -L/usr/syno/lib -L/source/libsynocgi/lib -L/usr/syno/sqlite3/lib/ -L/source/libsynoacl/lib/ -L/source/libsynosdk/gpl/ -L/source/google-authenticator-1.x -lsynocgi -ljson -lsynowireless-core -lsynoacl -lsynogpl -lsynocoregpl -lsynobandwidth -lsynowimax -lsynosdk -lsynocore -lcrypt -lnet -licui18n -licuuc -licudata -lxml2 -lattr -lm -ldl -lz -lsqlite3 -lgoogleauth -ldsm
/usr/local/i686-linux-gnu/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/bin/ld: cannot find -lnet
collect2: ld returned 1 exit status
make[2]: *** [../helloworld.cgi] Error 1
make[1]: *** [cgi] Error 2
make: *** [ui] Error 2
There is no install-dev scripts for helloworld.
Time cost: 00:00:03 [Build-->helloworld]
I got the following error:
make[2]: *** [../helloworld.cgi] Error 1
make[1]: *** [cgi] Error 2
make: *** [ui] Error 2
Source: (StackOverflow)
I have a mail server on a Synology DiskStation. I want to send emails using php but PHP mail function does not work. I have read that Synology mail server uses ESMTP and PHP uses sendmail so the mail function does not work and i need to build my message using direct SMTP. I found this:
<?php
function myMail($from, $namefrom, $to, $nameto, $subject, $message) {
$smtpServer = "xxx.xxx.xxx.xxx";
$port = "25";
$timeout = "45"; // typical timeout. try 45 for slow servers
$username = "user@example.com";
$password = "secret";
$localhost = "example.com";
$newLine = "\r\n";
$secure = 0;
$smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
$smtpResponse = fgets($smtpConnect, 4096);
if(empty($smtpConnect)) {
$output = "Failed to connect: $smtpResponse";
echo $output;
return $output;
}
else {
$logArray['connection'] = "<p>Connected to: $smtpResponse";
echo "<p />connection accepted<br>".$smtpResponse."<p />Continuing<p />";
}
fputs($smtpConnect, "HELO $localhost". $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['heloresponse2'] = "$smtpResponse";
fputs($smtpConnect,"AUTH LOGIN" . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['authrequest'] = "$smtpResponse";
fputs($smtpConnect, base64_encode($username) . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['authusername'] = "$smtpResponse";
fputs($smtpConnect, base64_encode($password) . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['authpassword'] = "$smtpResponse";
fputs($smtpConnect, "MAIL FROM: <$from>" . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['mailfromresponse'] = "$smtpResponse";
fputs($smtpConnect, "RCPT TO: <$to>" . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['mailtoresponse'] = "$smtpResponse";
fputs($smtpConnect, "DATA" . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['data1response'] = "$smtpResponse";
$headers = "MIME-Version: 1.0" . $newLine;
$headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
$headers .= "To: $nameto <$to>" . $newLine;
$headers .= "From: $namefrom <$from>" . $newLine;
fputs($smtpConnect, "To: $to\r\nFrom: $from\r\nSubject: $subject\r\n$headers\r\n\r\n$message\r\n.\r\n");
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['data2response'] = "$smtpResponse";
fputs($smtpConnect,"QUIT" . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['quitresponse'] = "$smtpResponse";
$logArray['quitcode'] = substr($smtpResponse,0,3);
fclose($smtpConnect);
//a return value of 221 in $retVal["quitcode"] is a success
return($logArray);
}
And it returns:
connection accepted
220 example.com ESMTP Postfix
Continuing
But my email does not arrive.
Thank you for help.
NOTE: Hostname was replaced by example.com
Source: (StackOverflow)
I would like to use a nginx
front server on my Synology NAS for reverse-proxying pruposes. The goal is to provide a facade for the non-standard port numbers used by diverse webservers hosted the NAS. nginx
should be listening on port 80, otherwise all this wouldn't make any sense.
However DSM comes out of the box with an Apache
server that is already listening on port 80. What it does is really silly : it simply redirects to port 5000, which is the entry point to the NAS web manager (DSM).
What I would like to do is disable this functionality, making the port 80 available for my nginx
server. How can I do this ?
Source: (StackOverflow)
OK, so, I've been using auto-loaders for a while, become rather used to MVC, and decided to try to tackle namespaces. Well, this hasn't worked as expected. I have managed to reproduce the error in a very simple way, so the contents of my php file read:
<?php
namespace site\test;
echo 'hello';
The output is not what I expected:
Fatal error: Namespace declaration statement has to be the very first statement in the script in file on line 2
I'm running PHP 5.3.10 on a Synology NAS, using the latest version of DSM (Synology's OS). This makes use of Apache v2.2.22. I can confirm that commenting out the "namespace" line returns the word "hello", with no extra characters before it.
There is no BOM at the beginning of the file. I also have no issues with setting headers such as "Location" which would suggest this as being an issue.
Line endings are Unix (\n only) and the character encoding of the file is UTF8.
The PHP setting "auto_prepend_file" is empty.
Source: (StackOverflow)
I've tried for quite some time to build node.js onto my Synology DS1511+. I've read this tutorial along with the comments, but I still hit a strange error that I cannot figure out how to build it. After I run sudo make
it runs the build fine for about 15 to 20 minutes, but then I get this:
/volume1/homes/admin/node/out/../deps/uv/src/unix/thread.c:286: undefined reference to `pthread_condattr_setclock'
collect2: ld returned 1 exit status
make[1]: *** [/volume1/homes/admin/node/out/Release/node] Error 1
make[1]: Leaving directory `/volume1/homes/admin/node/out'
make: *** [node] Error 2
From the error, it seems like it's related to the pthread libraries, but I really don't know if that's the case, especially since I replaced the pthread libraries according to the tutorial. BTW, the tutorial shows how to build node for an ARM based processor, but the Synology I'm building on is i686.
Anybody know how I can overcome this issue building node.js on the DS1511+
Source: (StackOverflow)
I have a Synology (DS211j, DSM 5.1-5022 Update 1, Python27) box and I'm trying to install pandas
package on it via pip
. Everytime I run pip install pandas
, I'm getting the following error message in console:
ImportError: No module named cygwinccompiler
I believe this package should be installed on Windows machines but not in Linux. Is there anything I need to install prior using pip
utility?
Source: (StackOverflow)
With the Synology DSM6 update, we have now to use Nginx instead of Apache. By default Nginx configuration don't allow wordpress permalinks (generate 404).
I read the idea was to transform the /uri in /?p=$uri and put this configuration in the "location" section of the server nginx config.
Where to put this configuration in DSM6 exactly ?
Source: (StackOverflow)