5mof tools: Difference between revisions
Jump to navigation
Jump to search
Created page with "=== html 5 timers === - http://hackandtell.org/timer/" |
|||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
= | = Tools for use for Five Minutes of Fame = | ||
== Logo == | |||
[[File:5MoF_logo.png|thumb|left|Five Minutes of Fame logo]] | |||
<br> | |||
<br> | |||
<br> | |||
<br> | |||
<br> | |||
<br> | |||
== html 5 timers == | |||
- http://hackandtell.org/timer/ | |||
== Speaker site that polls the event page == | |||
https://github.com/jeremyll/5mof_speaker_site | |||
== flaschentaschen and mary poppins control script == | |||
<pre> | |||
#!/bin/bash | |||
set -e | |||
HOST=localhost | |||
if [ -n "$1" ]; then | |||
HOST="$1" | |||
fi | |||
display () { | |||
convert -size 45x35 \ | |||
-colors 256 -depth 8 \ | |||
-background "$2" \ | |||
-fill white \ | |||
-gravity North \ | |||
-font Noto-Sans -pointsize 16 label:"$1" \ | |||
png:- | pngtopnm - > timer.pnm | |||
{ cat timer.pnm; \ | |||
printf "0 0 10\r\n" ; | |||
} | cat > /dev/udp/$HOST/1337 | |||
} | |||
MINS=5 | |||
SECS=0 | |||
COLOR='green' | |||
lower () { | |||
if [ "$SECS" -eq 0 ]; then | |||
if [ "$MINS" -eq 0 ]; then | |||
echo "done!" | |||
curl -XPOST http://pegasus.noise:5000/ -d "text=your five minutes of fame are over" | |||
exit 0 | |||
else | |||
MINS="$((MINS - 1))" | |||
SECS=59 | |||
fi | |||
else | |||
SECS="$((SECS - 1))" | |||
fi | |||
if [ "$MINS" -eq 0 ]; then | |||
COLOR=red | |||
fi | |||
} | |||
while true; do | |||
printf "%02d:%02d\n" "$MINS" "$SECS" | |||
display $(printf "%02d:%02d" "$MINS" "$SECS") "$COLOR" | |||
lower | |||
sleep 1 | |||
done | |||
</pre> | |||
-lizzie | |||
Latest revision as of 16:53, 2 February 2017
Tools for use for Five Minutes of Fame
[edit | edit source]Logo
[edit | edit source]
html 5 timers
[edit | edit source]- http://hackandtell.org/timer/
Speaker site that polls the event page
[edit | edit source]https://github.com/jeremyll/5mof_speaker_site
flaschentaschen and mary poppins control script
[edit | edit source]#!/bin/bash
set -e
HOST=localhost
if [ -n "$1" ]; then
HOST="$1"
fi
display () {
convert -size 45x35 \
-colors 256 -depth 8 \
-background "$2" \
-fill white \
-gravity North \
-font Noto-Sans -pointsize 16 label:"$1" \
png:- | pngtopnm - > timer.pnm
{ cat timer.pnm; \
printf "0 0 10\r\n" ;
} | cat > /dev/udp/$HOST/1337
}
MINS=5
SECS=0
COLOR='green'
lower () {
if [ "$SECS" -eq 0 ]; then
if [ "$MINS" -eq 0 ]; then
echo "done!"
curl -XPOST http://pegasus.noise:5000/ -d "text=your five minutes of fame are over"
exit 0
else
MINS="$((MINS - 1))"
SECS=59
fi
else
SECS="$((SECS - 1))"
fi
if [ "$MINS" -eq 0 ]; then
COLOR=red
fi
}
while true; do
printf "%02d:%02d\n" "$MINS" "$SECS"
display $(printf "%02d:%02d" "$MINS" "$SECS") "$COLOR"
lower
sleep 1
done
-lizzie