Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Archives for reset

December 25, 2019

XCode after Catalina Upgrade

I tried running git after the Mac OS Catalina upgrade and got this error.

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

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

Here’s the fix. For some very odd reason, Apple does not automatically reinstall xcode after each Mac OS upgrade.

You will need to either reset it or install it again.

# Try reset first
xcode-select --reset
# Or install it if reset doesn't work
xcode-select --install

# Try reset first xcode-select --reset # Or install it if reset doesn't work xcode-select --install

Close your terminal, and reopen and run git again.

September 2, 2019

Recover MySQL Root Password

How to recover a MySQL root password without a password.

  1. Stop MySQL.
  2. Start MySQL Safe Mode.
  3. Login to MySQL as root without password.
  4. Change root password.

# Stop MySQL.
service mysql stop
# MySQL Safe Mode.
mysqld_safe --skip-grant-tables &

# Stop MySQL. service mysql stop # MySQL Safe Mode. mysqld_safe --skip-grant-tables &

# Login to MySQL without password. Set new password.
mysql -u root -p
use mysql;
# For MySQL 5.6 or lower
UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root';
# For MySQL 5.7 or higher
SET PASSWORD FOR 'root'@'localhost' = PASSWORD("newpassword");
FLUSH PRIVILEGES;
exit;

# Login to MySQL without password. Set new password. mysql -u root -p use mysql; # For MySQL 5.6 or lower UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root'; # For MySQL 5.7 or higher SET PASSWORD FOR 'root'@'localhost' = PASSWORD("newpassword"); FLUSH PRIVILEGES; exit;

# Kill mysqld
killall mysqld
# Restart MySQL
service mysql start

# Kill mysqld killall mysqld # Restart MySQL service mysql start

I ran into issues running MySQL Safe mode. I got a “UNIX socket file don’t exists” error. Here’s the fix.

mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld

mkdir -p /var/run/mysqld chown mysql:mysql /var/run/mysqld

January 15, 2019

Reset Locked Out Linux User

Perform this command to reset a Linux account that has been locked out due to multiple login failures. This involves resetting the pam_tally back down to zero. Some systems use pam_tally2. First, check what’s the current tally.

Current tally:

pam_tally --user=username
pam_tally2 --user=username

pam_tally --user=username pam_tally2 --user=username

To reset:

pam_tally --user=username --reset
pam_tally2 --user=username --reset

pam_tally --user=username --reset pam_tally2 --user=username --reset

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021