Latest Threads

Forum Statistics
  • Forum posts:1 376
  • Forum threads:184
  • Members:2 963
  • Latest member:teastestdumps


Posted by: Ashus
30.8.2007 08:23
Forum: Delphi programs
- No Replies

This tool is able to extract names of tracks and lengths from CD text of an WinOnCD v3 - 6 project file or Winamp's M3U with extended information to plain text file (for further customization/print).

Print this item


Posted by: Ashus
17.8.2007 04:03
Forum: Bash scripts
- No Replies

Tahle sada skriptů slouží k monitorování dat klientů sítě na routeru.
Sbírá a odlišuje data: na proxy server (kombinace ip a portu), místní síť (ip/maska), internet (vše ostatní).
Podle toho pak zobrazuje data za posledních 24 hodin a za poslední interval ("aktuální" bitrate).
Generuje barevné grafy podle odlišných dat (RRDtool stack).

Je potřeba: Apache, PHP5, Cron, RRDtool, MySQL.


Část první: instalace
Pokud vám chybí některá z aplikací výše, doinstalovat. Do databáze přidat tabulku podle obsahu přiloženého souboru db.sql. Nastavit a ověřit nastavení v hlavičce ipaccounting.sh. Dovytvářet chybějící adresáře. PHP soubory hodit na www stránky, přidat do ip.php a iplist.php hlavičky a patičky, aby se to hodilo do theme vaší stránky. Do cronu přidat spouštění skriptu ipaccounting.sh každé 3 minuty (*/3 * * * *). Pokud se rozhodnete používat část skriptu proti zacyklení, nezapomeňte si přidat do skriptu spouštěného po restartu serveru spouštění "ipaccounting.sh clean" - tím se mimo jiné vymaže soubor, který by mohl zůstat přítomný po pádu systému při spuštěném ipaccountingu a zabraňovat dalšímu spouštění.


Část druhá: sběr informací
Bash skript IP accounting založený na práci Standuse a Bohdyho

  • automaticky označí pakety pomocí iptables v tabulce mangle
  • data z bufferů každé tři minuty vybírá a nuluje čítače
  • sesbíraná data ukládá pro grafy do rrd databází
  • do txt souborů ukládá data přenesená v posledním intervalu (aktuální aktivita klientů)
  • vše průběžně ukládá do mysql databáze


Část třetí: interpretace informací pomocí PHP
iplist.php, __mysql_connect.php, bar.gif
  • vypíše seznam klientů z aktivních (txt) a živých (sql)
  • přepočítá aktivitu za poslední interval na lidské jednotky kB(MB)/s
  • z databáze vyčte data za posledních 24 hodin pro každou IP adresu zvlášť (a přepočítá)
  • tento výčet je jakž takž optimalizován, síť okolo 60 PC trvá na Athlonu 1300MHz, 560MB RAM do 1s, podruhé stejné data (ve stejném intervalu) mysql optimalizuje na ~200ms
  • provede DNS resolve jednotlivých adres na názvy
  • je k dispozici filtr aktivity: aktivní (nenulové data v intervalu), neaktivní (nenulové data za 24h), všechny
  • data lze seřadit
  • parametr pro veřejnost skrytý: last=week, month, year (náročné na sql, month mi trvalo 25s)
  • u každého klienta je odkaz na skript ip.php

ip.php, make.php, _resolutions.php
  • vygeneruje graf datových toků pomocí RRDtool
  • barevně odlišuje tři síťové pásma (proxy, czf-lan, net)
  • zapamatuje si pomocí cookies poslední zobrazené časové měřítko (1h, 6h, 12h, 1d, 3d, týden, měsíc, rok)
  • šetří CPU - pokud není poslední požadovaný generovaný obrázek starší, než minuta, nebude generovat nový, ale jen vyhodí img src

Print this item


Posted by: Ashus
17.8.2007 02:58
Forum: Bash scripts
- Replies (1)

Simple script, that pings every 10 minutes a stable internet address. The number of successful pings is added to a new line of a data file.
Included PHP script counts relevant nonzero lines from the end of datafile and equates a percentage of availability last month.

If results are to be accurate, it is required for the server to run 24/7 and for cron to run the script regularly. If the server freezes and is kept frozen for an hour, the percentage may still output 100% incorrectly. On the other hand, the script doesn't require much resources and is as lightweight as it can be.

Print this item


Posted by: Ashus
17.8.2007 02:38
Forum: Bash scripts
- No Replies

Bash script, that checks site availability of a network by pinging a target address (eg. hardware AP).
When state changes, an email is send via sendmail. In Czech republic, only O2 and Vodafone give out free SMS support from internet.

Names of the sites must be resolvable to IP addresses - they have to be in /etc/hosts or an alternative.

Print this item


Posted by: Ashus
17.8.2007 02:35
Forum: Bash scripts
- No Replies

Bash script, that guards the availability or functionality of more cascaded proxy servers in your network and switches trough them to minimize drop-out times. The result is squid.conf, re-applied immediately after change.

Use cron to execute this script regularly (each 3-10 minutes, depends on how quickly you want your clients happy).

Two modes are available: automatic and manual - automatics act according to custom settings and switches the cascaded proxy server by priorities of your servers, if the server above in the list doesn't work. Manual settings blocks the automatics and sets an uplink of your choice.

Furthermore, to test the functionality of the proxy, the script uses links (text web browser), or availability of the site by pinging. Each has its pros and cons: checking functionality - finds out practical real functionality, but is dependant on a website; availability - lesser data rate, but server can be available without working proxy service.

Print this item


Posted by: Ashus
14.7.2007 02:28
Forum: Delphi programs
- No Replies

This tool compares two binary Sony-ericsson firmware files and outputs the differences in ViKlay Patch format (for use in FAR).

Print this item


Posted by: Ashus
9.7.2007 07:38
Forum: PHP scripts
- No Replies

This little PHP tool parses periodically retreived xml with your stats from Boinc servers. It ensures lightning-fast displaying of your stats on your website. And it is adjustable to suit your visual style (colors, styles...).
Requires Linux server or some kind of wget-like file downloader and Cron for Windows.

Installation
Part one:
Insert the following line into your crontab file and edit CPID (Cross-Platform ID - get it after login to any boinc site at bottom of the main page) and output path.

Code:
30 5 * * * root wget http://boinc.netsoft-online.com/get_user.php?cpid=101be7403f58c140d1ec4a0f4db7ae7a -O /var/www/boinc.xml 1>/dev/null 2>&1 &
Also, run the program to verify, that it works OK.

Part two:
Upload the boinc.inc.php script to your webserver and configure settings (language, AllProjectStats ID, Seti classic workunit count). Include the script using include('/var/www/boinc.inc.php'); to any page you want to display it on. Lastly, edit the table styles or classes to match your website look.

Print this item


Posted by: Ashus
9.7.2007 04:17
Forum: PHP scripts
- No Replies

This script takes care of your AdSense account - protects it from crazy clicking people.
Requires MySQL database access.

Every visitor on your site gets logged (his IP/proxied IP combination is unique identifier). His three last access times are logged as well. If he gets your AdSense ad displayed three times in 60 minutes (adjustable), he won't see any more of them. The logging is paused till he gets another ad displayed.
The behaviour of the limiter: if the visitor gets ad at 13.05, 13.10 and 13.15, he can see another one at 14.05, and for another one he has to wait till 14.10.

There's more: no ads will be displayed to visitors coming from IP addresses of your local networks/subnets. You probably are behind a NAT and that would cause AdSense team think, that you cheat.

For testing purposes, you can create a cookie for your server named adsense_test with value of 1. Then, you will see unlimited number of ads, and you can even click them, if you're interested, and no displays/clicks will be counted at AdSense servers.


There is one disadvantage though. The visitor can crawl trough your site for a longer time and when he finally wants to leave, he won't see another option, than to close the window.

Be noticed, that it is designed for only one ocurrence of ad per page.


Installation:

  • Extract the adsense.inc.php file from archive.
  • Edit the database access info, create table using query located in the file.
  • Edit your AdSense ID (replace pub-MMMMMMM).
  • Edit your default channel and color settings - $adsense['ch']
  • Edit the default width $adsense['w'], height $adsense['h'] and format $adsense['f'] code.
  • Include the file to target pages using include('/var/www/......./adsense.inc.php').
  • If required, modify the $adsense variables w, h, f or ch by setting them explicitly before the include line.
  • Create your testing cookie.

Print this item


Posted by: Ashus
8.7.2007 05:40
Forum: Delphi programs
- No Replies

This tool is a command line alternative of lynx -dump designed for Windows. It also supports lynx -source behaviour.

Print this item


Posted by: Ashus
8.7.2007 05:39
Forum: Delphi programs
- No Replies

This tiny loader executes any program with parameters and changed priority. If you need to load a non-form CLI program, you can also run it hidden or minimized. Useful for planned services, etc.

Print this item