Skip to content

Instantly share code, notes, and snippets.

View asiraky's full-sized avatar

Aaron HS asiraky

  • Sunshine Coast, Australia
  • 02:16 (UTC +10:00)
View GitHub Profile
public static class ConfiguredValues
{
public static int Get(Func<DynamicLookup, dynamic> value, int defaultValue)
{
int returnValue;
var globalSettingValue = value(DynamicLookup.Resolve);
if (globalSettingValue is int)
{
returnValue = globalSettingValue;
@asiraky
asiraky / gist:4ea5136e54c8df2de3fb6689f0a5ce18
Created March 24, 2021 07:21
Ubuntu 20.04 SQL Server ODBC Drivers for PHP 7.2
#run through the steps detailed here to install the odbc drivers for Ubuntu 20
https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#ubuntu17
#then force pecl to use 7.2
sudo pecl -d php_suffix=7.2 install sqlsrv-5.3.0
sudo pecl -d php_suffix=7.2 install pdo_sqlsrv-5.3.0
sudo bash -c 'echo "extension=sqlsrv.so" > /etc/php/7.2/mods-available/sqlsrv.ini'
sudo bash -c 'echo "extension=pdo_sqlsrv.so" > /etc/php/7.2/mods-available/pdo_sqlsrv.ini'
FROM php:7.2-fpm-buster
RUN apt-get update && \
apt-get install -y cron
# TLDR: CRON and Docker don't play well together.
#
# The idiomatic way to handle logging in docker is to output to stdout. This is achieved by
# redirecting the program output to /proc/1/fd/1 e.g. * * * * * echo hello > /proc/1/fd/1 2>&1. However, if you have a
# non-root user cron job, this is not possible due to the non-root user not being able to write to /proc/1/fd/1 which