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
#!/bin/sh | |
# script to convert mysql schema to be compatible with data warehouse software | |
# make sure that s3cmd and maatkit utility is installed | |
db_name=${1:-'test'} | |
> /root/$db_name.txt | |
temppath='/mnt/data/pdump1' | |
host='localhost' | |
user='maatkit' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
netstat -an | grep :443 | grep ESTABLISHED | wc -l |
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
@view_config(context=HTTPException) | |
def exception_view__upgrade(exc, request): | |
"""if we end with .json, serve json.""" | |
if (request.path[-5:]).lower() == '.json': | |
request.environ['HTTP_ACCEPT'] = "application/json" | |
return exc |
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
{ | |
"query": { | |
"function_score": { | |
"functions": [ | |
{ | |
"script_score" : { | |
"script" : "_score * log10(max(doc['like_count'].value, 1)) + ((doc['created_at'].value/1000) - 1412092800)/604800.0" | |
} | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
>>> a = unichr(int('5E97', 16)) | |
>>> a | |
u'\u5e97' | |
>>> print(a) | |
店 | |
>>> "%X" % ord(u'店') | |
'5E97' |
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
\set dag_id '''dag002'''; | |
delete from xcom where dag_id = :dag_id; | |
delete from task_instance where dag_id = :dag_id; | |
delete from sla_miss where dag_id = :dag_id; | |
delete from log where dag_id = :dag_id; | |
delete from job where dag_id = :dag_id; | |
delete from dag_run where dag_id = :dag_id; | |
delete from dag where dag_id = :dag_id; |
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
\set dag_id '''dag002'''; | |
delete from xcom where dag_id = :dag_id; | |
delete from task_instance where dag_id = :dag_id; | |
delete from sla_miss where dag_id = :dag_id; | |
delete from log where dag_id = :dag_id; | |
delete from job where dag_id = :dag_id; | |
delete from dag_run where dag_id = :dag_id; | |
delete from dag where dag_id = :dag_id; |