How to install FASD on zsh on Mac - zsh

Not sure if this is the right place to post this, but I'm trying to install fasd via this method on my zsh. I tried following the directions but had no luck.
I have it installed via brew and I've added the line plugins=(fasd) in my ./zsrhc file. I also have some other items installed in my ./zsrhc and I don't know if its conflicts with those or where I am going wrong. See below for the .zshrc file contents.
When I follow the directions here and try to run the make install command, I get this output below. When I google this error, I see it has a lot to do with xcode which i don't have installed anymore.
❯ make install
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
when i run eval "$(fasd --init auto)", nothing happens after it:
❯ eval "$(fasd --init auto)"
fasd install readout
❯ brew install fasd
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
You have 38 outdated formulae and 1 outdated cask installed.
You can upgrade them with brew upgrade
or list them with brew outdated.
Warning: fasd 1.0.1 is already installed and up-to-date.
To reinstall 1.0.1, run:
brew reinstall fasd
.zshrc file
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export PATH="/usr/local/Cellar/node/18.11.0/bin:$PATH"
ZSH_THEME="powerlevel10k/powerlevel10k"
source ~/powerlevel10k/powerlevel10k.zsh-theme
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.zsh/zsh-completions/zsh-completions.plugin.zsh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# to make more edits, open ~/.p10k.zsh with `code ~/.p10k.zsh`
# this is all from youtube video: https://www.youtube.com/watch?v=SVh4osULjP4
# FASD - https://github.com/clvv/fasd/wiki/Installing-via-Package-Managers
#https://github.com/clvv/fasd
plugins=(fasd)
Any and all help is appreciated.

Installing fasd with brew
❯ brew install fasd
Add this to shell configuration, in your case ~/.bashrc or ~/.zshrc:
eval "$(fasd --init auto)"
Restart your terminal emulator. You should now be able to run f a s d z commands!
Or instead after installing with brew you can configure fasd as a ohmyzsh plugin: https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/fasd/
Usage
Learn how fasd works by reading the on-line manual page:
man fasd
Here are also a few articles you can check for more information:
https://rm-rf.ca/posts/2020/fasd/
https://dewaka.com/blog/fasd-for-navigation/
https://bytexd.com/how-to-use-fasd-in-linux-for-quick-access-to-files-directories/
Hope this helps!

Related

R, issue "unable to load shared object cairo.so" on Linux CentOS 7

I've been using R with ggplot2 and other packages on my Linux CentOS 7 for a long time.
Today, all of a sudden, it stopped working.
When I call the png() function in my script, it generates the following errrors:
Warning messages:
1: In png(heatmap_file) :
unable to load shared object '/usr/lib64/R/library/grDevices/libs//cairo.so':
/lib64/libcairo.so.2: undefined symbol: FT_Get_Var_Design_Coordinates
2: In png(heatmap_file) : failed to load cairo DLL
I tried to update the cairo package many times but nothing worked out so far.
What can I do?
Thanks!
Your version of cairo (/lib64/libcairo.so.2) depends on a function called FT_Get_Var_Design_Coordinates. This function should come from FreeType. However, your version of libfreetype.so seems to be older and does not have this symbol. So, either you explicitly installed an older version, or "something" comes with an older version of FreeType.
I would look for files called libfreetype.so and check if they have the necessary symbol
I'm on Debian testing and here I get (this means that my version of FreeType does have this symbol; you would get no output if the symbol is not available):
$ nm -s -D /usr/lib/x86_64-linux-gnu/libfreetype.so | grep FT_Get_Var_Design_Coordinates
000000000001d260 T FT_Get_Var_Design_Coordinates
For you, based on the path to libcairo.so, I would expect something like /lib64/libfreetype.so to be the path to check.
I found a solution and I am going to share it with the community.
I am working on a Dell Latitude 3540 laptop running Linux CentOS 7 operating system (centos-release-7-3.1611.el7.centos.x86_64).
I ran sudo yum -y update and I understood there was a duplication issue regarding the freetype package, which was installed twice, and some other packages that were having conflicts.
I then removed the old freetype package and the conflicting packages with this command:
rpm -e freetype-2.4.11-12.el7.i686 --nodeps
rpm -e conflicting-package-1 --nodeps
rpm -e conflicting-package-2 --nodeps
...
Then I updated all the packages I manually removed:
sudo yum -y update freetype
sudo yum -y conflicting-package-1 freetype
sudo yum -y conflicting-package-2 freetype
...
This method worked out for me; I hope it might be helpful to someone.

LaTeX error related to tcolorbox.sty not found

I have a problem with LaTeX whenever I try to download the file in PDF.
When I try to do that, it gives me the following error:
! LaTeX Error: File `tcolorbox.sty' not found.
Type X to quit or <RETURN> to proceed ,or enter new name.
(Default extension: sty)Enter file name:! Emergency stop.<read > \usepackage
I've already downloaded the tcolorbox zip file and dragged the directory into the tex/latex tree, as said in README file, but neither that worked.
Originally I used to try to download the pdf from Jupiter Notebook, but also that gave me an error:
nbconvert failed: PDF creating failed, captured latex output:
Failed to run "xelatex .\notebook.tex -quiet" command:
This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/W32TeX) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
! Undefined control sequence.
<*> .\notebook
.tex -quiet
?
! Emergency stop.
<*> .\notebook
.tex -quiet
No pages of output.
Transcript written on ?.
Any suggestions?
After installing tcolorbox using LaTex's package manager tlmgr, I was getting similar errors for other dependencies. The solution below worked for me on Ubuntu 18.04 (64 bit) at the terminal:
tlmgr update --all --self
tlmgr install tcolorbox
tlmgr install pgf
tlmgr install xcolor
tlmgr install environ
tlmgr install trimspaces
tlmgr install mathpazo
tlmgr install parskip
tlmgr install adjustbox
tlmgr install collectbox
tlmgr install eurosym
tlmgr install ecs
tlmgr install ucs
tlmgr install enumitem
tlmgr install ulem
tlmgr install mathrsfs
tlmgr install jknapltx rsfs
sudo tlmgr install collection-fontsrecommended
Also, rendering the document to PDF using the "export notebook as" option didn't work for me. I did it at the command line: jupyter nbconvert --to pdf my_document.ipynb. You may need to install nbconvert if you don't have it.
If missing other dependencies, keep running tlmgr install with the missing dependencies until it works. I haven't figured out yet to which packages those dependencies belong, so my apologies for the dirty fix.
In addition to Oscar's answer, I also had to run:
sudo tlmgr install collection-fontsrecommended
and it worked
Arch/Manjaro users, get the tllocalmgr and follow Oscar's answer
yay -S tllocalmgr-git
tllocalmgr update --all --self
tllocalmgr install <package_name>
sudo texhash
I ran into this same issue on Fedora
running
dnf install texlive-collection-latexextra
Seemed solved the issue for me. I found this guide How to fully install Latex in fedora? to be particularly helpful in debugging my issues. It gave all the commands needed to install the latex packages I needed
Similar error on mac os. In my case, it was related to required packages not being installed in tlmgr.
I had to run
sudo tlmgr install tcolorbox
After fixing that, the same error appeared with other packages (e.g. environ). I kept installing each missing package
sudo tlmgr install {name_of_missing_package}
until it succeeded.
Following tsando's advice on this stack overflow post, I just had to add this to my ~/.zshrc file after installing MacTex,
# TeX
export PATH=/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin:$PATH

Rserve : ld: library not found for -lssl

I am getting an error while trying to install Rserve 1.8.6. I can successfully install 1.7.3 from CRAN. This is on Mac OS High Sierra.
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [forward] Error 1
make: *** [all] Error 2
ERROR: compilation failed for package ‘Rserve’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rserve’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rserve’
The downloaded source packages are in
‘/private/var/folders/v7/hyxrfmk94p1_03gdrm27fnxncy3vq1/T/RtmpFHKNMe/downloaded_packages’
This worked for me (MacOS):
In terminal:
brew install openssl
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
I'm running Mac OS 10.15 Catalina, I've spent 2 days trying to fix this same problem, scouring the internet for help. I finally managed it by cobbling together solutions from a few different sources.
The key thing I was missing was that Mac OS ships with its own version of openssl which it thinks is superior to anything else you can find. It is wrong. What you need to do is go and download the latest version of openssl, install that, then export THAT library to your library path variable. Here are the steps I took with openssl 1.1.1:
Get the version number for the latest version of openssl from the source (https://www.openssl.org/source/) and then manually install it directly where it's supposed to go:
cd /usr/local/src
If you're getting "No such file or directory", make it:
cd /usr/local && mkdir src && cd src
Download openssl using curl (shown) or using the link above to the source code (make sure you put the file in the directory you just made in the previous step):
curl --remote-name https://www.openssl.org/source/openssl-1.1.1f.tar.gz
Extract and cd in:
tar -xzvf openssl-1.1.1f.tar.gz
cd openssl-1.1.1f
Compile and install (these are the 64 bit Mac OS instructions. Refer to the openssl documentation for 32 bit and other OS instructions):
./Configure darwin64-x86_64-cc shared enable-ec_nistp_64_gcc_128 no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/ssl/macos-x86_64
make depend
sudo make install
This created a new openssl folder so when you export the library path you have to feed it the right openssl folder:
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl#1.1/lib/
Hope that helps you if you haven't figured it out yet, and anyone else in the future who is ready to chuck their computer across the room, like I was.

Getting error Warning: Could not link libevent. Unlinking

Trying to install tmux on OSX but getting:
$ brew install tmux
Error: You must `brew link libevent' before tmux can
mdurrant#C02MH2DQFD58:~
$ brew link libevent
Linking /usr/local/Cellar/libevent/2.0.21...
Warning: Could not link libevent. Unlinking...
Error: Permission denied - /usr/local/include/event2
I can't use sudo with brew.
I'd tried installing libevent previously by compiling it locally and now I can't seem to get rid of the traces of it, though I went to where I had it and did sudo make uninstall
In the end the answer was:
Install iterm2
brew install automake
brew install pkg-config
rm configure
sh autogen.sh
./configure
make
make install
This helped (http://whiletruecode.com/post/installing-iterm2-and-tmux-osx) and I had an almost identical experience though the final step was not the broken link but to do the above

nginx installed successfully but cannot start

I use homebrew to install nginx. However, when I start nginx, it prompts:
dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib
Referenced from: /usr/local/bin/nginx
Reason: Incompatible library version: nginx requires version 4.0.0 or later, but libpcre.1.dylib provides version 2.0.0
Trace/BPT trap: 5
Any ideas?
I had this same problem, try running this:
brew unlink pcre && brew link pcre
In my case, this was the output:
Unlinking /usr/local/Cellar/pcre/8.35... 5 symlinks removed
Linking /usr/local/Cellar/pcre/8.35... 133 symlinks created
Well, I don't know what causes the problem. I checked my pcre, and it was in latest version. Without option I just uninstall it and reinstall it again...Then it works...
Only thing that fixed it for me was reinstalling everything in brew.
https://gist.github.com/nmccready/adfae27c498e0795767f
I run the following and it sorted the issue for me
brew update && brew upgrade && brew rm extempore && brew install extempore
If you get any problem in nginx then you can debug using this command:
nginx -t
after running this command you will get error message including filename and line number where the problem is

Resources