Skip to content

Instantly share code, notes, and snippets.

View mjrider's full-sized avatar
😎
Improving the world 1 LOC at a time

Robbert Müller mjrider

😎
Improving the world 1 LOC at a time
View GitHub Profile
<?php
/*
optimalisation for path modification
dirname returns an \ on dirname('/') under windows
case 1: 'the right way' check if this is the case, and if so, fixit
case 1: 'the ugly way' just fixit
it is normal for this code path to be hit +1milion times per request
#ppage_customfield > div > div.fullwidthbanner.revslider-initialised.tp-simpleresponsive > ul > li {
position: absolute;
}

Keybase proof

I hereby claim:

  • I am mjrider on github.
  • I am mjrider (https://keybase.io/mjrider) on keybase.
  • I have a public key whose fingerprint is B1B2 5E4C E46F BA97 7CCC 2638 D576 BC74 186D 3A0C

To claim this, I am signing this object:

@mjrider
mjrider / gist:ae76bfe1651554e174ce
Created February 5, 2015 12:53
gen persistent connecties
diff --git a/lib/stores/mysqlstore.phtml b/lib/stores/mysqlstore.phtml
index c5380bc..a224808 100644
--- a/lib/stores/mysqlstore.phtml
+++ b/lib/stores/mysqlstore.phtml
@@ -80,7 +80,7 @@ class mysqlstore extends store{
**********************************************************************************/
$this->error="";
- $this->dbh = $this->getConnection('p:'.$config['host'], $config["user"], $config["password"], $config["database"]);
+ $this->dbh = $this->getConnection($config['host'], $config["user"], $config["password"], $config["database"]);
--- a/lib/stores/mysqlstore.phtml
+++ b/lib/stores/mysqlstore.phtml
@@ -1081,6 +1081,7 @@ class mysqlstore extends store{
if ($object) {
while (list($name, $value)=each($values)) {
+ if($name == 'scope' ) { continue; }
if ($value!="") {
$query_names.="AR_".AddSlashes($name).", ";
$query_values.="$value, ";
./acount_key.json -> account file
./bin/ -> contains script which does all the work
./certs/ -> directory for all the cert requests
./certs/example.com/account_key.json -> symlink to acount_key.json in the root
./certs/example.com/full.pem
./certs/example.com/request.txt -> arguments used for the cll to simp_le, if it changes remove full.pem and request again
./certs/example.com/ -> you know the rest
./domain.list ->input file with all domains
./public_html/ -> webroot for nginx /.well-known/acma-challenge/ is redirected here from haproxy
./simp_le/ -> containts git checkout with venv
commit e97ef4947f56deab4cfcec839b64644c2857e53d
Author: Robbert Müller <muller@muze.nl>
Date: Mon Oct 28 20:11:31 2013 +0100
Rework import user and group grants now also use auth config to find the user and groups
diff --git a/lib/templates/pgroup/system.import.groupgrants.phtml b/lib/templates/pgroup/system.import.groupgrants.phtml
deleted file mode 100644
index cb9292d..0000000
--- a/lib/templates/pgroup/system.import.groupgrants.phtml
<?php
interface ar_core_templateStoreInterface {
public function __construct($options);
// save template in store
public function save( $path, $template, $name, $type = "pobject", $nls = "any");
// retrieve a template defined by a previous save
#!/bin/sh
# Absolute path to this script. /etc/ssl/example.org/update.sh
SCRIPT=$(readlink -f $0)
# Absolute path this script is in. /etc/ssl/example.org/
SCRIPTPATH=$(dirname $SCRIPT)
cd "${SCRIPTPATH}" || exit 1
/srv/simp_le/venv/bin/simp_le -f full.pem -f account_key.json --default_root /var/www/ \
-d srv.example.org -d example.org -d home.example.org -d mail.example.org
#!/bin/bash
NEWARGS=();
for i in "${@}" ; do
NEWARGS+=( "${i}" )
if [ "${i}" = "--components" -o "${i}" = "-c" ] ; then
COMPONENTS=1;
fi
done
if [ -z "${COMPONENTS}" ] ; then
NEWARGS+=( "--components" )