Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Jonathan Aaron Steel stamster

🎯
Focusing
Block or report user

Report or block stamster

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stamster
stamster / magento2_init.sh
Created May 7, 2016
Magento2 INIT script
View magento2_init.sh
#!/bin/bash
MAG=magento #system wide symlink
# or absolute:
#MAG=/usr/share/nginx/mymagentoprojectroot/bin/magento #absolute path
echo "Enabling all modules with clearing static content..."
$MAG module:enable --all --clear-static-content
echo "Running setup upgrade..."
$MAG setup:upgrade
View ldap_safe_connect
<?php
/*
If you don't want your PHP program to wait XXX seconds before giving up in a case when one of your corporate DC have failed,
and since ldap_connect() does not have a mechanism to timeout on a user specified time,
this is my workaround which shows excellent practical results.
*/
function serviceping($host, $port=389, $timeout=1)
{
$op = fsockopen($host, $port, $errno, $errstr, $timeout);
if (!$op) return 0; //DC is N/A
You can’t perform that action at this time.