subscription-manager repos –enable rhel-server-rhscl-7-eus-rpms yum install rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl rh-php72-php-pecl-apcu yum install rh-php72-php-mysqlnd Ref: https://docs.nextcloud.com/server/15/admin_manual/installation/php_72_installation.htmlRead More →

I came up with this little script url=’https://www.mywebsite.com’; await page.goto(url, { waitUntil: ‘networkidle0’ }); await page.type(‘#logonIdentifier’, ‘[email protected]’); await page.type(‘#password’, ‘mypassword’); await page.screenshot({ path: ‘/puppeteer/step01.png’}); //this is where i handle popup windows page.on(‘dialog’, async dialog => { console.log(dialog.message()); await dialog.dismiss(); // or await dialog.accept() }); await page.click(‘#next’); await page.waitForNavigation(); console.log(await page.content()); await page.screenshot({ path: ‘/puppeteer/step03.png’});Read More →

When we use Curl or a curl library to some https website – we receive this error ” error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small” This is because Ubuntu set the SSL at a higher level of security – the target website is still using the old settings – if we can’t control the destination server, then we have to change our client – meaning we have to lower our security standard. this is how you can do it. In /etc/ssl/openssl.cnf, add this line before the start of the file: openssl_conf = default_conf At the end of the file, add these lines: [default_conf] ssl_conf = ssl_sect [ssl_sect]Read More →

apt install composer composer require microsoft/application-insights Create a new file: <?php $telemetryClient = new \ApplicationInsights\Telemetry_Client(); $context = $telemetryClient->getContext(); $script_start_time=microtime(true); register_shutdown_function(‘myshutdown’); // Necessary $context->setInstrumentationKey(‘yourkey’); function myshutdown() { global $script_start_time,$telemetryClient; $url = $_SERVER[“HTTP_HOST”].$_SERVER[“REQUEST_URI”]; $requestName = $_SERVER[“SCRIPT_FILENAME”]; $duration = microtime(true)-$script_start_time; $extra_data=array(); $extra_data[“client.user_agent”]=@$_SERVER[‘HTTP_USER_AGENT’]; $extra_data[“client.client_ip”]=@$_SERVER[‘REMOTE_ADDR’]; $telemetryClient->trackRequest($requestName, $url, @$_SERVER[“REQUEST_TIME”], $duration*1000, http_response_code(),true,$extra_data ); $telemetryClient->flush(); } ?> Modify file vendor/microsoft/application-insights/ApplicationInsights/Channel/Telemetry_Channel.php public function send($options = array(), $sendAsync = false) { $response = null; $useGuzzle = $this->_client !== null; if (count($this->_queue) == 0) { return; } $serializedTelemetryItem = $this->getSerializedQueue(); if($this->_sendGzipped && $useGuzzle) { $headersArray = array( ‘Content-Encoding’ => ‘gzip’, ); $body = gzencode($serializedTelemetryItem); } else { $headersArray = array( ‘Accept’ => ‘application/json’, ‘Content-Type’ => ‘application/json;Read More →

We have so many application insights created in our environment. It’s not easy to see which application is reporting correctly. I want to have a report how many requests that the application is sent to Application Insights. This will help us to identify if there is a problem with integration or the application is no longer in production or might be it can help to detect the application is down for long time. Finally i come with a solution with PHP and Azure CLI . I create a file name report.php ( see the file at the bottom) . Here is the step to run:Read More →

I’m a fan of PHP and docker make my life better. It’s difficult to maintain our favorite tool in a live system as our host system keeps updating and it could break our tool. I want to run Azure CLI in a docker environment. It’s easy to start , just using this command: docker run -it mcr.microsoft.com/azure-cli My problem is that, this Microsoft image doesn’t have the tool i need – it’s PHP. I want to do some cool stuff with PHP and Azure CLI. So, why don’t we build a new Azure CLI image from our existing Microsoft Azure CLI ? Finally, i goRead More →

I’m using smokeping, i see a bunch of files that is no longer needed. To be safe, i want to rename find these files and rename them. I came with this solution find /var/lib/smokeping/rrd/ -name “*.rrd” -type f -mtime +30 -exec bash -c ‘mv $0 $(echo “$0” | sed -r “s|\.rrd|\.rrd\.old|g”)’ ‘{}’ \; The above command will find all files with ext .rrd and not modified in the last 30 days.Read More →