Install anchor-cli on windows using cargo - rust-cargo

Installed anchor-cli on windows, but when I try to view the version I get this message. I don't think that I should be installing this globally.
Only x86_64 / Linux distributed in NPM package right now.
Trying globally installed anchor.
Could not find globally installed anchor, install with cargo.
Is this issue localised in the tag argument used (--tag v0.24.1) and if so, should I use an older version? Command used to install anchor
cargo install --git https://github.com/project-serum/anchor --tag v0.24.1 anchor-cli --locked

Try installing anchor without the --tag
cargo install --git https://github.com/project-serum/anchor anchor-cli --force
Alternative: Open Powershell or CMD in admin mode.
Type "winver" to check your OS version.
You need Windows 10 and above to install Windows Subsystem for Linux.
Enable WSL on Windows:
On you search bar, type
Turn windows features on or off
and find
Windows Subsystem for Linix
can check the box to turn it on
and click "OK" to save the settings.
Enable WSL by running this command on CMD or Powershell in admin mode:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
It will tell you if you need to restart your system, but restart anyway.
Next step:
Go to the Microsoft store and search for
linux
and install your prefered package
Ubuntu
After the installation, restart your system again.
Next step:
Open the Ubuntu application your just installed.
This will install some further packages.
Choose your new username and password and write it down somewhere you'll remember.
The password will not be visible so make sure there are no mistakes.
Press Enter and you will now see the output.
Next Step:
Open Vscode and open and open a new wsl terminal and install anchor using this command
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev

Related

Cloud9 C codes running failure

First, I running Cloud9 on Docker (using with linuxserver/cloud9) on Raspbian
and installed build-essential on Cloud9
When I tried to run C code (such as printing hello world), it says
Compiling /code/first_c.c ...
cc first_c.c -o first_c
bash: line 6: node: command not found
Process exited with code: 127
Should I install something more? or how can I solve it?
If you just want to run C code, you don't need node, but you have to first install gcc by opening a terminal and running:
sudo apt update && sudo apt install gcc
Then check that your runner is C (simple) and that you have uncheck the icon Run in debug mode.
If you want to run in debug mode you have to install node and gdb with:
sudo apt install nodejs gdb
== Update ==
P.S.: When gdb is not installed, C9 shows wrongly :
"gdbserver" is not installed
This is a bug: corrected by this (yet) non-merged PR.

Install later version of docker-engine stuck on Travis build

Because I need a newer version of docker-compose, I also need a newer version of docker-engine. I tried:
before_install:
- sudo apt-get install -qq docker-engine
However, the build gets stuck at a prompt:
Configuration file '/etc/default/docker'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** docker (Y/I/N/O/D/Z) [default=N] ?
How do I make it keep the old version without blocking? (Or should I accept the new version? I'm guessing Travis CI is doing some stuff to it...)
I tried sudo apt-get remove -qq docker-engine first, which didn't seem to do anything.
Make sure you're using the right Travis CI environment, the Trusty beta environment.
Then see the Travis docs for updating your Docker Compose here.

How to install the latest Docker .deb package?

On our production Ubuntu servers we are not allowed to make changes to the apt sources lists.
So, using the script located at https://get.docker.com/ubuntu/ is unfortunately not an option for me. Instead I need to download the docker .deb package for ubuntu and install it manually using dpkg.
However the docker installation documentation here: https://docs.docker.com/installation/ubuntulinux/#installing-docker-on-ubuntu does not detail how to get the deb package directly. Any ideas?
I ended up installing docker like so using direct deb package downloads:
#!/bin/bash
docker_version=1.6.2
get_docker=https://get.docker.io/ubuntu/pool/main/l
for package in lxc-docker lxc-docker-$docker_version; do
deb=${package}_${docker_version}_amd64.deb
curl -s $get_docker/$package/$deb -o $deb
done
sudo dpkg -i lxc-docker_${docker_version}_amd64.deb lxc-docker-${docker_version}_${docker_version}_amd64.deb
(Thanks to #eldos for pointing me in the right direction)
Latest docker packages (post 1.9) are now avaiable at https://apt.dockerproject.org/repo/pool/main/d/docker-engine/
You can download the one that suits your OS & architecture from here and install with 'sudo dpkg -i < package_name >'

Spyder does not autocomplete local variables

I'm having a problem getting my local variables autocompleted. This is a very basic functionality which I'm sure it should support. When I'm starting to write a variable name which was already declared, and press TAB (this is the default shortcut), I get nothing. Is this a bug?
(Spyder dev here) Spyder does complete local variables but to have this functionality you need to install a library called rope. You can do it by running this command in a terminal
pip install rope
If you use Python 3 this command needs to be
pip install rope_py3k
Besides, code completion on the Editor works now with both Ctrl+Space and with Tab.
Edit: Updated answer for the Spyder version 2.3.0.
Another hint:
If you want to customize the shortcut (for example, your 'ctrl+space' is already occupied), try
Tools--Preferences--Keyboard shortcuts--code completion
you can change it to whatever you want
Idoda, I made a little guide to install Python for scientific computing on Ubuntu or Debian from their repositories. I tested correctly using Python 3 on Ubuntu 14.04 LTS.
It summarizes as follows. First, install the interpreter and the package manager:
sudo apt-get install python3 python3-pip
Now install the Spyder's IDE:
sudo apt-get install spyder3
Thanks to Carlos Cordoba's advice, if you want to enjoy the autocomplete execute:
sudo pip3 install rope_py3k
Finally, open Spider and check if the autocomplete works rightly.
In my case, with the command conda install spyder, the installation process prompted me with the following...
The following NEW packages will be INSTALLED:
rope: 0.10.5-py36_0 conda-forge
spyder: 3.1.4-py36_0 conda-forge
Proceed ([y]/n)? y
I want to point out that my anaconda installation is for python 3. After this auto-completion was working. I'm utilizing OS X El Capitan.
Usually, ctrl+space is set to code completion in
Tools -> Preferences -> Keyboard shortcuts -> code completion
We have the option to change it to another shortcut.

ERROR: cannot start RubyMine. No JDK found. JDK Version? + desktop link

ERROR: cannot start RubyMine.
No JDK found. Please validate either RUBYMINE_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.
I'm not sure what JDK version number to use to download it?
Also how to create a desktop link in 11.10?
I think using apt-get is easier, see for example this article:
sudo apt-get install openjdk-7-jdk
Turned out that in the end I had to do several things to get java running and thus resolve the issue:
Get Java
Download oracle7 jdk at:
http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html
e.g. http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz
Follow instructions at:
http://www.webupd8.org/2011/09/how-to-install-oracle-java-7-jdk-in.html
e.g.
After downloading java (above):
Extract the downloaded Oracle Java JDK archive into your home folder and rename the newly created folder to "java-7-oracle".
sudo mv its_name java-7-oracle
Install Java
cd
sudo mkdir -p /usr/lib/jvm/ #just in case
sudo mv java-7-oracle/ /usr/lib/jvm/
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install update-java
sudo update-java # choose version 1.7 if necessary.
Check the Java install
java -version
javac -version
I was then able to start up rubyMine successfully.
Create rubyMine shortcut
To create the desktop launcher in Ubuntu 11.10:
Once you've installed rubymine and you have the executable somewhere:
If it's called mine, then create a desktop launcher that runs it
http://www.ubuntugeek.com/how-to-create-desktop-launchers-in-ubuntu-11-10oneiric.html
You'll run (in a terminal window):
gnome-desktop-item-edit ~/Desktop/ --create-new
Indicate where the rubyMine executable is, e.g. use /usr/local/bin/mine as the command to run.
You can then also drag that to the left side toolbar icons area for a icon quick-launcher there.
Note:
If following these instructions and making a quick-launch icon at the end - make sure NOT to delete the desktop icon you created earlier when cleaning up your desktop as this will also remove that quick-launch item (it's a link to it).

Resources