How to design a system for offline updates of Linux systems that use Debian's apt? - c

I'm developing an update / upgrade service with an offline SDK for Linux devices.
The idea is to replicate the update / upgrade Linux services into an offline device. The "offline" device is capable to reach "internet" but only through message exchange using the SDK and through other devices (multi-hop). Devices are from different architectures, therefore the device that has "internet" capabilities (gateway) has to be capable to request and download the packages to be upgraded to/from a different architecture. the gateway device has to be capable to cache the downloaded requested packages from updates (to act as a CDN), avoiding repo requests.
The offline device doesn't have have IP address and the way it communicates is irrelevant, because the offline SDK guaranties internet reachability over multi-hop.
What I need - I need someone to provide me some help or guidance about the update / upgrade work flow on Linux.
What I found so far:
update
update command loads the /etc/apt/sources.list
don't know how update resolves each line on /etc/apt/sources.list, it seems it has a function where it loads the "deb" a "link" and "arguments" that match the corresponding repo folders.
after that it starts to download all the corresponding "Packages" files in each resolved link.
upgrade
makes a comparison between the updated local "Packages" files and the "Packages" files in the repo.
Is there any source code from update / upgrade available ?
I did some web search on the apt repos, but I couldn't find the update / upgrade functions.

Related

How to support multi-architecture docker-compose configuration for devcontainer.json?

In our engineering team we have people using older macbook pros as well as the new M1 (ARM) chips. We currently have 2 different docker-compose.yaml files that pull in different docker images for our data services based on which architecture the host computer is using. This is not ideal, but currently works fine. I want to make use of devcontainer.json so that our app layer could also live in docker to make setting up a new machine within our eng org very easy. The problem I'm running into is I'm not sure how to tell devcontainer.json which docker-compose.yaml file to use based on which architecture is being used.
My current thought is to just have the developer set an env var on their host system that derives their arch and then utilize that env var within devcontainer.json to point to the correct docker-compose.yaml file, but I'm wondering if there is a better way to achieve my goal.
I noticed that there is an open issue within the vscode-remote-release repo but I think that pertains to the app code image that gets built. Not quite the same situation I'm in, but the solution is probably one part of the solution to my question.

Can I run a web app from usb with Bitlocker

As per the title, can I run a web application (AngularJS) from usb with Bitlocker.
I installed xampp portable, git portable and nodejs in usb. But I don't know my application can run normaly. I need distribute my application to many customer and secure my source code. Please let me know what I do is possible or not.
NOTE: my question is not duplicated with question Secure distribution of NODEJS application
Many Thanks

How can I build a standalone MQSeries client under Linux using the C API?

IBM offer an installable MQSeries Client software that allows you to access queue managers on remote hosts. They also offer some C-callable libraries that let you do messaging from a C application.
My problem is that I don't have admin access on the hosts I plan to test-deploy on, and getting an application installed comes with bigtime Enterprise hassle. IBM, meanwhile, acts as if there's no alternative to installing their whole client package. Assuming I'm willing to forgo their support, can I get around this? i.e. is there some set of objects/libraries I can link with to produce a standalone client?
From v8.0.0.4 onwards, IBM provides set of libraries as a zip/tar and you don't need to install whole client package. See here: http://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ins.doc/q122882_.htm.
But you still need queue manager running somewhere to test your application.

Using OpenSCManager to load the Service Database of a non-running Windows installation

I am pulling (in the IT sense) hard drives from working machines and need to adjust their service configuration in the registry. In the Windows API OpenSCManager, which is used to edit services in the registry, has a sparsely documented lpDatabaseName parameter. Can I use that, say if a Working but not running Windows install is mounted as drive E:\? (the running Windows install is mounted on drive C:\)
Could I do e.g. OpenSCManager(NULL, "E:\Windows\WHAT_IS_THE_FILENAME", SC_MANAGER_ALL_ACCESS). Then use the handle to edit the service configuration on drive E:\?
What is the file path for the second parameter? i.e. where would I find this service database file on drive E:\?
According to the SCM remote protocol specification, lpDatabaseName can only be NULL, "ServicesActive", or "ServicesFailed".

Use libfuse in a project, without root access (for installation)? FTP mounts & inotify/kqueue/FSEvents

I'd like my application to be able to show a directory listing from a remote FTP (or SFTP etc) location. When a file/directory changes in the remote directory tree, the application should update its view with the relevant changes.
Because traversing the entire tree is slow and wasteful, I'd like to use something along the lines of FSEvents (inotify/kqueues on Linux), but obviously these libraries are filesystem-based, and a connection to an FTP server is not the same as a mounted filesystem.
In order to make these libraries work, I'd need to actually mount a filesystem backed by FTP/SFTP on the local machine, then attach an FSEventStream (or kqueue etc) to this local mount. I know FUSE can do this, but is there any way I can use FUSE without the user having to first install it? I mean, can I bundle it with my (Mac) application and create mounts without having to put the user through the process of actually running an installer package to copy libfuse and the kernel modules into the system? Does it assume /dev/fuse exists, or can this live outside the /dev/ path, inside my application directory?
Nice Mac applications are installed with a simple drag & drop and I'd like to keep mine this way if possible. I'm unclear on if it's possible to use libfuse directly (provided the files are included with the app), without installing it in the system paths.
Alternatively, does anyone have any other suggestions for monitoring for changes over FTP, without polling?
Unfortunately FTP and SFTP do not support any form of client notification.
Much like HTTP they are based on a request/response scheme, where each data transfer is initiated by the client. What makes things worse is that, contrary to HTTP, there is no way to ask the server to inform the client of any changes since a specific date.
This means that not only you have to use polling, but also that said polling will by no means be lightweight.
As far as FUSE is related, most FTP and SFTP modules that are available only update their view of the filesystem when the userspace applications ask for a directory listing (e.g. hitting Refresh in a file browser window). They do not perform polling on their own. Your userspace application will have to initiate the refresh by polling the directory itself.
EDIT:
To clarify a couple of things, recent versions of FUSE do support notification events. They
simply pass through the events from the modules to the kernel. The modules still have to generate them and in the case of an FTP/SFTP client module that is impossible without polling the server.
Also keep in mind that many current NFS implementations do not support change notifications either, despite the fact that NFSv4.1 has the necessary provisions. Many SMB/CIFS servers (esp. those in cheap Network-Attached-Storage embedded systems) also have limited to no support.

Resources