Installing emacs on remote machine with limited permissions - emacs

I am trying to install emacs on my profile in the remote machine (I am not in the sudoers list). I downloaded the tar file and unzipped it, ran ./configure and then did make. When I do make install, it needs permissions to access /usr/local/share/emacs which I don't have. I was wondering if there exists an alternative way to install emacs.
I cannot run apt-get install as I do not have admin permissions on the remote machine.

You need the --prefix argument to ./configure. Like ./configure --prefix=/home/YOU/local/emacs or whatever path makes sense that you have write access to. Then run make and make install. Run ./configure --help for more information.

Related

powershell and conda: conda activate env returns command not found

I have pip installed powerline-shell in my base conda env. Switching envs yields the following error:
conda activate <env_name>
-bash: powerline-shell: command not found
I also tried running conda init powershell but it took no actions.
I have miniconda3, with conda 4.7, installed on MacOS Mojave.
I don't know a simple solution to this. I'm thinking you either need to install it in every env (which I don't recommend because it's best to avoid using pip in Conda) or you create a link to the powerline-shell binary in another location that you can keep on PATH to avoid adding the entire miniconda3/bin/ directory to PATH. I've done something like this in the past, but never with a Python entry point before.
I'd try something like
mkdir -p ~/.local/bin
ln -s /your/path/to/miniconda3/bin/powerline-shell ~/.local/bin/powerline-shell
Then add .local/bin to PATH in your .bashrc, probably toward the beginning (e.g., before the Conda section). The path here (~/.local/bin) is totally arbitrary, so adjust to your preferences. Main point is to minimize what you are exposing globally in a shell session.
Note: conda init powershell is for Windows PowerShell users.

How can I ensure HGFS in CentOS via Vagrant?

I am using Vagrant (1.7.4) with the VMware Fusion provider.
I have created a new VM from the centos/7 box, and configured shared folders in my Vagrantfile.
On startup, I get the message
HGFS was never found on the running virtual machine. This must be
installed either through VMware tools or Open VM Tools. HGFS is
required for shared folders to work properly. Please install either
the VMware tools or Open VM Tools and try again.
after a while, and the system starts up, but without the mounted shared volume.
I have tried installing Open VM tools, with a
sudo yum -y install open-vm-tools
in my Vagrant provisioner inline shell script
config.vm.provision "shell", inline: <<-SHELL
sudo yum -y update
sudo yum -y install open-vm-tools
SHELL
However, I still get the message at startup, and I do not see the mounted share.
I have an almost identical Ubuntu box (precise/64) that seems to work just fine.
I looked up the box https://atlas.hashicorp.com/centos/boxes/7 and from the release notes they clearly mention that virtual box guest are not installed
The VirtualBox Guest Additions are not preinstalled; if you need them for shared folders, please install the vagrant-vbguest plugin. We recommend using NFS instead of VirtualBox shared folders if possible.
I think what they should mention is that they did not install the VMWare tools neither so default sharing folder with VMWare does not work.
How to install the VMWare tools for the VM
Make sure to mount a cd
Open VMWare Fusion and make sure the VM is down - open the VM settings, select the hard drive and add a device, select the CDRom.
boot the VM from the VM menu select Install VMWare Tools
Installing VMWare Tools
login to the VM (either from VMWare or open an ssh session with vagrant ssh)
Install pre-requisites and update kernel (at least I had to run to successfully install the VMWare tools on VMWare fusion 8.0 - see here)
sudo yum install perl gcc gcc-c++ make binutils
sudo yum update kernel
reboot and run the following again
sudo yum install kernel-headers kernel-PAE-devel
mount the VMWare tools
this is found from the VMWare doc - Make sure to run the below commands with root or add sudo
To create a mount point, run:
mkdir /mnt/cdrom
To mount the CDROM, run:
mount /dev/cdrom /mnt/cdrom
To copy the Compiler gzip tar file to a temporary local directory, run:
cp /mnt/cdrom/VMwareTools-<version>.tar.gz /tmp/
Where version is the VMware Tools package version. To determine the version of VMware tools, run:
ls /mnt/cdrom
You see output similar to:
VMwareTools-5.0.0-12124.tar.gz
To change to the tmp directory and extract the contents of the tar file into a new directory called vmware-tools-distrib, run:
cd /tmp
tar -zxvf VMwareTools-version.tar.gz
To change directory to vmware-tools-distrib and run the vmware-install.pl PERL script to install VMware Tools, run:
cd vmware-tools-distrib
./vmware-install.pl
After all this, the tools were installed and shared folder is working correctly.
as a side note I can say that its much easier building a box with packer and install the tools directly from install. There are plenty of packer templates available on github for all versions of centos.

pycharm packages not displayed in the project interpreter window

I am using pycharm 5.0.4 community edition.
I wanted to install package fuzzywuzzy.
But when i go to project interpreter window and try to install package, it shows me no available packages.
Can it be issue because I am using my work desktop.
Thanksenter image description here
Can you provide more details- Are you not able to see any packages? Try searching for some other packages like pip, matplotlib, django, numpy etc. Sometimes it takes time for the IDE to build skeletons before you can actually start installing the packages. So once the IDE wait for it to complete its setup and then try to access the installation packages available.
Also if you do you have any other python interpreter installed on your local machine? If so then try switching to that interpreter.
Below are some steps you can try, which worked for me:
Step-1 Activate your intelpython using:
source <your installation path>/bin/activate
Step-2 Clone the environment using conda clone command and make sure the pwd is ~/:
conda create -n <source_environment> --clone <destination_environment>
Step-3 Activate the cloned environment:
source ~/.conda/envs/<your_environment>/bin/activate
Step-4 Provide read-wite permissions to intelpython and cloned enviroment using:
sudo chown -R <user_name>:<group_name> /<path_to_directory i.e. /opt/intel and ~/.conda/envs>
Step-5 Open Pycharm and in System Interpreter add the path to above created enviroment and then you can use pip or Pycharm itself, it should work.
I had a similar problem. I was using the Intel python distribution, and installing packages required write permissions to the folder that intelpython was installed in, which in my case was /opt/intel/intelpython2.
Try adding write permissions to the folder using the following command:
sudo chown -R <username> </path/to/folder>
Then try adding missing packages and/or repositories as seen in this page - https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html.

Installing with PIP in virtualenv?

I'm trying to wrap my head around virtualenv and pip still.
If I use pip to install a library, it doesn't matter where I 'cd' to, because it installs the libraries in the same place right (which i dont even know where that is)? So I guess my question is, when I install something with pip, how do I make sure it only installs that library inside of my virtual environment? Do I need to cd to that directory first? or is there a command I'm supposed to use with pip to make sure it only installs to the virtualenv project I'm working in?
Activate virtualenv first:
source virt_name/bin/activate
Then after that, install the libraries:
pip install module_name
Note: Don't use sudo with pip because sometimes it will assume you want to install in /usr/local/lib/site-packages.
Generally speaking, if you do not use virtualenv --system-site-packages to create your virtualenv, you should be only working with your per-environment packages.
Providing you run the activate script before installing anything.
i.e. Do the following, if you want to install something in your virtualenv.
Run activate script
Windows: [ve_directory]\Script\activate.bat
Linux: source [ve_directory]/bin/activate
pip install [your requirements]
I think it doesn't matter where your current working directory is.
Reference:
http://www.virtualenv.org/en/latest/#the-system-site-packages-option
When you create a new environment with virtualenv, among other things it creates a bash script venv/bin/activate (where venv is the folder you specified when you created the environment; libraries are located there as well, by the way). When you run it in your shell the environment variables become arranged so that pip installs new libraries in this environment's folder. See virtualenv docs for details, section "activate script".

Where is mongoctl after installation?

I've installed mongoctl according to Mongolab's simple instructions, but I can't do anything with the installed package because which mongoctl resolves to nothing.
The site makes it look like pip installs some kind of command line tool, but it seems like it just installs the python package, which would be fine if all of the documentation didn't treat mongoctl as a command line tool.
What's going on?
You can add the following option to your install command to ensure that "mongoctl" exe goes to /usr/local/bin
--install-option="--install-scripts=/usr/local/bin"
Since mongoctl is already installed on your mac, you will probably need to add a --upgrade and a --force-reinstall
So try the following
sudo pip install mongoctl --install-option="--install-scripts=/usr/local/bin" --upgrade --force-reinstall
What OS are you using?
'mongoctl' should be in /usr/local/bin. Check to make sure that directory is in your PATH
-will