Windows 11 not Accepting File Names Over 260 Characters

The new Windows 11 is another Microsoft release. As usual, I’m not impressed at all. Anyways, a client was having issues when trying to clone a git repo on her new Windows 11 machine. the client kept getting error “Destination path too long” error message.

There are some suggestions online to make a registry and or use the Group Policy Editor. Both did not work for me. The suggested registry change is to change the value of the below registry key to ‘1’:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

I rebooted and still got the same error above. I did not even try Local Group Policy since this was a Windows 11 Home edition.

After having some great coffee from Colombia, I found a way to make this work.

I created a folder directly on the root (C: drive). For example, C:\work_here

On the Windows 11 command prompt I change directories to the above and did a git clone. All works now.

Contact me if you have any questions. Remember to check my T-shirt and Coffee mugs shop.

Change Screenshot Location Using macOS Terminal

My desktop kept getting overloaded with screenshots. If you want to keep your macOS desktop nice and clean you can change the screenshot location in your macos using the Terminal.

This is simple. First, I brewed my own coffee at home. I got this great coffee from El Salvador which is fantastic!

Open your Terminal and type the following command:

defaults write com.apple.screencapture location /Users/[your_username]/Desktop/screenShots

In this case I decided to have my screenshots save to a folder in my Desktop. Now, every time I take a screenshot I only need to look inside one folder instead of wondering where is the file in my entire Desktop.

How to Flush DNS Cache macOS Terminal

A client with about 150 macOS called me. They needed to find a quick and effective way to flush DNS cache on macOS Terminal. After brewing a great cup of coffee from Guatelama I decided to take on this one.

I found a simple combination of commands using the macOS Terminal. Once you open your Terminal copy and paste the commands below and press enter:

sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder

You will not see a success confirmation message on the Terminal. After you run it try to ping or access the desired hostname.

You can even place this command on a bash script and deploy it to all your clients or ever for yourself (maybe create an alias in the Terminal).

Hope this is helpful. Contact me if you have any questions. Also, remember to see my cool T-Shirts and coffee mugs shop where I made my own designs.

cp Command to Overwrite Without Confirmation

I’m used to running the cp command in Linux often. But, this time a client had an emergency and I needed to use the cp command to overwrite a directory in their Red Hat Linux box.

I needed to login with root for this one. I needed to restore a directory to it’s original location using the cp command to overwrite the old corrupted one. In the terminal I ran:

cp -rf /data/restore/restored-dir/var/www/cms/ubi /var/www

And got prompted to confirm the overwrite for each file:

cp: overwrite ‘./ubi/index.html’?

It sucks to have to confirm thousands of files even when you’re logged in as root! Why? I ran to the kitchen and brew myself a nice cup of coffee from Guatemala.

Then, I found out that root in Red Hat Linux has an alias for the cp command:

which cp

and got:

which cp comamnd

In order to escape this alias in Linux I had to run the same command previously, but with an added ‘ / ‘ in front of the cp command:

/cp -rf /data/restore/restored-dir/var/www/cms/ubi /var/www

Now, all works. I was able to copy the restored files.

You can always contact me if you have any questions. Also, make sure to visit my coffee mugs and T-Shirts shop for inspiration.

Change MariaDB Data Directory Location CentOS

A client asked me if I can help their WordPress developer configure a development Linux box. They created a separate partition and wanted to change their MariaDB Data Directory Location on their CentOS server.

After taking a walk in New York City by the Madison Square Park I decided to put this tutorial together. There are some simple steps:

  1. Moving MariaDB Data Directory
  2. Pointing to the New Data Location
  3. Restart MariaDB

Moving MariaDB Data Directory

We need to verify the the current MariaDB data location first. Login using the below command. Enter your password when prompted:

mysql -u root -p

Then, once logged in run the following:

select @@datadir;

You should see the current location:

Change MariaDB Data Directory
MariaDB data location

Type exit.

Next, stop MariaDB:

sudo systemctl stop mariadb

Confirm it really stopped:

sudo systemctl status mariadb

Read the output and make sure it says:

Stopped MariaDB database server.

Point to the New Data Location

Now, we need to tell MariaDB where the new location will live. Edit /etc/my.cnf by running:

sudo vim /etc/my.cnf

Find the line that begins with ‘datadir=’ and make the changes to the new location. Also, change the ‘socket=’ if necessary.

Remember, you can also define a custom .cnf in side the /etc/my.cnf.d/ 

Write your above changes and now let go start MariaDB and see.

Finally, start MariaDB by running this command:

sudo systemctl start mariadb

Verify its running:

sudo systemctl status mariadb

Also, repeat the first command above:

mysql -u root -p
select @@datadir;

In order to verify the changes. Type exit or \q.

Cheers! Remember to see my T-shirt and coffee mugs shop. I designed some inspirational ones. Let me know what you think.

Hope you enjoy this Change MariaDB Data Directory brief tutorial.

Setup Windows 11 without a Microsoft Account

I found myself configuring for the first time a new Windows 11 laptop for a client. I was used to configure the initial account in other Windows versions as a local user. This time the setup of Windows 11 without a Microsoft account was very tricky.

After having a beer in one of my favorite bars in New York city I found a way to get around this confusing setup.

I tried the old fashion way to manage Windows users and I ran:

lusrmgr.msc

I got the usual screen which is funny because this is Windows 11 and NOT Windows 10. See what it says on the Local Users and Group screen:

lusrmgr.msc window in Windows 11

Finally, I found a quick way to setup Windows 11 without a Microsoft account.

Windows 11 without Microsoft account
New user screen Windows 11

I like the command prompt in either Windows or Linux or whatever system I touch.

At the setup screen in Windows press Shift + F10 shortcut. This will open a command prompt. Next, we need to release the network configuration we setup in the previous screen by running this command:

ipconfig /release
Windows 11 without Microsoft account
ipconfig /release command Windows 11

Quickly click on the Back button/arrow. Windows will now show you the ‘Who’s going to use this device?’ screen. This will be a local user. Enter your desired username, press Next and then enter a password for this new local user. You will be prompted for the usual privacy settings.

Enable SSH using the Terminal on macOS

The other day I was helping a client with her mac. Suddenly, Finder crashed and I ended up with just the Terminal open. This is what forced me to enable SSH using the Terminal. I decided to brew a great cup of Bourbon coffee first.

To enable SSH using the Terminal is quite simple. It requires sudo privileges. First, I wanted to check if SSH was already enabled by running this command:

sudo systemsetup -getremotelogin
Enable SSH using Terminal
Results Terminal showing ON

After confirming SSH was NOT enabled I ran the following command to turn ON SSH in this macOS:

sudo systemsetup -setremotelogin on

Remember when using sudo you need to enter your password because it requires administrator rights.

As always, contact me if you have any questions. Also, remember to visit my IT Handyman shop. I make all the designs. Thank you!

How to find Python shell executing in 32bit or 64bit

I was a little confused about how find Python shell executing in 32bit or 64bit. After taking a walk by the Buskwick Inlet Park in NYC I decided to look into this.

I found a simple and quick way to find if my Python shell is executing in 32bit or 64bit. I’m using a macOS in this case, but this should work on any Linux distro.

These are the simple steps I took:

1. Started the Python interpreter
2. Ran the following:
   import platform
   platform.architecture()[0]

The above should display the following output:

'64bit' or '32bit'
Python shell executing in 32bit or 64bit
Python shell interpreter

Manage Linux Users with the passwd command

To manage Linux users with the passwd command is very handy and straight forward. After brewing a really good Colombian coffee at home from Finca La Camelia I decided to put this brief tutorial.

passwd command options

passwd -S <username>

This option displays the status of a specific user. Example output:

username PS 2022-06-13 0 99999 7 -1 (Password set, SHA512 crypt.)

In the above example it shows that username was created June 13, 2022 with a SHA512 encryption.

passwd -l <username>

The above option with -l will lock the username above. This only locks access to the system, but the user can still login if he/she has SSH access set with a public key.

passwd -u <username>

With the -u option above you will ‘unlock’ the username that was already in ‘locked’ state with the -l option.

passwd -d <username>

The above will delete a password for username.

passwd -e <username>

To expire an account immediately use the above option -e. This option will force username to change their password at next login.

passwd -n 10 username

The above indicates the username cannot change their password until 10 days have gone by.

passwd -x 90 username

The above tells the Linux system that username that after 90 days the password will expire forcing the username to change their password.

Hopefully this short tutorial can point you to the right direction. You can always contact me if you have any questions. Also, check out my shop for unique coffee mugs and t-shirt designs I created. There are more options to manage Linux passwd command, but these are the most common ones. I will be adding more options soon.

Create a New Linux Superuser Admin User

The other day I had to add a sudo user in Linux. I have done this many times in Ubuntu/Debian Linux boxes, but forgot how to create a new Linux superuser in RedHat/CentOS/Fedora family.

I created this quick review and maybe can help others.

Create New Linux Superuser in Ubuntu/Debian

Let’s do this using the Terminal/Command-line way. Open your terminal and type:

sudo adduser newuser

The newuser is the name of the new user you’re trying to create.

The above command will create the new user. Now, you need to add the newuser to the sudo group. Type the next command in your terminal:

sudo usermod -aG sudo newuser

Little explaination about the above -a means to Append and G stands for Group.

When you’re done adding the user to the sudo group, you should verify by running this command in your terminal:

groups newuser

You should see the sudo group listed.

You can also do the first two commands in one shot:

sudo adduser newuser sudo

Linux is cool! Brew coffee at home is ever better! 🙂

Create New Linux Superuser in RedHat/CentOS

Using RedHat 8 at one of my clients. I haven’t touch this Linux disto in a while, but its no big deal. I took a walk by Pier 76 in NYC before handling this one.

Create a new user you need the adduser command:

adduser newuser

Next, set a password for the newuser:

passwd newuser

Last, you need to add the newuser to the wheel group:

usermod -aG wheel username

Now, if you haven’t open the sudoers file using this command:

visudo

Edit the line %wheel ALL(ALL) by removing the ‘#’ character in front of it. There might be other options for the wheel group let say you can add or un-comment this line:

%wheel  ALL=(ALL)       NOPASSWD: ALL

This will allow the users in the wheel group to run sudo without having to enter their password every time.

Hope you like this brief tutorial. You can always contact me if you have any questions. Also, check out my T-Shirts and coffee mugs shop. I made all the designs.