slitaz-forge view mirror/info/index.php @ rev 568

chub, doc, forum, floppies, mirror-info, pkgs, pro, tank: on demand qrcode script load
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jun 22 18:37:40 2014 +0200 (2014-06-22)
parents 88002a7d0351
children ba908ef4f9ff
line source
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <title>SliTaz Mirror</title>
6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
7 <meta name="description" content="slitaz mirror server" />
8 <meta name="robots" content="index, nofollow" />
9 <meta name="author" content="SliTaz Contributors" />
10 <link rel="shortcut icon" href="/static/favicon.ico" />
11 <link rel="stylesheet" type="text/css" href="/static/slitaz.css" />
12 <style type="text/css">
13 h2 img { padding-right: 4px; }
14 </style>
15 </head>
16 <body>
18 <!-- Header -->
19 <div id="header">
20 <div id="logo"></div>
21 <div id="network">
22 <a href="http://www.slitaz.org/">
23 <img src="/static/home.png" alt=" [ Home ] " /></a>
24 <a href="http://scn.slitaz.org/">Community</a>
25 <a href="http://doc.slitaz.org/">Doc</a>
26 <a href="http://forum.slitaz.org/">Forum</a>
27 <a href="http://slitaz.pro/">Pro</a>
28 <a href="http://slitaz.spreadshirt.net/">Shop</a>
29 <a href="http://bugs.slitaz.org">Bugs</a>
30 <a href="http://hg.slitaz.org/?sort=lastchange">Hg</a>
31 <a href="http://cook.slitaz.org/">Cook</a>
32 </div>
33 <h1><a href="http://<?php echo $_SERVER["HTTP_HOST"]; ?>/">SliTaz
34 <?php $host=preg_replace('/(\w+).*/i','$1',$_SERVER["HTTP_HOST"]); echo $host; ?></a></h1>
35 </div>
37 <!-- Block -->
38 <div id="block">
39 <!-- Navigation -->
40 <div id="block_nav">
41 <h4><img src="images/server.png" alt="[ Server ]" />Project servers</h4>
42 <ul>
43 <li><a href="http://tank.slitaz.org/">Tank server</a></li>
44 <li><a href="http://pangolin.slitaz.org/">Pangolin server</a></li>
45 <li><a href="http://chub.slitaz.org/">Chub server</a></li>
46 </ul>
47 </div>
48 <!-- Information/image -->
49 <div id="block_info">
50 <h4>Codename: <?php echo $host; ?></h4>
51 <p>
52 This is the SliTaz GNU/Linux main mirror. The server runs naturally SliTaz
53 (stable) in an UML virtual machine provided by
54 <a href="http://www.ads-lu.com/">Allied Data Sys. (ADS)</a>.
55 </p>
56 <p>
57 Mirror CPU is a <?php system("( sed '/cpuinfo=/!d;" .
58 "s/.*cpuinfo=\\([^ ]*\).*/: \\1/;s/_/ /g' /proc/cmdline ; grep '^model name' /proc/cpuinfo) | sed -e 's/.*Intel(R) //;" .
59 "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //;q' |" .
60 " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
61 "if (n == 4) printf \"quad \"; print s }' ")?> -
62 <?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
63 "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
64 "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?> - Located in France next to
65 Roubaix. This page has real time statistics provided by PHP
66 <code>system()</code> Mirror is also monitored by RRDtool which provides
67 <a href="graphs.php">graphical stats</a>.
68 </p>
69 </div>
70 </div>
72 <!-- Content -->
73 <div id="content">
75 <h2><a href="graphs.php"><img
76 title="Mirror RRDtool graphs" alt="graphs"
77 src="images/monitor.png" /></a>System stats</h2>
79 <h4>Uptime</h4>
81 <pre class="box">
82 <?php
83 system("uptime | sed 's/^\s*//'");
84 ?>
85 </pre>
87 <h4>Disk usage</h4>
89 <pre class="box">
90 <?php
91 system("df -h | sed '/^rootfs/d' | grep '\(^/dev\|Filesystem\)'");
92 ?>
93 </pre>
95 <h4>Network</h4>
96 <pre class="box">
97 <?php
98 system("ifconfig eth0 | awk '{ if (/X packet/ || /X byte/) print }' | sed 's/^\s*//'");
99 ?>
100 </pre>
103 <?php if (isset($_GET["all"])) { ?>
104 <h4>Logins</h4>
105 <pre class="box">
106 <?php
107 system("last");
108 ?>
109 </pre>
111 <h4>Processes</h4>
112 <pre class="box">
113 <?php
114 system("top -n1 -b");
115 ?>
116 </pre>
117 <?php } ?>
119 <a name="vhosts"></a>
120 <h2><img title="Mirror Virtual hosts" alt="vhosts"
121 src="/static/network.png" />Virtual hosts</h2>
123 <ul>
124 <li><a href="http://mirror.slitaz.org/">mirror.slitaz.org</a> - SliTaz Mirror.
125 (<a href="http://mirror.slitaz.org/stats">stats</a>)</li>
126 <li><a href="http://scn.slitaz.org/">scn.slitaz.org</a> - SliTaz Community Network.
127 (<a href="http://mirror.slitaz.org/awstats.pl?config=scn.slitaz.org">stats</a>)</li>
128 <li><a href="http://pizza.slitaz.org/">pizza.slitaz.org</a> - SliTaz Flavor builder.
129 (<a href="http://mirror.slitaz.org/awstats.pl?config=pizza.mirror.slitaz.org">stats</a>)</li>
130 <li><a href="http://tiny.slitaz.org/">tiny.slitaz.org</a> - Tiny SliTaz builder.
131 (<a href="http://mirror.slitaz.org/awstats.pl?config=tiny.slitaz.org">stats</a>)</li>
132 <li><a href="https://ajaxterm.slitaz.org/">ajaxterm.slitaz.org</a> - Slitaz Web Console.
133 (<a href="http://mirror.slitaz.org/awstats.pl?config=ajaxterm.slitaz.org">stats</a>)</li>
134 </ul>
136 <a name="replicas"></a>
137 <h2><a href="http://mirror.slitaz.org/awstats.pl?config=replicas.mirror.slitaz.org">
138 <img title="Tank replicas" alt="replicas"
139 src="/static/network.png" /></a>Tank replicas</h2>
141 <ul>
142 <li><a href="http://mirror.slitaz.org/www/">www.slitaz.org</a> - SliTaz Website.
143 (<a href="http://www.slitaz.org/">main</a>)</li>
144 <li><a href="http://mirror.slitaz.org/doc/">doc.slitaz.org</a> - Documentation.
145 (<a href="http://doc.slitaz.org/">main</a>)</li>
146 <li><a href="http://mirror.slitaz.org/pkgs/">pkgs.slitaz.org</a> - Packages Web interface.
147 (<a href="http://pkgs.slitaz.org/">main</a>)</li>
148 <li><a href="http://mirror.slitaz.org/hg/?sort=lastchange">hg.slitaz.org</a> - Mercurial repositories (read only).
149 (<a href="http://hg.slitaz.org/?sort=lastchange">main</a>
150 <a href="http://hg.tuxfamily.org/mercurialroot/slitaz/">tuxfamily</a>)</li>
151 <li><a href="http://mirror.slitaz.org/webboot/">boot.slitaz.org</a> - gPXE Web boot.
152 (<a href="http://boot.slitaz.org/">main</a>)</li>
153 </ul>
155 <a name="boot"></a>
156 <h2><a href="http://doc.slitaz.org/en:guides:pxe#web-booting">
157 <img title="Web boot" src="/static/network.png"
158 alt="web boot" /></a>Web boot services</h2>
159 The SliTaz mirror provides a <b>tftp</b> access and a
160 <a href="/pxe">pxe</a> tree. Simply add to your DHCP server configuration file:
161 <ul>
162 <li>for <b>udhcpd</b><!-- siaddr? sname? tftp? -->
163 <pre>
164 siaddr mirror.slitaz.org
165 boot_file gpxe.pxe</pre>
166 </li>
167 <li>for <b>dhcpd</b>
168 <pre>
169 next-server "mirror.slitaz.org"
170 filemane "gpxe.pxe"</pre>
171 </li>
172 <li>for <b>dnsmasq</b>
173 <pre>
174 dhcp-boot=gpxe.pxe,mirror.slitaz.org</pre>
175 </li>
176 </ul>
178 <a name="mirrors"></a>
179 <h2><a href="http://mirror.slitaz.org/awstats.pl?config=rsync">
180 <img title="Secondary mirrors" src="/static/network.png"
181 alt="mirrors" /></a>Mirrors</h2>
182 Most mirrors are updated using the url: <b>rsync://mirror.slitaz.org/slitaz/</b>
183 (<a href="http://mirror.slitaz.org/awstats.pl?config=rsync">stats</a>)
184 <pre>
185 rsync -azH --delete rsync://mirror.slitaz.org/slitaz/ /local/slitaz/mirror/ </pre>
186 New mirrors should be announced on the
187 <a href="http://www.slitaz.org/en/mailing-list.html">mailing list</a>.
188 <ul>
189 <?php
190 $output_url_file="";
191 $output_url_handler;
192 $mirrors_url_file="/tmp/mirrors";
194 function test_url($link, $proto)
195 {
196 global $output_url_file;
197 global $mirrors_url_file;
198 global $output_url_handler;
200 if ($output_url_file != "") {
201 switch($proto) {
202 case "http" :
203 case "ftp" :
204 $cmd = "busybox wget -s $link/README" ;
205 break;
206 case "rsync" :
207 $cmd = "rsync $link > /dev/null 2>&1" ;
208 break;
209 default :
210 return FALSE;
211 }
212 if (shell_exec("$cmd && echo -n OK") == "OK") {
213 fwrite($output_url_handler,$link."\n");
214 return TRUE;
215 }
216 return FALSE;
217 }
218 return shell_exec("grep -qs ^$link$ $mirrors_url_file && echo -n OK") == "OK";
219 }
221 if (! file_exists($mirrors_url_file)) {
222 $output_url_file = tempnam('/tmp','mkmirrors');
223 $output_url_handler = fopen($output_url_file, "w");
224 fwrite($output_url_handler,"http://mirror.slitaz.org/\n");
225 fwrite($output_url_handler,"rsync://mirror.slitaz.org/\n");
226 }
228 # Flags icons from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip
229 foreach (array(
230 array( "flag" => "ch",
231 "http" => "http://mirror.switch.ch/ftp/mirror/slitaz/",
232 "ftp" => "ftp://mirror.switch.ch/mirror/slitaz/"),
233 array( "flag" => "us",
234 "http" => "http://www.gtlib.gatech.edu/pub/slitaz/",
235 "ftp" => "ftp://ftp.gtlib.gatech.edu/pub/slitaz/",
236 "rsync" => "rsync://www.gtlib.gatech.edu/slitaz/"),
237 array( "flag" => "fr",
238 "http" => "http://download.tuxfamily.org/slitaz/",
239 "ftp" => "ftp://download.tuxfamily.org/slitaz/",
240 "rsync" => "rsync://download.tuxfamily.org/pub/slitaz/"),
241 array( "flag" => "fr",
242 "http" => "http://www.linuxembarque.com/slitaz/mirror/"),
243 // array( "flag" => "cn",
244 // "http" => "http://mirror.lupaworld.com/slitaz/"),
245 array( "flag" => "cn",
246 "http" => "http://ks.lupaworld.com/slitaz/"),
247 array( "flag" => "br",
248 "http" => "http://slitaz.c3sl.ufpr.br/",
249 "ftp" => "ftp://slitaz.c3sl.ufpr.br/slitaz/",
250 "rsync" => "rsync://slitaz.c3sl.ufpr.br/slitaz/"),
251 array( "flag" => "it",
252 "http" => "http://slitaz.mirror.garr.it/mirrors/slitaz/",
253 "ftp" => "ftp://slitaz.mirror.garr.it/mirrors/slitaz/",
254 "rsync" => "rsync://slitaz.mirror.garr.it/mirrors/slitaz/"),
255 array( "flag" => "si",
256 "http" => "http://mirror.drustvo-dns.si/slitaz/"),
257 // array( "flag" => "si",
258 // "ftp" => "ftp://ftp.pina.si/slitaz/"),
259 array( "flag" => "us",
260 "http" => "http://distro.ibiblio.org/pub/linux/distributions/slitaz/",
261 "ftp" => "ftp://distro.ibiblio.org/pub/linux/distributions/slitaz/"),
262 array( "flag" => "nl",
263 "http" => "http://ftp.vim.org/ftp/os/Linux/distr/slitaz/",
264 "ftp" => "ftp://ftp.vim.org/mirror/os/Linux/distr/slitaz/"),
265 array( "flag" => "nl",
266 "http" => "http://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/",
267 "ftp" => "ftp://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/"),
268 array( "flag" => "ch",
269 "http" => "http://ftp.ch.xemacs.org/ftp/pool/2/mirror/slitaz/",
270 "ftp" => "ftp://ftp.ch.xemacs.org//pool/2/mirror/slitaz/"),
271 array( "flag" => "de",
272 "http" => "http://ftp.uni-stuttgart.de/slitaz/",
273 "ftp" => "ftp://ftp.uni-stuttgart.de/slitaz/"),
274 array( "flag" => "au",
275 "http" => "http://mirror.iprimus.com/slitaz/"),
276 array( "flag" => "au",
277 "http" => "http://mirror01.ipgn.com.au/slitaz/"),
278 array( "flag" => "us",
279 "http" => "http://mirror.clarkson.edu/slitaz/",
280 "rsync" => "rsync://mirror.clarkson.edu/slitaz/")) as $mirror) {
281 $flag = "images/flags/".$mirror["flag"].".png";
282 $head = TRUE;
283 foreach(array("http", "ftp", "rsync") as $proto) {
284 if (!isset($mirror[$proto])) continue;
285 $link = $mirror[$proto];
286 if (!test_url($link, $proto)) continue;
287 $serveur = parse_url($link, PHP_URL_HOST);
288 if ($head) echo <<<EOT
289 <li><a href="http://en.utrace.de/?query=$serveur">
290 <img title="map" src="$flag" alt="map" /></a>
291 <a href="$link">$link</a>
292 EOT;
293 else echo <<<EOT
294 or <a href="$link">$proto</a>
295 EOT;
296 $head = FALSE;
297 }
298 if ($head) continue;
299 echo " </li>\n";
300 }
302 if ($output_url_file != "") {
303 fclose($output_url_handler);
304 rename($output_url_file, $mirrors_url_file);
305 chmod($mirrors_url_file, 0644);
306 }
308 ?>
309 </ul>
311 <a name="builds"></a>
312 <h3><img title="Daily builds" src="images/iso.png" alt="builds"
313 width="25" height="25" />
314 Daily builds</h3>
316 <?php
317 function display_log($file,$anchor,$url)
318 {
319 echo '<a name="'.$anchor.'"></a>';
320 echo "<h4><a href=\"$url\">";
321 system("stat -c '%y %n' ".$file." | sed 's/.000000000//;s|/var/log/\(.*\).log|\\1.iso|'");
322 echo "</a></h4>";
323 echo "<pre>";
324 $sed_script="s/.\[[0-9][^mG]*.//g";
325 $sed_script.=";:a;s/^\(.\{1,68\}\)\(\[ [A-Za-z]* \]\)/\\1 \\2/;ta";
326 $sed_script.=";s#\[ OK \]#[ <span style=\"color:green\">OK</span> ]#";
327 $sed_script.=";s#\[ Failed \]#[ <span style=\"color:red\">Failed</span> ]#";
328 system("sed '".$sed_script."' < $file");
329 echo "</pre>";
330 }
332 display_log("/var/log/packages-stable.log", "buildstable", "/iso/stable/packages-4.0.iso");
333 display_log("/var/log/packages-cooking.log","buildcooking","/iso/cooking/packages-cooking.iso");
334 ?>
336 <!-- End of content -->
337 </div>
339 <!-- Footer -->
341 <script type="text/javascript">
342 function QRCodePNG(str, obj) {
343 try {
344 return QRCode.generatePNG(str, {ecclevel: 'H'});
345 }
346 catch (any) {
347 var element = document.createElement("script");
348 element.src = "/static/qrcode.js";
349 element.type ="text/javascript";
350 element.onload = function() {
351 obj.src = QRCode.generatePNG(str, {ecclevel: 'H'});
352 };
353 document.body.appendChild(element);
354 }
355 }
356 </script>
358 <div id="footer">
359 Copyright &copy; <span class="year"></span>
360 <a href="http://www.slitaz.org/">SliTaz</a> - Network:
361 <a href="http://scn.slitaz.org/">Community</a>
362 <a href="http://doc.slitaz.org/">Doc</a>
363 <a href="http://forum.slitaz.org/">Forum</a>
364 <a href="http://pkgs.slitaz.org/">Packages</a>
365 <a href="http://boot.slitaz.org/">Boot</a>
366 <a href="http://bugs.slitaz.org">Bugs</a>
367 <a href="http://hg.slitaz.org/?sort=lastchange">Hg</a>
368 <p>
369 <img src="/static/qr.png" alt="SliTaz @" onmouseover="this.title = location.href"
370 onclick="this.src = QRCodePNG(location.href, this)" />
371 <a href="http://twitter.com/slitaz">Twitter</a>
372 <a href="http://www.facebook.com/slitaz">Facebook</a>
373 <a href="http://distrowatch.com/slitaz">Distrowatch</a>
374 <a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a>
375 <a href="http://flattr.com/profile/slitaz">Flattr</a>
376 </p>
377 <p>
378 <a href="http://validator.w3.org/check?uri=referer">
379 <img src="/static/xhtml10.png"
380 alt="Valid XHTML 1.0" title="Code valid. XHTML 1.0"
381 style="width: 80px; height: 15px;" /></a>
382 </p>
383 </div>
385 </body>
386 </html>