<?php
private function LatLngDist($p, $q) {
$R = 6371; // Earth radius in km
$dLat = (($q[0] - $p[0]) * pi() / 180);
$dLon = (($q[1] - $p[1]) * pi() / 180);
$a = sin($dLat / 2) * sin($dLat / 2) +
cos($p[0] * pi() / 180) * cos($q[0] * pi() / 180) *
sin($dLon / 2) * sin($dLon / 2);
$c = 2 * atan2(sqrt($a), sqrt(1 - $a));
return $R * $c;
}
(SELECT * FROM `good` WHERE qty >= 4 ORDER BY qty LIMIT 1)
UNION ALL
(SELECT * FROM `good` WHERE qty < 4 ORDER BY qty DESC LIMIT 1)
LIMIT 1
SELECT * FROM (SELECT * FROM `good` WHERE qty >= 4 ORDER BY qty >= 4, qty LIMIT 1) as g
UNION
SELECT * FROM (SELECT * FROM `good` WHERE qty < 4 ORDER BY qty < 4, qty DESC LIMIT 1) as g
<?
$rewrite['/'] = 'Новый тайтл';
$rewrite['/about/'] = 'Новый тайтл';
ob_start("titler");
function titler($content) {
global $rewrite;
if (isset($rewrite[$_SERVER['REQUEST_URI']]))
return preg_replace("#<title>.*?</title>#",'<title>' . $rewrite[$_SERVER['REQUEST_URI']] . '</title>');
else return $content;
}
php_value auto_prepend_file "titler.php";
#!/bin/sh
while true
do
iwlist eth1 scan > /tmp/wiscan.txt
if `cat /tmp/wiscan.txt | grep -c SSID1` = 1 then
do
iwconfig eth0 ssid SSID1
exit
done
if `cat /tmp/wiscan.txt | grep -c SSID2` = 1 then
do
iwconfig eth0 ssid SSID2
exit
done
sleep 3
done
myrpc 8000/tcp
myrpc stream tcp nowait ramzes /home/ramzes/tmp/myrpc.php myrpc.php
#!/usr/local/bin/php
<?
$f=fopen("php://stdin","r");
$data=fread($f,1024);
Save2DB($data);
fclose($f);
echo deadline > /sys/block/sda/queue/scheduler
echo 1 > /sys/block/sda/queue/iosched/fifo_batch
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0