Where It All Started.

Where It All Started.

Life, Stock Trading, Investments, Business and Startup. Most are programming stuff.

Month: January 2019

Disable Snap Daemon in Archlinux

Carry out a random act of kindness, with no expectation of reward, safe in the knowledge that one day someone might do the same for you.

— Princess Diana.

One day I woke up and I just don’t want to use Snap apps anymore. So how do I remove it from my workstation? Here are the things I’ve did to completely removed it from my workstation.

In order to disable Snap apps on your workstation you must first list all snap services and the included PID (Process Identifier) sockets running.

systemctl list-unit-files | grep snap

After you listed all of it, you must disable all known snap services. Below is just a gist of running snap services on my workstation (on Fedora Linux).

sudo systemctl disable snapd.service  
sudo systemctl disable snapd.seeded.service  
sudo systemctl disable snapd.socket  
sudo systemctl disable var-lib-snapd-snap-core-6130.mount

After you completed the steps above you must then restart your workstation for a much more cleaner startup.

So guys, if you have any problem running the above command let me know? That’s it guys as always live life and hope you enjoyed this article!

Debugging PHP with Xdebug over SSH

The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.

— Winston Churchill.

Back in days before Xdebug1 came to light, debugging PHP2 was pretty simple like in C3 on which you use print or var_dump. Today with improving tools and setup, PHP can now be debugged remotely with the help of ssh + xdebug.

To do this first you must connect to the remote development station on where PHP server is located (e.g. PHP direct dynamic server, Nginx, Apache HTTP).

ssh -R 9000:localhost:9000 [email protected]_goes_here

The -R stands for return remote callback connection on SSH on which server --(poll)--> host (xdebug server).

After running a remote port forwarding you will need to setup xdebug on the remote server, point it on which address it would bind and listen. For my use case I’d point mine to the loopback address 127.0.0.1 (as I’d only use it for development purposes) on which we setup remote port forwarding to listen to. Edit the php.ini file and at the xdebug configuration make it similar to the sample below.

[xdebug]
zend_extension="/usr/lib64/php/7.1/modules/xdebug.so"
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_log=/tmp/xdebug_remote.log
xdebug.remote_connect_back=0

The most notable part in the config is the xdebug.remote_host and xdebug.remote_port, this is where xdebug would bind. After all the changes have been done, just restart the server (e.g. for Apache HTTP running on CentOS).

service httpd restart

And at our workstation editor with PHP debugger extension we would just point it to 127.0.0.1:9000. That’s all now we can debug PHP remotely.

🧡🧡🧡🧡🧡

Hope you guys enjoyed this article!


  1. Xdebug is a PHP extension which provides debugging and profiling capabilities. It uses the DBGp debugging protocol. ↩︎
  2. PHP is a general-purpose programming language originally designed for web development. It was originally created by Rasmus Lerdorf in 1994; the PHP reference implementation is now produced by The PHP Group. ↩︎
  3. C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, while a static type system prevents unintended operations. ↩︎