View Full Version : Can I Delete a cgi counter? where do they live?
saintsteven
02-22-2008, 11:55 PM
If I am using a counter created in the cgi center, and I want to delete it, where does it live?
I know I can just stop USING it, but I have a reason for wanting to make sure it's not counting anyway-it's on a page on a site other than mine.........(long story, heh heh.......)
Thanks for any info about that.
redsox9
02-23-2008, 03:00 PM
My guess would be that it's posted in the cgi-bin in your public_html folder.
saintsteven
02-24-2008, 09:30 AM
a typical address of one of the counters is:
http://www.saintstevensthingery.com/cgi-sys/Count.cgi?df= (followed by the counter name and other display info)
for the life of me, I can't seem to spot a directory called cgi-sys, and if they're in my cgi-bin, they're some kind of invisible......
felgall
02-24-2008, 11:21 AM
That would be a system library shared between all accounts on the server. Simply removing the reference from your page is all that is needed.
Basil
02-24-2008, 01:54 PM
I actually tried deleting the dat file for a counter I generated, and despite being the owner of the file, I don't have permission to delete it.
I was able to chmod it to be unreadable, but that leaves a rather pointless file on the server. Although, considering that they don't give you a way to delete the file yourself, unused counters end up sitting in the cgi-sys folder doing nothing anyway.
Support would probably delete the file for you if you asked them via live chat, or if you'd like I could show you how to make the file unreadable yourself.
saintsteven
02-26-2008, 10:25 PM
Basil,
I WOULD like to know how to render 'em unusable, if you wouldn't mind....
Semlar
02-27-2008, 05:20 AM
Since I can't post on my account for some reason..
This is basically what I was using to test this myself, albeit somewhat more user friendly.
<?php
$b = "/var/cpanel/Counters/";
if($e = $_POST['counter']) chmod($b.$e.".dat", 0000);
else if($e = $_POST['ecounter']) chmod($b.$e.".dat", 0755);
if($a = opendir($b)) {
while(($c = readdir($a)) !== false) if(substr($c,-3) == "dat" && fileowner($b.$c) == posix_getuid()) {
$d .= "<input type='submit' value='".substr($c,0,-4)."' name='";
if(is_readable($b.$c)) $d .= "counter' /> <img src='/cgi-sys/Count.cgi?df=".$c."|display=Counter|ft=0|md=5|frgb=0;0;0|dd=E' style='border:1px solid #000'/>";
else $d .= "ecounter' /> (disabled)";
$d .= "<br/>";
}
closedir($a);
if($d) echo "<form method='post' action=''>".$d."</form>";
else echo "No counters found.";
}
?>
Just copy that and save it as a .php file. It lists out any counters owned by you in the folder and lets you toggle their permissions.
The core of the script is chmod("/var/cpanel/Counters/countername.dat", 0000), which sets all of the file permissions to zero.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.