brew install redis (osx 10.7) - ruby-on-rails

i tried installing Redis on osx 10.7 via homebrew in bash and I get the following error:
==> Downloading http://redis.googlecode.com/files/redis-2.6.9.tar.gz
Already downloaded: /Library/Caches/Homebrew/redis-2.6.9.tar.gz
==> make -C /private/tmp/redis-wQAX/redis-2.6.9/src CC=cc
Error: Permission denied - /usr/local/var/db
Redis is not installed from what i can tell.
$ ps -aux | grep redis
ps: No user named 'x'
I cannot find the solution and don't know who to ask! Please let me know if you have workaround or solution/suggestion to this. Thank you!

I am also using osx 10.7. I think you don't need to install Redis via homebrew. You can just follow the simple instructions in redis homepage:

in bash:
cd /usr/local/var/
ls
the directory 'db' is most likely missing, create it:
mkdir db
then run
brew install redis
check /usr/local/var/log
ls
most likely the directory 'log' is missing, create it
mkdir log
brew install redis

Related

docker login fails on a server with no X11 installed

I am trying to deploy a docker configuration with images on a private docker registry.
Now, every time I execute docker login registry.example.com, I get the following error message:
error getting credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY
The only solution I found for non-MacOS users was to run export $(dbus-launch) first, but that did not change anything.
I am running Ubuntu Server and tried with both the Ubuntu Docker package and the Docker-CE package.
How can I log in without an X11 session?
Looks like this is because it defaults to use the secretservice executable which seems to have some sort of X11 dependency for some reason. If you install and configure pass docker will use that instead which seems to solve the problem.
In a nutshell (from https://github.com/docker/compose/issues/6023)
sudo apt install gnupg2 pass
gpg2 --full-generate-key
This generates a you a gpg2 key. After that's done you can list it with
gpg2 -k
Copy the key id (from the line labelled [uid]) and do
pass init "whatever key id you have"
Now docker login should work.
There are a couple of bugs logged on launchpad regarding this:
https://bugs.launchpad.net/ubuntu/+source/golang-github-docker-docker-credential-helpers/+bug/1794307
https://bugs.launchpad.net/ubuntu/+source/docker-compose/+bug/1796119
This works: sudo apt remove golang-docker-credential-helpers
You can remove the offending package golang-docker-credential-helpers without removing all of docker-compose.
The following worked for me on a server without X11 installed:
dpkg -r --ignore-depends=golang-docker-credential-helpers golang-docker-credential-helpers
and then
echo 'foo' | docker login mydockerrepo.com -u dockeruser --password-stdin
Source:
bug reported in debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=910823#39
bug reported on ubuntu:
https://bugs.launchpad.net/ubuntu/+source/docker-compose/+bug/1796119
secretservice requires a GUI. You can use pass without a GUI.
Unfortunately, Docker's documentation on how to configure Docker Credential Helpers is quite lacking. Here's a comprehensive guide how to configure pass with Docker (tested with Ubuntu 18.04):
1. Install the Docker Credential Helper for pass
Find the url for the latest version of docker-credential-pass from https://github.com/docker/docker-credential-helpers/releases . For example:
# substitute with the latest version
url=https://github.com/docker/docker-credential-helpers/releases/download/v0.6.2/docker-credential-pass-v0.6.2-amd64.tar.gz
# download and untar the binary
wget $url
tar -xzvf $(basename $url)
# move the binary to a dir in your $PATH
sudo mv docker-credential-pass /usr/local/bin
# verify it works
docker-credential-pass list
2. Install and configure pass
apt install pass
# create a gpg2 key
gpg2 --gen-key
# if you have issues with lack of entropy, "apt install haveged" and try again
# create the password store using the gpg user id above
pass init $gpg_id
3. docker login
docker login
# You should not see any credentials stored in "auths" section.
# "credsStore": "pass" should have been automatically added.
# If the value is "secretservice", replace it with "pass".
cat ~/.docker/config.json
# verify credentials stored in `pass` store now
pass
There is a much easier answer than the ones already posted, which I found in a comment on https://github.com/docker/docker-credential-helpers/issues/105.
The solution is to rename docker-credential-secretservice out of the way
e.g: mv /usr/bin/docker-credential-secretservice /usr/bin/docker-credential-secretservice.broken
Once you do this, docker login works regardless of whether or not docker-compose is installed. No other package additions or removals are necessary.
I've resolved this issue by uninstalling docker-compose which was installed from Ubuntu repo and installing docker-compose by official instruction at https://docs.docker.com/compose/install/#install-compose
What helped me on Ubuntu 18.04 was:
Following the steps in #oberstet 's post and uninstalling the golang helper
Performing a login after the helper uninstall
Reinstalling docker via sudo apt-get install docker
Logging back in via sudo docker login

zsh: command not found: dcos

I tried to install DC/OS cluster on my Mac by dcos-vagrant.
Intsallation is quite smooth, no errors found.
==> m1: sudo: chmod u+x /opt/mesosphere/bin/postflight.sh
==> m1: sudo: /opt/mesosphere/bin/postflight.sh
==> boot: DC/OS Installation Complete
==> boot: Web Interface: http://m1.dcos/
but when I opne the http://m1.dcos/, doesn't show the web-ui, show the ERR_EMPTY_RESPONSE error, and cannot find the dcos command.
GET http://m1.dcos/ net::ERR_EMPTY_RESPONSE
➜ dcos-vagrant git:(master) dcos marathon app add https://dcos.io/docs/1.7/usage/nginx.json
zsh: command not found: dcos
Anyone can help me! Thanks in advance!
dcos cannot work duo to I didn't install the dcos CLI.
intallation DC/OS CLI
To install the CLI, copy and paste into your terminal:
mkdir -p dcos
cd dcos
curl -O https://downloads.dcos.io/dcos-cli/install.sh
bash ./install.sh . https://m1.dcos
source ./bin/env-setup
Empty response from http://m1.dcos/ would seem to indicate the UI service or admin router is having issues, but the CLI working means admin router is reachable and correctly proxying components like Marathon & Mesos.
You might check the admin router logs to see if it's having trouble serving the UI html/js.
Status:
systemctl status dcos-adminrouter.service
Logs:
journalctl -u dcos-adminrouter

How to install brew on Unix 13.10

I need to install fleetctl and I found a tutorial that says to use
brew install fleetctl
The thing is, I don't have brew installed, and when I follow this tutorial here and type
which brew
afterwards, nothing happens. So, how do I get brew working? I'm using Ubuntu 13.10
Brew, or Homebrew, is a package manager for OS X. Therefore, it will not work on Ubuntu, which is a Debian flavored Linux.
Package managers means that someone has precompiled source code. It doesn't look like Ubuntu's package manager, apt-get, has a precompiled version.
However, the creators of fleetctl have a compiled version here:
https://github.com/coreos/fleet > Releases > fleet-v0.8.3-linux-amd64.tar.gz
So on your box:
Download it:
$ wget https://github.com/coreos/fleet/releases/download/v0.8.3/fleet-v0.8.3-linux-amd64.tar.gz
Untar it:
$ tar -xvf fleet-v0.8.3-linux-amd64.tar.gz
It's not installed yet, as you can see from which but it'll run:
$ which fleetctl
/usr/bin/which: no fleetctl in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/ec2-user/bin)
$ ./fleet-v0.8.3-linux-amd64/fleetctl
(Optional but recommended) Install it by moving to /usr/local/bin
$ sudo cp fleet-v0.8.3-linux-amd64/fleetctl /usr/local/bin
You can prove that it's installed and run it from any directory:
$ which fleetctl
/usr/local/bin/fleetctl
$ fleetctl

Can't start elasticsearch server via Homebrew

So I have installed elasticsearch through brew:
$ brew install elasticsearch
Then when I run the elasticsearch server:
elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.19.3/config/elasticsearch.yml
I get this error:
{0.20.4}: Setup Failed ...
- FailedToResolveConfigException[Failed to resolve config path [/usr/local/Cellar/elasticsearch/0.19.3/config/elasticsearch.yml], tried file path [/usr/local/Cellar/elasticsearch/0.19.3/config/elasticsearch.yml], path file [/usr/local/Cellar/elasticsearch/0.20.4/config/usr/local/Cellar/elasticsearch/0.19.3/config/elasticsearch.yml], and classpath]
How can I fix this? Any ideas och suggestions are welcome.
I did this and it had worked for me:
Get the package:
$ curl -k -L -o elasticsearch-0.20.2.tar.gz http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz
Unzipp:
$ tar -zxvf elasticsearch-0.20.2.tar.gz
Run the elasticsearch server:
./elasticsearch-0.20.2/bin/elasticsearch -f
try with
elasticsearch -f -Des.path.conf=/usr/local/Cellar/elasticsearch/0.19.3/config/
That's weird, my install asked me to run elasticsearch slightly different. I got it running with:
Install
$ brew update
$ brew install elasticsearch
Run Elasticsearch
$ elasticsearch --config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
As #karmi said, brew info elasticsearch shows how to run elasticsearch on your system.
Things haven't been changed in 2021.
Homebrew stops distributing newer version of elasticsearch, and kibana, although you can still get outdated versions in homebrew-core.
It's beacause Homebrew defers to the OSI's open source licence definition. The new license used by elastic softwares is not compatible with it, and Homebrew rufuses to distribute them.
So, elastic begins to distribute these software with its own custom tap.
# tap maintained by elastic organization
# https://github.com/elastic/homebrew-tap
brew tap elastic/tap
brew install elastic/tap/elasticsearch-full
# brew install elastic/tap/kibina-full
# brew install elastic/tap/logstash-full

Installing rbenv, permission denied

I am setting up my VPS to deploy my rails app, but permission denied error keeps happening on my server side. I had to reinstall perl and curl, and now I'm getting the following:
deployer#max:~$ rbenv bootstrap-ubuntu-12-04
bash: /usr/bin/python: permission denied
I tried reinstalling python but came up with no success. How should I solve it?
Update:
root#max:/home/deployer# cd /usr
root#max:/usr# cd bin
root#max:/usr/bin# cd python
bash: cd: python: not a directory
Does this mean python is not installed correctly?
Update:
deployer#max:~$ ls -l 'which python'
total 0
deployer#max:~$ python
bash: /usr/bin/python: permission denied
I thought this meant python was not installed correctly, so I computed the following
deployer#d:~$ su root
root#d:/home/deployer# apt-get install python
python package is already the latest version
So I failed to find the solution yet.
As it turned out it was a permissions issue, here are some general tips on how to debug a permission denied error when trying to execute a binary, python in this case:
ls -l `which python` - tries to retrieve full path and permissions, like -rwxr-xr-x 1 nobody nobody 9644 2012-12-02 13:15 /tmp/env/bin/python
Has to be run as a privileged user if permissions are 0000, for example.
sudo chmod 0755 /usr/bin/python usually helps.

Resources