Skip to content

Instantly share code, notes, and snippets.

View davidalger's full-sized avatar

David Alger davidalger

View GitHub Profile
FROM debian:jessie
ENV BUILD_PKG "automake bzip2 cmake make g++ gcc git-core libssl-dev patch binutils"
RUN apt-get update && apt-get install -y \
libssl1.0.0 openssl ssl-cert $BUILD_PKG \
vim mysql-client && \
cd /usr/local/src && \
git clone -b 2018-04-01 --depth 1 --single-branch https://github.com/google/re2.git && \
git clone -b v1.4.8 --depth 1 --single-branch https://github.com/sysown/proxysql.git && \
@davidalger
davidalger / redis-type-configuration-example.php
Created September 14, 2018 21:19
Magento 2 Redis Type Configuration Example
<?php
'cache' =>
array (
'frontend' =>
array (
'default' =>
array (
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' =>
array (
@davidalger
davidalger / 1_kubernetes_on_macOS.md
Created September 18, 2018 17:59 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@davidalger
davidalger / env.php.dev
Created November 8, 2018 16:19
m2 example env.php configuration for dev
<?php
return [
'backend' => [
'frontName' => 'backend'
],
'crypt' => [
'key' => '<your_crypt_key_here>'
],
'install' => [
'date' => '<your_date_here>' // get this by running 'date' command
@davidalger
davidalger / bitbucket-backup.sh
Created November 9, 2018 15:51
Pulls backups from all repositories in BitBucket only if changed since last run
#!/bin/bash
#
# backup.sh
#
# Created by David Alger on 2015-03-13
# Copyright 2015 David Alger. All rights reserved.
#
##################################################
## Initialize our environment
@davidalger
davidalger / setup-gcp-billing-account.md
Created November 13, 2018 02:13
Instructions for setting up a billing account on GCP
  1. Login to the Google Cloud Console via following URL: https://console.cloud.google.com/billing

  2. Click "Add billing account" and create a new billing account named "My Company"

  • Step 1: You should be asked to agree to the TOS for Google Cloud, unless you've already done so in the past.

  • Step 2: Create a new payments profile filling in current business name and address plus payment card information which will be used after the free trial period expires and/or $300 of free credit is consumed.

  1. You should be taken to a welcome screen, go ahead and just click "Continue" to close the welcome popup after it presents itself.
@davidalger
davidalger / magento2-order-counts.sql
Last active March 8, 2023 10:57
magento2-order-counts.sql
SET @utc_offset = 6;
-- Orders Per Year --
SELECT period_date, CONCAT("UTC-", @utc_offset) AS utc_offset, order_count, gross_revenue, ROUND(gross_revenue / order_count, 2) AS gross_aov
FROM (
SELECT
COUNT(*) AS order_count,
ROUND(SUM(base_grand_total), 2) AS gross_revenue,
date_format(date_sub(o.created_at, INTERVAL @utc_offset HOUR), "%Y") AS period_date
FROM sales_order o
@davidalger
davidalger / composer_private_repos.sh
Created November 24, 2018 23:49 — forked from mttjohnson/composer_private_repos.sh
Composer Notes and Private Repositories
# List the composer home directory
# Typically /Users/<user>/.composer or /home/<user>/.composer or C:\Users\<user>\AppData\Roaming\Composer
echo $COMPOSER_HOME
# List files in the composer home
ls -la $COMPOSER_HOME
# View auth.json in composer home used when no local ./auth.json exists in the directory executed from
cat $COMPOSER_HOME/auth.json

Configure Valet+ to NOT require a password for sudo

echo "%admin ALL = NOPASSWD: /usr/local/bin/valet" | sudo tee /etc/sudoers.d/valet-nopasswd

Enable macOS Server Performance Mode

For more details see this page.

sudo nvram boot-args="serverperfmode=1 $(nvram boot-args 2>/dev/null | cut -f 2-)"
sudo reboot
@davidalger
davidalger / README.md
Created December 4, 2018 04:22 — forked from erikhansen/README.md
Example README.md file for Magento 2 project

Title of Site

Developer Setup

Run through the following steps to setup this project on your local environment. These instructions assume you're using the standard Classy Llama devenv.

Server Access

Use the following to connect to stage.