Skip to content

Commit 63e61ef

Browse files
committed
Autorefresh of live.html, changed file name in server to solve caching issues
1 parent 08e3efa commit 63e61ef

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

spark/_template_rdd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ no_header = txt.filter(lambda s: not s.startswith(item_fields[0]))
77
parsed = no_header.map(lambda s: parse_item(s)).cache()
88

99
print(parsed.take(1))
10-
print(parsed.toDebugString())
10+
print(parsed.toDebugString().decode('utf-8'))
1111

spark/hello1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
print(rdd.count())
77

88
# Also spark-submit hello1.py --conf spark.logLineage=true
9-
print(rdd.toDebugString())
9+
print(rdd.toDebugString().decode('utf-8'))
1010

spark/hello2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
solo_en_euros = rdd.filter(lambda fila: 'EUR' in fila)
77

8-
print(solo_en_euros.toDebugString())
8+
print(solo_en_euros.toDebugString().decode('utf-8'))
99
print(solo_en_euros.count())
1010
print(solo_en_euros.take(10))
1111

spark/live/live.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ fswatch ../live.py | while read -r fpath; do \
55
echo -e "\033[0;36mRELOAD\033[0m $fpath $(date +"%H%M%S")"
66
echo -e "# $(date +"%H:%M:%S")\n" | cat - ../live.py > live_mod.py
77
sed -e '/-python">/r./live_mod.py' live_template.html > live.html
8-
gsutil cp live.html gs://bigdata.luisbelloch.es/live.html
8+
gsutil -h "Cache-Control:no-cache,max-age=0" \
9+
cp live.html gs://bigdata.luisbelloch.es/en_directo.html
910

1011
# echo -e "# $(date +"%H:%M:%S")\n" | cat - live.py | pygmentize -f html -O full,linenos=1 -o live.html
1112
# scp live.html [email protected]:/var/www/html/index.html

spark/live/live_template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
7+
<meta http-equiv="Refresh" content="5">
78
<title>#bidataupv - live</title>
89
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Fira+Mono:400,500,700|Roboto:300,400,500,700,900" />
910
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.14.2/styles/dracula.min.css" />

0 commit comments

Comments
 (0)