How to run a ReactJS application at startup on Beaglebone? - node.js

My main computer is running Ubuntu 18,04, I developed an application on ReactJS on FrontEnd, NodeJS on BackEnd and MySQL concerning the database ON beaglebone. .
More information about my BeagleBone :
root#beaglebone:~# uname -a
Linux beaglebone 3.8.13-bone71.1 #162 SMP Fri Oct 16 07:27:34 CST 2015 armv7l GNU/Linux
I want to run my application always at startup on BeagleBone
What can I do to make a script run as soon as it boots up ?

Short answer: Just like on any other device (including PC or Server) that runs a Linux distribution.
Some quick pointers:
Latest BeagleBone Images are Debian 9.4 based
Use an "IoT" image unless you really need the HDMI (or LCD) output and accept the lower performance.
Debian uses systemd to manage automatic starting and stopping of software services
Create a systemd service file that invokes a process you need (e.g. npm) as the desired user (probably 'debian'). There seem to be helper tools like service-systemd
reload systemd systemctl daemon-reload to make it aware of the new file
enable it systemctl enable myfancy.service
Both flavours of mySQL on Debian (mysql-server and mariadb-server) come with a systemd file already.

Related

Can I change the Linux kernel that Docker uses on macOS?

Q1: Can I change which Linux kernel that Docker uses on macOS?
Q2: When does Docker upgrade the Linux kernel version?
Currently, as of:
21 Sep 2020, up-to-date Docker Desktop v2.3.0.5 (48029), Engine 19.03.12
it is using Linux kernel 4.19.76 (released 22 Oct 2018).
I expected it to be on a more recent kernel
(e.g., Linux 5.8 was released 2 Aug 2020; Linux 5.0 was release 3 Mar 2019).
$ docker run -it alpine uname -a
Linux f745312f5a3e 4.19.76-linuxkit #1 SMP Tue May 26 11:42:35 UTC 2020 x86_64 Linux
Related:
How does Docker run a Linux kernel under macOS host?
Can I change the kernel used in Docker for Windows?
https://kernelnewbies.org/LinuxVersions
Q1: Can I change which Linux kernel that Docker uses on macOS?
Safe and simple answer: No. Unless you want to mess-up directly with the Hyperkit VM that docker desktop for Mac is deploying for you when installing. I don't use Mac, I have no clue it this is even possible and strongly suggest you don't walk that path unless you seriously know what your are doing and are ready to reinstall everything if this breaks.
Q2: When does Docker upgrade the Linux kernel version?
When that change is incorporated to a new release and announced on the Docker for mac release notes. Latest kernel upgrade was made on 2020-05-27.
That being said, docker only uses the underlying kernel of the OS/VM where it is installed. If you really need a different kernel for a very specific reason, you can always deploy in parallel your own custom vm with the exact kernel you want, install a docker engine there and use it.
https://stackoverflow.com/a/65844573/8818399
Docker uses its own patched Kernel (along with a specialized Linux distro) called linuxkit in Docker Desktop. It is mentioned in https://hub.docker.com/r/docker/for-desktop-kernel.
I am able to find kernel, initrd.img and cmdline in a folder called linuxkit inside the application folder of my Docker for Mac installation.
Simply build your own Kernel with the instructions/patches of linuxkit and replace those files.

debian /etc/shutdown.allow does not fire when trying to shut down computer

i have a linux box where a remote management application should shut down the box. Those remote management application is running under a normal restrictive user (no root) and the shutdown does just not work.
I have created a file /etc/shutdown.allow and entered the name of that restricted user, but when i execute i get this error:
myuser/mybox:$ shutdown
command not found
also a shutdown -a is not recognized and this switch is also not mentioned in the shutdown manual
Is there a way to enable a user or a application running under a restricted user to shutdown the box at all?
INFO: a sudo shutdown of course is working from cmd-line, but does not enable the application to shut down the box and i would not be happy to let that application run as root user.
Anybody a idea?
Thank you.
INFO:
$ uname -a
Linux mybox 3.16.0-4-amd64 #1 SMP Debian 3.16.51-3 (2017-12-13) x86_64 GNU/Linux
$ cat /etc/issue
Debian GNU/Linux 8
You can only run shutdown as root user. Maybe you can run this using a sudo.

Oracle on lxc in ubuntu

I'm currently trying to install an oracle server (11g) in a linux container on ubuntu (following this tutorial (http://www2.hawaii.edu/~lipyeow/ics321/2014fall/installoracle11g.html).
When I try to change the file handler with sysctl, the modifications doesn't save into my container. Moreover, when I make the modification in the main ubuntu kernel, it propagates to the containers, so my question is as follow:
How can I modify the file handlers only in my oracle container ?
Thanks.
Try out the Orabuntu-LXC project code. It supports Ubuntu 16.04, 17.04, 17.10 and is purpose-built for running Any Oracle on Any Linux, including Ubuntu Linux. Note that as you probably already know, Oracle Corp does not formally support or certify Oracle on Ubuntu Linux.
As far as you question about the file handlers, some sysctl values can only be set at the LXC host level, and some can be set in the container.
https://sites.google.com/site/nandydandyoracle/oracle-rac-in-lxc-linux-containers/oracle-lxc-vlc#TOC-Install-the-etc-sysctl.conf-File-Required-for-Oracle
https://github.com/gstanden/orabuntu-lxc
https://sites.google.com/site/nandydandyoracle/
Please note that the step-by-step guides are quite old and that the basic LXC infrastructure together with OpenvSwitch, an LXC-containerized DNS/DHCP, and an optional SCST Linux SAN can all be installed on Ubuntu 16.04, 17.04 and 17.10 with one command:
./anylinux-services.sh
after completion of which all you would need do is download your Oracle database installtion media and install.

Brother QL-720NW, printing labels using CUPS & Ubuntu

I'm trying to get my Brother QL-720NW label printer working from an Ubuntu server. I'll briefly describe the process so far, and where I'm stuck.
First I installed CUPS and LPR and cupswrapper drivers from Brothers website, and now my QL-720NW shows up in the CUPS web interface. I set the default media size to fit my label(29x90mm). I clicked "Test print page" on the QL-720NW and it says "Sending data to printer." a few seconds, and then disappears and changing state to Idle, Accepting Jobs, Not Shared, Server Default. But my printer does nothing, not even a led light blinking.
My cups/error_log looks like this. I have googled the AddProfile failed error, and found someone suggesting it is a bug in Ubuntu 12.10, but I've also read that Arch users have had the same error, so I'm not sure. And the Uknown directive SystemGroup error is just a harmless error according to this site.
E [23/Apr/2013:12:20:47 +0200] Unknown directive SystemGroup on line 18 of /etc/cups/cupsd.conf.
W [23/Apr/2013:12:20:47 +0200] AddProfile failed: org.freedesktop.DBus.Error.UnknownMethod:No such interface `org.freedesktop.ColorManager' on object at path /org/freedesktop/ColorManager/devices/cups_QL_720NW
When I run lpstat -tl after trying to print a test page or a text file using lp test.txt, it says it's sending data to the printer. But the printer does nothing.
# lpstat -tl
scheduler is running
system default destination: QL-720NW
device for QL-720NW: usb://Brother/QL-720NW?serial=000K2Z658058
QL-720NW accepting requests since Tue 23 Apr 2013 12:45:56 PM CEST
printer QL-720NW is idle. enabled since Tue 23 Apr 2013 12:45:56 PM CEST
Sending data to printer.
So, does anyone have any suggestions where to go from here? Is there any other log files that might give me a clue of whats wrong?
I was able to get 64-bit Ubuntu working with the official QL-720NW drivers using their work-around:
http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/faq_prn.html#f00081
apt-get install cups cups-bsd
apt-get install ia32-libs
dpkg -i --force-architecture ql720nwlpr-1.0.1-1.i386.deb
dpkg -i --force-architecture ql720nwcupswrapper-1.0.1-1.i386.deb
cp /usr/lib/cups/filter/brlpdwrapper* /usr/lib64/cups/filter
cp /usr/lib/cups/filter/brlpdwrapper* /usr/lib64/cups/filter
My Linux distro (uname -a):
Linux 3.2.0-40-virtual #64-Ubuntu SMP Mon Mar 25 21:42:18 UTC 2013
x86_64 x86_64 x86_64 GNU/Linux
I finally got it to print on my Ubuntu system. The problem seemed to be that the drivers from Brother is not 64bit compatible, and I was using a 64bit version of Ubuntu.
I tried on Debian first, after learning from #sampi that he got it to work on Debian. When installing the drivers I got an error message, which I didn't get on Ubuntu, suggesting a 32/64bit issue. So after installing the ia32-libs packages it worked on Debian. I then tried installing a 32bit version of Ubuntu on my server, and now the printer did work.
But I can only get the printer to work through wifi(both on Debian and Ubuntu). No success with the USB cable, but that's not an issue for me.
I have used a QL-720NW with Debian since September. Using first the QL-580N driver & later, once it got released, the QL-720NW driver. Prior to buying the printer I did contact brother support who, within a very helpful response, told me that the printer worked as a network printer with the older product's driver, but not over USB.
Given that you do not explicitly state that you need to print via USB, I suggest you try connecting the printer to your network & reconfigure cups to use that connection instead.
FWIW: On Debian testing, I just installed the drivers from the Brother site (version 1.0.1 for both) and the QL-720nw printed via USB with no issues. I didn't even have to force anything (I already had multiarch installed to support other stupid 32-bit-only software), nor use any workaround. I haven't yet tried to use it on a network.

Remote IDE on Red Hat Enterprise Linux Server release 5.5

I have this version of Linux server:
-bash-3.2$ cat /proc/version
Linux version 2.6.18-194.11.1.el5 (mockbuild#hs20-bc2-3.build.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Jul 27 05:45:06 EDT 2010
-bash-3.2$ cat /etc/*release*
cat: /etc/lsb-release.d: Is a directory
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Currently, I am writing c program on the Linux side, I will need the server power to execute my program. I prefer IDE, but since my machine is Windows and what not, I have to compile the program remotely on the server. Sometimes, it's such a pain that I cannot run a stacktrace after the program crashes. And the thing is I want is to achieve higher productivity.
I can only access this server with PuTTY or the like, and I do not have the rights to install any software. And updating the software in the server is also not possible.
I see that the server got programs like Matlab that can output to XMing on the client side. (Ex. I can run Matlab as a GUI from the server side and have it display on my client device)
I see that some people suggest me for Eclipse, but the IDE is way too slow. In fact, it lowers productivity.
So is there any recommendation or a scheme that will allow me to compile, execute and debug my program remotely on the server with better ease-of-use, given the bold criteria above?
You cannot install as root, but maybe you can manually install applications in your user directory? With that and X11 forwarding you should be set (except a bit of latency).
Also, if you have gdb on the remote (which you probably do since you also have the compiler) you can see stack traces with it after enabling core dumps (ulimit -c unlimited), by opening the binary and the core file: gdb -c , then bt.

Resources