ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Topics
    2. anthonyh
    3. Best
    • Profile
    • Following 1
    • Followers 0
    • Topics 56
    • Posts 519
    • Groups 0

    Posts

    Recent Best Controversial
    • Perl - Get Today's Date, Yesterday's Date, and Current Time

      I'm working on cleaning up some Perl (5.3.3) scripts on a Windows server an old colleague of mine put together. These scripts basically check today's date and compares it to an array of dates (our holidays). If today's date matches a value in the array, it quits (i.e. doesn't run said process).

      The way he's checking the date, to me, is a bit convoluted. He's connecting to a MySQL instance on another server to grab today's date, yesterday's date, and current time (three variables).

      $database = "aMySQLdb";
      my $hostname = "10.10.10.10";
      my $port = '3306';
      $user = "auser";
      $password = "apassword";
      my $query = "SELECT NOW()";
      
      $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";
      $dbh = DBI->connect($dsn, $user, $password, {'RaiseError' => 1});
      $dbh->{LongReadLen} = 2000;
      $dbh->{LongTruncOk} = 1;
      
      my $rc;
      my @ts;
      my $dbTime;
      my $dbYesterday;
      my $holiday_flag = 'c:\perl\scripts\logs\holiday_flag';
      
      $sth = $dbh->prepare("select date_format(curdate(), '%m/%d/%Y')");
      $rc = $sth->execute;
      @ts = $sth->fetchrow_array;    
      $sth->finish;
                                      
      $dbToday = $ts[0];  
      
      $sth = $dbh->prepare("select date_format(curdate()-1, '%Y%m%d')");
      $rc = $sth->execute;
      @ts = $sth->fetchrow_array;    
      $sth->finish;
                                      
      $dbYesterday = $ts[0];  
        
      $sth = $dbh->prepare("select date_format(sysdate(), '%Y-%m-%d %H:%i:%s')");
      $rc = $sth->execute;
      @ts = $sth->fetchrow_array;    
      $sth->finish;
      $dbh->disconnect;
                                      
      $dbTime = $ts[0];
      

      I am no Perl expert (this is actually my first experience with Perl), but this seems insane. I must be able to simplify this.

      Any suggestions, oh ML wizards?

      Thanks!

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: Perl - Get Today's Date, Yesterday's Date, and Current Time

      @scottalanmiller said in Perl - Get Today's Date, Yesterday's Date, and Current Time:

      Um.... WHAT!!! LOL That is certainly insane.

      Yeah, that's what I'm saying!! I just need to figure out how to set these three variables...

      $dbToday = "Today's date in MM/DD/YYYY"
      $dbYesterday = "Yesterday's date in MM/DD/YYYY"
      $dbTime = "Current Date/Time in YYYY-MM-DD HH:MM:SS"
      

      I sure it can be done in less than half the current lines of code. Maybe even three one-liners. As soon as I'm off this extremely boring conference call I'll be heading to The Google. 😄

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: XenServer 6.5 Troubleshoot HBA SR Disk Space

      @scottalanmiller said in XenServer 6.5 Troubleshoot HBA SR Disk Space:

      @anthonyh said in XenServer 6.5 Troubleshoot HBA SR Disk Space:

      I have to say it's been a decent setup for what it is. I would prefer a vSAN setup of some sort utilizing local storage on the hosts, but it does the job for now. 🙂

      At sixteen hosts that's not trivial. You could do something like a Scale HC3 at that size, but most solutions are not meant to scale up like that. Around the dozen server mark (more or less) a good SAN solution starts to be a pretty obvious choice just because it is so cost effective to consolidate to that degree. 3PAR is one of the three best names in the SAN game, IMHO, and I'd likely stick with that unless you are really looking to redesign heavily. Now, two 3PARs that are synced, yeah, that would be the way to go. But, budgets.

      Good to know it's not a completely crazy setup. 😄

      I really have no complaints about the 3PAR setup we have. Support is good. I have an InformOS upgrade scheduled for Thursday. The upgrade will give us data deduplication which I'm excited to try.

      posted in IT Discussion
      anthonyhA
      anthonyh
    • Zimbra Collaboration Suite - Milter Question

      Anyone here have experience with the ZCS milter? I'm working on restricting a few of our distribution lists. I've found documentation on enabling it and granting/denying permission to send to distribution lists. However, I cannot find anything that explicitly states what the default permission is when the milter is enabled.

      If I enable it, will the default be that nobody can send to any distribution list and I will need to grant everyone access? OR is the default allow all?

      I want to be prepared for when I flip the switch.

      Thanks!!

      posted in IT Discussion zimbra milter
      anthonyhA
      anthonyh
    • RE: PCI over Ethernet?

      @aaronstuder It does, but this is not just IVR. It's an IVR interface for one of our databases. People can call in and get status on stuff along with submit responses (like to postpone and/or update their information).

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: PCI over Ethernet?

      @scottalanmiller said in PCI over Ethernet?:

      @anthonyh said in PCI over Ethernet?:

      Why change something that we have aboslutely no issues with? It wouldn't save us any money....

      Doesn't it? Are the physical IVRs going to be free forever and carry zero risk? If not, it seems like it does save money, at least eventually. It also protects you from something you don't have protection from today AND solves the problem that you are trying to solve here, right?

      Give me a minute to type up a post. I'll explain what this IVR system is and it should make sense after that.

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: PCI over Ethernet?

      @scottalanmiller said in PCI over Ethernet?:

      http://wiki.xen.org/wiki/Xen_PCI_Passthrough

      Hmm. This looks intimidating (but that has never stopped me). I wonder how well this would translate to the XenServer world though. What would happen when I deploy patches? Hmm. Something to check out though.

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: PCI over Ethernet?

      @JaredBusch said in PCI over Ethernet?:

      @anthonyh First, you need to ignore anyone telling you to switch your PBX. There is nothing wrong with PBX in a Flash. In fact it is a better solution than FreePBX from the point of view that PBX in a Flash uses 100% standard repos. FreePBX uses custom repos.

      Functionally they are identical.

      On to your problem. Let me ask you this question.

      The custom IVR thing uses the PCI card for what exactly? It sounds like they are FXO ports from your description in the first post. because you stated you connected them to an ATA which are typically an FXS device.

      Does the software only work via these FXO cards?

      They are multi-port FXO cards, yes (I couldn't remember the term!). I do not know exactly how the software interfaces with them. I'm not sure if they are proprietary hardware paired with their software, or if they are off-the-shelf cards that were simply recommended by the software vendor. This system was set up before my time, and has been solid enough that in the 2+ years I've been here I have not even needed to log into the box (though I have logged in so that 1) I knew I could get in if I needed to, and 2) to check it out so I at least kinda-knew what I was working with, lol).

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: Any Crystal Reports Wizards Here?

      BOOM. Adding not(OnFirstRecord) to my logic makes it work beautifully.

      posted in IT Discussion
      anthonyhA
      anthonyh
    • Ubiquiti AF5 Connection Question

      We are using Ubiquiti AF5's to connect two of our sites together. Because these sites do not have line of sight between them, we are leasing roofspace off a neighboring building and using it as a "repeat" site.

      We've recently started having trouble with the link, and I'm working on troubleshooting it. I'm not sure where the problem lies, but my suspicion is that it may be the switch we have at the repeat site.

      Can anyone think of a reason why I couldn't just eliminate the switch and conenct the two radios together directly? I'd use a crossover cable if they're not auto sensing.

      Thoughts?

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: Ubiquiti AF5 Connection Question

      @scottalanmiller said in Ubiquiti AF5 Connection Question:

      I agree that connecting directly makes the most sense. What's the purpose of the switch?

      The idea was that if we needed to connect to the network at the repeat site we could just "plug in" and statically assign said device an IP. The network I defined was big enough so that there were a few left over IPs. However, how often this will be necessary is likely slim to none (it's just a convenience thing).

      I directly connected the two using a straight cable (not a crossover cable) and they're only linking at 100 Mbps. It is a super short CAT5e cable made by yours truly (our fluke tester said it's good), but I'm going to try swapping it with a pre-made CAT6 cable.

      With a straight cable, you should be able to connect two gigabit devices and have them link at gigabit speed, right??

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: Ubiquiti AF5 Connection Question

      Ahh. This makes total sense. I learned something today!

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: Ubiquiti AF5 Connection Question

      @travisdh1 A home-made one that I left on my desk. According to a Ubiquiti employee (I posted on their forum) it should work. So I'm confused.

      https://community.ubnt.com/t5/airFiber/Directly-Connecting-Two-AF5-s/m-p/1607575

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: Ubiquiti AF5 Connection Question

      "UBNT-Chuck" from my Ubiquiti thread (the employee who initially tested this for me) re-tested and confirmed that in his environment directly connecting the two results in a 100Mbps link. Hopefully they fix that in a future revision.

      In the mean time, I put a different switch out there. We were originally using Ubiquiti's 5 port ToughSwitch. We had a spare, but I ran across a thread with lots of people complaining about throughput when using those switches in gigabit environments. The only other gigabit switch I have that'll fit in the cabinet we installed at the repeat site was a TP-LINK desktop switch. Not ideal, but if it resolves the issue it'll do for now.

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: Ubiquiti AF5 Connection Question

      @wirestyle22 said in Ubiquiti AF5 Connection Question:

      @anthonyh said in Ubiquiti AF5 Connection Question:

      "UBNT-Chuck" from my Ubiquiti thread (the employee who initially tested this for me) re-tested and confirmed that in his environment directly connecting the two results in a 100Mbps link. Hopefully they fix that in a future revision.

      Did they confirm that this is an auto-sense problem due to the POE injectors?

      They just confirmed that it was a problem. Haha...

      Unfortunately the issue I'm having still exists...I may start a separate thread about it if I get completely stumped.

      posted in IT Discussion
      anthonyhA
      anthonyh
    • Weird telnet Issue

      My primary workstation is a Fedora 24 box. I'm working on migrating management access to our switches and routers from telnet to SSH, but in the mean time I'm still doing a bit of telnet-ing into these devices.

      For some strange reason, when I do "telnet x.x.x", it takes 10-15 seconds for me to get a login prompt. If I do it from another workstation (Fedora or other), I do not have this issue. I'm pretty sure it's specific to my workstation, but I haven't a clue what is causing this. What's stranger is that I can ssh into my box from home (also Fedora 24), then telnet into our network equipment without any delay. So needless to say...I'm confused.

      I'm using Terminator as the terminal application. However, using the terminal that comes default with Fedora exhibits the same problem.

      Any ideas?

      posted in IT Discussion terminator telnet
      anthonyhA
      anthonyh
    • RE: Weird telnet Issue

      Here is where I'm boggled that I think some are missing...

      If I am using telnet directly on my workstation, I get a 10 or so second delay before the session starts.

      If I SSH into my workstation, then use telnet, the session starts instantly.

      If I SSH into my workstation, from my workstation (e.g. ssh 127.0.0.1), then use telnet, the session starts instantly.

      What would an SSH session change to remove the delay?

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: Weird telnet Issue

      Hmm. Something I just discovered is that even running "telnet --help" gives me the exact same delay.

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: Paying to upgrade from Windows 7 to Windows 10

      @Brains We have one application that just won't die that we do this for. We finally put money in this year's budget (FY starts July 1 for us) to have the software re-written. I will be so happy when it's replaced!

      posted in IT Discussion
      anthonyhA
      anthonyh
    • RE: Paying to upgrade from Windows 7 to Windows 10

      @Brains Is the delay a big deal? Windows 7 EOL is 1/14/2020 (Windows 8 is 1/10/2023). So in theory you have 3-4 years if currently runnin Win7 until one must upgrade. I'm not sure time is an issue.

      posted in IT Discussion
      anthonyhA
      anthonyh
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 5 / 8