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 | |
| import mysql.connector | |
| from itertools import chain | |
| import time | |
| class MySQL: | |
| def __init__(self): | |
| self.connector = mysql.connector.connect( | |
| user='usr', |
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 MySQL: | |
| def __init__(self): | |
| self.connector = mysql.connector.connect( | |
| user='usr', | |
| password='pwd', | |
| host='127.0.0.1', | |
| port='20033', # tunnel to server | |
| database='db') | |
| self.cursor = self.connector.cursor() |
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
| for s in remote1 remote2 ... remote87 | |
| do | |
| ssh $s ls -lrt /var/lib/jelli/audio-recording/ | tail -1 | |
| done |
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
| $ ssh remote ls -lrt /mnt/data/ | tail -1 |
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 | |
| import argparse | |
| import subprocess | |
| def check_one_station(station): | |
| cmd = 'ssh {0} ls -alrt /var/lib/jelli/audio-recording/ | grep -v ^d | tail -1'.format(station) | |
| p = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
| (out, err) = p.communicate() | |
| idx = err.find('cannot access') | |
| if idx >= 0: |
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 | |
| import argparse | |
| import subprocess | |
| import threading | |
| import Queue | |
| import string | |
| import time | |
| class CheckOneStation(threading.Thread): | |
| _err_marker = '###' |