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

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.

Adjusting date and time in openSUSE

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

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

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
🇮🇩

Accessing windows file sharing in Linux

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

Debian: installing VLC by compiling from source

In debian wheezy the latest version of VLC is 2.0.6. But, if you want to get the new version of VLC, you can grab it at here to do compiling by yourself.

 $ wget ftp://ftp.videolan.org/pub/videolan/vlc/2.1.4/vlc-2.1.4.tar.xz  

Once you have done downloading the VLC, now please install the required lib packets.

 # apt-get install libavcodec-dev libshout3-dev libsidplayfp-dev libfreerdp1 libvncserver-dev libcddb2-dev libavformat-dev libvlc-dev libmodplug-dev libshout3-dev libgnomevfs2-dev libcddb2-dev libbluray-dev libopencv-dev libsmbclient-raw-dev libssh2-1-dev libdvdnav-dev libdvdread-dev libzvbi-dev libraw1394-dev libdc1394-22-dev liblivemedia-dev libdssialsacompat-dev libfribidi-dev librsvg2-dev libcaca-dev libfluidsynth-dev libass-dev libspeexdsp-dev libtool build-essential pkg-config autoconf liblua5.1-luacsnd5.2 

Extract the archive of VLC using tarball utility:

 $ tar -xvf vlc-2.1.4.tar.xz; mv vlc-2.1.4 vlc; cd vlc 

Make sure you're in directory VLC installation, to configure it please run this command:

 $ ./configure 

or if you want to install in another directory:

 $ ./configure --prefix=/path/to/install/whatever-folder-you-want 
Let's compile the source, this will take a lot of time, be patient. B)

 $ make  
 # make install  
 # make clean  




Now,  VLC 2.1.4 has been installed in your system. Enjoy with the new version! :)


Fixing sh: 1: /usr/bin/gdbus: not found on Debian

When i'm done installing some packets or running "apt-get upgrade" on my machine(currently I use Wheezy), there's a last message comes up like this:

 sh: 1: /usr/bin/gdbus: not found  
So, how to fix that?
It's easy, just install the libglib2.0-bin packet by command below:
 # apt-get install libglib2.0-bin  
That's it, I hope this help.

Reference:
debianforum.de

Automount and R&W EXT4 drives in Debian GNU/Linux

Setelah melakukan fresh install Debian GNU/Linux, hard drive saya yang bertipe EXT4 harus di mount secara manual tiap kali komputer dinyalakan dan juga tidak dapat membaca dan tulis sebuah/beberapa files begitu saja.

Agar hard drive melakukan mounting secara otomatis, Anda bisa menambahkan partisi hard drive yang bertipe EXT4 pada berkas /etc/fstab. Sebelumnya, silahkan cek partisi mana saja yang akan di mounting secara otomatis dengan mengetikkan perintah blkid pada konsole:


Selanjutnya buatlah direktori baru di /mnt untuk melakukan mount point pada hard drive agar dibaca secara otomatis tiap kali mesin linux  di nyalakan.
 # mkdir /mnt/nama_direktori  
OK, setelah direktori baru dibuat, saatnya menyunting berkas /etc/fstab untuk menambahkan hard drive yang sudah kita tentukan sebelumnya.

Mungkin yang menjadi pertanyaan, dari mana mendapatkan UUID partisi hard drive seperti pada gambar diatas? Seperti yang telah disebutkan sebelumnya, untuk mengetahui UUID dari partisi hard drive pada mesin linux bisa dengan menggunakan perintah blkid. Setelah semuanya selesai, silakan save berkas fstab yang telah disunting dan lakukan remount dengan perintah mount -a. Kemudian ubah Owner dari setiap files yang akan di baca dan tulis agar mendapatkan permission pada direktori mount point yang telah dibuat sebelumnya dengan perintah:
 # chown -R namapengguna: /mnt/nama_direktori
and you're done. :)