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 | |
"Checkout git branch with name substring" | |
from __future__ import print_function | |
import sys | |
from subprocess import check_output | |
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 | |
rrdtool graph power.png --vertical-label=W*h --font=DEFAULT:11:Arial -w 900 -h 600 \ | |
DEF:apower=pcv.rrd:power:AVERAGE CDEF:whpower=apower,1000,\* LINE2:whpower#FF0000 |
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 | |
from __future__ import print_function | |
from datetime import datetime | |
from subprocess import call | |
from mercury206 import commands, communications, config | |
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 | |
from datetime import datetime | |
from subprocess import call | |
from mercury206 import commands, communications, config | |
def update_rrd(path, values): |
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 | |
"""Describe EC2 instances bound to DNS name. Lookup CNAME of DNS, | |
which can point to ELB or EC2 instance. Get info from AWS API. | |
DNS names should be passed as arguments to the script. | |
Valid AWS API credentials must be configured, see | |
http://docs.pythonboto.org/en/latest/getting_started.html#configuring-boto-credentials | |
""" | |
from __future__ import print_function |
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 | |
""" | |
Usage: check_ssl_certificate.py -H <host> -p <port> [-m <method>] | |
[-c <days>] [-w <days>] | |
-h show the help | |
-H <HOST> host/ip to check | |
-p <port> port number | |
-m <method> (SSLv2|SSLv3|SSLv23|TLSv1) defaults to SSLv23 | |
-c <days> day threshold for critical | |
-w <days> day threshold for warning |
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
# coding=utf8 | |
""" | |
Генератор CSV отчета из PDF отчетов банка Авангард о поступлении средств на | |
транзитный валютный счет. | |
По умолчанию читает из стандартного ввода данные извлеченные из PDF при помощи | |
textpdf.py утилиты. | |
Генерируемый CSV отчет печатается в стандартный вывод и включает следующие колонки: | |
* date - дата получения средств |
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
In [1]: list_of_lists = [['#'] * 4] * 4 | |
In [2]: list_of_lists | |
Out[2]: | |
[['#', '#', '#', '#'], | |
['#', '#', '#', '#'], | |
['#', '#', '#', '#'], | |
['#', '#', '#', '#']] | |
In [3]: map(id, list_of_lists) |
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 text_model(M): | |
print M.__name__ | |
print '~' * len(M.__name__) | |
print '-', '\n- '.join('%s: %s' % (f.name, f.__class__.__name__) for f in M._meta.fields) |
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 | |
""" | |
Combines provided access logs and outputs records sorted by | |
time of record. | |
Time of the record is expected to be the forth element in the | |
record and must have +0000 timezone. | |
""" | |
import logging |