Skip to content

Instantly share code, notes, and snippets.

View cbj4074's full-sized avatar

Ben Johnson cbj4074

View GitHub Profile
@cbj4074
cbj4074 / index.php
Last active February 29, 2020 00:20
Changes required to use non-standard public directory in Laravel 5
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylorotwell@gmail.com>
*/
/*
@cbj4074
cbj4074 / php7-ssh2-segfault-test.php
Created November 1, 2016 20:58
Demonstrates segfault that occurs with PHP 7.0.12 and PECL ssh2 extension, version 1.0
<?php
class ssh2
{
private $host = 'host';
private $user = 'user';
private $port = '22';
private $password = 'password';
private $con = null;
@cbj4074
cbj4074 / README.md
Last active December 20, 2023 15:57
Creating a Certificate Authority for Self-Signing TLS Certificates with OpenSSL

Creating the CA (Certificate Authority)

There is quite a bit of preparation and configuration required to create a CA. Fortunately, once the configuration is correct, the remainder of the process is relatively simple.

Create necessary directories and files

Absent these directories, openssl will emit errors during certain steps throughout the overall process.

$ cd ~
@cbj4074
cbj4074 / gist:fcc5cee405b0d176b88aac633cf4069b
Created May 15, 2018 21:09
Homestead box v6.0.0 provisioning failure output
> vagrant destroy
homestead-7: Are you sure you want to destroy the 'homestead-7' VM? [y/N] y
==> homestead-7: Destroying VM and associated drives...
> vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Importing base box 'laravel/homestead'...
==> homestead-7: Matching MAC address for NAT networking...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: Setting the name of the VM: homestead-7
@cbj4074
cbj4074 / oracle-instant-client.sh
Created May 17, 2018 16:19
Shell script to install Oracle OCI8 extension for PHP on Ubuntu
#!/bin/sh
echo 'Installing Oracle Instant Client...'
export DEBIAN_FRONTEND=noninteractive
apt-get -yq install libaio1 unzip php-dev
# See: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html#ic_x64_inst
client_version='12_2'
@cbj4074
cbj4074 / configure-and-make-output-oci8-ubuntu1804.txt
Created May 18, 2018 14:53
Configure and Make output for Oracle OCI8 extension on Ubuntu 18.04 LTS
root@homestead:/usr/local/src/oci8-2.1.8# phpize7.2
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
autoconf: warning: both `configure.ac' and `configure.in' are present.
autoconf: warning: proceeding with `configure.ac'.
autoheader: 'configure.ac' and 'configure.in' both present.
autoheader: proceeding with 'configure.ac'
root@homestead:/usr/local/src/oci8-2.1.8# ./configure --with-php-config=/usr/bin/php-config7.2 --with-oci8=instantclient,/opt/oracle/instantclient_12_2
@cbj4074
cbj4074 / strace-output.txt
Last active June 1, 2018 18:35
strace output from php7.2-fpm startup capturing failure for oci8.so to be loaded due to missing libmql1.so
17:00:39 openat(AT_FDCWD, "/usr/lib/php/20170718/oci8.so", O_RDONLY|O_CLOEXEC) = 3
17:00:39 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\265\0\0\0\0\0\0@\0\0\0\0\0\0\0hK\n\0\0\0\0\0\0\0\0\0@\0008\0\7\0@\0$\0#\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0Hs\2\0\0\0\0\0Hs\2\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0\360v\2\0\0\0\0\0\360v\"\0\0\0\0\0\360v\"\0\0\0\0\0\270A\0\0\0\0\0\0\260B\0\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0\0\255\2\0\0\0\0\0\0\255\"\0\0\0\0\0\0\255\"\0\0\0\0\0\360\1\0\0\0\0\0\0\360\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0$\0\0\0\0\0\0\0$\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0P\345td\4\0\0\0@F\2\0\0\0\0\0@F\2\0\0\0\0\0@F\2\0\0\0\0\0\324\5\0\0\0\0\0\0\324\5\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0R\345td\4\0\0\0\360v\2\0\0\0\0\0\360v\"\0\0\0\0\0\360v\"\0\0\0\0\0\0209\0\0\0\0\0\0\0209\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4
@cbj4074
cbj4074 / ldd-and-objdump-oci8-ubuntu18.txt
Last active June 4, 2018 18:39
ldd and objdump -p output for oci8.so and dependencies
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
# echo $LD_LIBRARY_PATH
/opt/oracle/instantclient_12_2
@cbj4074
cbj4074 / vagrant-trigger-debug.txt
Created August 7, 2018 21:14
Debug output for issue "Using inline script in trigger causes Ruby syntax violation"
INFO global: Vagrant version: 2.1.2
INFO global: Ruby version: 2.4.4
INFO global: RubyGems version: 2.6.14.1
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.1.2\\gems\\vagrant-2.1.2\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
INFO global: Plugins:
@cbj4074
cbj4074 / vagrant-homestead-hyperv-failure.txt
Created November 12, 2018 16:51
Output of vagrant destroy && vagrant up
>vagrant destroy && vagrant up
==> homestead-7: VM not created. Moving on...
Bringing machine 'homestead-7' up with 'hyperv' provider...
==> homestead-7: Verifying Hyper-V is enabled...
==> homestead-7: Verifying Hyper-V is accessible...
==> homestead-7: Importing a Hyper-V instance
homestead-7: Creating and registering the VM...
An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please