Skip to content

Instantly share code, notes, and snippets.

View marlocorridor's full-sized avatar
🏠
Working from home

mcorridor marlocorridor

🏠
Working from home
View GitHub Profile
#!/bin/bash
# Creator: Phil Cook
# Email: phil@phil-cook.com
# Twitter: @p_cook
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.6","7.0","7.1","7.2")
php_array=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
valet_support_php_version_array=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
php_installed_array=()
@marlocorridor
marlocorridor / key-fingerprint
Created June 10, 2020 03:36 — forked from yosemitebandit/key-fingerprint
view your ssh public key's fingerprint; compare this to what Github has listed in the ssh key audit
$ ssh-keygen -l -f /path/to/keys/id_rsa.pub
2048 aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66:77:88:99 id_rsa.pub (RSA)
@marlocorridor
marlocorridor / laravel-production-permissions.md
Created June 10, 2020 18:53 — forked from barbietunnie/laravel-production-permissions.md
MySQL Database User GRANT permissions for Laravel

MySQL Database User GRANT permissions for Laravel

For security reasons, you should probably grant select, delete, update and insert to your app user in production.

Have another user who can do alter, create, drop and index when running migrations.

If you run seeders in production, also grant select, insert and references to the migration user.

Yeah, 2 users, migrations are not always run in production everyday and this keeps more secure your database.

@marlocorridor
marlocorridor / install-ssl-apache.md
Created June 12, 2020 06:50 — forked from ccschmitz/install-ssl-apache.md
How to install an SSL certificate on an Apache server.

Installing an SSL certificate on Apache

  1. Create a private key:
openssl genrsa 2048 > private-key.pem
  1. Create a Certificate Signing Request (CSR):
@marlocorridor
marlocorridor / query.php
Created February 17, 2023 01:00
Laravel Raw DB query whereIn equivalent on JSON column
<?
DB::table('transactions')
->select(
'id',
DB::raw('meta->"$.target_units" as target_units'),
DB::raw('"9864a4b0-ac8a-43bc-a8cf-c10c6e2da09c" MEMBER OF(meta->"$.target_units") as hit')
)
->where('hit', true)
->get();