How to run an executable file on OS X - terminal

I follow this blog to use Dockbeat and at a certain moment it says that I need to download a file and to make it executable then to run it so I did:
wget https://github.com/Ingensi/dockbeat/releases/download/v1.0.0/dockbeat-v1.0.0-x86_64
chmod +x dockbeat-v1.0.0-x86_64
./dockbeat-v1.0.0-x86_64 -c dockbeat-1.0.0/dockbeat.yml -v -e
As the blog describe but I have this error:
-bash: ./dockbeat-v1.0.0-x86_64: cannot execute binary file
Although when I do ls -l dockbeat-v1.0.0-x86_64
I got:
-rwxr-xr-x 1 dav_NG staff 13412840 12 sep 14:17 dockbeat-v1.0.0-x86_64
So my question is why can't I run it ? (I checked and my OS X support 64bits)

I ran into your question when I was investigating why I couldn't run dockbeat on my own Mac OS X so I post here what worked for me.
In fact, the file dockbeat-v1.0.0-x86_64 you downloaded is a Linux executable, you can verify by typing the file dockbeat-v1.0.0-x86_64 command.
In order to run dockbeat on Mac OS X, you first have to compile the sources to generate a Mac executable (see the dockbeat's Github documentation).
Here are the steps that I followed:
Install Golang and Glide on your Mac OS X.
Navigate to ${GOPATH}/github.com/ingensi and create missing directories. For instance, in my case, I installed go with homebrew so the complete path I ended up with was /usr/local/Cellar/go/1.8.1/libexec/src/github.com/ingensi
In the ingensi directory, run git clone https://github.com/Ingensi/dockbeat.git
Enter in the cloned directory by typing cd dockbeat. You should now be in the ${GOPATH}/github.com/ingensi/dockbeat directory.
Run the makecommand. This will generate a Mac OS X dockbeat executable.
Configure dockbeat by editing the file etc/dockbeat.yml
Run normally with the command ./dockbeat -c etc/dockbeat.yml
Hope this helps :-)

Related

bash 3rdparty/osx/install_deps.sh?

I am trying to follow these installation instructions:
https://www.thomasvanhoey.com/post/installing-openpose-on-mac-october-2020-version/
for installing OpenPose on Mac.
I have a Mac M1, running Big Sir. When I try to do step 3, and run this in terminal: (I'm in the openpose folder that was created when I installed CMake, where there is a 3rdparty folder)
bash 3rdparty/osx/install_deps.sh
I get:
No such file or directory
also step 4 doesn't work, i run this in the command line in terminal:
~~protoc src/caffe/proto/caffe.proto --cpp_out=. mkdir include/caffe/proto mv src/caffe/proto/caffe.pb.h include/caffe/proto~~
I get
zsh: command not found: ~~protoc
Does anyone know why I am getting these errors? I "Cloned the repository in the target folder". I "Install CMake GUI" the old fashioned way. I ran and it installed.
brew install caffe
Thnx
Replace with: bash scripts/osx/install_deps.sh
The file to be executed is install_deps.sh. When I perform $ find . -name osx it is found in openpose/scripts/. So just run bash scripts/osx/install_deps.sh.

Can't Install FFMPEG with homebrew

I tried installing FFmpeg with homebrew today. When I enter "brew install FFmpeg" I get this:
I tried running commands like brew doctor and git -C $(--repo homebrew/core)
I'm using macOS Big Sur btw.
EDIT: I installed FFmpeg as a final solution it seems to be working now. Thanks for helping, guys. I don't know what's wrong with my homebrew though.
It's a weird error, but a workaround would be to execute following commands:
$~ wget https://www.nasm.us/pub/nasm/stable/nasm-2.15.05.zip -O nasm.zip
$~ unzip nasm.zip
$~ cd nasm*
$~/nasm ./configure --prefix /usr
$~/nasm make
$~/nasm sudo make install
The above
downloads the zipped source code
unzips it
goes into the unzipped folder
configures the source code to have the programs installed to the right place
builds programs and libraries from the source code
installs everything that has been built
After that, your homebrew should find nasm and just skip it.
EDIT:
Whilst the above should work perfectly fine on Linux, I learned that it does not work on Mac OS (thank you #Philippe !) as stated in the Mac OS docs on System Integrity Protection:
System Integrity Protection includes protection for these parts of the system:
/System
/usr
/bin
/sbin
/var
Apps that are pre-installed with OS X
Paths and apps that third-party apps and installers can continue to write to include:
/Applications
/Library
/usr/local
So, we can conclude that we cannot install nasm into /usr, but into /usr/local. That means command No. 4 should be changed to ./configure --prefix /usr/local.
EDIT2:
In case you get an error in step 1, use curl https://www.nasm.us/pub/nasm/stable/nasm-2.15.05.zip -o nasm.zip instead.
In case you get an error about your shell not finding /bin/sh, prepend the name of a shell you have installed on your PC to the command line.

Installing SANE backends via Mac OS X terminal

Where can I find sane-backends after performing these commands in the terminal:
$ cd Downloads
$ sudo installer -pkg sane-backends.pkg -target /
note:
- sane-backends.pkg is located inside Downloads folder.
- I downloaded sane-backends.pkg together with 4 other files here http://www.ellert.se/twain-sane/
I want to know where sane-backends is located to add a driver to the list of SANE drivers which is shown when you open SANE from System Preferences.

Install libSVM on Mac OSX and use easy.py and grid.py

I spent quite some time figuring out how to install libSVM on Mac OSX and use easy.py and grid.py. I've done quite some research but there are problems such as gnuplot isn't installed in the place where easy.py is calling it with brew.
It turned out I have to do the following steps
go to https://www.dropbox.com/s/rpn6yersv06tttz/gnuplot-4.2.5-i386.dmg
download the gnuplot-4.2.5-i386.dmg
open the resulting DMG file
open the gnuplot-4.2.3 DMG the Extras folder
drop Gnuplot.app into your applications folder
go to /usr/bin in terminal and do
$ sudo ln -sf "/Applications/Gnuplot.app/Contents/Resources/bin/
gnuplot"
You will be prompted to install X11 if you haven't done so, but after that if you run sample line like
python easy.py svmguide1 svmguide1.t
it should work. The sample files can be downloaded at http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html#svmguide1
references: http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf
Make sure Homebrew is installed, then just run:
brew install gnuplot
Link the executable, so that it is in the PATH (i.e. /usr/bin) and can be found by the Python scripts:
sudo ln -s /opt/local/bin/gnuplot /usr/bin/gnuplot
After that's done, libsvm's Python scripts should not complain any longer.
Since macOS high sierra, /usr/bin is not modifyable by the user anymore, gnuplot is installed at /usr/local/bin instead. Open easy.py and change the path from "/usr/bin" to "/usr/local/bin"

Problem installing leiningen on mac os

I am trying to install Leiningen on mac os 10.6.4, following the instructions here - http://alexott.net/en/clojure/ClojureLein.html. The package is being downloaded, but lein command is not found. What could be the problem?
You need to copy the executable in a directory which is in your path (/usr/local/bin/), for instance.
Type echo $PATH to see the different directories.
You'll also need to make the file executable:
chmod 555 /usr/local/bin/lein

Resources