The overall code are shown as follows.
Here is a zip file containing all patches.
The overall code are shown as follows.
Here is a zip file containing all patches.
| NS = {'tei': 'http://www.tei-c.org/ns/1.0'} | |
| def tei_to_fulltext(tei): | |
| from lxml import etree | |
| from six import text_type | |
| parser = etree.XMLParser(encoding='UTF-8', recover=True) | |
| tei = tei if not isinstance(tei, text_type) else tei.encode('utf-8') | |
| root = etree.fromstring(tei, parser) | |
| return get_fulltext(root) |
| from fabric.api import * | |
| class Tmux(object): | |
| """Tmux helper for fabric""" | |
| def __init__(self, session_name, run_cmd=run): | |
| self.session_name = session_name | |
| self.run_cmd = run_cmd | |
| self.create_session() |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| select | |
| cast('2008-2-23' as date) as DATE_TYPE, | |
| cast('12:20:30' as time) as TIME_TYPE, | |
| cast('2008-2-23 12:00:00' as timestamp) as TIMESTAMP_TYPE | |
| FROM | |
| INFORMATION_SCHEMA.`SCHEMATA`; |
| #!/bin/sh | |
| # Stop Hive (kill all process owened by user 'hive') | |
| ps aux | awk '{print $1,$2}' | grep hive | awk '{print $2}' | xargs kill >/dev/null 2>&1 |
| #!/bin/sh | |
| # http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.0.0.2/bk_reference/content/reference_chap3_1.html | |
| export HIVE_HOME=/opt/hive/hive-0.12.0-bin/ | |
| export HIVE_CONF=$HIVE_HOME/conf.drill/ | |
| su -l hive -c "env HADOOP_HOME=/usr nohup $HIVE_HOME/bin/hive --service metastore > /tmp/hive.out 2> /tmp/hive.log &" | |
| su -l hive -c "nohup $HIVE_HOME/bin/hiveserver2 -hiveconf hive.metastore.uris=\" \" > /tmp/hiveServer2.out 2>/tmp/hiveServer2.log &" |
| # Let us assume | |
| # | |
| # - you have a laptop A | |
| # - you work at company C | |
| # | |
| # how can you access C from A? | |
| # | |
| # Solution: a middle man B | |
| # | |
| # http://www.revsys.com/writings/quicktips/ssh-tunnel.html |
| ack DataMode.OPTIONAL | awk 'BEGIN {FS =":"} {print $1}' | xargs sed -i "s/DataMode.OPTIONAL/DataMode.DM_OPTIONAL/g" |