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
import MySQLdb | |
import json | |
conn = MySQLdb.connect(host = "127.0.0.1", user = "root", passwd = "", db = "lwc") | |
""" | |
Protections: | |
RENAME TABLE lwc_protections TO lwc_protections_old_uuid; |
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
local result = redis.call('zrange', KEYS[1], 0, -1, 'withscores') | |
local count = 0 | |
local sum = 0 | |
local min = 0 | |
local max = 0 | |
for i=1, #result, 2 do | |
local score = result[i + 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
-- keys: key dest | |
-- argv: score member [score member ...] | |
-- e.g. keys: "data:test:1:2" "data-sum:test:1:2" | |
-- argv: 10 a 15 b | |
local key = KEYS[1] | |
local dest = KEYS[2] | |
local sum = tonumber(redis.call('get', dest)) or 0 | |
for i=1, #ARGV, 2 do |
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
import sys | |
import glob | |
import os.path | |
def main(): | |
if len(sys.argv) != 3: | |
print('Usage: %s <directory of csv files> <output directory>' % sys.argv[0]) | |
sys.exit(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 python3 | |
import argparse | |
import os | |
import subprocess | |
import sys | |
import time | |
def execute_shell(cmd) -> str: |