• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

reset

Crontab on macOS Monterey

November 29, 2022

A recent OS upgrade rendered the crontab to malfunction on macOS Monterey. It turned out the system just needed a reset of System Preferences > Security & Privacy > Privacy tab, and to make sure cron has full access to disks. Once you flipped that, your crontab should start working. Hope that helps.

Filed Under: Linux Tagged With: cron, mac os, monterey, reset

Git Reset File From Master

May 28, 2022

Here’s how to reset a file from the master branch.

git checkout origin/master test.py

git checkout origin/master test.py

This will undo your changes and matches what’s in the master repo.

Filed Under: Git Tagged With: git, master, reset

GCP Windows Password Reset

February 14, 2022

Instead of the GCP Console, you can reset Windows Server password via gcloud.

gcloud compute reset-windows-password server-name \
--zone us-central1-a \
--project project-id

gcloud compute reset-windows-password server-name \ --zone us-central1-a \ --project project-id

Username and password will generated.

Filed Under: Cloud Tagged With: gcloud, gcp, password, reset, windows

Git Reset Hard

February 12, 2022

Reset uncommitted changes to both files and directories.

git reset --hard

git reset --hard

Remove untracked files and directories.

git clean -fd

git clean -fd

Filed Under: Git Tagged With: changes, hard, reset, uncommitted

GCP Reset Windows Password

February 4, 2022

How to reset password of a GCP Compute Engine running on Windows OS.

gcloud compute reset-windows-password servername \
--zone us-central1-a \
--project your-project-id

gcloud compute reset-windows-password servername \ --zone us-central1-a \ --project your-project-id

Output

This command creates an account and sets an initial password for the
user [firstname_lastname] if the account does not already exist.
If the account already exists, resetting the password can cause the
LOSS OF ENCRYPTED DATA secured with the current password, including
files and stored passwords.
 
For more information, see:
https://cloud.google.com/compute/docs/operating-systems/windows#reset
 
Would you like to set or reset the password for [firstname_lastname]
(Y/n)?  y
 
Resetting and retrieving password for [firstname_lastname] on [servername]
Updated [https://www.googleapis.com/compute/v1/projects/your-project-id/zones/us-central1-a/instances/servername].
WARNING: Instance [servername] does not appear to have an external IP
address, so it will not be able to accept external connections.
To add an external IP address to the instance, use
gcloud compute instances add-access-config.
password: xxxxxxxxxxxxxxx
username: firstname_lastname

This command creates an account and sets an initial password for the user [firstname_lastname] if the account does not already exist. If the account already exists, resetting the password can cause the LOSS OF ENCRYPTED DATA secured with the current password, including files and stored passwords. For more information, see: https://cloud.google.com/compute/docs/operating-systems/windows#reset Would you like to set or reset the password for [firstname_lastname] (Y/n)? y Resetting and retrieving password for [firstname_lastname] on [servername] Updated [https://www.googleapis.com/compute/v1/projects/your-project-id/zones/us-central1-a/instances/servername]. WARNING: Instance [servername] does not appear to have an external IP address, so it will not be able to accept external connections. To add an external IP address to the instance, use gcloud compute instances add-access-config. password: xxxxxxxxxxxxxxx username: firstname_lastname

Filed Under: Cloud Tagged With: compute, gcp, password, reset, set, windows

Git Undo Add

October 13, 2021

To undo a git add, run git reset file or get reset.

git reset filename
git reset

git reset filename git reset

Run git status to check.

git status

git status

Filed Under: Linux Tagged With: add, git, reset, undo

XCode after Catalina Upgrade

December 25, 2019

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.

Filed Under: Mac Tagged With: catalina, git, install, mac os, reset, xcode

Recover MySQL Root Password

September 2, 2019

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

Filed Under: Cloud, Linux Tagged With: error, mysql, password, recover, reset, root, safe mode, unix file socket

  • Go to page 1
  • Go to page 2
  • Go to Next Page »
  • Home
  • About
  • Archives

Copyright © 2023