Problem
Trying to access or set up the mysql-workbench tool in linux you get the error about forgot_password.
Solution
Install the gnome-keyring
sudo apt install gnome-keyring
You want to reset the root password for MySQL in your linux Ubuntu installation.
Follow the steps described https://linuxconfig.org/how-to-reset-root-mysql-password-on-ubuntu-18-04-bionic-beaver-linux
Problem
You would like to access a host set up with nginx after adding your own vhost configuration file in /etc/nginx/conf.d/myfile.smth, but you get Connection refused.
Solution
Make sure that your nginx configuration file has the .conf extension as /etc/nginx/conf.d/myfile.conf.
Problem
You would like to copy the contents of a source directory to a destination directory without overwriting existing files on the destination.
Solution
You can use
1 |
rsync -a -v --ignore-existing source_dir/ dest_dir/ |
and you can also use the –dry-run option to test before running it.
Problem
You have defined a variable in a bash script (ie MY_FOLDER) but you also want to dynamically get the parent folder (ie MY_FOLDER can have multiple values).
Solution
Use the dirname as in the following
1 2 3 4 5 6 7 8 9 |
MY_FOLDER=/home/user/first_folder/second_folder MY_PARENT_FOLDER=$(dirname $MY_FOLDER) echo $MY_FOLDER echo $MY_PARENT_FOLDER ....... /home/user/first_folder/second_folder /home/user/first_folder |
Problem
You would like to remove some lines from the bash history (ie using cut and paste with wrong values).
Solution
You can use the following, taken from the answer here
1 |
for i in {1..no_of_lines}; do history -d start_line; done |
where start_line is the start of the lines you want to remove and no_of_lines is the number of lines you want to be removed.