This file contains hidden or 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
select from_unixtime(86400 + floor(to_unixtime(time) / 86400) * 86400), sum(sum) from metrics_rollup60 where name= 'bytes_sent.0044b.ha' and to_unixtime(time) > to_unixtime(TIMESTAMP '2014-09-29 00:00:00.000') and to_unixtime(time) < to_unixtime(TIMESTAMP '2014-11-30 00:00:00.000') GROUP BY floor(to_unixtime(time) / 86400); | |
Result: | |
_col0 | _col1 | |
-------------------------+--------- | |
2014-10-02 00:00:00.000 | 1083855 | |
2014-10-03 00:00:00.000 | 1080823 | |
2014-10-04 00:00:00.000 | 1076970 | |
2014-10-05 00:00:00.000 | 1080710 |
This file contains hidden or 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
select time, sum(sum) from metrics_rollup60 | |
where name = 'bytes_sent.tcp_miss1.0044b.ha.300' and | |
to_unixtime(time) > to_unixtime(TIMESTAMP '2013-01-01 00:00:00.000') and | |
to_unixtime(time) < to_unixtime(TIMESTAMP '2013-01-31 00:00:00.000') | |
GROUP BY time; | |
time | _col1 | |
-------------------------+------------ | |
2013-01-01 00:01:00.000 | 432498985 | |
2013-01-01 00:02:00.000 | 155681891 |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
$script = <<SCRIPT | |
echo I am provisioning... | |
echo Installing EPEL packages... | |
su -c 'rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm' |
This file contains hidden or 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 Account(models.Model): | |
pass | |
class CustomUser(AbstractBaseUser, PermissionsMixin): | |
accounts = models.ManyToManyField(Account, | |
through='CustomUserAccount') | |
changed_by = models.ForeignKey(CustomUser, null=True, blank=True) | |
@property |
This file contains hidden or 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 History(models.Model): | |
changed_by = models.ForeignKey('user.CustomUser', null=True, blank=True) | |
history = HistoricalRecords() | |
@property | |
def _history_user(self): | |
return self.changed_by | |
@_history_user.setter |
This file contains hidden or 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 Account(PolymorphicMPTTModel): | |
parent = PolymorphicTreeForeignKey('self', | |
null=True, | |
blank=True, | |
related_name='children', | |
verbose_name=_('parent')) | |
name = models.CharField(max_length=150, unique=True) | |
company_name = models.CharField(max_length=150, unique=True, | |
help_text=_('Corportate Name')) |
This file contains hidden or 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 Account(models.Model): | |
pass | |
class Brand(Account): | |
name = models.CharField() | |
class Company(Brand): | |
parent = models.ForeignKey(Brand) | |
class Reseller(Company): |
This file contains hidden or 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
def save(self, domain_override=None, | |
subject_template_name='registration/password_reset_subject.txt', | |
email_template_name='registration/password_reset_email.html', | |
use_https=False, token_generator=default_token_generator, | |
from_email=None, request=None): | |
""" | |
Generates a one-use only link for resetting password and sends to the | |
user. | |
""" | |
from django.core.mail import send_mail |
This file contains hidden or 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
# Django settings for azionmanager project. | |
# -*- encoding: utf-8 -*- | |
import sys | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. | |
'NAME': 'azionmanager', # Or path to database file if using sqlite3. | |
'USER': 'root', # Not used with sqlite3. |
This file contains hidden or 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
# Django settings for azionmanager project. | |
# -*- encoding: utf-8 -*- | |
import os | |
import sys | |
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |