Author: isayeter

Let’s encrypt Certbot error

If you receive Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA. error in certbot. You can solve the problem by doing these: First, stop nginx or your http service. service nginx stop then start certbot like this: certbot --authenticator standalone --installer nginx -d yourdomain.com...

Read More

NodeJS MySQL package not fire “pool.getConnection()”

I used MySQL npm package in my one of NodeJS projects. When I was testing my program, I realized that after a while “pool.getConnection(function(err, connection)” blocks were not be fired. There was neither any error nor any output. After reading documentations, I found the problem. I forgot to release connections on some lines. The total number of available connection pools is 10 by default, so if you forgot to release your connections, after calling “pool.getConnection” function 10 times, it will never be fired again and connections will be queued. You can catch queued connections by; pool.on('enqueue', function () {...

Read More

About Provability and how we can use in MySQL

You may have heard about an algorithm called “provability” which is commonly used at online gambling websites. Provability means “provable” + “probability”, that means all lucky numbers created by the provider are provable. Here is a sample PHP code to create provable RANDOM number between 0.00 and 99.99 function provability($serverseed) { $clientseed = "94c6c5f4f8a26f56031eb973370af3c4"; //keep static, it's better to use 32 char sha1 string. to create a new one: "echo rand_sha1(32); function rand_sha1($length) {$max = ceil($length / 40);$random = '';for ($i = 0; $i < $max; $i++) {$random .= sha1(microtime(true) . mt_rand(10000, 90000));}return substr($random, 0, $length);}" $c = $clientseed; $result...

Read More

FFmpeg Centos 7 Installation

  If you want to use FFmpeg Library with your PHP, here it is; sudo rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm sudo yum install ffmpeg ffmpeg-devel -y After that, install FFmpeg PHP extension; https://github.com/char0n/ffmpeg-php Sample Code; if (class_exists("ffmpeg_movie")) { $mov = new ffmpeg_movie($source_video); $frame = $mov->getFrame(10); //take a screenshot image of frame 10 if ($frame) { $gd_image = $frame->toGDImage(); if ($gd_image) { imagepng($gd_image, $to_path."/".$filename); imagedestroy($gd_image); //save image. } }...

Read More