-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
110 lines (86 loc) · 2.35 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
default: build
rsync:
rsync -avz _site/ root@ssh.sandradodd.com:/var/www/site/archive/AlwaysLearning
ssh:
ssh root@ssh.sandradodd.com
build:
bundle exec jekyll build
start:
bundle exec jekyll serve
s: start
# Group: https://groups.yahoo.com/api/v1/groups/AlwaysLearning/
# Topics: https://groups.yahoo.com/api/v1/groups/AlwaysLearning/topics?count=100
# Photos: https://groups.yahoo.com/api/v1/groups/AlwaysLearning/photos
# Links: https://groups.yahoo.com/api/v1/groups/AlwaysLearning/links
# API docs: https://www.archiveteam.org/index.php?title=Yahoo!_Groups
.ONESHELL:
posts:
rvm `cat .ruby-version` do ruby create-posts.rb
cache:
rvm `cat .ruby-version` do ruby downloader.rb
.PHONY: cache
clean:
rm -vf \
cache/topics.json \
cache/topic-`jq .ygData.lastTopic cache/topics.json`.json
stats:
@jq '.ygData.numTopics' topics.json
@ls -1 topic-*.json | wc -l
@du -shc topic-*.json | tail -1
edit:
code -n .
e: edit
include .env
upload:
lftp -u gurdiga@sandradodd.com ftp.sandradodd.com \
--password $(LFTP_PASSWORD) \
-e '\
mirror --delete --reverse --parallel=5 --continue _site archive/AlwaysLearning; \
quit \
'
copy: download rsync feedburner charset encoding
ftp:
time lftp -u gurdiga@sandradodd.com ftp.sandradodd.com \
--password $(LFTP_PASSWORD) $(ARGS)
download:
time lftp -u gurdiga@sandradodd.com ftp.sandradodd.com \
--password $(LFTP_PASSWORD) \
-e "mirror \
--continue \
--parallel=5 \
--exclude-glob=archive/* \
--exclude-glob=logs/* \
. site; \
quit \
"
charset:
time ssh root@ssh.sandradodd.com "\
sed -i --regexp-extended -e 's|charset=windows-1252|charset=utf-8|g' /var/www/site/sca/atenveldt/lockehavenHistory.html \
"
time ssh root@ssh.sandradodd.com "\
find /var/www/site/ -type f -name '*.htm*' | xargs \
sed -i -e 's|charset=iso-8859-1|charset=utf-8|ig' \
"
encoding:
time ssh root@ssh.sandradodd.com '\
find /var/www/site/ -type f -name "*.htm*" | while read file; do \
encoding=`uchardet $$file`; \
if (( encoding != "UTF-8" && encoding != "ASCII" )); then \
echo "> $$file: $$encoding"; \
recode $$encoding...utf8 $$file; \
echo "< $$file: `uchardet $$file`"; \
fi; \
done \
'
i: install
install:
bundle install
u: update
update:
bundle update
a: audit
audit:
bundle exec bundle-audit
au: audit-update
audit-update:
bundle exec bundle-audit update