Automatically splitting large files with sed based on file size
When working with large prompt or configuration files (for example data/prompts-master.py), it’s common to copy or inspect the file in chunks using sed. Early on, this is easy to manage manually:
Copying a directory while excluding a specific child directory
When working with Drupal environments, there are times you need to duplicate a directory structure — for example, cloning a site or preparing a new environment without copying certain environment-specific folders.
A common case is excluding:
sites/default/filesThis directory typically contains:
Using terminal and dig to check your DNS records
Recently I had an error with a domain smtp server not recognising port 587. To begin to test what was happening I wanted to get some key information about the server. My tool of choice was the dig command. Using the dig command:
regex expressions a working sheet
Regular expressions (regex) are extremely useful in extracting information from any text by searching for one or more matches of a specific search pattern.
yum command for clearing cache and make
Whilst updating nodejs and npm on a Centos 6 or 7 server running Apache, I hit a few walls and as a matter of process found some commands that are handy to run before doing a deep dive in Google.
Cleaning the cache
sudo yum clean all rm -rf /var/cache/yum/*
To make the cache
sudo yum clean all; sudo yum makecache
If you want to run several commands use semi-colon as noted above.
vi(m) command mode
In Vim, following is an outline of the vi(m) functions you can utilise whilst in command mode - yes they are case sensitive