Can I use Homebrew on Ubuntu?


Question I just tried to use Homebrew and Linuxbrew to install packages on my Ubuntu Server but both failed. This is how I tried to install them: sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)" I got the following warning: Warning: /home/tong/.linuxbrew/bin is not in your PATH. I vi my bash.bashrc in home/etc and add this: export PATH="$HOME/.linuxbrew/bin:$PATH" export MANPATH="…
Read more ⟶

ImportError: No module named 'xlrd'


Question I am currently using PyCharm with Python version 3.4.3 for this particular project. This PyCharm previously had Python2.7, and I upgraded to 3.4.3. I am trying to fetch data from an Excel file using Pandas. Here is my code: import pandas as pd df = pd.read_excel(“File.xls”, “Sheet1”) print (df) When I ran this code, I am getting this error. ImportError: No module named 'xlrd' I searched Stackoverflow and found some suggestions: I tried with pip install xlrd But, when I did that, the message says "…
Read more ⟶

docker-compose up leads to 'client and server don't have same version (client : 1.14, server: 1.12)'' error but client and server have the same version


Question docker version prints: Client version: 1.0.1 Client API version: 1.12 Go version (client): go1.2.1 Git commit (client): 990021a Server version: 1.0.1 Server API version: 1.12 Go version (server): go1.2.1 Git commit (server): 990021a docker-compose --version prints: docker-compose 1.2.0 I installed docker with apt-get install docker.io and docker-compose with curl -L https://github.com/docker/compose/releases/download/1.2.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose I use Ubuntu 14.04 x64. Answer Checkout the environment variable COMPOSE_API_VERSION.…
Read more ⟶

convert bash `ls` output to json array


Question Is it possible to use a bash script to format the output of the ls to a json array? To be valid json, all names of the dirs and files need to be wrapped in double quotes, seperated by a comma, and the entire thing needs to be wrapped in square brackets. I.e. convert: jeroen@jeroen-ubuntu:~/Desktop$ ls foo.txt bar baz to [ "foo.txt", "bar", "baz" ] edit: I strongly prefer something that works across all my Linux servers; hence rather not depend on python, but have a pure bash solution.…
Read more ⟶

Install Bundler gem using Ansible


Question I am trying to install Bundler on my VPS using Ansible. I already have rbenv set up and the global ruby is 2.1.0. If I SSH as root into the server and run gem install bundler, it installs perfectly. I have tried the following three ways of using Ansible to install the Bundler gem and all three produce no errors, but when I SSH in and run gem list, Bundler is nowhere to be seen.…
Read more ⟶

R: apt-get install r-cran-foo vs. install.packages("foo")


Question When installing R packages (say mcmcpack in this example) under Ubuntu I have the choice between the following two methods of installation: # Let the distribution's packaging system take care of installation/upgrades apt-get install r-cran-mcmcpack Let R take care of installation/upgrades install.packages(“mcmcpack”) Questions: Is any of the two ways of installing R packages considered "best practice"? Assume that I first install.packages("mcmcpack") and later on apt-get install r-cran-mcmcpack - should I expect trouble?…
Read more ⟶

Unable to install PHP 7.4 on Ubuntu 16.04 even with Ondrej PPA repository in apache2


Question I am trying to install PHP 7.4 on Ubuntu 16.04 for Apache2 server. To install the 7.4 version, I used PPA ondrej repository as follows: sudo apt install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install -y php7.4 php -v I get the following error: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package php7.4 E: Couldn't find any package by glob 'php7.…
Read more ⟶