Skip to content

Instantly share code, notes, and snippets.

View erlangparasu's full-sized avatar

Erlang Parasu erlangparasu

View GitHub Profile
apt update
apt install libzmq-ffi-perl
git clone git://github.com/mkoppanen/php-zmq.git
cd php-zmq
phpize7.4 && ./configure

Install Supervisor with sudo apt-get install supervisor in Unix or brew install supervisor in Mac OSX. Ensure it's started with sudo service supervisor restart in Unix or brew services start supervisor in Mac OSX.

In Unix in /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini and in /usr/local/etc/supervisor.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread in Unix and with: brew services restart supervisor in MAc OSX . And start using those changes with: sudo supervisorctl update.

@erlangparasu
erlangparasu / setphp
Last active March 5, 2021 15:59
set php version ubuntu
/usr/bin/php
/usr/bin/php-cgi
/usr/bin/php-config
/usr/bin/phpdbg
/usr/bin/phpize
@erlangparasu
erlangparasu / .php_cs.laravel.php
Created January 5, 2021 10:51 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]
https://unix.stackexchange.com/questions/46235/how-does-reverse-ssh-tunneling-work/46271#46271
-- Laravel default tables
CREATE TABLE `cache` (
`key` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
`value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`expiration` int(11) NOT NULL,
UNIQUE KEY `cache_key_unique` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
CREATE TABLE `migrations` (
<?php
namespace main;
define("BACKEND_SOCKET", '<where the unix socket>');
define("BASE_URL", '<where this file located>');
function exit_500($msg) {
$msg = rtrim($msg, "\n") . "\nDebug trace:\n";
foreach(debug_backtrace() as $trace) {
<?php
namespace App\Providers;
// ...
class AppServiceProvider extends ServiceProvider
{
// ...
https://aaronparecki.com/oauth-2-simplified/
sudo yum install \
php71 \
php71-php \
php71-php-bcmath \
php71-php-brotli \
php71-php-cli \
php71-php-common \
php71-php-componere \
php71-php-dba \
php71-php-dbg \