How to completely remove youtube-dl from mac? - macos

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!

Related

Every Ansible command responds with "abort"

When I run any Ansible command the response is always abort. For example:
ansible --version
# Or:
ansible-playbook -i production site.yml --diff --check
Response:
[1] 78576 abort ansible --version
Any idea why or how to fix? I updated Ansible but error remained the same. Things used to work in the past but it's been a few months since I've used Ansible.
I found the solution to my problem here. It's a problem with OpenSSL:
https://nbari.com/post/python-quit-unexpectedly-macos/
The steps to fix:
brew reinstall openssl
cd /usr/local/lib
sudo ln -s /usr/local/opt/openssl/lib/libssl.dylib libssl.dylib
sudo ln -s /usr/local/opt/openssl/lib/libcrypto.dylib libcrypto.dylib
This looks like something specific on your system which has been misconfigured.
re-trace your steps which could’ve led to this error
Try to reinstall Python / Ansible
use ‘ps aux | grep ansible’ to see if there are other Ansible processes running
virtualenv?
worst case ; reinstall system

OSX Uninstall via terminal a cUrl Installation

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

git-crypt path on MacOSX

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.

OS X: equivalent of Linux's wget

How can I do an HTTP GET from a Un*x shell script on a stock OS X system? (installing third-party software is not an option, for this has to run on a lot of different systems which I don't have control on).
For example if I start the Mercurial server locally doing a hg serve:
... $ hg serve
And then, from a Linux that has the wget command I do a wget:
... $ wget http://127.0.0.1:8000
--2010-12-31 22:18:25-- http://127.0.0.1:8000/
Connecting to 127.0.0.1:8000... connected.
HTTP request sent, awaiting response... 200 Script output follows
Length: unspecified [text/html]
Saving to: `index.html
And on the terminal in which I launched the "hg serve" command, I can indeed see that an HTTP GET made its way:
127.0.0.1 - - [30/Dec/2010 22:18:17] "GET / HTTP/1.0" 200 -
So on Linux one way to do an HTTP GET from a shell script is to use wget (if that command is installed of course).
What other ways are there to do the equivalent of a wget? I'm looking, in particular, for something that would work on stock OS X installs.
The following native command will work:
curl http://127.0.0.1:8000 -o outfile
Note that curl does not follow redirects by default. To tell it to do so, add -L to the argument list.
brew install wget
Homebrew is a package manager for OSX analogous to yum, apt-get, choco, emerge, etc. Be aware that you will also need to install Xcode and the Command Line Tools. Virtually anyone who uses the command line in OSX will want to install these things anyway.
If you can't or don't want to use homebrew, you could also:
Install wget manually:
curl -# "http://ftp.gnu.org/gnu/wget/wget-1.17.1.tar.xz" -o "wget.tar.xz"
tar xf wget.tar.xz
cd wget-1.17.1
./configure --with-ssl=openssl -with-libssl-prefix=/usr/local/ssl && make -j8 && make install
Or, use a bash alias:
function _wget() { curl "${1}" -o $(basename "${1}") ; };
alias wget='_wget'
Curl has a mode that is almost equivalent to the default wget.
curl -O <url>
This works just like
wget <url>
And, if you like, you can add this to your .bashrc:
alias wget='curl -O'
It's not 100% compatible, but it works for the most common wget usage (IMO)
1) on your mac type
nano /usr/bin/wget
2) paste the following in
#!/bin/bash
curl -L $1 -o $2
3) close then make it executable
chmod 777 /usr/bin/wget
That's it.
Use curl;
curl http://127.0.0.1:8000 -o index.html
Here's the Mac OS X equivalent of Linux's wget.
For Linux, for instance Ubuntu on an AWS instance, use:
wget http://example.com/textfile.txt
On a Mac, i.e. for local development, use this:
curl http://example.com/textfile.txt -o textfile.txt
The -o parameter is required on a Mac for output into a file instead of on screen. Specify a different target name for renaming the downloaded file.
Use capital -O for renaming with wget. Lowercase -o will specify output file for transfer log.
Instead of going with equivalent, you can try "brew install wget" and use wget.
You need to have brew installed in your mac.
You can either build wget on the mac machine or use MacPorts to install it directly.
sudo port install wget
This would work like a charm, also you can update to the latest version as soon as it's available. Port is much more stable than brew, although has a lot less number of formula and ports.
You can install MacPorts from https://www.macports.org/install.php you can download the .pkg file and install it.
You could use curl instead. It is installed by default into /usr/bin.
wget Precompiled Mac Binary
For those looking for a quick wget install on Mac, check out Quentin Stafford-Fraser's precompiled binary here, which has been around for over a decade:
https://statusq.org/archives/2008/07/30/1954/
MD5 for 2008 wget.zip: 24a35d499704eecedd09e0dd52175582
MD5 for 2005 wget.zip: c7b48ec3ff929d9bd28ddb87e1a76ffb
No make/install/port/brew/curl junk. Just download, install, and run. Works with Mac OS X 10.3-10.12+.

PostgreSQL: command not found

I installed PostgreSQL via MacPorts. However, going to /opt/local/lib/postgresql84/bin I am unable to execute any of the pg commands. Does anyone know what I am doing wrong?
When you say "going to", it sounds like you're using the cd command to change to that directory. Something like:
$ cd /opt/local/lib/postgresql84/bin
$ psql
psql: command not found
Normally on Unix systems, the current directory is not part of your executable search path. So either explicitly execute psql from the current directory using ./:
$ cd /opt/local/lib/postgresql84/bin
$ ./psql
or, add the directory to your PATH:
$ export PATH=/opt/local/lib/postgresql84/bin:$PATH
$ psql
I had installed postgres (Mac,The capitan SO) with the dmg and also I got the same issue. I had to install psql through brew. Try with this :
brew install postgres
This worked for me.
Try this command:
find / -name psql
Try
whereis psql

Resources