Docker failed to solve with frontend dockerfile.v0: failed to create LLB definition

I was working on improving my Flask skills and at the same time learning about REST APIs and how to build them using Flask, Docker, MongoDB and AWS.

I’m using git in order to have my code available and practice whether at home or at the office macOS computer I have. Somehow, after pushing my last git update and then doing a git pull from my mac at the office i got the following docker compose build error:

Docker compose error
failed to solve: failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unknown desc = failed to fetch oauth token: Get "https://auth.docker.io/token?scope=repository%3Alibrary%2Fpython%3Apull&service=registry.docker.io": dial tcp: i/o timeout

After many coffees that I received from my friend’s coffee farm in Quillabamba, Peru I found a quick solution which I’m still not sure why we have to do this.

The solution was quite simple. In your terminal run these two commands:

export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0

Then I ran again in my project directory:

docker compose build and then docker compose up

And everything worked again as it did before. I’m still very confused to why this issue happened. If you have any comments please add them at the bottom of this article.

You can also contact me if you have any questions. Thanks!

Ping Command Examples in Brief

The ping command is one of the most common used commands in the IT field. After taking a walk in Brooklyn New York City I decided to put together some ping command examples to remember.

Basic ping command

The most basic ping command example would be to just ping itprohelper.com:

Ping command example

You can also test your localhost TCP/IP with any of these two ping commands:

# ping localhost
# ping 127.0.0.01

Other important ping command examples

Linux by default sends continuous pings unlike Windows that sends four. One ping command option I was not aware is the -a which sends an audible ‘cue’ with each ping when is a successful one:

# ping -a itprohelper.com

You can also adjust the number of pings using the -c option very easy. This example will only send eight pings:

# ping -c 8 itprohelper.com

If you don’t need to see the output of each ping you can use the -q option to summarize the results. This ping command example will show you if ping was successful at sending 3 packets:

Ping command using the -q option

A Little More Advance ping Example

You can change the size of the ping packet sent. It is usually 28 bytes. So, to send 128 bytes you will do:

# ping -s 100 itprohelper.com

You can also limit the total number of hops -routers- ping will pass by configuring the TTL(Time To Live) option:

# ping -t 10 itprohelper.com

There are many more ping command options. You can find them by checking the man pages.

Contact me if you have any questions. Also, remember to visit my shop and if you like my T-Shirts and coffee mugs designs grab one. Thanks!

How To Update macOS Using The Terminal

The other day my Finder crashed for some crazy reason. I’m using BigSur and wanted to update macOS using the Terminal since Finder was not responding. I decided to brew one of my favorite medium roast Caturra varietal coffee and put this little tutorial together.

Listing Available Updates On The Terminal

This is quite simple all you need to run is this command once you open your Terminal:

softwareupdate -l

This Terminal command will list available updates to install

softwareupdate command in Terminal

If you like to install all listed available updates just add -i -a to the softwareupdate Terminal command:

softwareupdate -i -a

Great thing about using the Terminal to download macOS updates is that you can keep using your computer while the download is happening in the background. Depending on the update type you might need to reboot at some point.

Now, if you want to specifically install a particular update then its a bit tricky. You will need to use -i and specify the update you want using single quotes ‘ ‘. For example this softwareupdate Terminal command will only install this Safari update:

softwareupdate -i 'Safari15.3BigSurAuto-15.3'
Updating Safari in macOS Terminal

You can also download the updates without installing them. Just add -d option to the softwareupdate tool in your Terminal.

softwareupdate -d 'Safari15.3BigSurAuto-15.3'

Hope you like this brief tutorial. Contact me if you have any questions or just want to say hello. You can also see my coffee mugs and T-Shirt shop. I created these designs for IT lovers. Thanks!

Enable vim Syntax Highlighting

I have to admit, I’m addicted to vim. There are many cool editors out there, but I still not used to them. Now, that I discovered how to enable vim syntax highlighting I decided to share some details.

First, I want to thank you for your support with my ITPro Helper shop. I’m going to add more cool inspiring T-Shirts and coffee mugs designs during this month.

After brewing a great cup of coffee from Panama I decided to put together this little tutorial. This instructions should work for any Linux distro or macOS. Just run this command to make sure you have vim installed:

vim -version

There are hundred of options to vim out there. I’m just going to concentrate on a few in this post.

Open any script to check vim syntax highlighting

For example I’m working on this Flask/Python file, I opened to check vim syntax highlighting:

vim app.py
.py file view in vim

In my case I already enabled vim syntax highlighting on this file by running this command while having the file opened with vim:

:syntax on

If you want you can turn it OFF:

:syntax off

You will need to do this every time you open your file. But, if you like to make this changes permanent in vim you will need to edit or create a .vimrc file in your home directory:

vim ~/.vimrc

Now, all you need to enter your desired vim options line by line. For example:

syntax on

Save it and that’s all!

If you like to set your syntax highlighting specific to a language then you can for example set it to python:

syntax=python

But, you can set it to other languages: perl, php, awk and etc..

Filezilla.xml could not be loaded

I got this error Filezilla.xml could not be loaded right after launching a new Filezilla install on a clients Windows 10 machine. I have never seen this one before. Filezilla has always worked flawless for me. So, I decided to brew my own coffee before I investigate this issue.

The quick fix for Filezilla.xml could not be loaded

This is the error and it shows you where filezilla.xml lives. You have to type the path on Windows explorer because some directories are hidden.

Filezilla.xml could not be found

Type your directory path as show in the screenshot above.

Rename the file: filezilla.xml to whatever you want, maybe filezilla_old.xml.

Close Filezilla and open it again.

If you get similar errors showing you “other files that cannot be found” while you’re closing Filezilla. Then, do the same procedure as above. Locate the file and rename it. Restart Filezilla each time.

How to Create Backups Using Robocopy in Windows

I was given a task to backup some data from some Windows computers to a local NAS drive. There are many options out there, but I remembered I many years ago I used a tool called Robocopy. As usual, Windows eventually bought this company and now Robocopy is part of Windows command tools.

Open your command prompt in Windows and type robocopy just to verify. You should see a brief output telling you about robocopy.

robocopy output in command prompt Windows

Now that you made sure robocopy is available in your Windows computer we can put this little script together maybe with a great cup of coffee on your desk. I will go directly to it:

@echo off 
robocopy C:\Users\%username%\Desktop\  \\hqnas01\home\migrated_data\Desktop /MIR /XA:H /R:1 /XA:SH /FFT /XJ > C:\temp\%username%_migration.log

Explanation:

ParameterDescription
C:\Users\%username%\Desktop\Source directory.
\\hqnas01\home\migrated_data\DesktopDestination directory.
/MIRMake a mirror backup. If you delete something from the source, it will also be deleted in the destination.
/XA:HLeave out hidden files.
/R:1The number of retries if the file is locked.
/XA:SHLeave out hidden files and system files.
/FFTThis is very important when backing up to a Linux NAS. If you leave this out it will try to copy files over and over even when they are already present. Just use it!
/XJExclude junction points. Those crazy hidden My Music, My Pictures and My Videos folders under Documents.
> C:\temp\%username%_migration.logFor creating a .log file in order to see what happened. If you’re adding more than one line of backup locations you should add ‘>>’ instead of ‘>’ so you can append to the .log instead of replacing what you had before.
robocopy example with explanation

Make sure you don’t confuse source with destination or you can have catastrophic lost of data. Contact me if you have any questions. Check out my shop with cool T-shirts and mugs designed by myself.

Install Shell Completion for Docker in macOS Big Sur

Docker Desktop comes with scripts to enable completion for the docker and docker-compose commands. The completion scripts may be found inside Docker.app, in the Contents/Resources/etc/ directory and can be installed both in Bash and Zsh.

Bash

Bash has built-in support for completion To activate completion for Docker commands, these files need to be copied or symlinked to your bash_completion.d/ directory. For example, if you installed bash via Homebrew:

etc=/Applications/Docker.app/Contents/Resources/etc
ln -s $etc/docker.bash-completion $(brew --prefix)/etc/bash_completion.d/docker
ln -s $etc/docker-compose.bash-completion $(brew --prefix)/etc/bash_completion.d/docker-compose

Add the following to your ~/.bash_profile:

[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

OR (this one worked for me!)

if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi

In my case since I’m using macOS Big Sur I wanted to change my default shell to bash. Big Sur comes with zsh as default. Below is my .bash_profile that worked for me. Yes, I used homebrew to install bash_completion. Not sure if this was necessary. Let me know what you think in the comments area below.

export PATH="/opt/homebrew/bin:$PATH"
if [ -f $(brew --prefix)/etc/bash_completion ]; then
   . $(brew --prefix)/etc/bash_completion
fi

xcrun: error: invalid active developer path MacOS

Again, I decided to come back and keep up with my path to become a full time Web Developer instead of an “IT handyman”. So, I brewed another cup of my favorite Caturra coffee varietal and poured it on my Caturra coffee varietal mug to get some code with coffee inspiration.

I opened my Terminal and wanted to check my git status:

git status

and got error:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I had no clue why. Then, I remembered the other day I applied an update to my macOS Mojave version. This seemed to mess things up. I found a solution somewhere. First you should try to reset you xcode install by issuing this command:

xcode-select --reset

The above did not resolve the xcrun: error: invalid active inactive issue. So, I have to re-install it by running the following on my Terminal:

xcode-select --install

It took about 5 minutes and I was able to run git commands again.

Contact me if you have any questions about this xcrun: error: invalid active or other issues with Technology. Remember I designed cool T-Shirts and coffee mugs inspired by tech and my trips. Check out my shop and let me know what you think. Thanks!

Find Command Examples Linux/MacOS

I wanted to put together some find command examples because I tend to forget this useful Linux command often. It is very important for Linux/MacOS administrators or DevOps to master the find command.

While having my favorite coffee varietal Caturra the other day I decided to put together this brief find command examples:

Syntax is simple:
find [where to start search from] [what to find] [-any options] [what to find at last]

1. Search a file with specific name.

$ find ./MyDirectory -name afile.txt

This find command will search for afile.txt in MyDirectory directory and display the results such as:

./MyDirectory/path/to/afile.txt

2. Find command examples to search for file patterns

For example if you want to find all files with a .txt extension inside the MyDirectory

find ./MyDirectory -name *.txt

If there are any .txt files you should get an output similar to:

./MyDirectory/some/path/afile.txt
./MyDirectory/some/path/bfile.txt

3. Search for empty files and directories.

This is a cool one. Let’s say you want to find those empty directories or file by just running a simple find command:

find ./MyDirectory -empty

If there are any empty files or directories you will get a list:

./MyDirectory/oneFile
./MyDirectory/twoFile

4. Find command examples to search for files with specific permissions

Another useful find command.

$ find ./MyDirectory -perm 644

The above find command example will search for files with permissions set to 644 under the /MyDirectory directory and will display a list.

Check the man pages for more useful options of the find command in Linux or MacOS. Contact me if you have any questions. Also grab one of my T-Shirt or coffee mugs designs on my shop. I design them myselft. Thanks!

Mirror a Website Using wget

The command is simple and to mirror a website using wget works fantastic. While I was crossing the Williamsburg Bridge in NYC I received a Slack chat from a customer. They wanted to backup some really old WordPress sites and just archive them as simple html files.

You can mirror a website using wget easily. Copy and paste the below into your terminal. If you’re on a mac you can install wget using brew or using your favorite method.

wget --mirror --convert-links --adjust-extension --page-requisites
--no-parent http://example.org

Explanation of the various flags:
• –mirror – Makes (among other things) the download recursive.
• –convert-links – convert all the links (also to stuff like CSS stylesheets) to relative, so it will be suitable for offline viewing.
• –adjust-extension – Adds suitable extensions to filenames (html or css) depending on their content-type.
• –page-requisites – Download things like CSS style-sheets and images required to properly display the page offline.
• –no-parent – When recursing do not ascend to the parent directory. It useful for restricting the download to only a portion of the site.
Alternatively, the command above may be shortened:
wget -mkEpnp http://example.org

wget will create a directory with the website’s name you’re mirroring. Enjoy and let me know if you have any questions by leaving a comment. You can also check out my shop for cool tech T-Shirts and Coffee mugs.