Skip to content

Instantly share code, notes, and snippets.

View shoemoney's full-sized avatar

Jeremy Schoemaker shoemoney

View GitHub Profile
@shoemoney
shoemoney / metrics.json
Created May 10, 2021 16:31 — forked from rawkode/metrics.json
Envoy Metrics
{
"stats": [{
"name": "access_log_file.flushed_by_timer",
"value": 0
}, {
"name": "access_log_file.reopen_failed",
"value": 0
}, {
"name": "access_log_file.write_buffered",
"value": 0
@shoemoney
shoemoney / ambassador_envoy_prometheus_grafana_dashboard.json
Created May 10, 2021 16:25 — forked from psalaberria002/ambassador_envoy_prometheus_grafana_dashboard.json
Grafana dashboard for Ambassador Envoy metrics per destination cluster
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@shoemoney
shoemoney / blog20191216-01.cfg
Created May 9, 2021 21:42 — forked from haproxytechblog/blog20191216-01.cfg
Programmatic HAProxy Configuration Using the Data Plane API
userlist dataplane-api
user dataplaneapi password $5$oui1y1Q7o$VXoOr7Ns9WLyDFkWH0LTu9oysn/zyYhF4mSQHe9Ba5D
program api
command /opt/hapee-extras/sbin/hapee-dataplane-api --host 192.168.122.14 --port 5555 -c /etc/hapee-2.0/hapee-lb.cfg -u dataplane-api -b /opt/hapee-2.0/sbin/hapee-lb -r "service hapee-2.0-lb reload" --reload-delay 5 -m /var/run/hapee-2.0/hapee-lb.sock --log-to=file --log-file=/var/log/hapee-runtime-api.log
@shoemoney
shoemoney / README.md
Created May 6, 2021 04:49 — forked from jelovac/README.md
Ubuntu Mate 20.04 XRDP setup

Ubuntu Mate 20.04 XRDP setup

Documenting XRDP setup which worked for me on Ubuntu Mate 20.04.

Some parts are taken from: http://c-nergy.be/blog/?p=14093.

Install xrdp

sudo apt install xrdp
@shoemoney
shoemoney / haproxy.conf
Created May 3, 2021 05:09 — forked from nateware/haproxy.conf
HAProxy sample config for EC2
#
# This config file is a combination of ideas from:
# http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy
# http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/
# http://wiki.railsmachine.com/HAProxy
# http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/
# http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/
# http://wiki.railsmachine.com/HAProxy
# http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9
#
@shoemoney
shoemoney / octane-on-forge.md
Created April 12, 2021 08:24 — forked from viezel/octane-on-forge.md
Quickly get Octane running on Laravel Forge

Quickly get Octane running on Laravel Forge

  1. Spin up a new App server, choose PHP 8
  2. SSH into it and run sudo -i to become root
  3. Run pecl install swoole and enable what you need. (I disabled curl as it did not work for me)
  4. Add a new Site to your server and use git to pull in your Laravel project that has Octane installed.
  5. Point your DNS to your new site
  6. Enable SSL using Lets Encrypt
  7. Change your new Sites Nginx settings to (assuing your site is named octane.example.com):
@shoemoney
shoemoney / s3-bucket-policy.json
Created March 30, 2021 14:58 — forked from ktrysmt/s3-bucket-policy.json
a valid aws bucket policy json format for S3 to handle access controll by IP addresses.
{
"Version": "2008-10-17",
"Id": "Policy<UNIQUE ID>",
"Statement": [
{
"Sid": "Stmt<UNIQUE ID>",
"Effect": "Deny",
"Principal": {
"AWS": "*"
},
@shoemoney
shoemoney / AnyLivewireComponent.php
Created March 22, 2021 10:12 — forked from binaryweavers/AnyLivewireComponent.php
Fluent toaster(alerts) for laravel/livewire using alpinejs and tailwindcss
public function showToasters(){
// default info toaster with timeout
$this->toaster('your message');
// makes it persistent
$this->toaster('your message')->persistent();
// warning toaster with timeout
$this->toaster('your message')->warning();
@shoemoney
shoemoney / eloquent-cheatsheet.php
Created February 20, 2021 09:33 — forked from hassansin/eloquent-cheatsheet.php
Laravel 5 Eloquent CheatSheet #laravel #eloquent
Model::
/*Select*/
select('col1','col2')
->select(array('col1','col2'))
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating'))
->addSelect('col3','col4')
->distinct() // distinct select
/*From*/
@shoemoney
shoemoney / upload-s3-webpack.mix.js
Created February 10, 2021 18:59 — forked from avosalmon/upload-s3-webpack.mix.js
Upload assets to S3 using Laravel Mix
const mix = require('laravel-mix');
const s3Plugin = require('webpack-s3-plugin');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass