Compiling a file leaves files in my home directory when doing vagrant provision - c++

I am using Vagrant to setup a linux box. I need to add a file I compiled to the system and I do so using the following commands -
sudo git clone https://github.com/thewtex/tmux-mem-cpu-load.git /tmp/tmuxcpu
sudo cmake /tmp/tmuxcpu
sudo make clean /tmp/tmuxcpu
sudo make install clean /tmp/tmuxcpu
However, this leaves tons of files including a makefile, config files, and other garbage inside the /home/vagrant/ folder. How do I make and install from tmp without littering the home directory with garbage?
The above commands work, but it leaves tons of files in the /home/vagrant folder that I don't want there. Is it possible to cmake, make, and make install without leaving 'trash'?

I have solved my issue with the help of Etan Reisner and reinierpost.
## CPU LOAD
sudo git clone https://github.com/thewtex/tmux-mem-cpu-load.git /tmp/tmuxcpu
sudo sh -c "cd /tmp/tmuxcpu && sudo cmake . && sudo make && sudo make install";
My install script now uses the above commands and this has resolved my issue. By keeping the files in /tmp, they are removed the moment I reboot the box. I am using this technique for several other items during the vagrant setup now and it works perfectly. This has solved numerous issues for me.

Related

Vmware on Arch: Could not open /dev/vmmon: No such file or directory

I want to install VMware Workstation on Arch. I used the command yay -S vmware-workstation to install. After installation finished, I ran VMware, created an VM, started it, and got the error:
Could not open /dev/vmmon: No such file or directory.
Please make sure that the kernel module `vmmon' is loaded.
I tried to install linux-header but it still didn't work.
OS: Arch Linux, 5.10.56-1-lts.
Thanks for any help!
I ran into this problem too, and the solutions I found online ended up having their own problems that needed to be solve, which I'll document here.
To solve the error Could not open /dev/vmmon/: you need to run:
sudo vmware-mod-config --console --install-all
If this returns an error about Glib not having support, you need to clone https://github.com/mkubecek/vmware-host-modules.git and make it.
$ git clone https://github.com/mkubecek/vmware-host-modules.git
$ cd vmware-host-modules
$ git checkout -b 16.2.1 origin/workstation-16.2.1
$ sudo make
If this returns an error containing fatal error: generated/autoconf.h: No such file or directory, you need to install linux-headers and make sure it matches your linux kernel version. Probably also make sure your kernel is up to date, although I'm not sure if that's necessary.
$ sudo pacman -S linux
$ sudo reboot
$ sudo pacman -S linux-headers
Now you should be able to make install in that cloned repo, which should install the required modules for you to be able to run the vmware-mod-config --console --install-all command, which should solve the issue.
So working backwards, the steps are:
Update your linux kernel and install the right linux-headers for it.
Clone this git repo, cd into it, git checkout -b 16.2.1 origin/workstation-16.2.1, and run sudo make install
Run sudo vmware-mod-config --console --install-all
More about can be found at my post here: https://bbs.archlinux.org/viewtopic.php?pid=2020372#p2020372
I also encountered same problem. Most of the stackoverflow pages suggest to reinstall the vmware but its not a fair solution and even its not a solution. Its just like if you have pain in teeth remove that teeth.
Another thing is that some post and even vmware official posts said to disable secure boot.
But after trying both nothing changed so i goto to cd /dev and found that the file vmmmon exists.
And when i tries to load the file it loaded successfully.
So from here i concluded that to solve this issue do the following:
Either disable the secure boot or sign the vmmon.
CD to /dev/
Load vmmon using modprobe
and as always Happy coding....
The command: sudo vmware-modconfig --console --install-all works, but every time that I reboot the system the error come out again.
In my case, the cause of this problem was the vmmon didn't be load. So I just
sudo modprobe -v vmmon
and it work.

How to install homebrew packages locally

I got homebrew installed, however I do not have admin access. How do I install homebrew packages without admin access? Is there a local tag or something that I keep missing?
Homebrew needs /usr/local to be chown-ed to your user, and you need sudo for that. If you can’t you have to install it elsewhere. Some people use ~/.brew or ~/homebrew; you can use anything but avoid paths with spaces. See the docs here.
Let’s say you want to install in ~/.brew; run the following command:
git clone --depth=1 https://github.com/Homebrew/brew ~/.brew
Then ensure the bin and sbin directories are in your PATH. If you’re using Bash add the following in your ~/.bash_profile:
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
Run source ~/.bash_profile or restart your shell and run brew doctor to see if it’s installed correctly. It should warn you it’s not installed into /usr/local but that’s expected here.
To install homebrew without sudo.
git clone https://github.com/mxcl/homebrew.git
echo 'export PATH="/path/to/cloned_folder/homebrew/bin:$PATH"' >> ~/.bash_profile
Update the /path/to/cloned_folder with the path of the homebrew cloned folder.
Restart terminal and run
brew update
brew --version
git clone https://github.com/Homebrew/brew
pwd
echo 'export PATH="*RESULT_OF_PWD*/brew/bin:$PATH"' >> ~/.bash_profile
if it's for programming/building purposes you could also is easy to download the formula, extract the download url, and unzip it in your prefix (is your local folder): it's json https://formulae.brew.sh/api/formula/gtk+3.json

Is it possible to undo a build just after ./configure, make and BEFORE sudo make install?

So I was trying to install Python 3.3 from source (I'm running on Debian Wheezy)...
$ cd /tmp
$ wget [web address of the tar]
$ tar -xzf [tar file]
$ ./configure --prefix=/usr/local/opt/python-3.3.6
$ make
..when I realised I was in production server. The installation should have been installed in local development.
$ make uninstall
make: *** No rule to make target `uninstall'. Stop.
It seems 'make uninstall' is not available and I do NOT have checkinstall installed.
Is it possible to abort the installation and leave everything as it was before? I mean, after firing 'make' I've only build the software but it hasn't been installed into a specific location (i.e. 'sudo make install'), right?
TL;DR
Is it just matter of deleting the directory created by the tar file (considering sudo make install hasn't been fired)?

Run Keter without GHC and cabal

I have a server and want to deploy my Yesod applications without installing GHC and Cabal. I am not sure if is possible: a Teacher told me that I must first compile Keter in my machine and, after that, put keter executable on the server, though I am not sure how to do that.
To build Keter, first you'll need to clone the sources from its GitHub repository. Then you'll need to set up a Haskell build environment and use cabal build or cabal install to build the sources. Personally, I use a Docker container derived from an image based on the following Dockerfile:
FROM haskell:7.10.2
RUN apt-get update && apt-get install -y \
git
RUN mkdir /src
RUN cd src && \
git clone https://github.com/snoyberg/keter && \
cd keter && \
git checkout e8b5a3fd5e14dfca466f8acff2a02f0415fceeb0
WORKDIR /src/keter
RUN cabal update
RUN cabal install keter
ENTRYPOINT /bin/bash
This is an image containing the Keter sources checked out at a specific revision with the minimum GHC toolchain required to build it all. The cabal command lines pull down all the project's dependencies and compiles the whole thing. Once this has completed, you can grab the keter executable from ~/.cabal/bin/keter.
Even if you choose not to use Docker, this file should give you a rough idea how to set up your environment.
Now you have Keter compiled, you can run it inside another Docker container. Here's a rough idea what the Dockerfile for the corresponding image might look like:
FROM debian
RUN apt-get update && apt-get install -y \
libgmp-dev \
nano \
postgresql
COPY keter /opt/keter/bin/
COPY keter-config.yaml /opt/keter/etc/
EXPOSE 80
CMD ["/opt/keter/bin/keter", "/opt/keter/etc/keter-config.yaml"]
Ths will take a base Debian image and install a minimal set of packages on top of it. It then copies the keter executable and configuration file into the image. If you then run a container from the resulting image it will start the keter executable.
Fair warning: This whole process is fairly involved. I'm still working on tweaking the exact details myself. Good luck!

Installing eyeD3 on Webfaction

I'm trying to install eyeD3 on Webfaction for my Django application and I tried to this command
easy_install-2.7 eyeD3
and it didn't work, also Webfaction prevents me from downloading packages as well right?
I could install "boto" with the very same command tho.
Any ideas?
Thanks in advance
You can always pull down whatever packages you need and place them into your /lib/python2.x folder within your application directory. WebFaction doesn't prevent you from downloading or installing packages using pip or easy_install.
Have a look at their documentation: http://docs.webfaction.com/software/python.html?highlight=install%20python%20pacakge#installing-python-packages
If that doesn't help, just contact technical support, their staff is extremely helpful.
eyeD3 is not packaged with a setup.py script, so its installation is a bit more complicated than simply easy_installing it.
Here are the commands you can run in a SSH session to install it in your home directory on your WebFaction server:
mkdir -p ~/tmp ~/src ~/lib/python2.7
export TMPDIR=~/tmp
cd ~/src
wget http://eyed3.nicfit.net/releases/eyeD3-0.6.17.tar.gz
tar zxf eyeD3-0.6.17.tar.gz
cd eyeD3-0.6.17
./configure --prefix=$HOME
cd ..
easy_install-2.7 eyeD3-0.6.17
Hope that helps!