Skip to content

Instantly share code, notes, and snippets.

@servercharlie
servercharlie / README.md
Created March 11, 2017 06:41 — forked from listochkin/README.md
How Node Resolves Dependencies

How Node Resolves Dependencies

Read more about node_modules and how you can use them in official node/iojs docs:

If the module identifier passed to require() is not a native module, and does not begin with '/', '../', or './', then io.js starts at the parent directory of the current module, and adds /node_modules, and attempts to load the module from that location.

If it is not found there, then it moves to the parent directory, and so on, until the root of the file system is reached.

Here I show you how you can easily build a hierarchy of modules inside your project and use nested node_modules directories to manage dependencies within your application. This is a pretty good solution that doesn't require you to change NODE_PATH, use many git repositories or setting up a private registry.

--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
@servercharlie
servercharlie / docker_0.md
Created March 8, 2017 10:55 — forked from goyalankit/docker_0.md
Docker Commands

Docker cheatsheet.

  • To get the list of commands:

      $ docker
    
  • To search for images in docker index:

      $ docker search tutorial
    
@servercharlie
servercharlie / commands.md
Last active March 10, 2017 03:14
Ubuntu 16.10 (Yakkety Yak!) Commands
@servercharlie
servercharlie / js-crypto-libraries.md
Created March 8, 2017 09:42 — forked from jo/js-crypto-libraries.md
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

I start with a list and plan to create a comparison table.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@servercharlie
servercharlie / steps.txt
Created March 7, 2017 17:03
Enabling root login in Ubuntu 16.10 (Yakkety YaK!) - Instant SFTP Access
> why enable root login?
> useful for dev purposes if you want instant sftp access.
> you can revert these settings anyways in case you decide to go for production.
sudo nano /etc/ssh/sshd_config
> change PermitRootLogin prohibit-password
> to PermitRootLogin yes
@servercharlie
servercharlie / notes.txt
Last active March 7, 2017 16:29
Musings on Azure VM setups
- portal.azure.com has that latest features compared to manage.windowsazure.com
- in portal.azure.com, you got two (2) deployment models: classic and resource-manager.
- resources deployed in classic won't be compatible with those deployed in resource-manager, same thing vice-versa.
on vm's, on opening ports:
- opening ports on manage.windowsazure.com is MANUAL, one-by-one, through your vm's endpoints.
- opening ports on portal.azure.com ALLOWS PORT RANGES, through your vm's network adapter's network security group.
- you can manage both inbound and outbound in your network security group.
- @ https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-nsg-quickstart-portal
@servercharlie
servercharlie / steps.txt
Last active September 22, 2017 13:22
MongoDB setup on Ubuntu 16.10 (Yakkety Yak!)
sudo apt-get update
sudo apt-get install mongodb
sudo nano /etc/systemd/system/mongod.service
> paste the shit below
> change your 'User=' value to your preferred user
> configure it with your dbpath & logpath
@servercharlie
servercharlie / steps.txt
Last active October 7, 2019 16:41
Setting up NodeJS w/ NPM + PM2 on Ubuntu 16.10 (Yakkety Yak!)
> SSH Login to your home directory.
> Get APT updates & upgrades.
sudo apt-get update
sudo apt-get upgrade
> NodeJS & NPM
> https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
> Installs the latest NodeJS & NPM, including the essential build tools (used by most packages).