WHMCS Hook - Trigger E-mail On New User Sign-Up
This script needs to go into your WHMCS hooks folder (root/includes/hooks/):<?php
function send_invitiation_email($vars) {
$command = "sendemail";
$adminuser = "admin"; // Your admin username
$values["messagename"] = "Google Groups Invitation"; // exact name of e-mail template
$values["id"] = $vars['userid'];
$results = localAPI($command,$values,$adminuser);
}
add_hook("ClientAdd",1,"send_invitiation_email");
?>
Bootstrap Form Builder
http://minikomi.github.io/Bootstrap-Form-Builder/This looks great for non-technical users who want a form built. It's a great response to "Hey, make me a checklist!"...
"You make the checklist the way you want it using this site, then I'll put it on the web."
PHPmyAdmin Loading Slowly (or not at all)
http://future500.nl/phpmyadmin-slow-on-startup/UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in position 12: ordinal not in range(128)
The error in the title will occur on pre-0.12.0 versions of python’s Requests library. It seems to be fixed on later versions and maybe even earlier.
Here’s an example of how you save a zip file from behind a corporate proxy with python’s Requests library:
That’s it! Just use the write function with the content of the returned request.
requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
This happens with the Requests library in python. All you need to do is set verify=false.For example:
cookieRequest = s.post(url, data=json.dumps(payload).strip('"'), allow_redirects=False, headers=headers, verify=False)
src/pycurl.c:42:20: fatal error: Python.h: No such file or directory
The following helped to resolve this issue: sudo apt-get install python-devWriting To File - UnicodeEncodeError: 'ascii' codec can't encode characters
I was getting a lot of errors when I was trying to download a file with the python requests library. The errors looked like the following:
UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 2-6: ordinal not in range(128)
This code ended up fixing it:
Prevent URL Encoding - Python Requests Library
Use json.dumps in the data parameter.
for example:
r = s.post(url, data=json.dumps(payload), allow_redirects=False, cookies=cookieRequest.cookies)