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

mirror: add QR code
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Mar 20 18:32:44 2013 +0100 (2013-03-20)
parents 0af8c6e40dcd
children 41bfd0397973
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 lguest 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 -e '/^model name/!d;s/.*Intel(R) //;" .
58 "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //' </proc/cpuinfo |" .
59 " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
60 "if (n == 4) printf \"quad \"; print s }' ")?> -
61 <?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
62 "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
63 "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?> - Located in France next to
64 Roubaix. This page has real time statistics provided by PHP
65 <code>system()</code> Mirror is also monitored by RRDtool which provides
66 <a href="graphs.php">graphical stats</a>.
67 </p>
68 </div>
69 </div>
71 <!-- Content -->
72 <div id="content">
74 <h2><a href="graphs.php"><img
75 title="Mirror RRDtool graphs" alt="graphs"
76 src="images/monitor.png" /></a>System stats</h2>
78 <h4>Uptime</h4>
80 <pre class="box">
81 <?php
82 system("uptime | sed 's/^\s*//'");
83 ?>
84 </pre>
86 <h4>Disk usage</h4>
88 <pre class="box">
89 <?php
90 system("df -h | sed '/^rootfs/d' | grep '\(^/dev\|Filesystem\)'");
91 ?>
92 </pre>
94 <h4>Network</h4>
95 <pre class="box">
96 <?php
97 system("ifconfig eth0 | awk '{ if (/X packet/ || /X byte/) print }' | sed 's/^\s*//'");
98 ?>
99 </pre>
102 <?php if (isset($_GET["all"])) { ?>
103 <h4>Logins</h4>
104 <pre class="box">
105 <?php
106 system("last");
107 ?>
108 </pre>
110 <h4>Processes</h4>
111 <pre class="box">
112 <?php
113 system("top -n1 -b");
114 ?>
115 </pre>
116 <?php } ?>
118 <a name="vhosts"></a>
119 <h2><img title="Mirror Virtual hosts" alt="vhosts"
120 src="/static/network.png" />Virtual hosts</h2>
122 <ul>
123 <li><a href="http://mirror.slitaz.org/">mirror.slitaz.org</a> - SliTaz Mirror.
124 (<a href="http://mirror.slitaz.org/stats">stats</a>)</li>
125 <li><a href="http://scn.slitaz.org/">scn.slitaz.org</a> - SliTaz Community Network.
126 (<a href="http://mirror.slitaz.org/awstats.pl?config=scn.slitaz.org">stats</a>)</li>
127 <li><a href="http://pizza.slitaz.org/">pizza.slitaz.org</a> - SliTaz Flavor builder.
128 (<a href="http://mirror.slitaz.org/awstats.pl?config=pizza.mirror.slitaz.org">stats</a>)</li>
129 <li><a href="http://tiny.slitaz.org/">tiny.slitaz.org</a> - Tiny SliTaz builder.
130 (<a href="http://mirror.slitaz.org/awstats.pl?config=tiny.slitaz.org">stats</a>)</li>
131 <li><a href="https://ajaxterm.slitaz.org/">ajaxterm.slitaz.org</a> - Slitaz Web Console.
132 (<a href="http://mirror.slitaz.org/awstats.pl?config=ajaxterm.slitaz.org">stats</a>)</li>
133 </ul>
135 <a name="replicas"></a>
136 <h2><a href="http://mirror.slitaz.org/awstats.pl?config=replicas.mirror.slitaz.org">
137 <img title="Tank replicas" alt="replicas"
138 src="/static/network.png" /></a>Tank replicas</h2>
140 <ul>
141 <li><a href="http://mirror.slitaz.org/www/">www.slitaz.org</a> - SliTaz Website.
142 (<a href="http://www.slitaz.org/">main</a>)</li>
143 <li><a href="http://mirror.slitaz.org/doc/">doc.slitaz.org</a> - Documentation.
144 (<a href="http://doc.slitaz.org/">main</a>)</li>
145 <li><a href="http://mirror.slitaz.org/pkgs/">pkgs.slitaz.org</a> - Packages Web interface.
146 (<a href="http://pkgs.slitaz.org/">main</a>)</li>
147 <li><a href="http://mirror.slitaz.org/hg/?sort=lastchange">hg.slitaz.org</a> - Mercurial repositories (read only).
148 (<a href="http://hg.slitaz.org/?sort=lastchange">main</a>
149 <a href="http://hg.tuxfamily.org/mercurialroot/slitaz/">tuxfamily</a>)</li>
150 <li><a href="http://mirror.slitaz.org/webboot/">boot.slitaz.org</a> - gPXE Web boot.
151 (<a href="http://boot.slitaz.org/">main</a>)</li>
152 </ul>
154 <a name="boot"></a>
155 <h2><a href="http://doc.slitaz.org/en:guides:pxe#web-booting">
156 <img title="Web boot" src="/static/network.png"
157 alt="web boot" /></a>Web boot services</h2>
158 The SliTaz mirror provides a <b>tftp</b> access and a
159 <a href="/pxe">pxe</a> tree. Simply add to your DHCP server configuration file:
160 <ul>
161 <li>for <b>udhcpd</b><!-- siaddr? sname? tftp? -->
162 <pre>
163 siaddr mirror.slitaz.org
164 boot_file gpxe.pxe</pre>
165 </li>
166 <li>for <b>dhcpd</b>
167 <pre>
168 next-server "mirror.slitaz.org"
169 filemane "gpxe.pxe"</pre>
170 </li>
171 <li>for <b>dnsmasq</b>
172 <pre>
173 dhcp-boot=gpxe.pxe,mirror.slitaz.org</pre>
174 </li>
175 </ul>
177 <a name="mirrors"></a>
178 <h2><a href="http://mirror.slitaz.org/awstats.pl?config=rsync">
179 <img title="Secondary mirrors" src="/static/network.png"
180 alt="mirrors" /></a>Mirrors</h2>
181 Most mirrors are updated using the url: <b>rsync://mirror.slitaz.org/slitaz/</b>
182 (<a href="http://mirror.slitaz.org/awstats.pl?config=rsync">stats</a>)
183 <pre>
184 rsync -azH --delete rsync://mirror.slitaz.org/slitaz/ /local/slitaz/mirror/ </pre>
185 New mirrors should be announced on the
186 <a href="http://www.slitaz.org/en/mailing-list.html">mailing list</a>.
187 <ul>
188 <?php
189 $output_url_file="";
190 $output_url_handler;
191 $mirrors_url_file="/tmp/mirrors";
193 function test_url($link, $proto)
194 {
195 global $output_url_file;
196 global $mirrors_url_file;
197 global $output_url_handler;
199 if ($output_url_file != "") {
200 switch($proto) {
201 case "http" :
202 case "ftp" :
203 $cmd = "busybox wget -s $link/README" ;
204 break;
205 case "rsync" :
206 $cmd = "rsync $link > /dev/null 2>&1" ;
207 break;
208 default :
209 return FALSE;
210 }
211 if (shell_exec("$cmd && echo -n OK") == "OK") {
212 fwrite($output_url_handler,$link."\n");
213 return TRUE;
214 }
215 return FALSE;
216 }
217 return shell_exec("grep -qs ^$link$ $mirrors_url_file && echo -n OK") == "OK";
218 }
220 if (! file_exists($mirrors_url_file)) {
221 $output_url_file = tempnam('/tmp','mkmirrors');
222 $output_url_handler = fopen($output_url_file, "w");
223 fwrite($output_url_handler,"http://mirror.slitaz.org/\n");
224 fwrite($output_url_handler,"rsync://mirror.slitaz.org/\n");
225 }
227 # Flags icons from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip
228 foreach (array(
229 array( "flag" => "ch",
230 "http" => "http://mirror.switch.ch/ftp/mirror/slitaz/",
231 "ftp" => "ftp://mirror.switch.ch/mirror/slitaz/"),
232 array( "flag" => "us",
233 "http" => "http://www.gtlib.gatech.edu/pub/slitaz/",
234 "ftp" => "ftp://ftp.gtlib.gatech.edu/pub/slitaz/",
235 "rsync" => "rsync://www.gtlib.gatech.edu/slitaz/"),
236 array( "flag" => "fr",
237 "http" => "http://download.tuxfamily.org/slitaz/",
238 "ftp" => "ftp://download.tuxfamily.org/slitaz/",
239 "rsync" => "rsync://download.tuxfamily.org/pub/slitaz/"),
240 array( "flag" => "fr",
241 "http" => "http://www.linuxembarque.com/slitaz/mirror/"),
242 array( "flag" => "cn",
243 "http" => "http://mirror.lupaworld.com/slitaz/"),
244 array( "flag" => "cn",
245 "http" => "http://ks.lupaworld.com/slitaz/"),
246 array( "flag" => "br",
247 "http" => "http://slitaz.c3sl.ufpr.br/",
248 "ftp" => "ftp://slitaz.c3sl.ufpr.br/slitaz/",
249 "rsync" => "rsync://slitaz.c3sl.ufpr.br/slitaz/"),
250 array( "flag" => "it",
251 "http" => "http://slitaz.mirror.garr.it/mirrors/slitaz/",
252 "ftp" => "ftp://slitaz.mirror.garr.it/mirrors/slitaz/",
253 "rsync" => "rsync://slitaz.mirror.garr.it/mirrors/slitaz/"),
254 array( "flag" => "si",
255 "http" => "http://mirror.drustvo-dns.si/slitaz/"),
256 array( "flag" => "si",
257 "ftp" => "ftp://ftp.pina.si/slitaz/"),
258 array( "flag" => "us",
259 "http" => "http://distro.ibiblio.org/pub/linux/distributions/slitaz/",
260 "ftp" => "ftp://distro.ibiblio.org/pub/linux/distributions/slitaz/"),
261 array( "flag" => "nl",
262 "http" => "http://ftp.vim.org/ftp/os/Linux/distr/slitaz/",
263 "ftp" => "ftp://ftp.vim.org/mirror/os/Linux/distr/slitaz/"),
264 array( "flag" => "nl",
265 "http" => "http://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/",
266 "ftp" => "ftp://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/"),
267 array( "flag" => "ch",
268 "http" => "http://ftp.ch.xemacs.org/ftp/pool/2/mirror/slitaz/",
269 "ftp" => "ftp://ftp.ch.xemacs.org//pool/2/mirror/slitaz/"),
270 array( "flag" => "de",
271 "http" => "http://ftp.uni-stuttgart.de/slitaz/",
272 "ftp" => "ftp://ftp.uni-stuttgart.de/slitaz/"),
273 array( "flag" => "au",
274 "http" => "http://mirror.iprimus.com/slitaz/"),
275 array( "flag" => "au",
276 "http" => "http://mirror01.ipgn.com.au/slitaz/"),
277 array( "flag" => "us",
278 "http" => "http://mirror.clarkson.edu/slitaz/",
279 "rsync" => "rsync://mirror.clarkson.edu/slitaz/")) as $mirror) {
280 $flag = "images/flags/".$mirror["flag"].".png";
281 $head = TRUE;
282 foreach(array("http", "ftp", "rsync") as $proto) {
283 if (!isset($mirror[$proto])) continue;
284 $link = $mirror[$proto];
285 if (!test_url($link, $proto)) continue;
286 $serveur = parse_url($link, PHP_URL_HOST);
287 if ($head) echo <<<EOT
288 <li><a href="http://en.utrace.de/?query=$serveur">
289 <img title="map" src="$flag" alt="map" /></a>
290 <a href="$link">$link</a>
291 EOT;
292 else echo <<<EOT
293 or <a href="$link">$proto</a>
294 EOT;
295 $head = FALSE;
296 }
297 if ($head) continue;
298 echo " </li>\n";
299 }
301 if ($output_url_file != "") {
302 fclose($output_url_handler);
303 rename($output_url_file, $mirrors_url_file);
304 chmod($mirrors_url_file, 0644);
305 }
307 ?>
308 </ul>
310 <a name="builds"></a>
311 <h3><img title="Daily builds" src="images/iso.png" alt="builds"
312 width="25" height="25" />
313 Daily builds</h3>
315 <?php
316 function display_log($file,$anchor,$url)
317 {
318 echo '<a name="'.$anchor.'"></a>';
319 echo "<h4><a href=\"$url\">";
320 system("stat -c '%y %n' ".$file." | sed 's/.000000000//;s|/var/log/\(.*\).log|\\1.iso|'");
321 echo "</a></h4>";
322 echo "<pre>";
323 $sed_script="s/.\[[0-9][^mG]*.//g";
324 $sed_script.=";:a;s/^\(.\{1,68\}\)\(\[ [A-Za-z]* \]\)/\\1 \\2/;ta";
325 $sed_script.=";s#\[ OK \]#[ <span style=\"color:green\">OK</span> ]#";
326 $sed_script.=";s#\[ Failed \]#[ <span style=\"color:red\">Failed</span> ]#";
327 system("sed '".$sed_script."' < $file");
328 echo "</pre>";
329 }
331 display_log("/var/log/packages-stable.log", "buildstable", "/iso/stable/packages-3.0.iso");
332 display_log("/var/log/packages-cooking.log","buildcooking","/iso/cooking/packages-cooking.iso");
333 ?>
335 <!-- End of content -->
336 </div>
338 <!-- Footer -->
339 <div id="footer">
340 Copyright &copy; <span class="year"></span>
341 <a href="http://www.slitaz.org/">SliTaz</a> - Network:
342 <a href="http://scn.slitaz.org/">Community</a>
343 <a href="http://doc.slitaz.org/">Doc</a>
344 <a href="http://forum.slitaz.org/">Forum</a>
345 <a href="http://pkgs.slitaz.org/">Packages</a>
346 <a href="http://boot.slitaz.org/">Boot</a>
347 <a href="http://bugs.slitaz.org">Bugs</a>
348 <a href="http://hg.slitaz.org/">Hg</a>
349 <p>
350 SliTaz @
351 <a href="http://twitter.com/slitaz">Twitter</a>
352 <a href="http://www.facebook.com/slitaz">Facebook</a>
353 <a href="http://distrowatch.com/slitaz">Distrowatch</a>
354 <a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a>
355 <a href="http://flattr.com/profile/slitaz">Flattr</a>
356 </p>
357 <p>
358 <a href="http://validator.w3.org/check?uri=referer">
359 <img src="/static/xhtml10.png"
360 alt="Valid XHTML 1.0" title="Code valid. XHTML 1.0"
361 style="width: 80px; height: 15px;" /></a>
362 </p>
363 <p>
364 <img src="#" id="qrcodeimg" alt="#" width="60" height="60"
365 onclick= "this.width = this.height = 300;" />
366 <script type="text/javascript" src="/static/qrcode.js"></script>
367 <script type="text/javascript">
368 document.getElementById('qrcodeimg').src =
369 QRCode.generatePNG(location.href, {ecclevel: 'H'});
370 </script>
371 </p>
372 </div>
374 </body>
375 </html>