Can't attach solidity-lsp for .sol files in neovim - solidity

Firtsble solidity-ls installed by mason via neovim command
:LspInstall solidity-ls
wasn't executable from terminal, altough it was shown as an executable one when typing :LspInfo in .sol file. After I installed it manually via npm
npm i solidity-ls -g
This is configuration for solidity-ls
require'lspconfig'.solidity.setup({
on_attach = on_attach,
})
With this empty configuration however root directory is not found, also solidity-ls is not attached to the file which I guess is just a consequence.
After adding root_dir manually in a following way and checking the file via luafile %
require'lspconfig'.solidity.setup({
on_attach = on_attach,
root_dir = function(fname)
return vim.fn.getcwd()
end,
})
I get this error
LSP[solidity]: Error SERVER_REQUEST_HANDLER_ERROR: "/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:86: bad argument #1 to 'ipairs' (table expected, got nil)"
Although :LspInfo shows root_dir is set up solidity-ls still is not attached
LspInfo from .sol file after
Any suggestion how to solve this?
Ubuntu 20.04.3 LTS
NVIM v0.7.2
I am new in vim, neovim and lua programming so apologizes in advance in case the question is too silly. Thanks.

Related

pocketbase: command not found

I am trying to set up a pocketbase on a Debian server.
on the server I created a dir called pb and scp over the pocketbase file which I downloaded from https://pocketbase.io/docs/
I downloaded all three linux packages pocketbase_0.10.2_linux_amd64.zip , pocketbase_0.10.2_linux_arm64.zip and pocketbase_0.10.2_linux_armv7.zip
I download the file, unzip it and then move the pocketbase file over to the server.
Note, Ive downloaded these onto a windows machine and then SCP pocketbase file over to my server.
When I run pocketbase serve I get the error command not found.
I can't find a good solution to this issue.
Execute it as instructed by pocketbase's documentation if you are within the same directory as the bin file:
./pocketbase serve
If you want to run it as pocketbase serve alone you will need to move the bin file under /usr/bin or ideally /usr/local/bin which should be under your system's $PATH variable.
https://pocketbase.io/docs/
Run ./pocketbase --help or ./pocketbase [command] --help for more assistance.

SOLVED - Ubuntu 18.04 setting up virtualenvwrapper, python 3.8

Original question:
I am installing virtualenvwrapper on Ubuntu 18.04. Here is what I have tried so far:
From https://virtualenvwrapper.readthedocs.io/en/latest/#:~:text=virtualenvwrapper%20is%20a%20set%20of,introducing%20conflicts%20in%20their%20dependencies:
$ pip install virtualenvwrapper
...
$ export WORKON_HOME=~/Envs
$ mkdir -p $WORKON_HOME
$ source /usr/local/bin/virtualenvwrapper.sh
Error: bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
Ok, so I went looking for virtualenvwrapper.sh. Eventually I found it:
joanna#joanna-X441BA:~/.local/bin$ ls
...
virtualenv-clone
virtualenvwrapper_lazy.sh
virtualenvwrapper.sh
...
Tried again with the new path: joanna#joanna-X441BA:/$ source /home/.local/bin/virtualenvwrapper.sh
bash: /home/.local/bin/virtualenvwrapper.sh: No such file or directory
Agh, ok. Searched StackOverflow, followed the instructions in Issue installing Virtualenvwrapper on Ubuntu 18.04?:
export WORKON_HOME=$HOME/.virtualenv
export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME"
export VIRTUALENVWRAPPER_HOOK_DIR="$WORKON_HOME"
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
I checked that this is in fact where my python3 installation lives. Same result though - No such file or directory.
Also tried sudo apt-get update and it successfully updated a bunch of stuff. But still No such file or directory.
Following this article, I also tried
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
(with the paths corrected for my filesystem setup.)
I don't understand why Bash is saying "No such file or directory" when it is in fact there (inexact error message that could be improved?), or more importantly how to fix this problem.
Note: This article warns me not to use sudo with pip because "If you think you need to use sudo, you're probably trying to modify a distribution-owned file", which is apparently Very Bad. I have also seen several articles warning that I should really use python -m pip install (or python3 -m pip install?) instead of plain pip install, because plain pip install can cause unintended side effects. I am not an expert by any means in these matters, but avoiding side effects sounds good to me.
Solution:
I finally got it to work! I kept playing around with it and double-checking that all the paths were correct and I did everything in the right order. I also had a stray installation of Python 3.8 that it seems I had installed in one of my folders that I use for code (my understanding is that Python installations should automatically go into one of the root folders like /usr/bin). On advice from my mentor I used the file manager to delete the stray Python 3.8, which may have helped with the virtualenvwrapper problem. After deleting the stray Python 3.8 I ran these commands and it finally worked!!!!
export WORKON_HOME=$HOME/.virtualenv
export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME"
export VIRTUALENVWRAPPER_HOOK_DIR="$WORKON_HOME"
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source ~/.local/bin/virtualenvwrapper.sh
My advice to readers of this question who are stumped with similar problems: triple-check the paths you are using by cd-ing into the folders, and also check for spelling errors in what you are typing. Your computer's file system may be set up slightly different from mine so don't blindly copy-paste the file paths I used. This will save you a lot of time and frustration. Also note that the file location of ~ is NOT the same as /home, that's one mistake I made.

Flatpak Intellij Idea - problem with subversion executable

After installing Intellij Idea using flatpak on Clear Linux I'm not able to make it run svn executable.
I added ---filesystem=host to flatpak permissions and tried to set executable path to /run/host/usr/bin/svn but with no luck (path is available/exists, though Intellij keeps complain)
svn command is normally available from system terminal.
When I try to run /run/host/usr/bin/svn command via Intellij Idea built-in terminal, I've got error that library is not available:
sh-5.0$ /run/host/usr/bin/svn
/run/host/usr/bin/svn: error while loading shared libraries: libsvn_client-1.so.0: cannot open shared object file: No such file or directory
I also tried set flatpak-spawn. Following command works perfectly fine in Intellij Idea built-in terminal:
/usr/bin/flatpak-spawn --host /usr/bin/svn, though when set as path to svn executable still gives me Intellij Idea error:
"The path to Subversion executable is probably wrong"
Could anybody please help with making it work?
TLDR: You probably need to add the path to svn into your IntelliJ terminal Path.
Details:
It looks like you are having a path issue. I had a similar problem running kubectl running PyCharm installed from a flatpak on Pop_Os.
If I try to run kubectl I see the following:
I have kubectl installed in /usr/local/bin. This is a screenshot from my 'normal' terminal.
In the PyCharm terminal this location is mounting under /run/host/usr/local/bin/.
If I look at my path in the PyCharm terminal, it is not there.
So I'll add the /run/host/usr/local/bin/ to my path and I can then run kubectl:
To make sure this comes up all the time, I need to add the PATH to the Terminal settings:
I can now execute any of the commands in my /usr/local/bin dir.
I found a really ugly solution for dealing with SVN with the JetBrains family, which does actually answer the question. But in a very roundabout way. Unfortunately Alex Nelson's solution didn't work for me.
You would think the Flatpak would come with a valid SVN, since it's actually part of the expected requirements for the program...
When in the terminal, you can run
cd ..
/usr/bin/flatpak-spawn --host vim ./svn
Then press i to go into input mode, then paste the following in the opened text file (Basically what it does is create an executable which passes it to the flatpak-spawn invocation):
#!/bin/bash
/usr/bin/flatpak-spawn --host /usr/bin/svn $#
Save and quit from vim (ESC, then :wq!). Make it executable:
chmod +x svn
Then in IntelliJ's menu, set the "path to svn" to
/home/<yourusername>/IdeaProjects/svn
It's worked for everything I've tried... Hope this helps out anyone else who was struggling with this.
I am using a similar solution to caluga.
#!/bin/sh
cd
exec /usr/bin/env -- flatpak-spawn --host /usr/bin/env -- svn "$#"
exec makes it replace the wrapper script process so the wrapper script process can end.
I'm using /bin/sh instead of /bin/bash as bash features are not needed.
using /usr/bin/env, but maybe not necessary if PATH is set up right.
remember to quote "$#" in case there are spaces in arguments.
I am putting it in ~/.local/bin and referencing it with its absolute path in the IntelliJ settings (Settings -> Version Control -> Subversion -> Path to Subversion executable).
I also was running into problems with IntelliJ saying that /app/idea-IC path does not exist. Figured that something outside the flatpak (i.e. svn or env) was trying to change directory to the working directory from where the wrapper script was invoked (inside the flatpak). Using cd allows the wrapper script to change to a directory that exists both inside the flatpak and on the host.
Fedora Silverblue or toolbox users might want to use dev tools inside their toolbox, in which case you can do:
#!/bin/sh
cd
exec /usr/bin/env -- flatpak-spawn --host toolbox run svn "$#"

Apache Nutch 1.11 installation on AIX machine giving bin/nutch: not found

I am installing Apache nutch 1.11 binary distribution in an AIX machine. After unzipping the zip file "apache-nutch-1.11-bin.zip " under /usr directory. I just tried to run the bin/nutch command as per the instruction at https://wiki.apache.org/nutch/NutchTutorial
I am getting the following exception : bin/nutch: not found
I am using root user and have also tried running the "chmod +x bin/nutch" for permissions.
Can anyone help me in understanding what I am missing here ? Thanks in advance.
Just to be sure, after unzipping the zip file, you did changed the directory to "apache-nutch-1.11" in your command prompt and then entered the bin/nutch command. right?
if you did please look for a "bin" subdirectory in "apache-nutch-1.11" directory. If there isn't any, I guess the zip file you downloaded has a problem. If there is, in your command prompt first change the directory to where it is in, and then run the command. I hope it helps.

How to install MySQLDb adaptor in zope?

I am trying to install MySQLDB adaptor in zope. I have a mac book pro with snow leopard. I have downloaded the "MySQL-python-1.2.0.
from: http://old.zope.org/Members/adustman/Products/MySQLdb/
I extracted the file in /usr/local/zope/lib/python/products
and then I changed directory to it:
cd MySQL-python-1.2.0
And I typed:
sudo /Users/dkar/Desktop/zope/bin/python setup.py build
sudo /User/dkar/Desktop/zope/bin/python setup.py install
I get this error:
Traceback (most recent call last):
File "setup.py", line 34, in ?
mysqlstatic = eval(os.getenv('mysqlstatic', 'False'))
File "<string>", line 0, in ?
NameError: name 'False' is not defined
I see the lines 0 and 34 in the setup.py but I don't know what should I do. Any suggestions what to do? I am new in these things and I don't have any idea how to solve this issue.
Please let me know if you don't understand some part and I will try to explain it better!
Environment that was used:
Debian 2.6.32-5-amd64
Plone 4.3.10
MySQL Server 5.1.49-3
Python-MySQL 1.2.3
ZMySQLDA
Step by step...
Install Plone
Install MySQL, in this exemple I install using apt-get install mysql-server
Install another dependecies apt-get install libmysqlclient-dev
Edit base.cfg or buildout.cfg in eggs add:
eggs =
MySQL_python
In buildout.cfg at the bottom add:
[zmysqlda]
recipe = collective.recipe.zmysqlda
target = ${buildout:directory}/products
run buildout bin/buildout -v
edit DABase.py at the line 92 and the file DA.py line 96
Where have: from ImageFile import ImageFile
Change to: from App.ImageFile import ImageFile
create a folder that the script request:
mkdir -p /{buildout_folder}/buildout-cache/eggs/Zope2-2.13.12-py2.6.egg/Shared/DC/ZRDB/www
Put the icon that don't exist in the folder
wget http://old.zope.org/Documentation/Guides/ZSQL-HTML/DBAdapterFolder_icon.gif
run buildout again.
In zope interface management add Z MySQL database connection
Enter Database conection string:
I hope help yoU!
I extract this cookbook from my post here: http://julianoaraujo.objectis.net/blog/pzp/400320287, it's in Brazilian Portuguese.
I don't know what causes the strange error you get so I'm not sure if my answer will help you. I also had trouble installing mySQLdb. I found out that mysql has to be installed on your system, even if you do not intend to use it with mySQLdb (maybe you just want to use it with a remote connection).
Before building and installing, you have to edit site.cfg and set the path to your mysql_config (which on my mac is: /usr/local/mysql/bin/mysql_config). Then make a symlink, so that your mysql client will be found:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
Hope that helps :)