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

mirror/info: Update pages and link to use files from static and images (the one only used here)
author Christophe Lincoln <pankso@slitaz.org>
date Tue Mar 20 20:37:15 2012 +0100 (2012-03-20)
parents 2ff7070bdedc
children 1f27742b054c
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 #copy {
14 text-align: center;
15 }
17 #bottom {
18 text-align: center;
19 }
20 </style>
21 </head>
22 <body>
24 <!-- Header -->
25 <div id="header">
26 <div id="logo"></div>
27 <div id="network">
28 <a href="http://www.slitaz.org/">
29 <img src="/css/pics/network.png" alt="network.png" /></a>
30 <a href="http://scn.slitaz.org/">Community</a>
31 <a href="http://doc.slitaz.org/" title="SliTaz Community Documentation">Doc</a>
32 <a href="http://forum.slitaz.org/" title="Slitaz Forum">Forum</a>
33 <a href="http://bugs.slitaz.org/" title="Bug Tracking System">Bugs</a>
34 <a href="http://hg.slitaz.org/" title="SliTaz repositories">Hg</a>
35 </div>
36 <h1><a href="http://<?php echo $_SERVER["HTTP_HOST"]; ?>/">SliTaz
37 <?php $host=preg_replace('/(\w+).*/i','$1',$_SERVER["HTTP_HOST"]); echo $host; ?></a></h1>
38 </div>
40 <!-- Block -->
41 <div id="block">
42 <!-- Navigation -->
43 <div id="block_nav">
44 <h4><img src="images/server.png" alt="[ Server ]" />Project servers</h4>
45 <ul>
46 <li><a href="http://tank.slitaz.org/">Tank server</a></li>
47 <li><a href="http://pangolin.slitaz.org/">Pangolin server</a></li>
48 <li><a href="http://chub.slitaz.org/">Chub server</a></li>
49 </ul>
50 </div>
51 <!-- Information/image -->
52 <div id="block_info">
53 <h4>Codename: <?php echo $host; ?></h4>
54 <p>
55 This is the SliTaz GNU/Linux main mirror. The server runs naturally SliTaz
56 (stable) in an lguest virtual machine provided by
57 <a href="http://www.ads-lu.com/">Allied Data Sys. (ADS)</a>.
58 </p>
59 <p>
60 Mirror CPU is a <?php system("sed -e '/^model name/!d;s/.*Intel(R) //;" .
61 "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //' </proc/cpuinfo |" .
62 " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
63 "if (n == 4) printf \"quad \"; print s }' ")?> -
64 <?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
65 "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
66 "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?> - Located in France next to
67 Roubaix. This page has real time statistics provided by PHP
68 <code>system()</code> Mirror is also monitored by RRDtool which provides
69 <a href="graphs.php">graphical stats</a>.
70 </p>
71 </div>
72 </div>
74 <!-- Content -->
75 <div id="content">
77 <h2><a href="graphs.php"><img
78 style="padding: 0 4px 0 0;"
79 title="Mirror RRDtool graphs" alt="graphs"
80 src="images/monitor.png" /></a>System stats</h2>
82 <h4>Uptime</h4>
84 <pre class="box">
85 <?php
86 system("uptime | sed 's/^\s*//'");
87 ?>
88 </pre>
90 <h4>Disk usage</h4>
92 <pre class="box">
93 <?php
94 system("df -h | sed '/^rootfs/d' | grep '\(^/dev\|Filesystem\)'");
95 ?>
96 </pre>
98 <h4>Network</h4>
99 <pre class="box">
100 <?php
101 system("ifconfig eth0 | awk '{ if (/X packet/ || /X byte/) print }' | sed 's/^\s*//'");
102 ?>
103 </pre>
106 <?php if (isset($_GET["all"])) { ?>
107 <h4>Logins</h4>
108 <pre class="box">
109 <?php
110 system("last");
111 ?>
112 </pre>
114 <h4>Processes</h4>
115 <pre class="box">
116 <?php
117 system("top -n1 -b");
118 ?>
119 </pre>
120 <?php } ?>
122 <a name="vhosts"></a>
123 <h3><a href="http://mirror.slitaz.org/awstats.pl?config=info.mirror.slitaz.org">
124 <img title="Mirror Virtual hosts" alt="vhosts"
125 src="pics/website/vhosts.png" /></a>Virtual hosts</h3>
127 <ul>
128 <li><a href="http://mirror.slitaz.org/">mirror.slitaz.org</a> - SliTaz Mirror.
129 (<a href="http://mirror.slitaz.org/stats">stats</a>)</li>
130 <li><a href="http://scn.slitaz.org/">scn.slitaz.org</a> - SliTaz Community Network.
131 (<a href="http://mirror.slitaz.org/awstats.pl?config=scn.slitaz.org">stats</a>)</li>
132 <li><a href="http://pizza.slitaz.org/">pizza.slitaz.org</a> - SliTaz Flavor builder.
133 (<a href="http://mirror.slitaz.org/awstats.pl?config=pizza.mirror.slitaz.org">stats</a>)</li>
134 <li><a href="http://tiny.slitaz.org/">tiny.slitaz.org</a> - Tiny SliTaz builder.
135 (<a href="http://mirror.slitaz.org/awstats.pl?config=tiny.slitaz.org">stats</a>)</li>
136 <li><a href="https://ajaxterm.slitaz.org/">ajaxterm.slitaz.org</a> - Slitaz Web Console.
137 (<a href="http://mirror.slitaz.org/awstats.pl?config=ajaxterm.slitaz.org">stats</a>)</li>
138 </ul>
140 <a name="replicas"></a>
141 <h3><a href="http://mirror.slitaz.org/awstats.pl?config=replicas.mirror.slitaz.org">
142 <img title="Tank replicas" alt="replicas"
143 src="pics/website/vhosts.png" /></a>Tank replicas</h3>
145 <ul>
146 <li><a href="http://mirror.slitaz.org/www/">www.slitaz.org</a> - SliTaz Website.
147 (<a href="http://www.slitaz.org/">main</a>)</li>
148 <li><a href="http://mirror.slitaz.org/doc/">doc.slitaz.org</a> - Documentation.
149 (<a href="http://doc.slitaz.org/">main</a>)</li>
150 <li><a href="http://mirror.slitaz.org/pkgs/">pkgs.slitaz.org</a> - Packages Web interface.
151 (<a href="http://pkgs.slitaz.org/">main</a>)</li>
152 <li><a href="http://mirror.slitaz.org/hg/">hg.slitaz.org</a> - Mercurial repositories (read only).
153 (<a href="http://hg.slitaz.org/">main</a>
154 <a href="http://hg.tuxfamily.org/mercurialroot/slitaz/">tuxfamily</a>)</li>
155 <li><a href="http://mirror.slitaz.org/webboot/">boot.slitaz.org</a> - gPXE Web boot.
156 (<a href="http://boot.slitaz.org/">main</a>)</li>
157 </ul>
159 <a name="boot"></a>
160 <h3><a href="http://doc.slitaz.org/en:guides:pxe#web-booting">
161 <img title="Web boot" src="/static/network.png"
162 alt="web boot" /></a>Web boot services</h3>
163 The SliTaz mirror provides a <b>tftp</b> access and a
164 <a href="/pxe">pxe</a> tree. Simply add to your DHCP server configuration file:
165 <ul>
166 <li>for <b>udhcpd</b><!-- siaddr? sname? tftp? -->
167 <pre>
168 siaddr mirror.slitaz.org
169 boot_file gpxe.pxe</pre>
170 </li>
171 <li>for <b>dhcpd</b>
172 <pre>
173 next-server "mirror.slitaz.org"
174 filemane "gpxe.pxe"</pre>
175 </li>
176 <li>for <b>dnsmasq</b>
177 <pre>
178 dhcp-boot=gpxe.pxe,mirror.slitaz.org</pre>
179 </li>
180 </ul>
182 <a name="mirrors"></a>
183 <h3><a href="http://mirror.slitaz.org/awstats.pl?config=rsync">
184 <img title="Secondary mirrors" src="/static/network.png"
185 alt="mirrors" /></a>Mirrors</h3>
186 Most mirrors are updated using the url: <b>rsync://mirror.slitaz.org/slitaz/</b>
187 (<a href="http://mirror.slitaz.org/awstats.pl?config=rsync">stats</a>)
188 <pre>
189 rsync -azH --delete rsync://mirror.slitaz.org/slitaz/ /local/slitaz/mirror/ </pre>
190 New mirrors should be announced on the
191 <a href="http://www.slitaz.org/en/mailing-list.html">mailing list</a>.
192 <ul>
193 <?php
194 $output_url_file="";
195 $output_url_handler;
196 $mirrors_url_file="/tmp/mirrors";
198 function test_url($link, $proto)
199 {
200 global $output_url_file;
201 global $mirrors_url_file;
202 global $output_url_handler;
204 if ($output_url_file != "") {
205 switch($proto) {
206 case "http" :
207 case "ftp" :
208 $cmd = "busybox wget -s $link/README" ;
209 break;
210 case "rsync" :
211 $cmd = "rsync $link > /dev/null 2>&1" ;
212 break;
213 default :
214 return FALSE;
215 }
216 if (shell_exec("$cmd && echo -n OK") == "OK") {
217 fwrite($output_url_handler,$link."\n");
218 return TRUE;
219 }
220 return FALSE;
221 }
222 return shell_exec("grep -qs ^$link$ $mirrors_url_file && echo -n OK") == "OK";
223 }
225 if (! file_exists($mirrors_url_file)) {
226 $output_url_file = tempnam('/tmp','mkmirrors');
227 $output_url_handler = fopen($output_url_file, "w");
228 fwrite($output_url_handler,"http://mirror.slitaz.org/\n");
229 fwrite($output_url_handler,"rsync://mirror.slitaz.org/\n");
230 }
232 # Flags icons from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip
233 foreach (array(
234 array( "flag" => "ch",
235 "http" => "http://mirror.switch.ch/ftp/mirror/slitaz/",
236 "ftp" => "ftp://mirror.switch.ch/mirror/slitaz/"),
237 array( "flag" => "us",
238 "http" => "http://www.gtlib.gatech.edu/pub/slitaz/",
239 "ftp" => "ftp://ftp.gtlib.gatech.edu/pub/slitaz/",
240 "rsync" => "rsync://www.gtlib.gatech.edu/slitaz/"),
241 array( "flag" => "fr",
242 "http" => "http://download.tuxfamily.org/slitaz/",
243 "ftp" => "ftp://download.tuxfamily.org/slitaz/",
244 "rsync" => "rsync://download.tuxfamily.org/pub/slitaz/"),
245 array( "flag" => "fr",
246 "http" => "http://www.linuxembarque.com/slitaz/mirror/"),
247 array( "flag" => "cn",
248 "http" => "http://mirror.lupaworld.com/slitaz/"),
249 array( "flag" => "cn",
250 "http" => "http://ks.lupaworld.com/slitaz/"),
251 array( "flag" => "br",
252 "http" => "http://slitaz.c3sl.ufpr.br/",
253 "ftp" => "ftp://slitaz.c3sl.ufpr.br/slitaz/",
254 "rsync" => "rsync://slitaz.c3sl.ufpr.br/slitaz/"),
255 array( "flag" => "it",
256 "http" => "http://slitaz.mirror.garr.it/mirrors/slitaz/",
257 "ftp" => "ftp://slitaz.mirror.garr.it/mirrors/slitaz/",
258 "rsync" => "rsync://slitaz.mirror.garr.it/mirrors/slitaz/"),
259 array( "flag" => "si",
260 "http" => "http://mirror.drustvo-dns.si/slitaz/"),
261 array( "flag" => "si",
262 "ftp" => "ftp://ftp.pina.si/slitaz/"),
263 array( "flag" => "us",
264 "http" => "http://distro.ibiblio.org/pub/linux/distributions/slitaz/",
265 "ftp" => "ftp://distro.ibiblio.org/pub/linux/distributions/slitaz/"),
266 array( "flag" => "nl",
267 "http" => "http://ftp.vim.org/ftp/os/Linux/distr/slitaz/",
268 "ftp" => "ftp://ftp.vim.org/mirror/os/Linux/distr/slitaz/"),
269 array( "flag" => "nl",
270 "http" => "http://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/",
271 "ftp" => "ftp://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/"),
272 array( "flag" => "ch",
273 "http" => "http://ftp.ch.xemacs.org/ftp/pool/2/mirror/slitaz/",
274 "ftp" => "ftp://ftp.ch.xemacs.org//pool/2/mirror/slitaz/"),
275 array( "flag" => "de",
276 "http" => "http://ftp.uni-stuttgart.de/slitaz/",
277 "ftp" => "ftp://ftp.uni-stuttgart.de/slitaz/"),
278 array( "flag" => "au",
279 "http" => "http://mirror.iprimus.com/slitaz/"),
280 array( "flag" => "au",
281 "http" => "http://mirror01.ipgn.com.au/slitaz/"),
282 array( "flag" => "us",
283 "http" => "http://mirror.clarkson.edu/slitaz/",
284 "rsync" => "rsync://mirror.clarkson.edu/slitaz/")) as $mirror) {
285 $flag = "images/flags/".$mirror["flag"].".png";
286 $head = TRUE;
287 foreach(array("http", "ftp", "rsync") as $proto) {
288 if (!isset($mirror[$proto])) continue;
289 $link = $mirror[$proto];
290 if (!test_url($link, $proto)) continue;
291 $serveur = parse_url($link, PHP_URL_HOST);
292 if ($head) echo <<<EOT
293 <li><a href="http://en.utrace.de/?query=$serveur">
294 <img title="map" src="$flag" alt="map" /></a>
295 <a href="$link">$link</a>
296 EOT;
297 else echo <<<EOT
298 or <a href="$link">$proto</a>
299 EOT;
300 $head = FALSE;
301 }
302 if ($head) continue;
303 echo " </li>\n";
304 }
306 if ($output_url_file != "") {
307 fclose($output_url_handler);
308 rename($output_url_file, $mirrors_url_file);
309 chmod($mirrors_url_file, 0644);
310 }
312 ?>
313 </ul>
315 <a name="builds"></a>
316 <h3><img title="Daily builds" src="images/iso.png" alt="builds"
317 width="25" height="25" />
318 Daily builds</h3>
320 <?php
321 function display_log($file,$anchor,$url)
322 {
323 echo '<a name="'.$anchor.'"></a>';
324 echo "<h4><a href=\"$url\">";
325 system("stat -c '%y %n' ".$file." | sed 's/.000000000//;s|/var/log/\(.*\).log|\\1.iso|'");
326 echo "</a></h4>";
327 echo "<pre>";
328 $sed_script="s/.\[[0-9][^mG]*.//g";
329 $sed_script.=";:a;s/^\(.\{1,68\}\)\(\[ [A-Za-z]* \]\)/\\1 \\2/;ta";
330 $sed_script.=";s#\[ OK \]#[ <span style=\"color:green\">OK</span> ]#";
331 $sed_script.=";s#\[ Failed \]#[ <span style=\"color:red\">Failed</span> ]#";
332 system("sed '".$sed_script."' < $file");
333 echo "</pre>";
334 }
336 display_log("/var/log/packages-stable.log", "buildstable", "/iso/stable/packages-3.0.iso");
337 display_log("/var/log/packages-cooking.log","buildcooking","/iso/cooking/packages-cooking.iso");
338 ?>
340 <!-- End of content -->
341 </div>
343 <!-- Footer -->
344 <div id="footer">
345 Copyright &copy; <span class="year"></span>
346 <a href="http://www.slitaz.org/">SliTaz</a> - Network:
347 <a href="http://scn.slitaz.org/">Community</a>
348 <a href="http://doc.slitaz.org/">Doc</a>
349 <a href="http://forum.slitaz.org/">Forum</a>
350 <a href="http://pkgs.slitaz.org/">Packages</a>
351 <a href="http://boot.slitaz.org/">Boot</a>
352 <a href="http://bugs.slitaz.org">Bugs</a>
353 <a href="http://hg.slitaz.org/">Hg</a>
354 <p>
355 SliTaz @
356 <a href="http://twitter.com/slitaz">Twitter</a>
357 <a href="http://www.facebook.com/slitaz">Facebook</a>
358 <a href="http://distrowatch.com/slitaz">Distrowatch</a>
359 <a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a>
360 <a href="http://flattr.com/profile/slitaz">Flattr</a>
361 </p>
362 </div>
364 </body>
365 </html>