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
| db.adminCommand("listDatabases").databases.forEach( function (d) { | |
| if (d.name != "local" && d.name != "admin" && d.name != "config") | |
| db.getSiblingDB(d.name).dropDatabase(); | |
| }) |
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 distinct points.user_id as user_id, points.total-redeem.total as total | |
| from ( | |
| select tickets.id_cliente as user_id, sum(tickets.puntos_obtenidos) as total | |
| from tickets where aprobado=1 and cancelado=0 group by tickets.id_cliente | |
| ) points | |
| left join ( | |
| select articulos_recibidos.id_cliente as user_id, sum(articulos_recibidos.puntos) as total | |
| from articulos_recibidos group by articulos_recibidos.id_cliente | |
| ) redeem on redeem.user_id=points.user_id | |
| order by user_id asc; |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Copyright (c) 2013 Asumi Kamikaze Inc. | |
| # Copyright (c) 2013 The Octopus Apps Inc. | |
| # Licensed under the Apache License, Version 2.0 (the "License") | |
| # Author: Alejandro M. Bernardis | |
| # Email: alejandro.bernardis at gmail.com | |
| # Created: 04/Oct/2013 09:37 | |
| import urllib |
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
| #!/bin/bash | |
| REPORT_DATE=$(date +%Y%m%dT%H%M%S) | |
| REPORT_PATH=`pwd`/r${REPORT_DATE} | |
| # Clean | |
| rm -fR ${REPORT_PATH} | |
| rm -f *.json | |
| mkdir -p ${REPORT_PATH} | |
| # Drop DB |
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
| op = db.devices.aggregate([{ | |
| $project: { | |
| date: 1, | |
| newDate: { | |
| year: { | |
| $year: '$created' | |
| }, | |
| month: { | |
| $month: '$created' | |
| }, |
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
| #!/bin/sh | |
| echo "Stopping firewall and allowing everyone..." | |
| iptables -F | |
| iptables -X | |
| iptables -t nat -F | |
| iptables -t nat -X | |
| iptables -t mangle -F | |
| iptables -t mangle -X | |
| iptables -P INPUT ACCEPT | |
| iptables -P FORWARD ACCEPT |
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
| var i, c, | |
| co_name, co_new, | |
| co_old, co_old_i, | |
| _db = db.getSiblingDB('logs'), | |
| _colls = ['activity.games', 'activity.session', 'activity.social', 'activity.store']; | |
| for (i in _colls){ | |
| co_name = _colls[i]; | |
| co_old = _db[co_name]; | |
| co_old_i = co_old.getIndexes(); |
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
| # Copyright (c) 2010, Philip Plante of EndlessPaths.com | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is | |
| # furnished to do so, subject to the following conditions: | |
| # | |
| # The above copyright notice and this permission notice shall be included in |
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 db(self, database=None): | |
| _ref = None | |
| _settings = self.settings.get('database') | |
| if _settings: | |
| if database: | |
| _databases = _settings.get('databases') | |
| if database not in _databases: | |
| raise KeyError('Database "%s" is not supported.' % database) | |
| database = _databases.get(database) | |
| else: |
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
| TCPKeepAlive yes | |
| ClientAliveInterval 30 | |
| ClientAliveCountMax 99999 |