How to install the locate command on nixos - nix

I've searched on the nixos package manager, if there is package named locate.
Yes and several. But that's not the bash command that I am searching for.
I want to add this bash command
locate name.extention
which gave me the path of this file

The package mlocate provides a locate executable. The package plocate provides an executable named plocate which might be better. Both of these packages will require some extra setup steps to allow them to build their file location database, and I don't happen to have a link to those instructions at the moment.
nix-shell -p mlocate

Related

How is Go executable created in Docker?

I'm pretty new to development Golang & Docker. I'm following the instructions in the official Golang DockerHub image. Here's the part I'm a bit confused:
The part I really don't get is the last line of the Dockerfile:
CMD ["app"]
My question is, how is the "app" executable created in the first place? I created a standard hello-world.go file and added this Docker file to a directory. I don't get how building the Docker image would generate an executable called "app". Can someone explain?
Excerpt of the go command https://golang.org/cmd/go/#hdr-Compile_and_install_packages_and_dependencies
Compile and install packages and dependencies
Usage:
go install [-i] [build flags] [packages]
Install compiles and installs the packages named by the import paths.
Executables are installed in the directory named by the GOBIN
environment variable, which defaults to $GOPATH/bin or $HOME/go/bin if
the GOPATH environment variable is not set. Executables in $GOROOT are
installed in $GOROOT/bin or $GOTOOLDIR instead of $GOBIN.
When module-aware mode is disabled, other packages are installed in
the directory $GOPATH/pkg/$GOOS_$GOARCH. When module-aware mode is
enabled, other packages are built and cached but not installed.
The -i flag installs the dependencies of the named packages as well.
For more about the build flags, see 'go help build'. For more about
specifying packages, see 'go help packages'.
See also: go build, go get, go clean.
This makes an executable out of your go code.

Lumber: Command 'lumber' not found

I just setup a Rails Application in my Ubuntu 18 machine, and I want to connect it to Forest Admin. However, Forest Admin requires that I set up a Node Application using npm first. The node application requires the installation of Lumber CLI tool in order to install Forest Admin.
I have however installed Lumber CLI tool by running the command below:
npm install -g lumber-cli#latest -s
When I run the command below npm lumber -version in my command line terminal, I get the response:
6.13.4
But when I try to generate the Forest Admin using the command below:
lumber generate "my_project"...
I get the following error:
Command 'lumber' not found
I need some help. Thank you.
Here's how I solved it:
The issue is because NPM does not have the write access to the directory that will contain the package you want to install (here lumber-cli).
To solve this issue, override the default directory where your global NPM packages will be stored:
mkdir ~/.npm-global
Then, configure NPM to use this directory instead of the default one:
npm config set prefix '~/.npm-global'
Then, make the node executables accessible from your PATH. To do so, export the environment variable PATH by opening or creating the file ~/.profile and add this line at the end:
export PATH=~/.npm-global/bin:$PATH
Finally, reload the ~/.profile file:
source ~/.profile
Try installing lumber cli again using the command below:
npm install -g lumber-cli#latest -s
It should be able to install lumber without any error, and also display the directory where lumber-cli is installed.
Reference: Prevent permission errors at installation
That's all
I hope this helps

Apache Jena Commands not found

I'm trying to set up my system (Ubuntu 16.04) with Apache Jena 3.10.0, and followed the provided instructions, but I'm unable to access any of the commands that I should have access to.
For example, sparql --version and bin/sparql --version both return:
sparql: command not found
I have downloaded and extracted the files to /home/[user]/apache-jena-3.10.0, then run:
export JENA_HOME=/home/[user]/apache-jena-3.10.0
export PATH=$PATH:$JENA_HOME/bin
The command cd $JENA_HOME successfully goes the apache-jena-3.10.0 directory.
I feel that there is a basic linux thing here that I'm missing, but I've tried a lot of things and had no luck so far. Any help would be greatly appreciated. Thanks!
The files in the download from Apache were not marked as executable. From the main apache-jena-3.10.0 directory, chmod -R 775 bin changed all files so I could run them from command line.

While checking man file in youtube-dl

Commend: man youtube-dl
Output :
No manual entry for youtube-dl
See 'man 7 undocumented' for help when manual pages are not available.
how to resolve this problem.
Your installation of youtube-dl does not include a manpage. There are a couple of options you can take:
Read the information online
Contact your packaging and ask for a fixed package. If you have manually installed youtube-dl, this does not apply.
Check out repository or build tarball and install youtube-dl manually from that with sudo python setup.py install.
Install the manpage from a build - it's the youtube-dl.1 file included in builds, and belongs in /usr/share/man/man1/.
Create the manpage yourself by checking out the source code and running make youtube-dl.1 . Place this file in /usr/share/man/man1/.
Simply run youtube-dl --help | less - that's got most of the information anyways.
Check out the youtube-dl repository (or a tarball) and run less README.md (you can also use any editor to open README.md)

phpcpd, You need to set up the project dependencies using composer install

I've just installed phpcpd globally via following command:
sudo composer global require 'sebastian/phpcpd=
my ~/composer/vendor/bin/ directory is in my $PATH variable too.
Now when I try to run phpcpd I get following error:
You need to set up the project dependencies using the following commands:
wget http://getcomposer.org/composer.phar
php composer.phar install
Any idea what I'm doing wrong here?
Thanks.
The point Sebastian didn't mention in the installation instructions is that by using Composer to globally install PHPCPD, you don't get it's dependencies installed, only the direct code. You have to go to the PHPCPD directory in the global vendor directory (i.e. the PHPCPD main folder in there, something like ...somepath/.composer/vendor/sebastian/phpcpd/) and run composer install there.
The easier way would be to just install the .phar file, but I understand this has different issues.

Resources