Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 17
  1. #1
    cPanel Partner NOC This forum account has been confirmed by cPanel staff to represent a vendor.cPanel Partner NOC Badge
    Join Date
    Nov 2001
    Location
    San Clemente, Ca
    Posts
    703

    Default Any requests?

    As some of you might know, i write scripts some times to take care of certian things. Any requests for a night when i get in a coding mood? just list them here.

    for those of you who dont know, you can check some of them out here.

    http://www.cplicensing.net/extras/

    cPanel.net Support Ticket Number:
    Shaun Reitan
    NDCHost.com - cPlicensing.net - ProVPS.com
    Contact us for your cPanel Licensing needs! We Price Match, We provide Support, We take care of our customers!

  2. #2
    GOT
    GOT is offline
    Get Proactive! GOT's Avatar
    Join Date
    Apr 2003
    Posts
    902

    Default

    Search and replace script.

    Basically, an advanced bash search adn replace program would be great. Ask for a search string, and for a replacement string, or to delete the string or to delete the line that contains that string.

    Ability to recursively search is a must. Like

    /home/*/.spamassassin/user_prefs

    That kind of thing would be tremendous.

    Thanks for the things that you do!

    cPanel.net Support Ticket Number:
    Proactive Server Monitoring and Management
    http://got-management.com

  3. #3
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    Originally posted by GotHosting
    Search and replace script.

    Basically, an advanced bash search adn replace program would be great. Ask for a search string, and for a replacement string, or to delete the string or to delete the line that contains that string.

    Ability to recursively search is a must. Like

    /home/*/.spamassassin/user_prefs

    That kind of thing would be tremendous.

    Thanks for the things that you do!

    cPanel.net Support Ticket Number:
    Check out this script - http://www.cgiware.com/downloads/swap.txt

    cPanel.net Support Ticket Number:
    Regards,
    David
    Forum Moderator

  4. #4
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    A script that searches for hidden files and directories alerting when new ones are found.

    Have it know about normal hidden files, This script below (which we find is a pretty good start) could be the basis.


    #!/bin/sh
    /usr/bin/find / -name ".*" -print -xdev |grep -v .htaccess |grep -v .neomail |grep -v .bash_profile|grep -v .spamassassin|grep -v .e
    xists|grep -v .csvignore (cat <<EOF
    This is an automated report of possible existent hidden files on the server
    SERVERNAME, generated by the find utility command.

    New detected HIDDEN files under the / directory include:
    EOF
    cat
    ) | /bin/mail -s "Content of hidden file audit report" mail@domain.com

    cPanel.net Support Ticket Number:
    Regards,
    David
    Forum Moderator

  5. #5
    GOT
    GOT is offline
    Get Proactive! GOT's Avatar
    Join Date
    Apr 2003
    Posts
    902

    Default

    That scripts is a really good start, though I would like to see the ability to delete any line that conatins the specified text and to simply delete the specified text.

    cPanel.net Support Ticket Number:
    Proactive Server Monitoring and Management
    http://got-management.com

  6. #6
    cPanel Partner NOC This forum account has been confirmed by cPanel staff to represent a vendor.cPanel Partner NOC Badge
    Join Date
    Nov 2001
    Location
    San Clemente, Ca
    Posts
    703

    Default

    Maybe i'm not understanding what you want but whats wrong with the bash command replace?

    replace oldtext newtext -- files

    example: replace 1.1.1.1 2.2.2.2 -- *

    cPanel.net Support Ticket Number:
    Shaun Reitan
    NDCHost.com - cPlicensing.net - ProVPS.com
    Contact us for your cPanel Licensing needs! We Price Match, We provide Support, We take care of our customers!

  7. #7
    GOT
    GOT is offline
    Get Proactive! GOT's Avatar
    Join Date
    Apr 2003
    Posts
    902

    Default

    I checked the man page for replace, and I did not see a switch for deleting lines containing a particular text.

    Also, the ability to search on key cpanel info would be nice too. I know we could do that with ensim, but not sure if that info is available to bash.

    In any case, if it is not interesting, then disregard... Was just a suggestion!

    cPanel.net Support Ticket Number:
    Proactive Server Monitoring and Management
    http://got-management.com

  8. #8
    Member casey's Avatar
    Join Date
    Jan 2003
    Location
    If there is trouble, it will find me
    Posts
    2,336

    Default

    How about a script to increment all serial numbers by one after mass dns changes have been made?

    cPanel.net Support Ticket Number:

  9. #9
    DHL
    DHL is offline
    Member
    Join Date
    Mar 2002
    Posts
    88

    Default

    I checked the man page for replace, and I did not see a switch for deleting lines containing a particular text
    replace 'remove this line' '' -- *



    cPanel.net Support Ticket Number:

  10. #10
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    Hey Shaun;

    How about a script that does the log stats for cPanel's access_log in /usr/local/cpanel/logs?

    sort of a

    for i in /var/cpanel/users do ' grep $i /usr/local/cpanel/logs/access_log >/home/$i/tmp/cp_access

    Or some such.

    cPanel.net Support Ticket Number:
    Regards,
    David
    Forum Moderator

  11. #11
    cPanel Partner NOC This forum account has been confirmed by cPanel staff to represent a vendor.cPanel Partner NOC Badge
    Join Date
    Nov 2001
    Location
    San Clemente, Ca
    Posts
    703

    Default

    dgbaker: your looking for a script to verify that no old logs for terminated users exist?

    cPanel.net Support Ticket Number:
    Shaun Reitan
    NDCHost.com - cPlicensing.net - ProVPS.com
    Contact us for your cPanel Licensing needs! We Price Match, We provide Support, We take care of our customers!

  12. #12
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    Nope, looking to be able to track for each cpanel login id listed in the cpanel access_log to history of from where, when, etc..

    Ideally to be able to give webalizer stats or such on cpanel access.

    cPanel.net Support Ticket Number:
    Regards,
    David
    Forum Moderator

  13. #13
    Member
    Join Date
    Mar 2002
    Location
    Alberta, Canada
    Posts
    1,509

    Default

    Originally posted by shaun
    dgbaker: your looking for a script to verify that no old logs for terminated users exist?

    cPanel.net Support Ticket Number:
    David may not be, but I sure am!

    I have found, depending if Reseller or Hosting account, files similar to below get left behind and must be manually removed.

    /etc/proftpd/xxx_logs

    /usr/local/frontpage/www.xx.com:80.cnf
    /usr/local/apache/domlogs/ftp.xxx-ftp_log.offset
    /usr/local/apache/domlogs/ftp.xxx-ftp_log.offsetftpbytes

    /var/cpanel/bandwidth/xxx-all.rrd
    /var/cpanel/bandwidth/xx-http.rrd
    /var/cpanel/bandwidth/xxx-ftp.rrd
    /var/cpanel/bandwidth/xxx-pop3.rrd
    /var/cpanel/bandwidth/xxx-smtp.rrd
    /var/cpanel/bandwidth/xxx
    /var/cpanel/packages/xxx
    /var/cpanel/dips/xxx
    /var/cpanel/mainips/xxx
    /var/cpanel/suspended/xxx
    /var/cpanel/xxx.accts

    Although an eMail outlining this has not been sent to DarkOrb, it's mostly because I don't have very cancellations -- so to me, it's not that big of a deal. Down the road it may be handy as more Servers are being aquired and, others may appreciate it now.

    cPanel.net Support Ticket Number:
    Helping people Host, Create, and Maintain their Web Site
    Also providing Server Admin Services - setup / troubleshooting

    http://potentproducts.com/

  14. #14
    Member
    Join Date
    Aug 2001
    Posts
    130

    Default

    I noticed your script to restrict bandadmin. Can you tell me what people are typing on my server to view it without being authenticated?

    Are they using something like:

    http://mydomain.com/bandadmin/stat?

    How does that work?

    I'll use your script to fix it but i'm curious as to what people are doing to see my bandadmin

    cPanel.net Support Ticket Number:

  15. #15
    Member
    Join Date
    Oct 2003
    Posts
    10

    Default Re: Any requests?

    Originally posted by shaun
    As some of you might know, i write scripts some times to take care of certian things. Any requests for a night when i get in a coding mood? just list them here.

    for those of you who dont know, you can check some of them out here.

    http://www.cplicensing.net/extras/

    cPanel.net Support Ticket Number:
    Yeah,

    here's one.

    I am trying to isolate upload traffic (including php/web scripting) for each account on Cpanel (NOT by IP, but by account)

    I have had three people sell me half baked attempts that don't work - if you can help out it would be greatly appreciated

Similar Threads & Tags
Similar threads

  1. Feature requests?
    By alpha-mike in forum New User Questions
    Replies: 1
    Last Post: 02-03-2008, 08:00 AM
  2. Failed Requests
    By andy7t in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-23-2007, 10:34 AM
  3. apache requests on a different ip
    By Paxuist in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 06-06-2006, 10:06 AM
  4. Feature Requests
    By cpanelnick in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-18-2003, 05:36 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube