Jump to content

chadrt

Members
  • Posts

    124
  • Joined

  • Last visited

Everything posted by chadrt

  1. In my db I have 2 tables I need to pull data from and run a count if somehow. The db_cust table has all the customer data. The db_devices has a few thousand entries on devices that are either being billed, promotional, cancelled etc. So I am looking for a way to have a single query that will look at the db_devices and count each device that has a "billable" example below... CUSTOMER NAME - BILLABLES Test Customer - 5 Great Customer - 38 Really Great Customer - 235 it would look at db_devices.agencyname and count each instance of where that field contains a "1" as that is the billable int. customer 4567 (Test Customer) has 38 devices listed but some are cancelled, lost and some are free for being nice etc etc and 5 are billable it would return a 5 for the count if bill_type='1'
  2. I have a small linux server setup with FreePBX on it. I have it locked down with Fail2Ban and for some odd reason I keep getting major hack attempts. I have the settings set to a pretty restrictive set 3 bad attempts in 30 minutes and you get banned for 1 hour. This has helped knock down a ton of attempts on the system but there are a few who get way beyond the threshold I have setup. I get emails from Fail2Ban that say things like "banned after 146 attempts, banned after 138 attempts, etc" so why is it allowing that many attempts before banning the ip's. Now if I notice many blocks to the same ip over the course of a few hours I will go in and permanently add that ip to the iptables drop list. But that is not my concern, my concern is that Fail2Ban is allowing so many before dumping them into the abyss. My passwords are super strong and not anything remotely available in any dictionary in the world and are notoriously 12-18 characters long with uppers, lowers, numbers and special characters all jumbled up in a fashion that I have laid out in my head and never written down. Has anyone else gone thru this as well?
  3. Here is another line I have been experimenting with... echo $(($(date -d 17-Aug +%j) - $(date +%j))) Days Until Close
  4. Here is what I have so far... #!/bin/bash ### DELETED THE CONTENTS OF THESE VARIABLES FOR POSTING PURPOSES TO="" # WHO IS TO RECEIVE THE EMAIL FROM="" # WHO IS THE EMAIL FROM USUALLY SAME AS THE USER SERV="" # THE SERVER TO USE AND THE PORT server:port IS THE FORMAT USER="" # USERNAME OF THE OUTBOUND SERVER PASS="" # PASSWORD OF THE OUTBOUND SERVER SUB="bla bla bla" ###### So I have tried both of these ###### MSG= 'echo $(expr '(' $(date -d 2015/08/17 +%s) - $(date +%s) + 86399 ')' / 86400) " Days Until Close"' #MSG= /path/to/daysuntil.sh # This contains the line from above runnnig this alone works fine! /usr/bin/sendEmail -f $FROM -t $TO -u $SUB -m $MSG -s $SERV -xu $USER -xp $PASS
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.