Tuesday, January 2, 2018

Starting frontend GLOBAL: cannot bind UNIX socket [/var/run/haproxy/admin.sock]

Haproxy Error: 
 [WARNING] 000/231555 (73783) : Can't open server state file '/var/state/haproxy/global': No such file or directory
Starting frontend GLOBAL: cannot bind UNIX socket [/var/run/haproxy/admin.sock]

How to fix this:

Login to the server
mkdir -p  /var/run/haproxy/
Start haproxy service

It works.  

Haproxy needs to write to /var/run/haproxy/admin.sock but it wont create the directory for you. Create the directory /var/run/haproxy

 

Saturday, December 30, 2017

package github.com/gorilla/mux: cannot download, $GOPATH not set

While installing a GO package, I am getting the following error.

# go get github.com/gorilla/mux
package github.com/gorilla/mux: cannot download, $GOPATH not set. For more details see: go help gopath


How to solve this error:

Login to the server.
# mkdir /path/to/a/folder
# vi ~/.bashrc
# export GOPATH=/path/to/a/folder
# source ~/.bashrc


Now try the command go get github.com/gorilla/mux, It works.



cannot find package "github.com/gorilla/mux"

In Go, while building (go build) I am getting the following error

cannot find package "github.com/gorilla/mux"

Solution:

Login to the server
# go get github.com/gorilla/mux 
# go build

This will  help to fix the package error.

But you may see another error :  cannot download, $GOPATH not set. For more details see: go help gopath

Click the link for the fix

Friday, December 22, 2017

Finding the python path in windows

I have two pythons installed on my windows 7 machine. I need to know which python is marked as default. I am not using any virtual environment for python.

Open your cmd prompt.
Type python
>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)
'C:\\Python3'