Skip to content

Instantly share code, notes, and snippets.

View markshust's full-sized avatar
🤓
Currently exploring building production apps with Claude Code & AI.

Mark Shust markshust

🤓
Currently exploring building production apps with Claude Code & AI.
View GitHub Profile
@markshust
markshust / README.md
Last active February 28, 2017 16:43
Setup Drupal 8 on Docker

#Installing Drupal 8 with Docker

First, create and enter a directory on your host machine to act as a project root:

mkdir -p ~/Sites/drupal8 && cd $_

Then, execute the following line to use Composer to install the Drupal 8 files with correct permissions into a www subdirectory of your project root:

docker run --rm -v $PWD/html:/var/www/html composer create-project drupal-composer/drupal-project:8.x-dev /var/www/html --stability dev --no-interaction

@markshust
markshust / gist:5b6bfd51602da29d7964a155d6752a40
Created April 3, 2017 23:17
Prune all google storage buckets that occured over X months ago
#!/bin/bash
## Author: Mark Shust <[email protected]>
## Version: 1.0.0
## This script looks for folders with the following naming structure:
## gs://bucket/subdir/2017-03-01/
## Prune all google storage buckets that occured over X months ago
MONTHSAGO=3
#linux
@markshust
markshust / alias-docker-compose.sh
Created April 19, 2017 19:57 — forked from maxclaus/alias-docker-compose.sh
Aliases for docker-compose
alias c='docker-compose'
alias cb='docker-compose build'
alias cup='docker-compose up'
alias cr='docker-compose run --service-ports --rm'
alias crl='docker-compose run --service-ports --rm local'
alias crd='docker-compose run --service-ports --rm develop'
alias crt='docker-compose run --rm test'
alias crp='docker-compose run --rm provision'
alias crci='docker-compose run --rm ci'
alias crwt='docker-compose run --rm watchtest'
@markshust
markshust / gist:891f185fce6b04681be7ab2413242c25
Last active April 29, 2022 07:31
create MySQL dump of one specific MySQL table from a full database dump
sed -n -e '/DROP TABLE.*`table_name`/,/UNLOCK TABLES/p' db.sql > db.table_name.sql
@markshust
markshust / new_domain.php
Created June 14, 2017 20:51
update current domain with new subdomain in laravel, http or https
<?php
$new_domain = preg_replace('#^(https?):\/\/(.*)#', '$1://subdomain-goes-here.$2', \Illuminate\Support\Facades\Request::root());
@markshust
markshust / kadira-apm-setup-README.md
Last active June 11, 2020 02:04
Kadira APM Setup

Kadira APM Setup

Short guide on how to get Kadira APM setup with Docker.

  1. Setup at least on instance with 1.7GB RAM.
  2. Open up firewall ports for inbound TCP port 443. Also open up 11011 & 4000 for debugging. Port 11011 is kadira-engine, port 4000 is the kadira-ui.
  3. Setup a Mongo database, and have the connection string ready (with username and password).
  4. Install Docker https://docs.docker.com/engine/installation/linux/docker-ce/debian/ , run sudo usermod -aG docker your-user, then install Docker Compose https://docs.docker.com/compose/install/ on the instance.
  5. Verify that you have docker and docker compose installed correctly and can use it.
  6. Setup A-records to point your kadira-ip to kadira-engine.domain.com and kadira-ui.domain.com.
@markshust
markshust / gist:b10c90fd7ba39907a84b0ddea40b3c6a
Created August 29, 2017 19:04 — forked from rogerclotet/gist:3901b03107437b247b03
Execute PHPUnit disabling xdebug
# Before using these aliases and function you must make a backup of your xdebug.ini
# (in this case /etc/php/conf.d/xdebug.ini.back)
# You will also need to be able to edit xdebug.ini
alias xdebug-disable='echo "" > /etc/php/conf.d/xdebug.ini'
alias xdebug-restore='cat /etc/php/conf.d/xdebug.ini.back > /etc/php/conf.d/xdebug.ini'
phpu() {
xdebug-disable
phpunit "$@"
@markshust
markshust / gist:c16c56525f55b71527f36faa4bd166ab
Created August 29, 2017 19:04 — forked from rogerclotet/gist:3901b03107437b247b03
Execute PHPUnit disabling xdebug
# Before using these aliases and function you must make a backup of your xdebug.ini
# (in this case /etc/php/conf.d/xdebug.ini.back)
# You will also need to be able to edit xdebug.ini
alias xdebug-disable='echo "" > /etc/php/conf.d/xdebug.ini'
alias xdebug-restore='cat /etc/php/conf.d/xdebug.ini.back > /etc/php/conf.d/xdebug.ini'
phpu() {
xdebug-disable
phpunit "$@"
@markshust
markshust / docker-compose.yml
Created November 3, 2017 17:25
kadira docker compose yaml
version: '2'
services:
kadira-engine:
image: vladgolubev/kadira-engine
ports:
- "11011:11011"
environment:
- PORT=11011
- MONGO_URL=${MONGO_URL}
@markshust
markshust / gist:ac5ddb553bb09b2d8e67967be34bc152
Last active November 4, 2017 12:00
Let's Encrypt SSL certificate generation with Certbot and Docker
#replace foo.com and [email protected] with your domain and email
docker run --rm -p 80:80 -p 443:443 -v $(pwd)/certs:/etc/letsencrypt certbot/certbot certonly -d foo.com --standalone -m [email protected] --agree-tos
#create this cronjob to renew certificates
@daily docker run --rm -v $(pwd)/certs:/etc/letsencrypt certbot/certbot renew
#setup symlinks for use with nginx-proxy
ln -s ~/certs/live/foo.com/privkey.pem ~/certs/foo.com.key
ln -s ~/certs/live/foo.com/fullchain.pem ~/certs/foo.com.crt