Skip to content

Instantly share code, notes, and snippets.

lnrsoft lnrsoft

Block or report user

Report or block lnrsoft

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lnrsoft
lnrsoft / roll-a-die.cpp
Created Jan 23, 2019
Roll a 6-sided die 5 times using c++
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';
@lnrsoft
lnrsoft / box-it.cpp
Last active Jan 21, 2019
Box It HRANK problem in c++
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;
@lnrsoft
lnrsoft / Enabling HTTP2 in Apache on Ubuntu 18.04
Created Dec 21, 2018
Enabling HTTP2 in Apache on Ubuntu 18.04
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:
@lnrsoft
lnrsoft / Set qmake home on ubuntu
Last active Dec 9, 2018
Set qmake home on ubuntu
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
@lnrsoft
lnrsoft / install_opencv-4.0.0_on_ubuntu.sh
Created Dec 8, 2018
Install OpenCV 4.0.0 on Ubuntu 18.04, 18.10
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 |
@lnrsoft
lnrsoft / enable http2 on ubuntu server
Created Nov 19, 2018
enable http2 on ubuntu server
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
@lnrsoft
lnrsoft / enable http2 on ubuntu server
Created Nov 19, 2018
enable http2 on ubuntu server
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
@lnrsoft
lnrsoft / Install or Upgrade to PHP 7.X on Ubuntu
Created Nov 18, 2018
Install or Upgrade to PHP 7.X on Ubuntu
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
@lnrsoft
lnrsoft / quick generate ssh key on osx terminal
Created Nov 15, 2018
quick generate ssh key on osx terminal
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
@lnrsoft
lnrsoft / quick generate pgp key on osx terminal
Created Nov 15, 2018
quick generate pgp key on osx terminal
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
You can’t perform that action at this time.