TODO: to script with select screen. Extend functionality of https://github.com/cesar-rgon/desktop-app-installer
sudo apt install gnome-tweaks -y
gsettings set org.gnome.desktop.input-sources xkb-options "['grp:ctrl_shift_toggle']"
gsettings set org.gnome.desktop.input-sources xkb-options "['grp:alt_shift_toggle']"lsb_release -a
uname -a
Read:
- trash-cli https://www.2daygeek.com/trash-cli-command-line-trashcan-linux-system/
- don`t alias rm https://apple.stackexchange.com/a/17637
sudo -E apt-get install -y trash-cli
echo "alias rmt=trash" >> ~/.bashrc
source ~/.bashrc
# test
touch testfile
rmt testfile
# commanlist:
trash-put: Delete files and folders.
trash-list: Pint Deleted files and folders.
trash-restore: Restore a file or folder from trash.
trash-rm: Remove individual files from the trashcan.
trash-empty: Empty the trashcan(s).
trash-empty 10: Remove older then 10 days file
If Trash-cli is not available on the repositories, you can compile and install it from sources.
# read https://www.ostechnix.com/trash-cli-command-line-trashcan-unix-like-systems/
git clone https://github.com/andreafrancia/trash-cli.git
cd trash-cli
sudo python setup.py install
Other platforms:
wget --no-check-certificate https://github.com/PhrozenByte/rmtrash/archive/v1.12.zip
unzip -d rmtrash
chmod +x rmtrash/rmtrash
chmod +x rmdirtrash/rmdirtrash
sudo mv rmtrash/rmtrash /usr/bin/
sudo mv rmdirtrash/rmdirtrash /usr/bin/
echo "alias rmt=rmtrash" >>/etc/bashrc
source /etc/bashrc
touch testfile
rmt testfile
TODO
TODO
TODO
sudo nano /etc/cntlm.conf
# After edit:
# sudo service cntlm restart
Username .........
# Domain corp.yourcompany
Domain corp
Proxy yourcompany.com:port
# NoProxy localhost, 127.0.0.*, 10.*, 192.168.*, 172.16., .yourcompany.com
Listen 8088
# Or any port you want
# Edit ~/.profile:
# nano ~/.profile
# export http_proxy=127.0.0.1:8088
# export ftp_proxy=127.0.0.1:8088
# export https_proxy=127.0.0.1:8088
# Apply changes:
# source ~/.profile
# sudo cntlm -v This runs cntlm in verbose mode and it prints information about every connection it makes.
# sudo service cntlm status
Gateway no
Allow 127.0.0.1
Allow localhost
Allow 192.168.1.10
# after sudo cntlm -c /etc/cntlm.conf -I -M http://google.ro
Auth NTLMv2
PassNTLMv2 ...........
sudo nano /etc/apt/apt.conf.d/00proxy
Acquire::https { Proxy "https://user:pass@proxydomain:port"; proxydomain DIRECT; };
Acquire::http { Proxy "http://user:pass@proxydomain:port"; proxydomain DIRECT; };
sudo nano /etc/apt/apt.conf
# If your username or password has '@' in it you can replace it with %40 Example:If your password is @123 enter it as %40123.
Acquire::https::Proxy "https://localhost:8088/";
Acquire::http::Proxy "http://localhost:8088/";
Acquire::ftp::Proxy "ftp://localhost:8088/";
Acquire::socks::proxy "socks://localhost:8088/";
Acquire::::Proxy "true";
Main - Canonical-supported free and open-source software.
Universe - Community-maintained free and open-source software.
Restricted - Proprietary drivers for devices.
Multiverse - Software restricted by copyright or legal issues.
sudo add-apt-repository universe
sudo apt update -y
sudo apt upgrade -y
# This software provides an abstraction of the used apt repositories. It allows you to easily manage your distribution and independent software vendor software sources.
sudo apt install software-properties-common -y
Go Settings —> Repositories
Main – Free and open-source software supported by Ubuntu team
Universe – Free and open-source software maintained by the community
Restricted – Proprietary drivers for devices.
Multiverse – Software restricted by copyright or legal issues.
Canonical Partners – Software packaged by Ubuntu for their partners
sudo apt update -y
sudo apt install finger -y
finger
sudo apt install synaptic -y
sudo apt install -y ubuntu-restricted-addons mencoder flac faac faad sox ffmpeg2theora libmpeg2-4 uudeview mpeg3-utils mpegdemux liba52-dev mpeg2dec vorbis-tools id3v2 mpg321 mpg123 icedax lame libmad0 libjpeg-progs libdvdcss2 libdvdread4 libdvdnav4
sudo add-apt-repository ppa:videolan/stable-daily
sudo apt-get update && sudo apt-get install vlc -y
sudo apt-get install unrar zip unzip p7zip-full p7zip-rar rar sharutils mpack arj cabextract file-roller cabextract -y
sudo apt-get install ia32-libs -y
sudo apt-get install skype -y
OR latest:
apt install apt-transport-https -y
curl https://repo.skype.com/data/SKYPE-GPG-KEY | apt-key add -
echo "deb https://repo.skype.com/deb stable main" | tee /etc/apt/sources.list.d/skypeforlinux.list
apt update
apt install skypeforlinux -y
sudo apt-get install python-setuptools python-dev python-pip
If you use company index-url:
sudo cat >> /etc/pip.conf << EOF
[global]
timeout = 60
index-url = https://pypi.python.org/simple/
extra-index-url = http://151.101.112.223/root/pypi/+simple/
http://pypi.company:port/root/pypi/+simple/
trusted-host = pypi.python.org
pypi.org
files.pythonhosted.org
pypi.corp.company
EOF
sudo chmod 644 /etc/pip.conf
python -V
pip -V
sudo apt-get install build-essential -y
sudo apt-get install wine winetricks -y
ubuntu docker https://docs.docker.com/install/linux/docker-ce/ubuntu/
postinstall https://docs.docker.com/install/linux/linux-postinstall/
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo touch /etc/docker/daemon.json
sodo nano /etc/docker/daemon.json
Move docker data to another drive:
{
//...
"data-root": "/mnt/docker"
//...
}
https://medium.com/developer-space/how-to-change-docker-data-folder-configuration-33d372669056
sudo apt install python-software-properties -y
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt update
sudo apt-get install openjdk-8-jdk openjdk-8-jre oracle-java8-installer
wget http://download.teamviewer.com/download/teamviewer_i386.deb
dpkg -i teamviewer_i386.deb
apt-get install -f -y
rm -rf teamviewer_i386.deb
sudo apt install chromium-browser -y
OR for latest:
if [[ $(getconf LONG_BIT) = "64" ]]
then
echo "64bit Detected" &&
echo "Installing Google Chrome" &&
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb &&
sudo dpkg -i google-chrome-stable_current_amd64.deb &&
rm -f google-chrome-stable_current_amd64.deb
else
echo "32bit Detected" &&
echo "Installing Google Chrome" &&
wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb &&
sudo dpkg -i google-chrome-stable_current_i386.deb &&
rm -f google-chrome-stable_current_i386.deb
fi
sudo apt-get -y install transmission curl wget
sudo apt-get -y install vim
TODO:
# vim-plugins
- name: Install pathogen
git: >
repo="https://github.com/tpope/vim-pathogen.git"
dest="/home/{{ ansible_ssh_user }}/.vim"
update=no
environment:
GIT_SSL_NO_VERIFY: true
- name: Install vim plugins
git: >
repo="{{ item }}.git"
dest="/home/{{ ansible_ssh_user }}/.vim/bundle/{{ item | basename }}"
update=no
environment:
GIT_SSL_NO_VERIFY: true
with_items:
# General-purpose tools
- https://github.com/xolox/vim-misc
- https://github.com/ervandew/supertab
- https://github.com/junegunn/vim-easy-align
- https://github.com/tpope/vim-surround
- https://github.com/tpope/vim-sensible
- https://github.com/christoomey/vim-tmux-navigator
- https://github.com/kien/ctrlp.vim
- https://github.com/Lokaltog/vim-easymotion
- https://github.com/sjl/gundo.vim
- https://github.com/mileszs/ack.vim # requires the 'ack-grep' package
- https://github.com/ciaranm/detectindent
- https://github.com/tomtom/tcomment_vim
# Colors
- https://github.com/flazz/vim-colorschemes
- https://github.com/vim-scripts/vim-colorscheme-switcher
- https://github.com/tomasr/molokai
# Git tools
- https://github.com/tpope/vim-fugitive
# Yaml tools
- https://github.com/stephpy/vim-yaml
# Puppet tools
- https://github.com/rodjek/vim-puppet
# C/C++ tools
- https://github.com/Rip-Rip/clang_complete
# Docker tools
- https://github.com/ekalinin/Dockerfile.vim
#- name: Download YouCompleteMe
# git:
# repo: 'https://github.com/Valloric/YouCompleteMe'
# dest: ~/YouCompleteMe
# update: no
# environment:
# GIT_SSL_NO_VERIFY: true
#
#- name: Getfull YouCompleteMe
# command: chdir=~/YouCompleteMe git submodule update --init --recursive
#
#- name: Compile YouCompleteMe
# command: chdir=~/YouCompleteMe ./install.py --clang-completer
# environment:
# CC: clang-6.0
# CXX: clang++-6.0
sudo apt install synaptic gimp gimp-data gimp-plugin-registry gimp-data-extras -y
sudo apt install bleachbit -y
sudo apt install tasksel -y
sudo apt install sddm -y
# The system will then offer you to make a selection for configuring sddm
sudo dpkg-reconfigure sddm
# The sddm display manager is the default one for KDE Plasma desktop. Hit Enter for Ok.
sudo tasksel install kubuntu-desktop
# The system will then offer you to make a selection for configuring sddm
Restart your system to login to KDE Plasma
Configure KDE https://linuxthebest.net/ukrashaem-rabochee-okruzhenie-kde-plasma/
sudo -E add-apt-repository ppa:graphics-drivers/ppa
sudo -E apt update -y
sudo -E ubuntu-drivers autoinstall
Worth running df -i to check the you haven't run out of inodes (ifree should be non-zero on writable partitions) - this can happen on some filesystems, especially if a larger number of small files have been created.
Get swap and RAM size
sudo -E apt install htop -y
htop
Generally, an amount equal to or double the amount of RAM on your system is a good starting point. Another good rule of thumb is that anything over 4G of swap is probably unnecessary if you are just using it as a RAM fallback.
Only if you dont have swap - create new:
sudo fallocate -l 1G /swapfile
# Make the file only accessible to root by typing:
sudo chmod 600 /swapfile
# Verify
ls -lh /swapfile
# mark the file as swap space
sudo mkswap /swapfile
# enable the swap file, allowing our system to start utilizing it
sudo swapon /swapfile
# verify
sudo swapon --show
# Make the Swap File Permanent
# Back up the /etc/fstab file in case anything goes wrong:
sudo cp /etc/fstab /etc/fstab.bak
# You can add the swap file information to the end of your /etc/fstab file by typing:
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Resize existing swap:
# Turn off all swap processes
sudo swapoff -a
# Check Available Space on the Hard Drive Partition
df -h
# Resize the swap. Command will append count*bs of zero bytes at the end of your swap file.
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
# Make the file usable as swap
sudo mkswap /swapfile
# Activate the swap file
sudo swapon /swapfile
# Verify
sudo swapon --show
The swappiness parameter configures how often your system swaps data out of RAM to the swap space. This is a value between 0 and 100 that represents a percentage.
# verify
cat /proc/sys/vm/swappiness
# For a Desktop, a swappiness setting of 60 is not a bad value. For a server, you might want to move it closer to 0.
sudo sysctl vm.swappiness=60
# Make the swappiness Permanent
sudo nano /etc/sysctl.conf
# At the bottom, you can add:
vm.swappiness=60
vfs_cache_pressure. This setting configures how much the system will choose to cache inode and dentry information over other data.
cat /proc/sys/vm/vfs_cache_pressure
sudo sysctl vm.vfs_cache_pressure=50
sudo nano /etc/sysctl.conf
# At the bottom, add the line that specifies your new value:
vm.vfs_cache_pressure=50
sudo apt-get install -y --no-install-recommends openssh-server ssh
sudo apt install sshpass -y
sudo apt install filezilla -y
sudo apt install git -y
sudo apt install meld -y
sudo apt install smartgit -y
$ git config --global user.name '...' # username
$ git config --global user.email '...@...' # email
$ git config --global color.ui true # pretiffy
$ git config --global credential.helper 'cache --timeout=3600' # cache password for 1 hour
OR
$ git config --global credential.helper store
$ git config --list
echo "Cleaning Up" &&
sudo apt -f install &&
# Remove Orphaned Packages
sudo apt autoremove &&
sudo apt -y autoclean &&
# Clean Package Cache
sudo apt -y clean
(settings)
"editor.multiCursorModifier": "ctrlCmd"
USE ctrl+shift
(keybindings)
[
{
"key": "ctrl+shift+alt+down",
"command": "cursorColumnSelectDown",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+alt+left",
"command": "cursorColumnSelectLeft",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+alt+pagedown",
"command": "cursorColumnSelectPageDown",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+alt+pageup",
"command": "cursorColumnSelectPageUp",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+alt+right",
"command": "cursorColumnSelectRight",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+alt+up",
"command": "cursorColumnSelectUp",
"when": "editorTextFocus"
}
]
https://www.qt.io/offline-installers
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key --no-check-certificate | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main"
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main"
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main"
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main"
sudo -E apt-get update
sudo -E apt-get install build-essential -y
sudo -E apt-get install clang-6.0 python-lldb-6.0 lldb-6.0 lld-6.0 llvm-6.0-dev -y
sudo -E apt-get install clang-tools-6.0 libclang-common-6.0-dev libclang-6.0-dev -y
sudo -E apt-get install libc++-6.0-dev libc++abi-6.0-dev -y
# sudo -E apt-get install libstdc++6 -yTODO:
#!/bin/bash
# python-setuptools python-pip python-devel must be preinstalled
# cmake must be preinstalled
# see https://llvm.org/docs/GettingStarted.html
# see https://github.com/search?q=DLLVM_ENABLE_PROJECTS&type=Wikis
# se for deps list https://github.com/spack/spack/blob/master/var/spack/repos/builtin/packages/llvm/package.py
# requires curl gcc Make python zlib
# make sure requirements installed
yum -y install make curl tar gcc gcc-c++ m4 autoconf automake libtool zlib-devel libstdc++-devel git rpm-build libxml2-devel libffi-devel
yum -y install ninja-build
yum -y install subversion
yum -y install ncurses-devel ncurses
# see https://lldb.llvm.org/build.html
yum -y install libedit-devel libxml2-devel swig
yum -y install unrar unzip
mkdir -p src/llvm-project
cd src/llvm-project
#if [ ! -d llvm ] ; then
# git clone too slow, replaced with wget
#GIT_SSL_NO_VERIFY=true git clone https://llvm.org/git/llvm.git
wget https://github.com/llvm-mirror/llvm/archive/release_60.zip --no-check-certificate
# TODO https://github.com/llvm/llvm-project/archive/llvmorg-6.0.1.zip
unzip release_60.zip -d llvm
mv llvm/llvm-release_60/* llvm/
rm release_60.zip
cd llvm
#git checkout release_60
# git checkout release_70
# git checkout d42d9e83aeb0e752cec99b1a1f2b17a9246bff27
cd ..
#fi
#if [ ! -d clang ] ; then
# git clone too slow, replaced with wget
#GIT_SSL_NO_VERIFY=true git clone https://llvm.org/git/clang.git
wget https://github.com/llvm-mirror/clang/archive/release_60.zip --no-check-certificate
unzip release_60.zip -d clang
#mv clang/llmv-release_60/* clang/
mv clang/clang-release_60/* clang/
rm release_60.zip
cd clang
#git checkout release_60
# git checkout release_70
# git checkout 23b713ddc4e7f70cd6e96ea93eab3f06ca3a72d7
cd ..
#fi
#if [ ! -d libcxx ] ; then
# git clone too slow, replaced with wget
#GIT_SSL_NO_VERIFY=true git clone https://llvm.org/git/libcxx.git
wget https://github.com/llvm-mirror/libcxx/archive/release_60.zip --no-check-certificate
unzip release_60.zip -d libcxx
#mv libcxx/llmv-release_60/* libcxx/
mv libcxx/libcxx-release_60/* libcxx/
rm release_60.zip
cd libcxx
#git checkout release_60
# git checkout release_70
# git checkout 0b261846c90cdcfa6e584a5048665a999900618f
cd ..
#fi
#if [ ! -d libcxxabi ] ; then
# git clone too slow, replaced with wget
#GIT_SSL_NO_VERIFY=true git clone https://llvm.org/git/libcxxabi.git
wget https://github.com/llvm-mirror/libcxxabi/archive/release_60.zip --no-check-certificate
unzip release_60.zip -d libcxxabi
mv libcxxabi/libcxxabi-release_60/* libcxxabi/
rm release_60.zip
cd libcxxabi
#git checkout release_60
# git checkout release_70
# git checkout 565ba0415b6b17bbca46820a0fcfe4b6ab5abce2
cd ..
#fi
# git clone too slow, replaced with wget
#GIT_SSL_NO_VERIFY=true git clone https://llvm.org/git/lld.git
wget https://github.com/llvm-mirror/lld/archive/release_60.zip --no-check-certificate
unzip release_60.zip -d lld
mv lld/lld-release_60/* lld/
rm release_60.zip
cd lld
#git checkout release_60
# git checkout release_70
# git checkout 565ba0415b6b17bbca46820a0fcfe4b6ab5abce2
cd ..
# git clone too slow, replaced with wget
#GIT_SSL_NO_VERIFY=true git clone https://llvm.org/git/compiler-rt.git
wget https://github.com/llvm-mirror/compiler-rt/archive/release_60.zip --no-check-certificate
unzip release_60.zip -d compiler-rt
mv compiler-rt/compiler-rt-release_60/* compiler-rt/
rm release_60.zip
cd compiler-rt
#git checkout release_60
# git checkout release_70
# git checkout 565ba0415b6b17bbca46820a0fcfe4b6ab5abce2
cd ..
# git clone too slow, replaced with wget
#GIT_SSL_NO_VERIFY=true git clone https://llvm.org/git/lldb.git
wget https://github.com/llvm-mirror/lldb/archive/release_60.zip --no-check-certificate
unzip release_60.zip -d lldb
mv lldb/lldb-release_60/* lldb/
rm release_60.zip
cd lldb
#git checkout release_60
# git checkout release_70
# git checkout 565ba0415b6b17bbca46820a0fcfe4b6ab5abce2
cd ..
# git clone too slow, replaced with wget
#GIT_SSL_NO_VERIFY=true git clone https://llvm.org/git/libunwind.git
wget https://github.com/llvm-mirror/libunwind/archive/release_60.zip --no-check-certificate
unzip release_60.zip -d libunwind
mv libunwind/libunwind-release_60/* libunwind/
#mv libunwind/llmv-release_60/* libunwind/
rm release_60.zip
cd libunwind
#git checkout release_60
# git checkout release_70
# git checkout 565ba0415b6b17bbca46820a0fcfe4b6ab5abce2
cd ..
# git clone too slow, replaced with wget
#GIT_SSL_NO_VERIFY=true git clone https://llvm.org/git/clang-tools-extra.git
wget https://github.com/llvm-mirror/clang-tools-extra/archive/release_60.zip --no-check-certificate
unzip release_60.zip -d clang-tools-extra
mv clang-tools-extra/clang-tools-extra-release_60/* clang-tools-extra/
rm release_60.zip
cd clang-tools-extra
#git checkout release_60
# git checkout release_70
# git checkout 565ba0415b6b17bbca46820a0fcfe4b6ab5abce2
cd ..
export PATH=/usr/local/bin:/usr/bin:$PATH:$HOME/bin
which cmake
file /usr/local/bin/cmake
file /usr/bin/cmake
cmake --version
pwd
ls -artl
cd llvm
mkdir -p llvm-build
cd llvm-build
# see http://www.linuxfromscratch.org/blfs/view/cvs/general/llvm.html
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_DOCS=OFF -DLIBCXX_INCLUDE_BENCHMARKS=OFF -DLLVM_ENABLE_DOXYGEN=OFF -DLLVM_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/clang_6.0.1 -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;libunwind;libcxx;libcxxabi;lldb;lld;compiler-rt" -G "Unix Makefiles" -DLLVM_ENABLE_EH=On -DLLVM_ENABLE_RTTI=On ..
cmake --build . -- -j2
# make install
# see https://solarianprogrammer.com/2013/01/17/building-clang-libcpp-ubuntu-linux/
make install/strip
# /home/vagrant/src/llvm-project/*
ls -artl ../../*
cd ..
# NOTE: To append text to a file you use >>. To overwrite the data currently in that file, you use >
# create new .conf files
echo "/usr/local/clang_6.0.1/lib" > /etc/ld.so.conf.d/clang.conf
echo "/usr/local/clang_6.0.1/libexec" > /etc/ld.so.conf.d/clanglibexec.conf
/sbin/ldconfig
# append to ~/.bashrc
echo 'export PATH=/usr/local/clang_6.0.1/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/clang_6.0.1/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
clang --version
clang++ --version
clang-6.0 --version
clang-6.0.1 --version
# TODO update-alternatives
# https://gist.github.com/sergey-shambir/a075161d774e211e1a423826764c7d33
## too slow git clone -> use wget or ssh-clone
## GIT_SSL_NO_VERIFY=true git clone https://github.com/llvm/llvm-project.git
#wget https://github.com/llvm/llvm-project/archive/llvmorg-6.0.1.zip #--no-check-certificate
#unzip llvmorg-6.0.1.zip -d llvm-project
#cd llvm-project
## too slow git clone -> use wget or ssh-clone
## git checkout release/6.x
## (in-tree build is not supported)
#mkdir build
#cd build
#cmake -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;libcxx;libcxxabi;libunwind;lldb;compiler-rt;lld" -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_LIBCXX=On -DLLVM_ENABLE_EH=On -DLLVM_ENABLE_RTTI=On ../llvm-project-llvmorg-6.0.1
#cmake --build . -- -j2
#make install
#cd ..
#rm -rf llvm-project
# https://bobsteagall.com/2018/01/15/clang-builder/
# https://github.com/BobSteagall/clang-builder/tree/clang60
# export CLANG_VERSION=6.0.X
#GIT_SSL_NO_VERIFY=true git clone https://github.com/BobSteagall/#clang-builder.git
#cd clang-builder
#git checkout clang60
#cd clang-builder
## CLANG_VERSION=6.0.1 ./clang-build-vars.sh
##./build-clang.sh -T | tee build.log
###- Get the CLANG-related variables and command-line options for this build.
###
## source ./clang-build-vars.sh
###- Fetch the various pieces required to build LLVM, CLANG, and LIBCXX.
###
#export CLANG_VERSION=6.0.1
#
#
###- Customize variable this to name the installation; the custom name
### is displayed when a user invokes clang or clang++ with the -v flag
### ("clang -v").
###
#export CLANG_VENDOR="(KEWB Computing Build)"
#
###- Customize this variable to define the middle substring in the Clang
### build triple.
###
#export CLANG_CUSTOM_BUILD_TAG=kewb
#
###- Customize these variables to specify where this version of Clang will
### be installed.
###
#export CLANG_INSTALL_ROOT=/usr/local
#export CLANG_INSTALL_PREFIX=$CLANG_INSTALL_ROOT/clang/$CLANG_VERSION
#
###- Customize this variable to specify the installation's time stamp.
###
#export CLANG_TIME_STAMP=201807131000
#
###- Customize this variable if you want to change the arguments passed
### to "make" that specify the number of threads used to build Clang.
###
#export CLANG_BUILD_THREADS_ARG='-j2'
#
###- If building on Linux, customize these variables to specify the location
### of the preferred GCC toolchain partner on this platform. The most
### important thing is that the variable GCC_INSTALL_PREFIX be defined;
### it should have the same value as the --prefix flag used to configure
### the GCC installation.
###
#if [ `uname` == "Linux" ]
#then
# export GCC_VERSION=8.1.0
# export GCC_INSTALL_PREFIX=/usr/local/gcc/$GCC_VERSION
#fi
#
###- If building on Linux, customize this variable to specify the desired ABI
### that libc++ will be linked against. The choices currently supported by
### these scripts are libstdc++ and libsupc++.
###
### If you think that you'll be building executables that link to shared
### objects that are themselves linked to libstdc++, then you should specify
### "GCC_CXX_ABI=libstdc++" below.
###
### On the other hand, if you'll be building everything using a single #version
### of Clang (this one), then it's OK to specify "GCC_CXX_ABI=libsupc++" #below.
###
#if [ `uname` == "Linux" ]
#then
# export GCC_CXX_ABI=libsupc++
#fi
#
###--------------------------------------------------------------------------#----
### Do not change below this line!
###--------------------------------------------------------------------------#----
###
#export CLANG_PLATFORM=`uname`
#
#export LLVM_TARBALL=llvm-$CLANG_VERSION.src.tar.xz
#export CFE_TARBALL=cfe-$CLANG_VERSION.src.tar.xz
#export CRT_TARBALL=compiler-rt-$CLANG_VERSION.src.tar.xz
#export CTX_TARBALL=clang-tools-extra-$CLANG_VERSION.src.tar.xz
#export LIB_TARBALL=libcxx-$CLANG_VERSION.src.tar.xz
#export ALL_TARBALLS="$LLVM_TARBALL $CFE_TARBALL $CRT_TARBALL $CTX_TARBALL #$LIB_TARBALL"
#
#export CLANG_TAG="${CLANG_VERSION//.}"
#export CLANG_SRC_DIR=$TOP_DIR/llvm-$CLANG_VERSION
#export CLANG_BLD_DIR=$TOP_DIR/llvm-$CLANG_VERSION-build
#export CLANG_INSTALL_RELDIR=`echo $CLANG_INSTALL_PREFIX | sed 's:^/::'`
#
#export LIBCXX_SRC_DIR=$TOP_DIR/libcxx-$CLANG_VERSION
#export LIBCXX_BLD_DIR=$TOP_DIR/libcxx-$CLANG_VERSION-build
#
#export CLANG_STAGEDIR=$TOP_DIR/dist
#
#if [ "$CLANG_PLATFORM" == "FreeBSD" ]
#then
# export CLANG_MAKE=gmake
#
#elif [ "$CLANG_PLATFORM" == "Linux" ]
#then
# export GCC_BIN=$GCC_INSTALL_PREFIX/bin/gcc
# export CLANG_MAKE=make
#else
# echo "Unknown build platform!"
# exit 1
#fi
#
#if [ -z "$NO_PARSE_OPTS" ]
#then
# if [ $# == "0" ]
# then
# DO_CLANG=YES
# DO_CXXLIB=YES
# DO_TEST=YES
# else
# while getopts ":clhtT" opt
# do
# case $opt in
# c ) DO_CLANG=YES ;;
# l ) DO_CXXLIB=YES ;;
# h ) echo "usage: $0 [-c] [-l] [-h] [-t|-T]"
# exit 1 ;;
# t ) DO_TEST=YES ;;
# T ) DO_TEST= ;;
# * ) echo "usage: $0 [-c] [-l] [-h] [-t|-T]"
# exit 1 ;;
# esac
# done
# fi
#fi
#
##./fetch-clang.sh
#
#mkdir -p ./tarballs
#cd ./tarballs
#
#echo "Checking for required tarballs... "
#
#if [ ! -e $LLVM_TARBALL ]
#then
# echo "Downloading $LLVM_TARBALL... "
# wget http://llvm.org/releases/$CLANG_VERSION/$LLVM_TARBALL
#fi
#
#if [ ! -e $CFE_TARBALL ]
#then
# echo "Downloading $CFE_TARBALL... "
# wget http://llvm.org/releases/$CLANG_VERSION/$CFE_TARBALL
#fi
#
#if [ ! -e $CRT_TARBALL ]
#then
# echo "Downloading $CRT_TARBALL... "
# wget http://llvm.org/releases/$CLANG_VERSION/$CRT_TARBALL
#fi
#
#if [ ! -e $CTX_TARBALL ]
#then
# echo "Downloading $CTX_TARBALL... "
# wget http://llvm.org/releases/$CLANG_VERSION/$CTX_TARBALL
#fi
#
#if [ ! -e $LIB_TARBALL ]
#then
# echo "Downloading $LIB_TARBALL... "
# wget http://llvm.org/releases/$CLANG_VERSION/$LIB_TARBALL
#fi
#
#cd ..
#
###- Unpack, configure, and build LLVM and CLANG.
###
#./unpack-clang.sh -c
#./configure-clang.sh -c
#./make-clang.sh -c
#
###- Unpack, configure, and build LIBCXX
###
#./unpack-clang.sh -l
#./configure-clang.sh -l
#./make-clang.sh -l
#
#./stage-clang.sh
#./pack-clang.sh
#sudo tar -zxvf ./packages/kewb-clang60X*.tgz
## ./make-clang-rpm.sh -v
#
#clang --version
sudo -E wget https://releases.hashicorp.com/vagrant/2.2.3/vagrant_2.2.3_x86_64.deb --no-check-certificate
sudo -E dpkg -i vagrant_2.2.3_x86_64.deb
sudo -E apt-get install -f
sudo -E rm vagrant_2.2.3_x86_64.deb
sudo -E apt-get -y install software-properties-common
sudo -E apt-get -y install gcc make linux-headers-$(uname -r) dkmsvirtualbox >= 5.1 https://www.virtualbox.org/wiki/Linux_Downloads
sudo -E wget https://download.virtualbox.org/virtualbox/6.0.4/virtualbox-6.0_6.0.4-128413~Ubuntu~bionic_amd64.deb --no-check-certificate
sudo -E dpkg -i virtualbox-6.0_6.0.4-128413~Ubuntu~bionic_amd64.deb
sudo -E apt-get install -f
sudo -E rm virtualbox-6.0_6.0.4-128413~Ubuntu~bionic_amd64.deb
sudo -E modprobe vboxdrv
sudo -E modprobe vboxnetflt
sudo -E modprobe vboxpci
sudo -E modprobe vboxnetadp
lsmod | grep vboxsudo -E apt-get install nfs-kernel-server -y
sudo -E apt-get install nfs-common -ySEE https://askubuntu.com/a/973540 and https://stackoverflow.com/a/51565653/1373413
sudo -E wget https://www.openssl.org/source/old/1.1.0/openssl-1.1.0g.tar.gz
tar xzvf openssl-1.1.0g.tar.gz
cd openssl-1.1.0g
./config
make
sudo make install/usr/local/bin/openssl version -a
cd /usr/local/src/
sudo -E wget https://releases.hashicorp.com/packer/1.3.4/packer_1.3.4_linux_amd64.zip --no-check-certificate
sudo -E unzip packer_*.zip
sudo -E rm -rf /usr/local/src/packer_*.zip
yes | sudo -E mv -f /usr/local/src/packer /usr/local/bin/packer
sudo -E chmod +x /usr/local/bin/packer
packer versionsudo -E apt-get update
sudo -E apt-get install git -y
sudo -E apt-get install python-paramiko -y
sudo -E apt-get install python-jinja2 -y
sudo -E apt-get install python-yaml -y
sudo -E apt-get install python-crypto -y
sudo -E apt-get install python-pip -y
cat << EOT > ~/install_ansible.sh
#!/bin/bash
sudo -E apt-get install -y build-essential python-dev python-setuptools
cd /tmp && wget https://github.com/ansible/ansible/archive/v2.7.8.tar.gz --no-check-certificate
tar xzf v2.7.8.tar.gz
cd ansible-2.7.8* && sudo -E python setup.py install
EOT
bash ~/install_ansible.sh
sudo echo 'export PATH=$PATH:/usr/local/bin' >> /etc/profile
source /etc/profile
ansible --versionsudo -E apt-get install cppcheck -y
cmake-3.13.4.tar.gz --no-check-certificate
tar -zxvf cmake-3.13.4.tar.gz
pwd
ls -artl
cd cmake-3.13.4
./bootstrap --prefix=/usr/local
cmake --build . -- -j4
make install
export PATH=/usr/local/bin:/usr/bin:$PATH:$HOME/bin
echo "PATH=$PATH" >> ~/.bash_profile
source ~/.bash_profile
cmake --version
# This will create a checksum of "myFile" while downloading and save it to the file MD5SUM, possibly saving you some time.
wget -O - https://cmake.org/files/v3.13/cmake-3.13.4.tar.gz --no-check-certificate | tee myFile | md5sum | awk '{print $1}' > ~/md5.txt
echo "b5a544ffc73f6922a6cf371fcb6bae22" >> ~/md5check.txt
cat >> ~/mdcheck.sh << EOF
#!/bin/bash
echo "md5 = `cat ~/md5.txt`"
echo "md5check = `cat ~/md5check.txt`"
if [ "`cat ~/md5.txt`" != "`cat ~/md5check.txt`" ]; then
echo "md5sum failed. Please check the md5sum. File may possibly be corrupted."
else
echo "md5sum passed ;)"
fi
EOF
sh ~/mdcheck.sh
TODO
- name: Install docker
yum: name={{ item }} state=present
with_items:
- docker-io
notify:
- start docker daemon
- start docker on boot
# Same as sudo groupadd docker
- name: Ensure group "docker" exists
group:
name: docker
state: present
# Same as sudo usermod -aG docker vagrant
# groups: you can use a comma separated list: admin,sudo.
# if you omit append: yes, user will be removed from all other groups
- name: Add user to docker group
user: name={{ ansible_ssh_user }} groups=docker append=yes
- vim-enhanced
- htop
- socat
- ack
- libnotify
- rsync
- nasm
- ltrace
- ctags
- cscope
- xz
- elinks
- pam-devel
- openssl-devel
- libpcap-devel
- tig
- gdb
- graphviz
- valgrind
- automake
- kcachegrind
- ccache
- doxygen
- bison
- flex
- cppcheck
- sudo
- tmux
- wget
- xz-libs
- zlib
- openssl
- curl
- expat
- libuuid
- libuuid-devel
- mlocate
- iftop
- htop
- yum-plugin-fastestmirror
- ncurses
- ncurses-devel
- unzip
- iperf
- screen
- yum-utils
yum -y install SDL2-devel # https://apps.fedoraproject.org/packages/SDL2-devel/
yum -y groupinstall "X Software Development"
# yum search SDL2 # look for libraries and development headers should something like sdl2.0 and sdl2.0.0-dev
# emscripten
# see https://blog.cles.jp/item/9428
# see https://blog.csdn.net/martinking1997/article/details/82460849
# Python preinstalled!
# Install Python
# yum -y install python2.7
# Install node.js
echo "strict-ssl=false" >> ~/.npmrc
echo "registry=http://registry.npmjs.org/" >> ~/.npmrc
yum -y install nodejs
export NODE_TLS_REJECT_UNAUTHORIZED=0
#export NODE_EXTRA_CA_CERTS=/etc/pki/ca-trust/source/anchors/yourCerts.pem
echo 'NODE_TLS_REJECT_UNAUTHORIZED=0' >> ~/.bashrc
node --version
yum -y install npm
# see https://stackoverflow.com/a/18346387
npm config set strict-ssl false
# Then set npm to run with http, instead of https:
npm config set registry "http://registry.npmjs.org/"
npm --version
npm config list
# you may get NPM to work behind a proxy by setting BOTH HTTP_PROXY and HTTPS_PROXY environment variables,
# npm config set proxy http://proxy_host:port
# npm --without-ssl --insecure --proxy http://username:password@cacheaddress.com.br:80\ install packagename
npm install -g pm2
# CMake preinstalled!
# Install CMake (optional, only needed for tests and building Binaryen)
# sudo apt-get install cmake
# Install Java (optional, only needed for Closure Compiler minification)
# jre
yum -y install java-1.8.0-openjdk
# jdk
yum -y install java-1.8.0-openjdk-devel
# clone emsdk
GIT_SSL_NO_VERIFY=true git clone https://github.com/emscripten-core/emsdk.git
# Enter that directory
cd emsdk
# Fetch the latest version of the emsdk (not needed the first time you clone)
git pull
# Download and install the latest SDK tools.
# see https://hub.docker.com/r/minextu/sdl2-cross-platform/dockerfile/
./emsdk install -j2 --build=MinSizeRel latest
# Make the "latest" SDK "active" for the current user. (writes ~/.emscripten file)
./emsdk activate latest
# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh
cat ./emsdk_env.sh
#export PATH="/home/wes/.emscripten-install:$PATH"
#export PATH="/home/wes/.emscripten-install/clang/e1.37.21_64bit:$PATH"
#export PATH="/home/wes/.emscripten-install/node/4.1.1_64bit/bin:$PATH"
#export PATH="/home/wes/.emscripten-install/emscripten/1.37.21:$PATH"
echo $PATH
# see https://hub.docker.com/r/minextu/sdl2-cross-platform/dockerfile/
# see https://stackoverflow.com/a/38227522
echo "source $(pwd)/emsdk_env.sh" >> ~/.bashrc
emcc -v
cd ..
pwd
ls -artl
#echo " IMPORTANT TO DO !!!! #-----------------------------------------------------------------------------#---------"
#echo " Open the file ./emsdk/emsdk_set_env.sh and copy its content into your #.bashrc file in your home folder"
#echo " This is used to supply the proper path to EMSCRIPTEN"
#echo " #-----------------------------------------------------------------------------#------------------------------"
# PATH="/opt/emsdk_portable:/opt/emsdk_portable/clang/fastcomp/build_master_64/bin:/opt/emsdk_portable/node/4.1.1_64bit/bin:/opt/emsdk_portable/emscripten/master:${PATH}"
ebook utils
docker container to convert ebooks with calibre.
epub to pdf
djvu to pdf
create ebooks with css
The Blitz’ introductory tutorial
1 Document 2 Rule them All 3: Kindle eBook, PDF and Web Page
Blitz tips