" node "

Generate an inode report (file count) for Debian, CentOS, cPanel, RHEL, with INODES shell/bash script

If you have every used shared hosting, or are involved with the hosting business in any way, you should already know what an inode is. Each time a file is created, uploaded, and so on, an inode is created. This inode stores information like ownership, permissions, etc … basically all the metadata about the file. What is the purpose of limiting the amount of files/inodes? Because each shared host will have many customers on the same server, customers that have excessive amounts of inodes (anywhere from 100,000 to 500,000 and up), can cause a heavy load on the server during backups, general operation, and can be taxing on hard drives. Most of the time excessive amounts of inodes is due to cache scripts installed by the user, catchall email accounts, and normally the customer/user doesn’t even know they exist. Well fear no more, I have created a shell/bash script that will help generate reports, and soon notify you about inode usage… (more…)

How to use MongoDB date aggregation operators in Node.js with Mongoose ($dayOfMonth, $dayOfYear, $dayOfWeek, etc)

While I was working on creating a tutorial for MongoDB aggregation I came across a few issues while trying to use the built in date aggregation operators.  I was storing the date in the db as the unix epoch timestamp.  I tried multiple variations such as “new Date()”, “new Date().getTime()”, “Date.now()”, etc, but none of those would work.  I kept getting this error “can’t convert from BSON type NumberDouble to Date”.  Turns out, the solution was very simple, and something I completely overlooked (more…)

How to count the number of values found for a field in MongoDB using Node.js and Mongoose (using aggregation)

This post is part 1 of a series of posts I will make regarding Node.js and MongoDB.  I will be using the Mongoose module for Node.js, but for the most part the MongoDB syntax is about the same.  The ultimate goal with this series is to take data from a MongoDB database, and use that data to create a dynamic graph/chart with Morris.js.

The first step to this process is learning about MongoDB aggregation. The data we will be using in this example is a collection of products, that has a field product_manufacturer.  We will use MongoDB to return to us, the total number of products that each manufacturer has in our database.  So let’s get started .. (more…)

Proxmox/OpenVZ Can’t umount (unmount) device or resource busy

Recently when working on an OpenVZ container I was attempting to create a backup.  While doing so I kept running into a problem where the server wouldn’t let me unmount the container in order to create the backup.  The error you may see in this instance would say “Can’t umount /var/lib/vz/root/OpenVZID device or resource busy”, or “Can’t umount /var/lib/vz/root/100: Device or resource busy TASK ERROR: command ‘vzctl umount 100’ failed: exit code 51″, in this case the container being 100.  Here’s how I was able to fix it …  (more…)