These steps have been tested with
- Oracle Linux 6.4
- RHEL 6.5
- CDH 5.1
Note I wish this was parceled up.
I run irssi inside a tmux session on OSX. I often close the terminal as I usually get notified by growl about important stuff. I don't want to open a terminal and write a command every time I want to check IRC.
#!/bin/zsh
/usr/local/bin/tmux attach -d -t irssi || /usr/local/bin/tmux new -s irssi irssi
| --- | |
| current_section: Currently | |
| doing_file: ~/Dropbox/notes/wwid-??.md | |
| views: | |
| times: | |
| date_format: '%a %_I:%M%P' | |
| section: All | |
| count: 0 | |
| wrap_width: 0 | |
| template: '%boldblack%date %boldcyan > %boldwhite%title %boldbgwhite%boldblack%interval%default' |
| #!/usr/bin/env ruby | |
| # Uses the Readability Metrics API from http://ipeirotis.appspot.com/readability-api.html | |
| # Accepts text from STDIN (piped) or as an argument | |
| =begin examples | |
| pbpaste|text_score.rb # copy text and run (on OS X) to get the stats for the clipboard. | |
| cat myfile.md|text_score.rb # get scores for the contents of a file | |
| =end | |
| require 'open-uri' | |
| require 'net/http' |
These are the steps I followed to setup a 6.5 CentOS VM, and install CDH5 and CM5 on it. All these commands should be run on a single node if running on a cluster, it will serve as the master node.
Caveats:
Recent versions of Cloudera's Impala added NDV, a "number of distinct values" aggregate function that uses the HyperLogLog algorithm to estimate this number, in parallel, in a fixed amount of space.
This can make a really, really big difference: in a large table I tested this on, which had roughly 100M unique values of mycolumn, using NDV(mycolumn) got me an approximate answer in 27 seconds, whereas the exact answer using count(distinct mycolumn) took ... well, I don't know how long, because I got tired of waiting for it after 45 minutes.
It's fun to note, though, that because of another recent addition to Impala's dialect of SQL, the fnv_hash function, you don't actually need to use NDV; instead, you can build HyperLogLog yourself from mathematical primitives.
HyperLogLog hashes each value it sees, and then assigns them to a bucket based on the low order bits of the hash. It's common to use 1024 buckets, so we can get the bucket by using a bitwise & with 1023:
select| #!/usr/bin/python | |
| import csv | |
| import sys | |
| import argparse | |
| import io | |
| csv.field_size_limit(sys.maxsize) | |
| parser = argparse.ArgumentParser(description='Clean csv of in-line newlines') | |
| parser.add_argument('infile',help='Path to input CSV file'); |