Monituring bandwidth on a particular directory

 
Post new topic   Reply to topic    Aprelium Forum Index -> Off Topic Discussions
View previous topic :: View next topic  
Author Message
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Fri Dec 22, 2006 8:55 pm    Post subject: Monituring bandwidth on a particular directory Reply with quote

Ok my friend is starting a site (not using abyss, iv told him a lot about it but hes not the sharpest tool in the shed ;) ) but the site the host he is going with will not allow him to put .mp3's on there server. I told him that i would host hsi music but he is only getting 2 GB of bandwidth per month (i think thats fare) and if he needs more its goinna be 5 bucks per 5Gb (but it add each month, like if he had 2 GB and bought 5 GB next month he will start with 7 GB) but before i do im looking for a program or script that will let me monture the bandwidth on his directory. If anyone knows where i can obtain such a script please post.

Thanks and merry Christmas,
Hc2995
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Fri Dec 22, 2006 10:28 pm    Post subject: Reply with quote

I have a PHP snippet that will parse the logfile.

You could have PHP run through the logfile and total the sent bytes.

I'll try to get that snippet for you in maybe a day or so.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Sat Dec 23, 2006 1:08 am    Post subject: Reply with quote

pkSML wrote:
I have a PHP snippet that will parse the logfile.

You could have PHP run through the logfile and total the sent bytes.

I'll try to get that snippet for you in maybe a day or so.


Thanks, take your time no rush :D
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sat Jan 06, 2007 11:04 pm    Post subject: Reply with quote

Took me a little while to get that script. Sorry. My hard drive crashed with all my data.

Here's the script:
http://stephen.calvarybucyrus.org/redirect.php?code=count_bytes

Just set the logfile and the directory name in the script and it should work for ya'!
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Sat Jan 06, 2007 11:11 pm    Post subject: Reply with quote

wow, i thought you had forgotten about me, no big deal on the time, hope you didnt lose anything. Thanks for the script :D
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
loloyd
-


Joined: 03 Mar 2006
Posts: 435
Location: Philippines

PostPosted: Sun Jan 07, 2007 3:55 am    Post subject: Reply with quote

hc2995, regarding the mp3 files, maybe your friend can circumvent the restriction by renaming the files into another extension like .tx3. for streaming, maybe declare it to be handled as audio/mp3 files, or users can be made to be aware to rename it to .mp3 after a download. another alternative is to zip or rar those mp3 files prior to uploading in the server. just providing some ideas anyway.

pkSML, so sorry to hear about that. i hope you have backups of your precious data. what was the brand/model/specs of this hd that crashed?
_________________

http://home.loloyd.com/ is online if the logo graphic at left is showing.


Last edited by loloyd on Mon Jan 08, 2007 4:14 am; edited 1 time in total
Back to top View user's profile Send private message Visit poster's website
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sun Jan 07, 2007 4:25 am    Post subject: Reply with quote

Loloyd, the HD was a Maxtor DiamondMax Plus 9 120 GB ATA/133 drive. It was in an USB enclosure and fell from the top of my computer case at a friend's house. It won't spin up when powered on. After about 5 seconds it makes some goofy sounds like from a Mario game or something. I don't know if it's something on the electronic board or something inside the drive (like the voice coil).

I have it backed up from about 4 months ago, but I still lost quite a bit of scripts (and all the quotes I saved from your sig :). I might try to take it in and see if I can get some of the data back.

Hc2995, I actually found a copy of this script on my server just today. I thought I lost it with the HD. Hope it works well for you!
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Sun Jan 07, 2007 5:49 am    Post subject: Reply with quote

pkSML wrote:
Loloyd, the HD was a Maxtor DiamondMax Plus 9 120 GB ATA/133 drive. It was in an USB enclosure and fell from the top of my computer case at a friend's house. It won't spin up when powered on. After about 5 seconds it makes some goofy sounds like from a Mario game or something. I don't know if it's something on the electronic board or something inside the drive (like the voice coil).

I have it backed up from about 4 months ago, but I still lost quite a bit of scripts (and all the quotes I saved from your sig :). I might try to take it in and see if I can get some of the data back.

Hc2995, I actually found a copy of this script on my server just today. I thought I lost it with the HD. Hope it works well for you!


The script should work, i just have to find out how many KB the script uses it self (so i can subtract it from the total)
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sun Jan 07, 2007 6:41 pm    Post subject: Reply with quote

hc2995 wrote:
i just have to find out how many KB the script uses it self

If the script is in a different directory than the user's directory, it won't enter into the calculations.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Mon Jan 08, 2007 2:05 am    Post subject: Reply with quote

ok so i can keep the script in a folder like /no-access/ and have user accounts on like /SD/ and it wont interfere?
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Mon Jan 08, 2007 2:21 am    Post subject: Reply with quote

Correct.
The script will use the filesystem to load your logfile.
Quote:
210.196.191.68 - - [30/Apr/2006:15:26:04 -0400] "GET /adserver/adxmlrpc.php HTTP/1.0" 404 7994 "" ""

If you're checking for the /adserver directory, the script uses preg_match() to see if the bold part begins with /adserver. If it does, it adds the underlined value to its running total (which is the total bytes sent).

It doesn't matter where the script is kept. As long as it's not in /sd, the script will not count it.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Off Topic Discussions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group