Synology DS120j autostart node.js server in deamon mode on system boot - node.js

How to start node.js server in deamon mode on Synology DS120j NAS (and other synology models if it's similar) drive since it looks that there is not systemd?

You need to create an installer package (spk).
Therefore you find related developer documents provided by synology
If you have docker on your diskstation, you find a solution by KeesCBakker on github
Even it is possible to create the required files inplace on the DiskStation, I recommend to create an spk with a build environment as provided by SynoCommunity

Related

Python/Pycharm on a nas server

I recently upgraded my mac-mini with external hard drives to a proper NAS server (DS920+).
With the mac-mini I installed Pycharm and was able to code/develop a few projects on it. Now with the NAS server, I can't find a tutorial on how to install pycharm. It seems that everything has to be done in command-line. Isn't there a way to have a proper IDE? or do I need to create a virtual machine with windows for instance and there I would install pycharm (?) My goal is not to develop code on the nas but rather on my local PC (mostly scripts for data fetching/automation) and have a nice user interface on the nas (and not the command line window)
Furthermore I have developped a web server based on dash/plotly. Ideally I would like to have the webserver deployed on the nas. So I have a collection of .py files and a main.py which lauches the web server. I would need to use "docker" in order to deploy my code onto the nas right?

Create an Azure virtual machine with premade files and run them?

Is there a way in Azure to create a new virtual machine with preselected files that will always be there when establishing the new machine, as well as run them?
I have a shell script that I have to run on new Ubuntu machines that I deploy and I was wondering if there's a way to make Azure already install Ubuntu with those files and maybe even run them.
You can store the files in a storage account and quickly get the files in your VM: https://learn.microsoft.com/en-us/azure/storage/files/storage-files-quick-create-use-windows. Alternatively, you can restore a backup of a VM that has all prerequisites installed: https://learn.microsoft.com/en-us/azure/backup/backup-azure-arm-restore-vms.
If this is not what you're looking for, I think you should create an ISO of your VM with all software/files installed that you want. This is however not straightforward, see the discussion here: https://serverfault.com/a/952930
If I do not misunderstand, you're searching for a way to run the shell script when creating a new VM. Then I will recommend you use the cloud-init, it can run your shell script to provision the VM in the creation time. You can follow the notes here to use the shell script.

Deploy NWJS with docker

I am developing an app with NWJS, now I am thinking in the deploy process, what I need is install the app into different machines that will use that app, the problem that I see is if I change some file I will need install again into each machine, I was reading about docker and if I understood fine, I can make an Image and download the last version of the app into each machine that use the app.
The Question is if can I upload the app into a container and download that into each machine?, and How can I search the documentation for do that?.
Thanks for any help
I think I've cheated my way into a solution, this could work for you, depending on what your exact requirements are.
In one scenario, I have a shared network folder that allows machines to launch the NWJS app via the network share, so every time I update the file and someone relaunches their short-cut, they have a fresh copy.
The remote users, who are not directly on our same network, has their copy in a DropBox folder - which - of course - automatically update as I drop the new copy into that folder.
None of these solutions are as "clean" as an installer, but, for our use case, works rather well. It's a bonus that DropBox handles the downloading of the new copy of the file automatically.

Using Git with a Samba shared folder

I am new to Git, and trying to determine how to best implement it.
I have the following four machines:
Linux server running GitLabs which stores my main repository.
Linux production server running Apache, etc. I am not currently concerned about this part.
Linux development server running Apache, etc. It also runs Samba and maps /var/www to Windows. It is located in my home and is on a LAN.
Windows 7 PC running a PHP IDE (happens to be PhpED). It is located in my home and is on the same LAN as the Linux development server. It directly edits the files in the Samba
folder on the Linux development server, as well as uses this folder for debugging, and does not have code directly on it. The IDE has some basic Git functionality via TortoiseGit, however, I don't yet know how strong it is.
I am currently not concerned about sharing files, but only version control.
I've read that Git is all about being local. Giving my configuration, does that mean Git is run on the Windows PC even though my working directory is not located on it? Or is it handled just using Linux between /var/www/ and the GitLab repository? How do you envision I implement Git under this configuration?
Thank you
Git works on files. With the way you describe it, you will be running git on your windows pc - the fact the files are actually being accessed via the network rather than directly is something git probably won't even be aware of. As long as that is the only machine accessing that share, it should be fine.
But it's not really how you should use git. It has it's own mechanism for pushing/pulling changes between machines; so unless you are running an interesting driveless setup, you should probably consider storing the working directory on the machine that it is being edited on. Especially if there is a chance the files could be accessed from the linux machine as well (mixing version control accesses to the same working directory between multiple machines is always a bad idea, let alone between multiple OSes.

How do I install wkhtml2pdf?

I've been looking for a solution to this for about a year, still haven't found one.
I'm trying to get a website snapshot script that I can host on my server and use freely that works well on 99% of webpages.
So far I've been using html2canvas but it doesn't really display images.
I looked into wkhtml2pdf before but I tried installing every single binary and executing from PHP. None of them worked!
All I know about my server is that it is Linux (so I only tested Linux static binaries). Even the basic --help command didn't work.
Please help me out. Thanks!
If you are using a hosting service, it is possible that it is impossible to execute binary programs stored in users' directories. (noexec flag on specific partition). You should first contact system administrator and ask if it is possible to put your own binary executables there. Perhaps, you can ask system administrator to install wkhtmltopdf for you in a global directory /usr/local/bin.
You'll need more then a simple shared hosting, and more then "it is Linux". PHP could be in safemod and lots and lots of other limitations. I would choose a minimal VPS (like digitalocean or similar), root access, install wkhtml2pdf with dnf, yum or what's on you Linux distro, because it brings lots of dependencies to your machine. A minimal LAMP server should not have what's needed on it. You need to be able to allow Apache (or other user) to exec the binary.

Resources