I've installed clamp thru this:
$ curl http://jide.github.io/clamp/install.sh | sh
( Followed this instructions: https://jide.github.io/clamp/ )
Now I have it installed, I found out is not working and is not exactly what I wanted, so I want to uninstall it. How do I do it?
If you look at the code, it has not done much but created /usr/local/clamp/ and then soft-linked /usr/local/clamp/clamp to /usr/local/bin/clamp.
Please refer the Line #64 & #65 of install.sh
You can delete the files as part of manual uninstall
$ rm -rf /usr/local/clamp/
$ rm -rf /usr/local/bin/clamp
Related
I've uninstalled the stylus package on my Debian by sudo apt-get remove --purge node-stylus.
Now it says when I try to run the stylus command: stylus: command not found. So it works as it should.
But in my scripts I check whether Stylus is installed or not by:
if ! command -v sudo stylus &> /dev/null; then
echo "ERROR: Stylus is not installed!"
exit 1
fi
And for some reason command -v stylus still returns /usr/bin/stylus thus the script won't fail.
I checked /usr/bin/ and there is no stylus there.
Could someone explain to me please why does this work like this?
Bash maintains a cache for lookups; you want to do
hash -r stylus
to force it to forget the old value.
Separately, of course, don't use command -v sudo when you actually want command -v stylus, as already pointed out in a comment.
I installed youtube-dl with brew but it wasn't working... It kept saying connection refused. So, I tried to reinstall in using the curl command at - https://github.com/rg3/youtube-dl
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
Still didn't work... I tried uninstalling it like I did the first time with
brew remove youtube-dl
But that's obviously not working cause I didn't install it the second time with brew. I just want to remove it now.
Let analyse the command you install:
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
We can see the youtube-dl is install in our system path:
/usr/local/bin/youtube-dl
So, in here we can remove the path directly.
$rm -rf /usr/local/bin/youtube-dl
Maybe its not done yet, I used the command find if any remain path.
$sudo find / -name youtube-dl
After a few minutes waiting...There is no more remain youtube-dl in my mac. Cong!
I've installed docker on mac os as written in documentation.
But in some docs (for example in the docker book) I see the recomendations to use man docker-run (man docker-pull, etc).
But when I run such command I get the error:
bessarabov#bessarabov-osx:~$ man docker
No manual entry for docker
How can I install docker man-documentation to my Mac OS system?
As of 2017.06.01, you have to git checkout your desired tag/version from
version >= 17.06: https://github.com/docker/docker-ce
version < 17.06: https://github.com/moby/moby
and then, go to the components/cli directory and execute:
make -f docker.Makefile manpages
To add the manpages to the manpath:
echo "MANPATH $PWD/man" | sudo tee -a /private/etc/man.conf
Source: https://github.com/docker/cli/issues/217
It looks like docker has slightly changed since #Sergiy's answer. Here is a slightly updated version that worked for me.
git clone https://github.com/docker/docker.git
cd docker/man # looks like the directory has moved up
docker build -t docker/md2man . # don't forget the '.'
docker run -v $PWD/:/docs:rw -w /docs -i docker/md2man /docs/md2man-all.sh
sudo cp -R man* /usr/share/man/ # you'll likely need sudo access for this
man docker # check it worked
Until the issue is resolved you can build man pages manually via a docker container using the supplied Dockerfile and then just copy generated files to /usr/share/man/:
# Step 1: checkout docker sources, but make sure you do this
# somewhere in /Users directory because boot2docker can only
# share this path with docker containers
git clone https://github.com/docker/docker.git
# Step 2: build docker image
cd docker/docs/man
docker build -t docker/md2man .
# Step 3: build man pages
docker run -v /Users/<path-to-git-dir>/docker/docs/man:/docs:rw \
-w /docs -i docker/md2man /docs/md2man-all.sh
# Step 4: copy generated man pages to /usr/share/man
cp -R man* /usr/share/man/
Enjoy!
It seems the go/glide bits under the hood of docker/md2man have changed since #gilly's answer. What I ended up doing, on Mac OS:
cd /usr/local
git clone https://github.com/docker/docker.git
brew install ruby
gem install md2man
cd docker/man
mkdir man1; for i in *.1.md; md2man-roff $i > man1/${i%.md}; done
cd /usr/local/share/man/man1
for i in ../../../docker/man/man1/*.1; do ln -s $i .; done
I am running docker and I want bash command completion for docker commands and parameters.
If you have already homebrew bash-completion installed just install the docker completion script into the bash_completion.d
curl -XGET https://raw.githubusercontent.com/docker/cli/master/contrib/completion/bash/docker > $(brew --prefix)/etc/bash_completion.d/docker
Note: If you do not have homebrew bash-completion installed, follow these instructions to install it before you execute the line above.
Note: the completion depends on some functions defined in debian bash-completion. Therefore, just sourcing the docker completion script as described in completion/bash/docker may not work. If you try to complete docker run (by hitting TAB) you may get an error like __ltrim_colon_completions: command not found. This could mean that you have not installed the bash-completion scripts.
The official Docker for Mac page has a section on installing bash completion:
https://docs.docker.com/docker-for-mac/#bash
If you have Homebrew bash completion installed:
cd /usr/local/etc/bash_completion.d
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion
The completion scripts come with Docker Beta. I want them to stay up to date. So, on OS X...
Install homebrew's bash-completion
Symlink the files
find /Applications/Docker.app \
-type f -name "*.bash-completion" \
-exec ln -s "{}" "$(brew --prefix)/etc/bash_completion.d/" \;
The stumbling point for me was that once you brew install bash-competion, you have to add few lines in your .bash_profile to load it once you launch Terminal:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Source:
http://davidalger.com/development/bash-completion-on-os-x-with-brew/
Because I haven't found anywhere a step by step documentation, I've made a quick script to install homebrew, bash-completion and eventually the completion scripts for docker.
https://github.com/HypnoTheNomad/docker-bash-completion-macos-brew
The auto completion of docker needed not only for mac, its also needed for ubuntu / bash terminals.
In Ubuntu
curl -ksSL https://raw.githubusercontent.com/docker/cli/master/contrib/completion/bash/docker |sudo tee /etc/bash_completion.d/docker
Completion will be available upon next login.
Since its top result in google I added answer here.
The official Docker site has a section for Command-line completion, and for Mac to:
https://docs.docker.com/compose/completion/#mac
Helped for me with Homebrew:
brew install bash-completion
After the installation, Brew displays the installation path. From documentation is correct for me:
/usr/local/etc/bash_completion.d/
Run the script:
sudo curl -L https://raw.githubusercontent.com/docker/compose/1.25.4/contrib/completion/bash/docker-compose -o /usr/local/etc/bash_completion.d/docker-compose
Open and add following in the end of your file ~/.bash_profile:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Restart terminal. It's all.
Guide to setup autocomplete for ZSH on Mac OSX
Follow these steps if you are using oh-my-zsh and autocomplete is not working:
Step 1:
Make the following three links:
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion /usr/local/share/zsh/site-functions/_docker
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.zsh-completion /usr/local/share/zsh/site-functions/_docker-compose
Step 2:
Either add autoload -Uz compinit; compinit to .zshrc
or run echo "autoload -Uz compinit; compinit" >> .zshrc in your shell
Just to be said:
if you use brew:
brew install docker
will do all what you need. It includes brew link docker which installs the completion into `brew --prefix`/etc/bash_completion.d/docker
same topic, same answer for docker-machine, docker-compose, etc. ...
else (perhaps you are using Docker Beta (new "more native" docker installation package without Virtualbox) you still have to add it manually, then follow Michael's answer plus have a look at the additional completion scripts for docker-machine, docker-compose and some shell-helper that are handled in the 'script' from CodeCorrupt
I have installed git-crypt (https://github.com/shadowhand/git-encrypt) on Windows and it's work fine.
But when i try on MacOSX (Mavericks), it's not successful.
From the guide this command on Linux:
$ sudo ln -s "$(pwd)/gitcrypt" /usr/local/bin/gitcrypt
But i can not make it work on MacOSX.
I also try this command without success:
sudo -s 'echo "/usr/local/bin/gitcrypt" > /etc/paths.d/$(pwd)/gitcrypt'
I have found solution. I post here for anyone find it:
$ clone https://github.com/shadowhand/git-encrypt /usr/local/git-encrypt
$ sudo vi /etc/paths
Add /usr/local/git-encrypt to the end save and quit terminal.