# generate .crt and .key files
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
# generate strong Diffie-Hellman group
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
To create a custom mouse script in nautilus just put your script in ~/.local/share/nautilus/scripts/
and make sure it's executable.
var linhas = `Abandonada por você | |
Tenho tentado te esquecer | |
No fim da tarde, uma paixão | |
No fim da noite, uma ilusão | |
No fim de tudo, a solidão | |
Apaixonada por você | |
Tenho tentado não sofrer | |
Lendo antigas poesias | |
Rindo em novas companhias | |
E chorando por você |
I moved my project from Windows Desktop to Linux Home and the tests became faster.
This is related to watchman and inotify, i just moved my project from Windows Desktop to Linux home and watch mode start to work. This ocours because inotify doesn't work correctly ousite a linux file system. Issue Here
SQL Server function to calc distance between two coordinates
create FUNCTION [dbo].[fncCalcula_Distancia_Coordenada](
@decLat1Deg DECIMAL(9,6), -- First latitude in degrees.
@decLon1Deg DECIMAL(9,6), -- First longitude in degrees.
@decLat2Deg DECIMAL(9,6), -- Second latitude in degrees.
When you use mocha with flag --watch on typescript you need to set .mocharc.json file on root folder of project to specify for mocha watch .ts files; Otherwise the terminal will spawn in the first run but will not restart when you save the file.
// .mocharc.json
{
"extension": [
"ts"
For this project i will use github as example. I have two keys id_rsa and personal_rsa.
First of all you need to create file ~/.ssh/config. Inside the file put content as follow and edit as your need
# Default configuration (ask for password if there's no key in config file)
Host *
IdentitiesOnly yes
This script below get a path to one video and stream using php, this is possible because the Range header field. If the browser doesn't allow this header the script only drop all video on response.
<?php
function streamVideo($path) {
$fileInfo = pathinfo($path);
header("Content-Disposition: inline; filename=\"{$fileInfo['basename']}\"");
if(!isset(getallheaders()['Range'])) {
echo file_get_contents($path);