Hexo is a fast, simple and powerful blog framework. You write posts in Markdown (or other languages) and Hexo generates static files with a beautiful theme in seconds. - https://hexo.io/docs/
To generate static files, I need a Node.js development environment. But as I move around from different computers and operating systems, this becomes inconvenient. I need a cloud development environment where I can access it from any device.
So, I have decided to move my blog to Cloud9 IDE, a development environment in the cloud. And this is the first blog from the environment.
Using Vagrant file provision in a Windows host, the line endings are not converted from CRLF to LF (Linux systems). So, code cannot be executed properly in the guest Linux system. And also this is a frequently occurred message for working with Windows:
1
2
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory.
One solution is to use UNIX line ending (LF) even in Windows, hence no conversion is needed. This is done by setting:
1
$ git config --global core.autocrlf input
Which means when committing the code to a remote repository, the line ending will be convert from CRLF to LF if any, but when checking out from the remote directory, no conversion from LF to CRLF is performed.
Keep a single server up to date is easy, but updating multiple servers at once, you need tools like Ansible. For each server, here is a list of basic steps:
Check if there are packages available to be upgraded
Upgrade all packages to the latest version
Check if a reboot is required
Reboot the server
When we log into the remote server, we might see the message showing the number of packages can be updated. The message is generated by:
NPM provides a command to check for outdated packages:
1
$ npm help outdated
However, by default, the command checks the entire dependency tree, not only the modules specified in package.json, but also the dependencies of those modules. If we only care about the top-level packages, we can add --depth option to show just that:
1
$ npm outdated --depth 0
This is similar to listing installed packages:
1
$ npm list --depth 0
Using the option, it will not print out the nested dependency tree, but only the top-level. The option is similar to tree -L 1, but zero indexed instead of one.
Another interesting thing about outdated command is the color coding in the output: