Instantly share code, notes, and snippets.

lnrsoft lnrsoft

View GitHub Profile
View roll-a-die.cpp
#include <cstdlib>
#include <iostream>
#include <ctime>
int main()
{
std::srand(std::time(nullptr));
int random_variable = std::rand();
std::cout << "Random value on [0 " << RAND_MAX << "]: "
<< random_variable << '\n';
View box-it.cpp
// This source code written by Roland Ihasz
#include<bits/stdc++.h>
// #include <iostream>
using namespace std;
class Box {
private:
int l, b, h;
View Enabling HTTP2 in Apache on Ubuntu 18.04
$ sudo apt-get install php7.2-fpm
$ sudo a2enmod proxy_fcgi
$ sudo a2enconf php7.2-fpm
$ sudo a2dismod php7.2
$ sudo a2dismod mpm_prefork
$ sudo a2enmod mpm_event
$ sudo service apache2 restart
#nstalling and Enabling HTTP/2 in Apache
#Enable the module mod_http2:
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