Skip to content

Instantly share code, notes, and snippets.

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.

@iammart
iammart / fix-wordpress-permissions.sh
Created June 28, 2017 14:55 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@iammart
iammart / scripts.sh
Last active May 26, 2017 09:30
cPanel Mail
#
# Delete email older than %%
#
$ find /home/%ACCOUNT%/mail/%MAILBOX%/new -type f -mtime +30 -delete
$ find /home/%ACCOUNT%/mail/%MAILBOX%/cur -type f -mtime +30 -delete
#
# Fix quotas
# https://forums.cpanel.net/threads/how-to-reset-mail-quota.105325/#post-691898
#
  • Pagination
  • Filters
  • Order By
  • Limit
  • Validation
  • Ajax Controller
  • Assets
  • RSS
@iammart
iammart / protips.js
Created May 26, 2016 07:13 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@iammart
iammart / regex.whitespace
Created February 11, 2016 10:20
Atom - Remove whitespace
^(?:[\t ]*(?:\r?\n|\r))+
@iammart
iammart / export.sql
Created December 15, 2015 16:07
Export table from mysqldump
sed -n -e '/DROP TABLE.*%TABLE%/,/UNLOCK TABLES/p' %DATABASE-DUMP%.sql > %EXPORT%.sql
@iammart
iammart / vsftp
Created November 11, 2015 09:51
Centos
# Add user
adduser -s /bin/false -d %PATH% %USER%
# Set user password
passwd %USER%
# Add permissions to ACL
setfacl -R -d -m "u:%USER%:rwx" %PATH%
setfacl -R -m "u:%USER%:rwx" %PATH%
@iammart
iammart / gist:1fe85fe380beba64cb42
Created October 15, 2015 13:36 — forked from getify/gist:7ae82fdc2e86bf66bcba
List of ES6 books either out or in progress...
@iammart
iammart / simplifymultifilearray.php
Last active September 23, 2015 10:29
Simplify multiple file array
<?php
function simplifyMultiFileArray($files = array()){
$sFiles = array();
if(is_array($files) && count($files) > 0){
foreach($files as $key => $file){
foreach($file as $index => $attr){
$sFiles[$index][$key] = $attr;
}
}