This file contains 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
''' | |
USAGE: ubuntu@mysql-ab1:~$ python mysqltail.py | |
''' | |
from pymysqlreplication import BinLogStreamReader | |
from pymysqlreplication.row_event import (DeleteRowsEvent, UpdateRowsEvent, WriteRowsEvent) | |
import types | |
import sys | |
from datetime import date | |
import redis | |
import time |
This file contains 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
Here X contains one column named 'metadata' of type bytearray. But the actual content is a JSON i.e. the d is a JSON (keys as sId & cId) as shown below: | |
grunt> describe X | |
X: {metadata: bytearray} | |
grunt> dump X | |
({"sId":"003_w","cId":"k"}) | |
({"sId":"001_rf","cId":"r"}) | |
({"sId":"001_rf","cId":"r"}) | |
({"sId":"004_rf","cId":"r"}) |
This file contains 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
import boto | |
from boto.s3.connection import OrdinaryCallingFormat | |
(aws_access_key_id, aws_secret_access_key) = ('<aws_access_key_id>', '<aws_secret_access_key>') | |
def deleteBucket(aws_access_key_id, aws_secret_access_key, bname): | |
s3 = boto.connect_s3(aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key, calling_format=OrdinaryCallingFormat()) | |
print '# Permanently deleting bucket[%s]...' %bname | |
bucket = s3.get_bucket(bname) | |
bucketListResultSet = bucket.list() | |
return bucket.delete_keys([key.name for key in bucketListResultSet]) |
OlderNewer