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 time | |
import sqlite3 | |
import os | |
import random | |
import multiprocessing | |
class Store1: | |
"""sharding to tables""" |
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 os | |
import Queue | |
import threading | |
def f(q): | |
while True: | |
try: | |
q.get(block=False) | |
except Queue.Empty: |
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
1:M 16 Mar 06:48:01.553 * DB saved on disk | |
1:S 16 Mar 11:31:32.720 * Before turning into a slave, using my master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer. | |
1:S 16 Mar 11:31:32.720 * SLAVE OF 82.118.17.133:8887 enabled (user request from 'id=4 addr=172.18.0.1:42860 fd=8 name= age=0 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=slaveof') | |
1:S 16 Mar 11:31:33.143 * Connecting to MASTER 82.118.17.133:8887 | |
1:S 16 Mar 11:31:33.143 * MASTER <-> SLAVE sync started |
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
Homebrew build logs for git on macOS 10.13.6 | |
Build date: 2018-09-17 11:52:37 |
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 requests | |
import re | |
total = 0 | |
for arch in ['aarch64', 'ppc64', 'ppc64le', 's390x', 'x86_64']: | |
for ver in range(5, 8): | |
r = requests.get(f'https://packages.chef.io/repos/yum/stable/el/{ver}/{arch}/') | |
s = r.text | |
m = re.findall(r'([\d.]+) MB', r.text) | |
one = sum(map(float, m)) |
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 sys | |
def j(lineno): | |
frame = sys._getframe().f_back | |
called_from = frame | |
def hook(frame, event, arg): | |
if event == 'line' and frame == called_from: | |
try: | |
frame.f_lineno = lineno |
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
from IPython.terminal.ipapp import TerminalIPythonApp | |
app = TerminalIPythonApp.instance() | |
context = make_shell_context() | |
app.exec_lines = ['from __future__ import unicode_literals',] | |
app.user_ns = context | |
app.initialize(argv=['--no-banner',]) | |
app.start() |
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
{ | |
"culprit": "sentry/layout.html", | |
"datetime": "2016-06-14T10:56:55.000000Z", | |
"errors": [], | |
"extra": { | |
"sys.argv": [ | |
"'uwsgi'" | |
] | |
}, | |
"fingerprint": [ |
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
# coding: utf-8 | |
import struct | |
# opti | |
from socket import inet_aton | |
from bisect import bisect_left | |
_unpack_ul_little = lambda b: struct.unpack("<L", b)[0] | |
_unpack_ul_big = lambda b: struct.unpack(">L", b)[0] | |
_unpack_us_big = lambda b: struct.unpack(">H", b)[0] |
NewerOlder