summaryrefslogtreecommitdiff
path: root/encode_html.sh
blob: 50da6cc6d8ff2f652264e7c912453195317ce469 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

# Copy HTML to a web server....
scp index.html prometheus.ethernal.org:public_html/arduino.html

# Fetch HTML with appropriate Accept-Encoding: header -> save to raw file
/bin/echo -ne "GET /~mjb/arduino.html HTTP/1.0\nAccept-Encoding: gzip\n\n" | nc www.ethernal.org 80  > index_gzip.raw

# Process Raw file - delete headers and blank line -> save to raw gzip dat file
sed -e '0,/^\r$/d' index_gzip.raw                                                               > index_gzip.dat

# Process raw gzip dat file into hex array for inclusion in program
od -A n -t x1 index_gzip.dat | sed -e 's/ \(..\)/0x\1, /g' -e 's/^/      /'                     > index_gzip.txt

ls -l index_gzip.*