developer resources
Codebales holds an ever growing number of solutions to problems that we have experienced in our day to day code writing
Selected filter
131
results
Andrew Fletcher
•
This page will be a progressive outline of moving those regular run scripts that really need to be automated. Or triggered by a keyword.
These scripts are rsync commands
The initial scripts
production environment
sudo rsync -aur staging/{project}/config drupal
cd drupal
sudo chown -R www-data:www-data config
cd ..
sudo rsync -aur staging/{project}/core drupal
cd drupal
sudo chown -R www-data:www-data core
cd ..
sudo rsync -aur staging/{project}/modules drupal
cd drupal
sudo chown...
Andrew Fletcher
•
This issue
I have a folder with about 10,000 files in it. I want to scan...
Andrew Fletcher
•
Using Homebrew for speed tests...
I'm using Speediest CLI - for more details go...
Andrew Fletcher
•
I'm in an environment where the default branch is staging and I'm attempting to...
Andrew Fletcher
•
This guide has been compiled as a reference tool on how to access field values...
Andrew Fletcher
•
How to count the number of files in a directory. At some point you'll have a directory or directories that you need to know the number of files in them. On Linux, the list command (ls) is piped with the wc -l command.
ls | wc -lThis command works great if all the files are located in one directory. What about if you have multiple directories. Then you will need to use the find command piped with the wc command
find <directory> -type f | wc -lThis command only...
Andrew Fletcher
•
I've recently upgraded the server Ubuntu 20.04 updating the PHP version from 7.4...
Andrew Fletcher
•
Installing PHP on OSX and it installed PHP 8.2.x. However, for my...
Andrew Fletcher
•
Find by file name
To perform a find command in terminal use
find / -name...
Andrew Fletcher
•
I had generated a backup of key directories on the server - see Create a...
Andrew Fletcher
•
An approach to generating a backup server is using a shell script. A script can define directories to backup, and pass those directories as arguments to the tar utility, which creates an archive file. The archive file can then be moved or copied to another location.
Example Shell Script
#!/bin/bash
#
# Backup script
#
# NAME: daily-backup.sh
# PATH: /mnt/e/bin
# DESC: Backup scripts, documents and configuration files to .tar
#
# What to backup
# backup_files="/home...
Andrew Fletcher
•
Creating a bash script
Bash scripts are files containing code that tell your...
Andrew Fletcher
•
JSON structure
Outlining the structure of the elements common attributes:...
Andrew Fletcher
•
In this instance, I'll check the beginning of the string. I want to focus...
Andrew Fletcher
•
Working from the bases that .DS_Store has not been added to your git repository,...