Instantly share code, notes, and snippets.

View Set qmake home on ubuntu
#On Ubuntu simply export the qmake path using the following command:
$ export PATH=/opt/qt511/bin:$PATH
#Check qmake location and version:
$ which qmake && qmake -query
View install_opencv-4.0.0_on_ubuntu.sh
######################################
# INSTALL OPENCV ON UBUNTU OR DEBIAN #
######################################
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |----------------------------------------------------|
# | OS | OpenCV | Test | Last test |
# |----------------|--------------|------|-------------|
# | Ubuntu 18.10 | OpenCV 4.0.0 | OK | 18 Nov 2018 |
# | Ubuntu 18.04 | OpenCV 4.0.0 | OK | 18 Nov 2018 |
View enable http2 on ubuntu server
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
sudo apachectl stop
sudo apt-get install php7.2-fpm
sudo a2enmod proxy_fcgi setenvif
View enable http2 on ubuntu server
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
sudo apachectl stop
sudo apt-get install php7.2-fpm
sudo a2enmod proxy_fcgi setenvif
View Install or Upgrade to PHP 7.X on Ubuntu
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php7.2
sudo apt-get install php7.2-mysql
sudo apt-get install php7.2-cli php7.2-common libapache2-mod-php7.2 php7.2 php7.2-mysql php7.2-fpm
sudo apt-get install php7.2-mbstring
View quick generate ssh key on osx terminal
ssh-keygen -t rsa -b 4096 -C "your@domain.com"
ssh-add -k ~/.ssh/new_osx_id_rsa
// copy to osx clipboard
pbcopy < ~/.ssh/new_osx_id_rsa
View quick generate pgp key on osx terminal
gpg --full-generate-key
gpg --list-secret-keys --keyid-format LONG
//gpg --armor --export [insert the sec id after rsa4096/9872634985729442]
gpg --armor --export 9872634985729442
View qt511
#source: https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.11.1-bionic
sudo add-apt-repository ppa:beineri/opt-qt-5.11.1-bionic
sudo apt-get update
sudo apt install qt511-meta-full qt511creator qt511meta-dbg-full qt511-meta-minimal
View install_macport_MacOS_mojave
$ sudo xcode-select –install
$ cd ~/Desktop
$ mkdir macports
$ cd macports
$ curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.5.3.tar.gz
$ tar -xzvf MacPorts-2.5.3.tar.gz
$ cd MacPorts-2.5.3
$ ./configure
$ make
$ sudo make install
View gist:c58d314dc0e7cf0223fc073a0984ea43
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.9 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 1000
sudo update-alternatives --install /usr/bin/clang++ clang /usr/bin/clang-3.9 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 1000
sudo update-alternatives --config clang
sudo update-alternatives --config clang++