When I was testing Docker’s initial tutorial when you download for the first time I got the error:
The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64) and nospecific platform was requested.
It sucks because I got a new MacBook Pro M1 and I did not know about these issues with arm64 chips and images. Trying to play with the tutorial while having great coffee from Latin America I got stuck when trying to run the MySQL image in my compose file.
Searching around I found two options to resolve this. See below:
Option 1: Add the flag –platform linux/arm64
This will tell your MacOS M1 what platform to use. Brief example:
The most likely cause is faulty software. A kernel panic can also be caused by damaged or incompatible hardware, including external devices attached to your Mac. If the kernel panic is caused by a known problem, the faulty software is identified. To make sure that this software doesn’t continue to cause kernel panics, move it to the Trash.
If not a faulty software and your MacOS continues to reboot with kernel panics, try these:
Restart your Mac in safe mode. If it successfully starts up in safe mode, choose Apple menu > App Store, click Updates, then install any available updates.
Uninstall any plug-ins or other enhancement software from manufacturers other than Apple. If you recently updated macOS or an app, plug-ins and other software that worked in the past may no longer be compatible. Read the manufacturer’s documentation (including Read Me notes) to be sure the software is compatible with your version of macOS.
Disconnect all devices except for an Apple keyboard and mouse. Remove hardware upgrades from other manufacturers, such as random-access memory (RAM) and Peripheral Component Interconnect (PCI) cards. Then try restarting your Mac.
If this resolves the issue, reconnect one device at a time, restarting your Mac after reconnecting each one, until you determine which device is causing the problem.
Use Apple Diagnostics to diagnose problems with your computer’s internal hardware, such as the logic board, memory, and wireless components.
You can also check MacOS Console to find out more details about why your MacOS restarted.
The other day a friend asked me to create a desktop shortcut in Windows 10 for all users. I have been using other operating systems for a while and have been trying to stay away from Windows.
After taking a walk in New York City I refreshed my mind and found a way to create this desktop shortcut for all users in Windows 10. These are the steps:
Login as Administrator in Windows 10 (Your local Admin account)
Go to your C drive > Users > Public > Public Desktop (“Public Desktop” is usually a hidden file, so you need to do this – in your File Explorer select ‘View’ and then select the checkbox ‘Hidden Items’
Now just drag and drop your shortcuts into the Public Desktop and it will show for all your users in Windows 10.
The other day I got a new laptop and needed to generate ssh key pair. Sometimes you forget basic commands when you don’t run them on a daily basis. So, I took a short walk in Brooklyn, New York City before I started working on my new laptop setup.
To generate ssh key pair in Linux is quite simple. Use the ssh-keygen command. Open your Terminal and type:
ssh-keygen -t rsa
Next, you will need to specify the location of the file where you want to save the key such as for example:
Enter file in which to save the key (/home/youruser/.ssh/id_rsa):
Don’t type anything to leave your key at the default location with the default name /home/youruser/.ssh/id_rsa. If you want to you can specify a different name. I do this when I need to ssh to different servers, this helps me keep organized.
Finally, you will need to type a password if you like:
Enter passphrase (empty for no passphrase):
I usually leave it empty, but this is really up to you.
This will create a private key written to: /home/youruser/.ssh/id_rsa
and a public key written /home/youruser/.ssh/id_rsa.pub
Copy the contents of your .pub file into your server’s .ssh/authorized_keys
You need to change your Linux permissions to:
chmod 700 .ssh/
chmod 600 .ssh/authorized_keys
Now you should be able to SSH to your server without using a password. Give it a try and Contact me if you have any questions.
The other day I got a new Apple M1 processor chip (I really don’t like there’s only two ‘USB-4’ ports and the ‘Magic bar’ bothers me!). But, anyways when I opened my terminal i noticed the below message and wanted to change default shell to bash for this macOS Bir Sur.
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
I got used to bash on my nice old friend macOS High Sierra. So, I found a way to change default shell to bash for it. Before changing this I brewed one of my favorite Latin America coffees from Honduras.
How Change Default Shell to bash macOS Big
This is very easy to do:
Open your terminal
List available shells by typing: cat /etc/shells
To change your account to use bash type: chsh -s /bin/bash
Close your terminal
Open your terminal and verify that bash is your default shell running: echo "$SHELL" or printf "%s\n" "$SHELL"
While building my own Flask application for learning purposes. I was not sure how it was being served on the web. I did not install Apache of any other web server, but it is running on my Digital Ocean test server. The I found out about Python’s built-in HTTP server.
This final purpose of this app is to keep track of your blood pressure at home. I will keep you posted about the progress. You can also see my Github repo and offer any suggestions if you like.
Anyways, after having a great cup of Latin America coffee I discovered that Python has an standard HTTP server built into the standard library. So, when I run my CMD python run.py at the end of my Dockerfile it starts the Python standard HTTP build-in server for me.
If you like to run it alone for other testing purposes you can do the below.
For Python 3.x:
python3 -m http.server
For Python 2.x
python -m SimpleHTTPServer 8000
This will serve the current directory at your http://localhost:8000 or http://127.0.0.1:8000
Python’s built-in HTTP server is a useful standard library that I was not aware or did not occur to think about it until today. Don’t know why.
I invite you to check my other posts about setting up Ubuntu server static IP. Thanks and let me know if you have any questions.
The other day one of my friends who is a Windows user asked me to basic Linux commands because he wanted to improve his IT skills. I helped him out and also decided to put together a brief list of basic Linux commands for newbies while having fantastic Latin America coffee at home.
Basic Linux Files and Navigation Commands
List of files/directories in current directory
Formatted listing including hidden files
Change directory to <dir>(<dir> is directory name)