Posts

Showing posts from May, 2020

Running Background Tasks From SSH

Most online sources will tell you that you need a tool such as Screen to be able to run background tasks from an SSH session. But the simplest way is to simply configure an a Cron job. The process will continue to run even after the SSH session is disconnected. The process can also be monitored later with PS (pipe through grep to find it), and even terminated with Kill if necessary.

PHP Custom timeout for file_get_contents

$CustStreamContext = stream_context_create (     array     (         'http'=> array         (                     'timeout' => 0.5,  //0.5 seconds             )     ) );         $Cont = @file_get_contents("https://www", false, $CustStreamContext);