Skip to main content

How to efficiently use find and replace in VS Code

When it comes to text editing, Visual Studio Code (VS Code) is one of the most popular tools among developers. One of its powerful features is the Find and Replace function, which can save you countless hours of manual editing. In this article, we'll explore how to use this function to replace all spaces with a newline character, and then go a step further to find spaces followed by alphabetic characters (excluding numerics), and replace them with newlines.

 

Checking if a file exists using command line queries in Ubuntu with Nginx

On a server directory with over 100,000 PDF files, I needed to verify the existence of specific documents. Whether there are a few hundred or whatever the number of files, this article explores the practical use of command-line tools to quickly ascertain whether a file is present. In the area of server management or application development, especially on systems like Ubuntu equipped with Nginx, it's crucial to perform routine checks to ensure that all necessary files are in place.

Efficiently managing large file archives in Linux: excluding directories with Zip

Managing large directories, especially those filled with a diverse mix of media such as documents and images, can quickly become cumbersome. In my latest project, dealing with a directory that totals a whopping 87GB, the need for efficient file compression and selective archiving became apparent. How can we streamline this process using the zip command, particularly when we want to exclude non-essential files and directories?

 

Understanding transaction control in MySQL: A guide to START TRANSACTION, ROLLBACK and COMMIT

Recently I came across this piece of gold when dealing with databases, particularly relational ones like MySQL, managing transactions efficiently is crucial to ensure data integrity and consistency. In MySQL, transactions are used to group several SQL commands into a single unit that either completely succeeds or completely fails, ensuring that a database remains in a consistent state.

Exploring historical memory usage monitoring with Sysstat

In the realm of system administration and monitoring, understanding memory usage trends is crucial for maintaining system health and performance. While tools like htop offer real-time insights into memory usage, they lack the capability to provide historical data. So, what if you need to analyze memory usage over the past 24 hours or even a week? Fear not, as Sysstat comes to the rescue with its powerful sar command.

 

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

Subscribe to iTerm2