Skip to content

Instantly share code, notes, and snippets.

@rdenadai
Last active November 22, 2023 09:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rdenadai/807951bc32a38f6590c5 to your computer and use it in GitHub Desktop.
Save rdenadai/807951bc32a38f6590c5 to your computer and use it in GitHub Desktop.
Super complex set of script and text files to build a full feature computer with a lots of python libs, java and other stuff like ffmpeg, opencv, llvm inside a vagrant script or linux install!!!
# The commands must be executed in the order bellow! Not doing this may break the installation!
# Install python-software-properties if you get a 'command not found'
# sudo apt-get install python-software-properties
# In case you need to install setuptools
# Keep in mind that doing this may destroy pip installation of setuptools
# Instead you can pip install setuptools ... :)
# wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
sudo add-apt-repository ppa:openjdk-r/ppa
sudo add-apt-repository ppa:webupd8team/java -y
sudo add-apt-repository ppa:numix/ppa -y
sudo add-apt-repository ppa:mc3man/trusty-media -y
sudo add-apt-repository ppa:kivy-team/kivy
# Add this repo if you want to install pypy
# Remember that you need to install pypy inside a virtualenv to correct use pip
#-- sudo add-apt-repository ppa:pypy/ppa -y
sudo apt-get update | sudo apt-get upgrade -y --force-yes
# Enable silent install to ORACLE JDK!!! Other wise it can occur to be blocked on the agreenment licence button, very annoying
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
# Enable silend install to ttf-mscorefonts! Other wise it can occur to be blocked on the agreenment licence button, very annoying
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
# Get the bellow files to run. Remember to clear what you dont want to install!
cat libs.txt | sudo xargs apt-get install -y
cat programs.txt | sudo xargs apt-get install -y
# Before install requirements, if numba is enabled, please change llvm version since numba only works with llvm 3.6+
# Remove symlink
# sudo rm -rf /usr/bin/llvm-config
# Create a new symlink to new llvm
# sudo ln -s ../lib/llvm-3.4/bin/llvm-config /usr/bin/llvm-config
# Perhaps you have to change all links here that are connecting to llvm to not break your system!!!
cat requirements.txt | sudo xargs pip install --upgrade
# Install OPENCV
# Download the zip file from opencv website: http://opencv.org/
# SimpleCV uses the old cv module from OpenCV, please install version 2.4.11 util the lib migrate to new version
# https://github.com/sightmachine/SimpleCV/issues/542
#-- cd opencv/
#-- mkdir build
#-- cd build/
# Bellow cmake command is usefull, if you are using pyenv (and you should) to manage different python versions!
#-- cmake \
#-- -D CMAKE_BULD_TYPE=RELEASE \
#-- -D CMAKE_INSTALL_PREFIX=/usr/local \
#-- -D BUILD_PYTHON_SUPPORT=ON \
#-- -D USE_V4L=ON \
#-- -D WITH_TBB=ON \
#-- -D WITH_EIGEN=ON \
#-- -D WITH_QT=ON \
#-- -D WITH_LAPACK=ON \
#-- -D WITH_CUDA=OFF \
#-- -D BUILD_NEW_PYTHON_SUPPORT=ON \
#-- -D USE_GStreamer=ON \
#-- -D WITH_FFMPEG=ON \
#-- -D WITH_OPENGL=ON \
#-- -D PYTHON_EXECUTABLE=~/.pyenv/versions/3.7.0/bin/python \
#-- -D PYTHON_LIBRARY=~/.pyenv/versions/3.7.0/lib/libpython3.7m.a \
#-- -D PYTHON_INCLUDE_DIR=~/.pyenv/versions/3.7.0/include/python3.7m \
#-- -D PYTHON_INCLUDE_DIRS=~/.pyenv/versions/3.7.0/include/python3.7m \
#-- -D PYTHON_INCLUDE_DIRS2=~/.pyenv/versions/3.7.0/include/python3.7m \
#-- -D INCLUDE_DIRS=~/.pyenv/versions/3.7.0/include/python3.7m \
#-- -D INCLUDE_DIRS2=~/.pyenv/versions/3.7.0/include/python3.7m \
#-- -D PYTHON_PACKAGES_PATH=~/.pyenv/versions/3.7.0/lib/python3.7/site-packages \
#-- -D PYTHON_NUMPY_INCLUDE_DIR=~/.pyenv/versions/3.7.0/lib/python3.7/site-packages/numpy/core/include ..
#-- make
#-- sudo make install
# This disable the error that might happen if you are running OpenCV inside a VM without camera hardware
# libdc1394 error: Failed to initialize libdc1394
#-- sudo ln /dev/null /dev/raw1394
# NLTK python package have some database bank informations, to download enter in python interpreter and execute the following:
# >>> import nltk
# >>> nltk.download()
# Since version 0.5 SkyField python package does not have de DES421 package, if you need this, enter in python interpreter and execute the following:
# >>> from skyfield.api import load
# >>> ts = load.timescale()
# >>> planets = load('de421.bsp')
# To use usb devices inside virtualbox VM one must give permission to the vboxusers, log off and log in again
# sudo usermod -a -G vboxusers $USER
# Also you need to install the appropriate extension pack based on the version you are using
# http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html#extpack
# If you run with sudo, may end up not been able to access usb
# VBoxManage list extpacks
# VBoxManage extpack install <file extension>
# VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"
# Add vagrant user to video group helps your webcam to work inside the box
# sudo usermod -a -G video vagrant
# IF YOU WANT A LIGHT WEIGHT GUI INTERFACE LIKE XFCE
# sudo adduser <username>
# sudo usermod -a -G sudo <username>
# sudo apt-get install xorg openbox xubuntu-desktop alacarte xfce4-volumed gstreamer0.10-alsa pavucontrol
# sudo nano /etc/lightdm/lightdm.conf.d/10-xubuntu.conf
# Edit the file above, putting:
# [SeatDefaults]
# user-session=xubuntu
# autologin-user=<username>
# This is interesting in cases like these:
# - https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
# - http://askubuntu.com/questions/148171/dropbox-error-echo-100000-sudo-tee-proc-sys-fs-inotify-max-user-watches
echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf; sudo sysctl -p
# Install RUST!
curl https://sh.rustup.rs -sSf | sh
#Install NodeJS
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install pyenv...
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
pyenv update
# Install latest python version til now...
pyenv install 3.7.0
# Make it the default version on the platform
pyenv global 3.7.0
# Case pyenv command is not available put the bellow commands this in the .bashrc | .bash_profile file
# export PATH="~/.pyenv/bin:$PATH"
# eval "$(pyenv init -)"
# eval "$(pyenv virtualenv-init -)"
alsa
build-essential
cmake
enchant
ffmpeg
fftw-dev
fftw2
g++
gfortran
imagemagick --fix-missing
libeigen3-dev
libbtbb-dev
libatlas-base-dev
libatlas-dev
libatlas3-base
libav-tools
libavcodec-dev
libavformat-dev
libblas-dev
libblas3
libbz2-dev
libcairo2
libdc1394-22
libdc1394-22-dev
libedit-dev
libeigen3-dev
libfaac-dev
libffi-dev
libfftw3-3
libfftw3-dev
libfreetype6-dev
libgdal-dev
libgdk-pixbuf2.0-0
libgif-dev
libgif4
libgstreamer-plugins-base0.10-dev
libgstreamer0.10-dev
libgtk2.0-dev
libjasper-dev
libjasper1
libjpeg-dev
libjpeg-turbo8-dev
libjpeg8
libjpeg8-dev
liblapack-dev
liblapack3
libldap2-dev
libmp3lame-dev
libncurses5-dev
libncursesw5-dev
libopencore-amrnb-dev
libopencore-amrwb-dev
libopencv-dev
libopenexr-dev
libpango1.0-0
libpng-dev
libpng12-0
libpng12-dev
libportaudio2
libportmidi-dev
libqt4-dev
libreadline-dev
libsasl2-dev
libsdl-image1.2-dev
libsdl-mixer1.2-dev
libsdl-ttf2.0-dev
libsdl1.2-dev
libsdl2-image-2.0-0
libsdl2-image-dev
libsdl2-mixer-2.0-0
libsdl2-mixer-dev
libsmpeg-dev
libsqlite3-dev
libssl-dev
libswscale-dev
libtbb-dev
libtbb2
libtheora-dev
libtiff5
libtiff5-dev
libv4l-0
libv4l-dev
libvorbis-dev
libwebcam0
libwebcam0-dev
libwebp-dev
libx264-dev
libxine2-dev
libxml2-dev
libxslt1-dev
libxvidcore-dev
llvm
llvm-3.6-dev
make
openjdk-8-jdk
pkg-config
poppler-utils
portaudio19-dev
postgresql-9.4
postgresql-client-9.4
postgresql-server-dev-9.4
python-dev
python-kivy
shared-mime-info
tesseract-ocr
tesseract-ocr-por
unzip
v4l-utils
v4l2ucp
x264
xz-utils
yasm
zlib1g-dev
ubuntu-restricted-extras
ttf-mscorefonts-installer
sublime-text
python-pip
python-pygame
pinta
vlc
streamripper
meld
virtualbox
virtualbox-dkms
virtualbox-guest-additions-iso
virtualbox-guest-dkms
virtualbox-qt
openshot
chromium-browser
pepperflashplugin-nonfree
dropbox
python-gpgme
curl
htop
gparted
libclamunrar6
gufw
clamav
clamav-daemon
clamtk
clamav-freshclam
oracle-java7-installer
oracle-java7-set-default
numix-icon-theme
numix-icon-theme-circle
numix-icon-theme-bevel
numix-gtk-theme
numix-tools
mercurial
git
linux-headers-generic
build-essential
dkms
texlive-latex-base
texlive-fonts-recommended
texlive-fonts-extra
texlive-latex-extra
transmission
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment