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
113
results
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
•
How do you remove a file from git?
Use the command (rm) to remove files from...
Andrew Fletcher
•
Moving a Git repo due to a change of agencies
Steps to change the...
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 Ubuntu backup shell script. With a backup in hand, now it was time to test how to unpack a backup and overwrite the directories.
First I unpacked the backup to a temporary directory tmp-cc.
Now I wanted to replace several of the directories on the server. Starting with home, var and etc. But what is an efficient method to overwrite a directory? Also removing any directories that aren't in the...
Andrew Fletcher
•
An approach to generating a backup server is using a shell script. A...
Andrew Fletcher
•
Currently, I have a situation where I have two repositories. The first is...
Andrew Fletcher
•
Creating a bash script
Bash scripts are files containing code that tell your...
Andrew Fletcher
•
Working from the bases that .DS_Store has not been added to your git repository,...
Andrew Fletcher
•
How do you generate a .pem file from an existing .ppk key?
Is putty on your mac?
Check by running the command
puttygen -VWhich will generate a response similar to
puttygen: Release 0.76
Build platform: 64-bit Unix
Compiler: clang 12.0.5 (clang-1205.0.22.9)
Source commit: 1fd7baa7344bb....Don't have Putty, well easily fixed with homebrew.
brew install putty
Generate the key
We will use puttygen to generate the key.
puttygen key.ppk -O private-openssh -o key.pem
key.ppk
the...
Andrew Fletcher
•
Adding git tag to your actions.
The regular process that I work to is
git add...
Andrew Fletcher
•
In this woalk through I am going to use GitHub. However, the steps are...
Andrew Fletcher
•
If you edit a Drupal contrib module, the next time the module is updated those...
Andrew Fletcher
•
In terminal I ran a regular command - compose update. Something I've...