This command will help you spot any unusually large directories
The red flag was when I saw the server disk space is showing a site is taking up 57992.5 MB, where locally the site size is showing 957MB. There is something serious happening here and I need to establish the problem quickly. When dealing with a significant discrepancy in site size between a local environment and a server, it's important to identify the root cause of the larger disk usage on the server.
How to determine the size of a directory in Terminal
To determine the size of a directory using the terminal, you can use the du (disk usage) command. The syntax for this command can vary slightly depending on the operating system you are using, but a common way to use it is as follows:
npm package management
A summary of Node package commands
Short cut commands
npm install <package>
npm i <package>
npm install --save <package>
npm i -S <package>
npm install --save-dev <package>
npm i -D <package>
npm install --global <package>
Git changing local and remote branch name
Something I haven't had to do in a while is to change the name of a Git branch both local and remote.
Steps to renaming a branch
Rename your local branch:
If you are on the branch you want to rename:
git branch -m new-name
Whereas, if you're on a different branch:
How to resolve a cURL certificate 60 error - curl: (60) SSL certificate problem
Post a NetSkope update, composer would fail when running any command that required accessing an external package. Actually initially all external traffic was being blocked. The error was similar to
curl: (60) SSL certificate problem: self signed certificate in certificate chain
More details here: https://curl.se/docs/sslcerts.html
This error was also generated when running a basic command
Creating and applying a patch
I need to generate a patch and then apply automatically to my Drupal installation.
Current path to the file: web/core/modules/views/src/Plugin/views/argument/
Orignal filename: ArgumentPluginBase.php
Adjusted filename: ArgumentPluginBase-adjusted.php
Create a Patch
A patch is used to create or override changes in another file. The command to create a patch is:
error: pathspec did not match any file(s) known to git
Post creating a new branch in the repo, next step was to run the checkout command locally. On my local environment I ran the following command
git checkout {branch-name}
However, the response was
error: pathspec '{branch-name}' did not match any file(s) known to git
Drupal set the private folder
How to set the Private file path in Drupal using the following steps:
- Create a private folder in the web root
- Add a .htaccess file to the private folder
- Update the settings.php file
homebrew for speed tests
Using Homebrew for speed tests...
I'm using Speediest CLI - for more details go to https://github.com/sivel/speedtest-cli
To install speedtest CLI is is quick by running the following
brew install speedtest-cli
I had a few brew updates required as you'll see by the response below
How to create list of files that is recursive and output as txt file?
This issue
I have a folder with about 10,000 files in it. I want to scan through the directories and isolate files that are different from what sits in the database. How do you generate a list of file names of all the files into a single txt file?