';
}
function argomenti() {
$fd=mysql_query('SELECT args FROM tricks');
$num=mysql_num_rows($fd);
$args=array();
for ($i=0;$i<$num;$i++) {
$row=mysql_fetch_array($fd);
$tmp=explode(' ', $row['args']);
foreach ($tmp as $arg) {
$args[$arg]++;
}
}
/*
foreach ($args as $arg => $val) { // divido i risultati in due gruppi (1-pochi args con tanti articoli, 2-quelli con un solo articolo)
if ($val>1) {
$t2[$arg]=$val;
} else {
$t1[$arg]=$val;
}
}
arsort($t2);
foreach ($t2 as $arg => $val) { // ordino il primo gruppo per chiave (molti risultati in cima)
arg_tot($arg, $val);
}
ksort($t1);
foreach ($t1 as $arg => $val) { // ordino gli altri alfabeticamente
arg_tot($arg, $val);
}
*/
ksort($args);
echo '
';
foreach ($args as $arg => $val) { // ordino il primo gruppo per chiave (molti risultati in cima)
arg_tot($arg, $val);
}
echo '
}
function handle_static() {
global $page;
if ($page=='mission') {
echo "
Our mission is share solutions
\n";
echo "
I spend a lot of time every day debugging code and administering servers (and clients) with big troubles.
\n";
echo "Sometimes I find on the Internet the correct solution of my problems in little time, but more often\n";
echo "I spend hours searching for a trick and when I find it I write orrible lines of code with stupid comments\n";
echo "on a piece of paper that can only be forgiven or destroyed the next day. Sometimes I add a link in a bookmark, but\n";
echo "some problems that are too specific - linked to a software or hardware customization - to let that solution be useful again.
\n";
echo "When I have the time I try to spend some time writing documentation... Sometimes...
\n";
echo "Today I want to write down the first trick in a place where everybody can find it for free. \n";
echo "Today I promise to find the time I need to write documentation, comments and remarks. \n";
echo "Today I start to publish for You my tips and trick about computing, coding, system administration, games, security, trashware,\n";
echo " networking, etc.
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
Start Bootstrap
August 25, 2014 at 9:30 PM
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
Nested Start Bootstrap
August 25, 2014 at 9:30 PM
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
*/
} else if ($topic!='') {
echo "
Top ".ucfirst($topic)." Tips and Tricks
\n";
echo "
\n";
$fd=mysql_query('SELECT * FROM tricks WHERE args LIKE "%'.$topic.'%" ORDER BY ts DESC');
$num=mysql_num_rows($fd);
for ($i=0;$i<$num;$i++) {
$row=mysql_fetch_array($fd);
row($row['idtrick'], $row['votes'], $row['posts'], $row['views'], $row['title'], explode(' ', $row['args']), substr($row['ts'], 0, 10));
}
echo "
\n";
echo " \n";
} else if ($src!='') {
echo '
Searching for: '.$src."
\n";
echo "
\n";
$fd=mysql_query('SELECT * FROM tricks WHERE title LIKE "%'.$src.'%" ORDER BY ts DESC');
$num=mysql_num_rows($fd);
for ($i=0;$i<$num;$i++) {
$row=mysql_fetch_array($fd);
$ttt=str_ireplace($src, ''.$src.'', $row['title']);
row($row['idtrick'], $row['votes'], $row['posts'], $row['views'], $ttt, explode(' ', $row['args']), substr($row['ts'], 0, 10));
}
echo "
\n";
echo " \n";
} else {
handle_static();
}
}
function handle_title() {
handle_h1();
echo ' - Tips and Tricks for Programmers and SysAdmins';
}
function handle_h1() {
global $title;
global $topic;
if ($title!='') {
echo $title;
} else if ($topic!='') {
echo ucfirst($topic).' Related Problems and Solutions';
} else {
echo 'Smart Solutions for Programmers and Sysadmins';
}
}
function statistics() {
//
/*
echo '';
$site_name='tips-and-tricks';
//include('/var/www/html_stats/preparse.php');
echo "\n\n";
echo "\n";
echo "\n";
*/
?>
}
?>
handle_title(); ?>
handle_h1(); ?>
handle_page(); ?>
Search
Categories
argomenti(); ?>
Welcome
We need collaboration and a real boost from our community: write us an email for every trick you find!
This website is a sysadmin swiss-knife for every-day Windows, Linux and Mac administration and troubleshooting
Our database grows if YOU send us your tips and trick as soon as you find them every day!