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
-- {{{ Battery bar | |
mybatterybar = awful.widget.progressbar() | |
mybatterybar:set_border_color(theme.border_normal) | |
mybatterybar:set_background_color(theme.bg_normal) | |
mybatterybar:set_color(theme.bg_focus) | |
mybatterybar:set_width(50) | |
mytimer = timer({ timeout = 30 }) | |
mytimer:connect_signal("timeout", function() | |
f = io.popen('acpi -b', r) |
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
def get_var(srcfile, *variables): | |
"""Get variables' values from bash shell source file. | |
Return a dictionary that maps from variable name to its value. | |
""" | |
cmd = ". " + srcfile + ";" | |
for var in variables: | |
cmd += "echo ${" + var + "};" | |
proc = subprocess.Popen([cmd], stdout=subprocess.PIPE, shell=True) |
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
hadoop jar $HADOOP_HOME/contrib/streaming/hadoop-streaming*.jar \ | |
-input /path/to/input/data/dir \ | |
-ouput /path/to/output/result/dir \ | |
-mapper mapcmd \ | |
-reducer reducecmd \ |
NewerOlder