Pages

Sunday, November 30, 2014

PHPMailer

I've been a stubborn hold out for just using the PHP mail() function. It was what I learned early on, and it worked wherever I needed it.

Well, this weekend I needed SMTP, and I decided to use an existing project instead of trying to roll my own. (It would have taken me forever, and probably would have come out pretty shabby too.)

I chose PHPMailer from some recommendations online. Another alternative is SwiftMailer. I couldn't tell you why one is better than the other, just that when I did my searches, PHPMailer seemed like the best choice for me at the time.

I was using this for a form submission, so the first thing I did was create an email address just for this project to use. Then, I put that account's  username and password into the appropriate properties in the script.

You can download the entire project from github.com/PHPMailer/PHPMailer

I only needed four files to make it work for me,

  • PHPMailerAutoload.php (Just to simplify the require statement)
  • class.phpmailer.php
  • class.pop3.php
  • class.smtp.php
Then, in the "examples" folder, I found the pop_before_smtp.phps file. I used this to create a test. I got that working and then tweaked it for my site in production.

For whatever reason, even with debugging set to zero, I was getting success messages echoed on screen. I'll probably go back later and figure out the real fix, but the quick work around was to wrap the whole thing in output buffering and throw away the buffer:

ob_start();
[PHPMailer code here]
ob_end_clean(); 
So, if you're looking for an alternative to the mail() function in PHP, you might want to try PHPMailer or SwiftMailer


Thursday, November 27, 2014

Update on Adf.ly

Well,

I've been on adf.ly for two weeks now. I really haven't tried very hard. I have very few twitter followers, so that's not going to do much for me. I tried a couple of random reddit posts, but /r mods don't appreciate it. It would probably be different if I actually got involved in a sub, then posted a good link.

Speaking of reddit, there's r/HITsWorthTurkingFor where everyone expects your links to be adfly, and they are happy to click them. But, the links need to be to good HITs on Amazon's MTurk.


Monday, November 24, 2014

Cloudbuster Helium Balloons

If you need to rent a Giant Helium Balloon, one of my customers, Giant Balloon Rental,  has exactly what you need.

You've probably seen the giant round helium balloons tethered with flag streamers. They are very popular at car dealerships and grand opening events. There are also blimp shaped helium balloons that can hold a custom printed banner, and we can't forget the Hot Air Ballon shaped Helium balloon.

Maybe you just need a tank full of helium to fill a bunch of party balloons. They offer that as well. If your business or organization has an ongoing need for helium, contact Giant Balloon Rental for a price quote.

Giant Balloon Rental
www.giantballoonrental.com
407-968-5139




Thursday, November 20, 2014

Manifest Inefficiency

I was going to write a great blog post about writing a great blog post, but when I did a quick Google search for a little kick-start to my writing, I stumbled onto a mentioning of Parkinson's Law. The gist of Parkinson's Law is "Work expands so as to fill the time available for its completion".

This is absolutely true! I am a small business owner. I am the sole employee. I have no supervisor or boss. It's just me. If I give myself all day to get a project done, it will take me all day to do it. It doesn't matter if it was a one or two hour job. There's always something that will come along and make it take longer. Add to that, the so called 80/20 rule, where a person gets about 80% done with a job relatively quickly and spends all the extra time trying to perfect the last 20%, and whole day is consumed. I have a friend who is an excellent artist, and his 80% is better than the 100% of most others, yet it's hard for him to let go of that pursuit of perfection. A loose or distant deadline just exacerbates the issue.

Reading a little more about the origins of this adage shows that it actually came from the writings of Cyril Parkinson, and was describing how bureaucracies tend (always) to expand. Not only do they expand, but they expand themselves into uselessness and powerlessness.

This is not just a symptom of western government. Alessandro Natta, an Italian communist, complained about the growing bureaucracy in Italy, to which Mikhail Gorbachev reportedly replied "Parkinson's law works everywhere".

Take the example of a small council like a Cabinet. Perhaps the Cabinet begins with five or six advisers. Over time, a few more advisers are added until one reaches twenty or so. When the Cabinet is small, it can come to agreement, but there are enough members that a single person does not wield all power. As it grows, it loses the ability to agree, and thereby loses all relevance. Parkinson suggests that the point of manifest inefficiency is around 19 to 23 and that perhaps the optimal membership is 8.

In business, I've heard that if it takes more than one head to make a decision, you're already in trouble.



Monday, November 17, 2014

CloudFlare Scare

One of my clients was getting tens of thousands of pageviews a day, but not getting sales to justify that amount of traffic. I went looking and found a lot of foreign traffic from places where they are not likely to make any sales at all.

I experimented with .htaccess, but this is a shared hosting environment and I wasn't even sure Apache was paying any attention to my custom rules. To make things worse, the shared hosting provider was having a bunch of downtime. Even though my account wasn't being directly effected, it made their ticket system about five times slower than normal. (No exaggeration!)

Then, by fate or divine intervention, I stumbled on someone somewhere talking about CloudFlare. I had never heard of it, but it turns out that my hosting provider includes it in CPanel, so I thought I'd give it a try.

I installed it on my own site, the effected site, and another site that I noticed was going slow.

I used it to block a bunch of regions that I recognize as high risk and for the effected account I set a security level that was labled "I'm under attack".

Check out this graph from their analytics page:



The double peak is because I turned the level down to "High" for a day and then back to "I'm under attack". From 15,000 pageviews down to 100-200 pageviews a day. Much more like this customer should expect. For this, I am very thankful.

Now for the scary part.
I went to log in to my own site by FTP. In my FTP program, I had used "www.tecbrat.com" where one might put the domain name or IP. My FTP program was failing to connect and I didn't recognize the IP it was trying to connect to. I was starting to think my router had been hacked, or that I had some other DNS problem. I opened a windows command prompt and pinged my domain "tecbrat.com" and it gave the expected IP. I changed my FTP program to "tecbrat.com" and it connected just fine.
I pinged "www.tecbrat.com"  and THERE WAS MY ANSWER. No hack, just

"Pinging www.tecbrat.com.cdn.cloudflare.net"

Phew! Now I understand. The "www" subdomain was being re-directed to Cloudflare, and they were not passing on the FTP traffic. Don't know if it's even possible that they could. I'm one or two college degrees short on that issue.

So, if you're using CloudFlare AND you use your domain name in your FTP program, AND you see an unfamiliar IP in your FTP console, try removing the "www." or directly providing the IP of your server.

I hope this helps someone. :D

Friday, November 14, 2014

Another monitization attempt

I'm trying adf.ly, a URL shortening service that puts an ad between the link and the destination.

Here are the links I have shortened so far:

Russian Drivers
MMA KOs
People falling down
MTurk home page
MTURK Search Result
Mturk Forum
HitsWorthTurkingFor
Turker Nation
Adfly advertiser review
Adfly Content Provider review

The only thing i don't like is that it's not obvious to the user what they should do after they click the link.

If you'd like to give it a try, Here's my referral link: ADF.LY

Wednesday, November 12, 2014

MTurk revisited

A couple of years ago, I tried a work at home program called Mechanical Turk, or MTurk, through Amazon.com. I blogged about it at mymturkexperience and finished with a fairly unfavorable opinion.

I never thought it was an outright scam. Certainly Amazon's participation in it and the part they directly control is on the up and up. But, a worker or "turker" is actually working for a third party, a "requester". Even then, I'd say that most requesters are legitimate.  It's just that there are too many jobs, called "HITs", that expect a turker to do 10 minutes work for a penny. (just an example)

But, as I talked about when I broke my personal ban on surveys I found a helpful forum (actually a sub-reddit) called HitsWorthTurkingFor that helped me find HITs that actually pay a decent amount.

So, I have revisited my opinion on MTurk and continue to blog about my experience there.
I think I earned as much yesterday as I had in my entire MTurk experience leading up to it.

Monday, November 3, 2014

OEMR

I have the privilege of working on the open source project, OpenEMR or OEMR. It is an Electronic Medical Records system for doctor's offices and clinics to keep track of their patience and their procedures.

Specifically, I am working with Adoption Related Services of Pinellas (ARSP), and organization dedicated to helping some of the most at risk children get the physical and psychiatric care they need. I haven't contributed much code yet, but I am at least getting familiar with the team.

I'm supposed to be working on a batch email system, but I never seem to have the time to devote to it, so instead I'm going to work on a bit of front-end stuff on their main site (The part that is not related to OEMR) Hopefully I'll be able to post some progress soon.