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
| """ | |
| Simple watchdog which just restarts the command. | |
| You can specify the limit for restarts by env-variable LIMIT | |
| Example: | |
| LIMIT=10 python watchdog.py this_may_fall.exe | |
| """ | |
| import logging | |
| import os |
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
| module.exports = { | |
| package: null, | |
| syntax: "proto2", | |
| messages: [{ | |
| name: "Msg", | |
| syntax: "proto2", | |
| fields: [{ | |
| rule: "optional", | |
| type: "Commands", | |
| name: "command_number", |
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
| from __future__ import print_function | |
| """ | |
| Pre-commit hook for PEP8 styling | |
| Works well with flake8==3.0.4 | |
| """ | |
| __author__ = 'Ivan Styazhkin <[email protected]>' | |
| import subprocess | |
| import sys |
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
| from __future__ import print_function | |
| INPUT_FILENAME = 'export_dmr.txt' | |
| OUTPUT_FILENAME = 'export_dmr.csv' | |
| FIELDS = [ | |
| 'dmr_transaction_id', | |
| 'paid_at', | |
| 'purchase_price', | |
| 'purchase_currency', | |
| 'order_price', |
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
| """ | |
| Simple watchdog which kills the command affter timeout. | |
| You can specify the timeout in seconds for kill by env-variable TIMEOUT | |
| Example: | |
| TIMEOUT=300 python time-keeper.py this-will-hang-up-but-gonna-be-killed-in-5-mins.exe | |
| """ | |
| import logging | |
| import os | |
| import subprocess |
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 | |
| import csv | |
| import glob | |
| import logging | |
| import os | |
| logging.basicConfig( | |
| level=logging.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
| In [39]: a = {} | |
| In [40]: for i in xrange(4): | |
| ...: key = ''.join(random.sample(string.ascii_lowercase, 10)) | |
| ...: a[key] = key | |
| ...: | |
| In [41]: a | |
| Out[41]: | |
| {'beuvqlcnyp': 'beuvqlcnyp', |
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
| package main | |
| import ( | |
| "encoding/json" | |
| "flag" | |
| "fmt" | |
| linuxproc "github.com/c9s/goprocinfo/linux" | |
| "github.com/streadway/amqp" | |
| "log" | |
| "os" |
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
| from __future__ import print_function | |
| """ | |
| Pre-commit hook for Cyclomatic Complexity check | |
| Works well with radon==2.2.0 | |
| """ | |
| __author__ = 'Ivan Styazhkin <[email protected]>' | |
| import subprocess |
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
| """ | |
| Sends system's pulse to a watchdog device | |
| Usage: | |
| python pulse.py <serial device> | |
| Example: | |
| SLEEP=25 python pulse.py /dev/ttyUSB0 | |
| """ |