-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.txt
107 lines (79 loc) · 3.5 KB
/
README.txt
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
node version v4.2.6 -- works well
---- installation of nightmare with xvfb --- vvv
apt-get update &&\
apt-get install -y libgtk2.0-0 libgconf-2-4 \
libasound2 libxtst6 libxss1 libnss3 xvfb
Xvfb -ac -screen scrn 1280x2000x24 :9.0 &> /dev/null & disown
and it's very important do add this to .bashrc
export DISPLAY=:9.0
diagnose:
sudo apt-get install x11-utils
xdpyinfo -display :9.0 >/dev/null 2>&1 && echo "In use" || echo "Free"
git clone https://github.com/stopsopa/spark.git spark
cd spark
npm install -g yarn
yarn install
npm run supervisor 0.0.0.0 8080 &
npm run start 0.0.0.0 80 &
echo '<head><meta http-equiv="refresh" content="4"></head><body><pre>' > static/log.html && node crawler.jsx &>> static/log.html & disown
echo '<pre>' > static/log.html && node crawler.jsx &>> static/log.html & disown
# vagrant for testing
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.synced_folder ".", "/vagrant/vbox"
config.vm.network "private_network", ip: ENV["VM_TEST"] || "172.28.121.1"
config.vm.provider "virtualbox" do |vb|
vb.name = "vagrant-nightmare"
vb.memory = "2524"
# vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end
config.vm.hostname = "vagrant-nightmare"
end
---- installation of nightmare with xvfb --- ^^^
update spark_cache set updateRequest = FROM_UNIXTIME(UNIX_TIMESTAMP() + (100000 - length(url)))
yarn install
npm run test
npm run start
http://localhost/sandbox.html
npm run start 0.0.0.0 80
(sudo killall electron && echo 'killed' || echo 'nothing to kill') && (sudo killall node && echo 'killed' || echo 'nothing to kill') && sudo npm run start 0.0.0.0 80
#kill and run for tests
((kill $(ps aux | grep "killme" | grep -v grep | grep -v sh | head -1 | awk '{print $2}')) && echo 'killed' || echo 'nothing to kill') && npm run start 0.0.0.0 81 killme & disown
and then
http://xxxx:81/sandbox.html
window.nmsc = window.nmsc || []; nmsc.push(true);
/// headless browser testing travis-ci
https://docs.travis-ci.com/user/gui-and-headless-browsers/
---- further research ----
https://github.com/oliviertassinari/react-swipeable-views
---- further research ----- vvv
grab html : lib\server.js:400
---- further research ----- ^^^
--- manual work ---- vvv
delete from spark_cache where id != '42099b4af021e53fd8fd4e056c2568d7c2e3ffa8'
node early_spider.jsx
--- manual work ---- ^^^
411 pages within 31 minut [1860 sek] => 4.52 sek per page
---- test --- vvv
npm run start 138.68.156.126 8081
---- test --- ^^^
=== x crush log ====
root 11779 0.0 22.3 390544 227116 ? S Mar15 1:41 Xvfb -ac -screen scrn 1280x2000x24 :9.0
2017-03-17-12-41-57
root 11779 0.0 22.3 390544 227116 ? S Mar15 1:41 Xvfb -ac -screen scrn 1280x2000x24 :9.0
2017-03-17-12-46-57
root 11779 0.0 22.3 390544 227116 ? S Mar15 1:41 Xvfb -ac -screen scrn 1280x2000x24 :9.0
2017-03-17-12-51-57
root 11779 0.0 23.0 390916 234176 ? S Mar15 1:42 Xvfb -ac -screen scrn 1280x2000x24 :9.0
2017-03-17-12-56-57
root 11779 0.0 23.4 394672 238220 ? S Mar15 1:43 Xvfb -ac -screen scrn 1280x2000x24 :9.0
2017-03-17-13-01-57
root 11779 0.0 23.7 397828 241540 ? S Mar15 1:45 Xvfb -ac -screen scrn 1280x2000x24 :9.0
2017-03-17-13-06-58
root 11779 0.0 24.0 401060 244548 ? S Mar15 1:47 Xvfb -ac -screen scrn 1280x2000x24 :9.0
2017-03-17-13-11-58
2017-03-17-13-16-58
2017-03-17-13-21-58
2017-03-17-13-26-58
2017-03-17-13-31-58
2017-03-17-13-34-17