Legit
CopyLeft© | Darmanex Weblog - A journey about virtual world.
2008 - 2019
Powered by Blogger
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 Manjaro 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
August 17, 2018

Git: Your branch is based on 'origin/branch', but the upstream is gone.

darmanex | 4:16 PM Be the first to comment!
Since I've added remote branch on my local repository, and when I'm going to checking out a remote branch, I got an error/warning message like the title of this post above. After googling same keywords of the warning message, there was who asked on stackoverflow with the same error message like me.
$ git checkout apps-devel
Checking out files: 100% (208/208), done.
Switched to branch 'apps-devel'
Your branch is based on 'hsp/apps-Dev', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)

For your information, the original remote branch is hsp/apps-Dev and I've rename it to apps-devel. I try to pull a remote branch as well, and get another message like below:
$ git pull hsp
Your configuration specifies to merge with the ref 'refs/heads/apps-Dev'
from the remote, but no such ref was fetched.

So this is how to fix it.
First open the git config on your local repo (generally the location at .git/config). Here are my configs for the remote branch:
[branch "apps-devel"]
 remote = hsp
 merge = refs/heads/apps-Dev

and I change it to
[branch "apps-devel"]
 remote = hsp
 merge = refs/heads/apps-devel

Then let's checking it again
$ git pull hsp
Already up-to-date.

$ git status
On branch apps-devel
Your branch is up-to-date with 'hsp/apps-devel'.

nothing to commit, working tree clean

As you can see above, no warning message anymore.

Happy Independence day Indonesia! 🇮🇩
Hiduplah Indonesia Raya
🇮🇩
April 20, 2018

Accessing windows file sharing in Linux

darmanex | 2:21 PM Be the first to comment!
Well, my Dev team mate have a Linux server for build some projects, and they wanted to access their files from Linux by remote/konsole mode, in this case their files are on Windows. So, here are their files sharing on Windows system.
As you can see above, we will access on those folder Autogenerated and Resources. So, here's the step to make it accessible from Linux.
Installing a requirements packages
# apt-get install cifs-utils

After that then go to /etc/nsswitch.conf and edit it:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

add "wins" on that line
hosts:  files mdns4_minimal [NOTFOUND=return] wins dns mdns4

If winbind is not installed on Linux system, please install it by this issue command:
# apt-get install libnss-winbind winbind

Now reload the network to take effect:
# service networking restart

Mounting drive
Backup the fstab configuration to avoid any mistaken in the future.
# cp /etc/fstab{,.old}

Now create a credential user files who will accessing the folder share files on current linux user.
# printf '%s\n' 'username=darm' 'password=******' > .smbuser

Next, we should know the UID and GID on the system. Run the following command
# id programmer
uid=1000(programmer) gid=1000(programmer) groups=1000(programmer),27(sudo),7001(wksadmin)

Create folder for mounting point.
# mkdir /media/prg
# mkdir /media/prg2

Then we open fstab file to start mounting point, and put this line on it.
//Workstation/AutoGenerated /media/prg cifs credentials=/home/programmer/.smbcredentials,iocharset=utf8,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0
//Workstation/Resources /media/prg2 cifs credentials=/home/programmer/.smbcredentials,iocharset=utf8,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0

Save your configuration, and reload the fstab
# mount -a

Now let's take a look the result. :D