Two Approaches for Opening Multiple Electron Windows in a React/Electron Desktop Application

Recently I’ve had to figure out how to open multiple Electron windows for use in a React/Electron application. This turned out to be simpler and easier than I’d originally thought but finding the simple solution did take some searching around, since I didn’t see any good examples. In fact, many of the examples I came… Continue reading Two Approaches for Opening Multiple Electron Windows in a React/Electron Desktop Application

Joining Collections in MongoDB Queries using $lookup

Note: This only works in MongoDB 3.2 or later, be sure to update if you need this functionality! In situations where you have an ObjectID in a collection and you want it resolved by MongoDB during your query, you can accomplish this with aggregate and lookup. Let’s say we had two collections: insuranceClaim and insuranceProvider.… Continue reading Joining Collections in MongoDB Queries using $lookup

Calculating a Modulo 256 Checksum in NodeJS for an Access 2 Laboratory Instrument

I’ve recently had to figure out how to send a checksum with my messages to an Access 2 instrument. I did not find very many good resources for doing so, so I’m going to share what I’ve got here. I got my first clues from the examples in the Access 2 LIS documentation. Unfortunately, it… Continue reading Calculating a Modulo 256 Checksum in NodeJS for an Access 2 Laboratory Instrument

Published
Categorized as NodeJS

Automatically Check RSYNC and Restart if Stopped

I occasionally use RSYNC to synchronize large directories of files between servers. This is especially useful if you’re moving a client from one server to another and they have alot of static files that are always changing. You can copy the files and sync them up, all with RSYNC and if your connection gets cut… Continue reading Automatically Check RSYNC and Restart if Stopped

Mounting CIFS Shares At the LINUX Command Line or in /etc/fstab

Linux makes it relatively easy to mount shared drives either manually, at the command line, or automatically, by configuring an entry in /etc/fstab. Here is the basic syntax of our mount command. [ccase@midas ~]$ sudo mount -t cifs -o username=,password=, /// Here is an example of mounting our CIFS share to a folder named myshare.… Continue reading Mounting CIFS Shares At the LINUX Command Line or in /etc/fstab

Getting the Last Modification Timestamp of a File with Stat

If we want to get just the date modified, for a file, in a format of our choosing. This can be done with a utility called stat. The syntax is as follows: stat -f -t “” In this example, we are printing just the date created in the format YYYYMMDD_HHMMSS. stat -f “%Sm” -t “%Y%m%d_%H%M%S”… Continue reading Getting the Last Modification Timestamp of a File with Stat

Using the Linux Command Line to Find and Copy A Large Number of Files from a Large Archive, Preserving Metadata

One of my recent challenges is to go through an archive on a NAS and find all of the .xlsx files, then copy them; preserving as much of the file metadata (date created, folder tree, etc) as possible, to a specified folder. ¬†After this copy, they will be gone through with another script, to rename… Continue reading Using the Linux Command Line to Find and Copy A Large Number of Files from a Large Archive, Preserving Metadata

Explicitly Setting log4j Configuration File Location

I ran into an issue recently, where an existing log4j.xml configuration file was built into a jar file I was referencing and I was unable to get Java to recognize another file that I wanted it to use instead. ¬†Fortunately, the solution to this problem is fairly straightforward and simple. I was running a standalone… Continue reading Explicitly Setting log4j Configuration File Location