This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
const args = process.argv; | |
const rootName = args[2]; | |
const rootPath = path.resolve(process.cwd(), rootName); | |
const alias = "@"; | |
if (!rootPath || !alias) return; | |
const { promisify } = require("util"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NestMeta(type): | |
def __getattr__(cls, key): | |
return cls(cls, key) | |
def __str__(cls): | |
return cls.__name__ | |
__repr__ = __str__ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# update | |
sudo yum -y update | |
sudo yum -y upgrade | |
# enable EPEL6 by changing enabled=0 -> enabled=1 | |
sudo vim /etc/yum.repos.d/epel.repo | |
# install htop | |
sudo yum install htop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* * | |
* @filename downloader.class.php | |
* @author PsyKzz | |
* @version 1.0.0 | |
* @description Simple class to rate limit your downloads, while also providing a custom tickrate to combat timeout issues. | |
* @url http://www.psykzz.co.uk | |
* | |
* @license 'WTFPL ' - "Do What The Fuck You Want To Public License". | |
* This program is free software. It comes without any warranty, to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ldap | |
def check_credentials(username, password): | |
"""Verifies credentials for username and password. | |
Returns None on success or a string describing the error on failure | |
# Adapt to your needs | |
""" | |
LDAP_SERVER = 'ldap://xxx' | |
# fully qualified AD user name | |
LDAP_USERNAME = '%[email protected]' % username |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.appengine.api import xmpp | |
import logging | |
import logging.handlers | |
import os | |
DEFAULT_FROM_JID = 'logs@%s.appspotchat.com' % os.environ['APPLICATION_ID'] | |
class XmppLogHandler(logging.Handler): | |
def __init__(self, jid, from_jid): |