Legit
CopyLeft© | Darmanex Weblog - A journey about virtual world.
2008 - 2019
Powered by Blogger
October 17, 2020

Pyenv shims cannot find executables

darmanex | 3:53 PM Be the first to comment!
After I upgrade python to the new version on my laptop, and when I run python I got this warning:
/Users/darm/.pyenv/shims/python3: line 21: /usr/local/Cellar/pyenv/1.2.18/libexec/pyenv: No such file or directory

To solve the issue, you have to rehash it, like below.
pyenv rehash
August 23, 2020

PostgreSQL: password authentication failed for user "postgres"

darmanex | 11:46 PM Be the first to comment!
In our development environment we use postgresql for our database engine. We just create a new database, and our developer requested that they want have new role. The new role will have SELECT access into tables that they requested before.
But something happen when our developer trying to run sql command like below:
# select * from table_name;
ERROR:  could not connect to server "server_master"
DETAIL:  FATAL:  password authentication failed for user "postgres"

In this situation we have to check one by one what's the password of user postgres, and we found the password is different. To check current password of user mappings, you can type \deu+ on psql console.
In this case we will change the password of user mappings. To change the password, assuming you are on the right database, and run this on psql console:
# ALTER USER MAPPING FOR postgres SERVER server_master OPTIONS (SET password 'YOUR_NEW_PASSWORD');

Then check it again the user mappings with \deu+.
Then try it once again.

Cool, we have no error found anymore!
Reference: https://www.postgresql.org/docs/10/sql-alterusermapping.html
August 3, 2020

Linux Kernel 5.8 relased!

darmanex | 2:05 PM Be the first to comment!


Well, as we know that Kernel 5.8 has announced by Linus Torvalds. You guys can directly check his announcement on Linux Kernel Mailing List(LMKM).
And I'm going to upgrade my kernel on Arch Linux. Stay tuned!
February 22, 2019

ERROR MySQL: Can't connect to local MySQL server through socket

darmanex | 12:48 PM Be the first to comment!
Currently I used OpenSUSE as my operating system, so to fix the issue as the title of this post is I'll modified the MySQL config at /etc/my.cnf. Open up the my.cnf config and go find the [client] section and uncomment these 2 lines below:
# port       = 3306
# socket     = /run/mysql/mysql.sock

Don't forget to change mode the my.cnf config file to 600, so just only you can edit it.
# chmod 600 my.cnf

To take effect, please restart mysql service.
# service mysql start

Now you can connect to mysql client by this command
# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.2.15-MariaDB openSUSE package

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Let say you haven't set the root password yet, you could reset/set a new root password with this following step below.
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [mysql]> show tables;
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
-----------SNIP--------------
| user                      |
+---------------------------+
30 rows in set (0.00 sec)

Now set a new root password
MariaDB [mysql]> update user set password=PASSWORD("YOUR_NEW_PASSWORD") where User='root';

Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

And then tells MySQL to put the new changes.
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

After all steps above done, you can now test it to connect to MySQL client with password that you've created.
# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.15-MariaDB openSUSE package

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

That's all.
August 24, 2018

Adjusting date and time in openSUSE

darmanex | 5:42 PM Be the first to comment!
When you want to adjust the date and time on Debian/Ubuntu system you can just type this command
$ sudo dpkg-reconfigure tzdata

But, if you use openSUSE, to adjust the date and time just simply run the following command
$ sudo yast2 timezone


Select the region and timezone then press F10/OK, and you're done.
Reference: goo.gl/KLDALY