Skip to content

Instantly share code, notes, and snippets.

View pointybeard's full-sized avatar

Alannah Kearney pointybeard

View GitHub Profile
@pointybeard
pointybeard / install_php7.4.x_with_pthreads.md
Created October 2, 2021 03:30
Compiling PHP 7.4.x with pthreads enabled

Compiling PHP 7.4.x with pthreads (https://github.com/pmmp/pthreads) enabled

Install required libraries

build-essential autoconf libtool bison re2c pkg-config git-core libsqlite3-dev libonig-dev libzip-dev libltdl-dev libbz2-dev libxml2-dev libxslt1-dev libssl-dev libicu-dev libpspell-dev libenchant-dev libmcrypt-dev libpng-dev libjpeg8-dev libfreetype6-dev libmysqlclient-dev libreadline-dev libcurl4-openssl-dev

Download PHP 7.4.x source

cd /var/sources

wget https://www.php.net/distributions/php-7.4.24.tar.gz

@pointybeard
pointybeard / OpenSCADParameterParser.php
Created September 7, 2021 02:19
Parses the contents of an input scad file looking for parameters that can be set dynamically
<?php
$paramters = [];
const CONSTRAINT_TYPE_MINMAX = "minmax";
const CONSTRAINT_TYPE_SET = "set";
function determineParameterConstraintType(array $constraint): string
{
return count($constraint) == 1 ? CONSTRAINT_TYPE_MINMAX : CONSTRAINT_TYPE_SET;
@pointybeard
pointybeard / how_to_get_pdf_dimensions_on_cli.md
Last active July 29, 2021 00:08
How to get PDF page dimensions in MM from CLI

How to get PDF page dimensions in MM

Using pdfinfo

apt install poppler-utils

Then, use the following command:

pdfinfo test.pdf | grep "Page size" | grep -Eo '[-+]?[0-9]*\.?[0-9]+' | awk -v x=0.3528 '{print $1*x}'
@pointybeard
pointybeard / server_build_guide-ubuntu20.04LTS_lnmp_lamp.md
Last active November 12, 2023 20:00
Server Build Guide: Ubuntu (20.04LTS) LNMP/LAMP

Server Build Guide: Ubuntu (20.04LTS) LNMP/LAMP

This is a living document which reflects the current process, accumulated and tuned over many years, that I use to set up a Ubuntu 20.04LTS LNMP/LAMP stack from scratch. It might not suit everyone, and probably isn't without its flaws, but it's a good foundation for any new server setup, one that I use for dev and production servers alike.

If you would like a quick, no-fuss, local LNMP stack, check out my ubuntu_lnmp_docker_vagrant repository.