Sodus Point Triathlon 2016 – Sprint Distance Result

Official Result:

Total Time : 2:00:06.92
Overall Place: 153 (out of 172)
All Female: 61 out of (77)
Swim – 23:15 (1.2 mph)
Bike – 1:01:32 (12.8 mph)
Run – 32: 02 (10:20 per mile)

Thoughts:

1) one-piece triathlon suit – hard to go to bathroom. Consider switching to a two-piece
2) good idea to have two sets of replacement tubes and CO2 bottles instead of just one
3) need to focus on race especially when riding a bicycle instead of getting distracted by pretty sceneries and farm animals.
4) do not plan anything after the race…you need a serious nap afterward.
5) if Darth Vader carrying an American flag with a six flag pole and a gas mask on can finish the race, so can you.
6) Bring your own stash of donuts. Healthy events like these provide cut vegetables and fruits, small cookies. My craving for post-race is donuts not fruits.

Keeping cell phone bill under $20

Republic Wireless is introducing SIM based smartphones this months which allows their customers, for the first time, BYOD.

But with this new line of smartphone offering, Republic Wireless also came up with yet another new billing plan that increased the lowest plan from $10 to $15 (With cell network from $20 + unused data refund to $20 with no refund). You can stay on the old plan as long as your device is compatible with the old plan, that is non SIM based smartphones that were sold by Republic Wireless.  But if you are thinking of getting a SIM based smartphone, like I am, staying with the old plan isn’t an option.

So I’ve been researching various phone options as well as alternative service providers. After a bunch of goole searching I narrow them down to:

Device: Moto G 4th Generation from Amazon Prime Exclusive Phone ($140)
Service Provider: RingPlus
Continue reading “Keeping cell phone bill under $20”

When to upgrade T2 instances on AWS – CPU usage

AWS currently offers five levels of T2, Burstable Performance, instances on EC2. T2 instances “provide a base level of CPU performance with the ability to burst above the baseline.”

What’s not obvious from the general documentation page is that what’s the easy indicator to determine if you need to upgrade your T2 instance to the next level.

T2 Instance CPU Baseline Performance

What I found to be the best/quickest way to figure out when to upgrade T2 instance is to look at CPU Utilization (Percent) chart on the monitoring section for the instance. You need to compare the average usage of the CPU and the baseline of the T2 instance (above the baseline means the server is in the “burst” mode which uses the extra CPU credits).

Here are the baseline of each T2 instances:

Instance TypeCPU Baseline Performance
t2.nano5%
t2.micro10%
t2.small20%
t2.medium40%
t2.large60%

CPU Credit Usage and CPU Credit Balance

CPU credit usage chart and CPU credit balance chart are also good indicators. However, when the credit usage is too rapid, you might not be able to catch the issue in time to resolve the performance issue. The decrease in the credit balance is recorded only AFTER the server is performing beyond baseline performance. In other words, it’s not a good PREVENTATIVE indicator.

But Beware…

This is a simple way to measure the performance of the server reflected on CPU usage. There are other resources that causing the issue on your server(s). The most common issue I experience is the depletion of available memory. This happens if I am running a multiple servers (such as LAMP) under one instance. While CPU usage is within a normal range, not too uncommon to run out of available memory and your application stop running properly. I find that t2.nano instance and t2.micro instance aren’t sufficient to run a LAMP in most cases.

Resources: New Low Cost EC2 Instances with Burstable Performance
Resources: EC2 Update – T2.Nano Instances Now Available
Resources: Burstable Performance Instances

jQuery conflict in WordPress 4.5 and WooCommerce 2.5

If your WooCommerce site is having a problem since you upgraded your WordPress to version 4.5, the problem might be associated with jQuery version that came with the new WordPress.

WordPress 4.5 “Coleman” comes with jQuery 1.12.3, the first version 1.12.0+. Previously it was using 1.11.x.

Check to see if your site generates script error(s). My script error after the WordPress upgrade was

 Syntax error, unrecognized expression: a[href*=#]:not([href=#])

I discovered when I wasn’t able to add a variable product to a shopping cart (the product page did not show the product price after all the options are selected, and displayed “please choose options” message)

Solutions

If you haven’t upgraded WordPress 4.5, my recommendation is to hold off the ugprade for now. If you already have upgraded, then you can add the following code to your theme’s functions.php to downgrade jQuery version:

// Downgrade to jQuery given version
function downgrade_jquery() {
  global $wp_scripts;
 
  if ( !is_admin() ) :
    wp_deregister_script('jquery');
    wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3');
  endif;
}
add_action( 'wp_head', downgrade_jquery() );

How to darken post background images in Fable theme 1.7.4

The theme I’m currently using for this site is Fable Theme by Elegant Theme.

One of the issues I recently dealt was how I have to be picky about selecting featured images for each post. The featured image is used as the background image for each post on homepage and archive pages. And by default, when there is an featured image assigned to a post, the font color of the post title and its summary is white.

Initially, I darken the text shadow to make the text more readable. But depending on the image I picked, it wasn’t an effective solution for some posts.

So I decided to apply linear gradient over the post background/featured image to make it little darker to give little more contrast between the text and the image.

Unfortunately, you can’t simply overwrite style.css in this case. The themes uses a function, et_fable_get_background(), to insert background-image property in the section in content.php

So in order to make the change, you need to modify two files in the child theme folder.
Continue reading “How to darken post background images in Fable theme 1.7.4”

A step toward quitting cigarettes

So there, my biggest weakness…smoking. Among many things that I enjoy, smoking is the only thing that I can’t seems to control. I LOVE bacon, but I can go without bacon for days, weeks, or months. I LOVE drinking wines, but I can take a break from any alcohol beverages for months. But cigarettes…not a chance.

Yes, I did the patches, the gum, and the prescriptions…you know the standards. There are times I was able to stop smoking for months…but every time I went back eventually.

The problem is, though I know it is driven by addiction, I can’t stop enjoying smoking. The alternatives were simply NOT enjoyable. It leaves me frustrated and pissed off…and the frustration grows the longer I stay away from smoking. It never got better.

That is until I got introduced the world of vaping about a week ago.

Hello? How come I didn’t get hooked on this sooner?

The biggest thing is I ENJOY vaping. It doesn’t make me frustrated. The day I started vaping is the day I stop smoking cigarettes…well almost (I went for a couple of cigarettes while the battery had to be charged for hours). This is the first alternative method that doesn’t make me miss smoking. I prefer the taste of vapor over cigarettes.

I love the fact that I don’t smell like cigarettes, that my next car won’t be stinky, that I don’t accidentally make a cigarette burn on anything, that cost much less than buying a pack of cigarette at a gas station (after a bit of investment on the equipment but you’ll get that back in time). And I love the fact that I can control the nicotine intake without a waste. So many times, I just want to get little of smoke, not the whole cigarette. I tossed out so many less than half smoked cigarette butts before.

The bottom line is, THIS already allowed me to breakaway from cigarettes with such an ease. I’m hopeful that this will be my permanent goodbye to cigarettes. Yes, it’s only a week so far, but I’m very optimistic this time.

Note: I am not encouraging anyone to start vaping. As far as I know, there is no conclusive research result that show vaping is a better alternative to smoking cigarette or a suitable smoking cessation method. There is no understanding of long-term health effect of vaping either. I STRONGLY discourage people from vaping especially if you are not addicted to smoking already.

How to sort grouped product’s children in WooCommerce 2.5.x

You MUST backup your database and your web files before you try this method.  If you decide to try this method, please do so at your own risk. I will not be responsible for any site breakage.

The order of child products in a group product page in WooCommerce is based on “menu_order” value in ascending order. You can change each product’s menu order value in “Edit Product” page under “Advanced” tab.

The problem is you can’t go through this process when you have hundreds or thousands or products and finish in timely manner.

There are several ways you can do to re-sort your child products in much faster manner.
Continue reading “How to sort grouped product’s children in WooCommerce 2.5.x”

Recreate Cazbah legacy platform’s product table in MySQL

CREATE TABLE products (
productActive bit(1),
productCategoryname varchar(500),
productSku varchar(500),
productName varchar(500),
productLongdesc text,
productPrice  double,
productMSRPActive bit(1),
productMSRPLabel varchar(500),
productMSRPPrice  double,
productMSRPSeparator varchar(500),
productMSRPColor varchar(500),
productWeight double,
productShipprice  double,
productFreeshipping bit(1),
productPic varchar(500),
productPicurl varchar(500),
productPiclink varchar(500),
productSubtitle varchar(500),
productThumbnailPic varchar(500),
productThumbnailurl varchar(500),
productDisplayOrder int,
productTrackInventory bit(1),
productCurrentInventory double,
productVariablePricing bit(1),
variationSku varchar(500),
variationDisplayName varchar(500),
variationInvoiceName varchar(500),
variationPrice double, 
variationMSRPActive bit(1),
variationMSRPLabel varchar(500),
variationMSRPPrice double, 
variationMSRPSeparator varchar(500),
variationMSRPColor varchar(500),
variationWeight double,
variationShipprice double,
variationPicUrl varchar(500),
variationActive bit(1),
variationFreeshipping bit(1),
variationDisplayOrder int,
variationTrackInventory bit(1),
variationCurrentInventory double,
variationVariablePricing bit(1),
questionWording varchar(500),
questionDisplayOrder int,
questionAnswerRequired bit(1),
questionDropDownAnswers bit(1),
questionPriceChange double,
questionLongText text,
answersDisplayName varchar(500),
answersInvoiceName varchar(500),
answersDisplayOrder int,
answersPriceChange double,
googleCategory text,
productGglProdCondition varchar(500),
productGglOnlineOnly bit(1),
productGglGTIN varchar(500),
productGglMPN varchar(500),
productGglBrand varchar(500),
productGglColor varchar(500),
productGglSize varchar(500),
productGglMaterial varchar(500),
productGglPattern varchar(500),
productGglAgeGroup varchar(500),
productGglGender varchar(500),
choiceGglProdCondition varchar(500),
choiceGglVariant bit(1),
choiceGglOnlineOnly bit(1),
choiceGglGTIN varchar(500),
choiceGglMPN varchar(500),
choiceGglBrand varchar(500),
choiceGglColor varchar(500),
choiceGglSize varchar(500),
choiceGglMaterial varchar(500),
choiceGglPattern varchar(500),
choiceGglAgeGroup varchar(500),
choiceGglGender varchar(500)
);

WooCommerce 2.3.8 – how to set minimum order amount for a product

It’s not uncommon to be asked to implement minimum checkout requirements to WooCommerce Cart. The common requirements are:

  • Minimum Dollar Amount Per Order
  • Minimum Number of Products Per Order or Per Products

Luckily, there is a great tutorial for implementing these by Yojance Rabelo.

But the other day, I got a request to implement minimum dollar amount PER PRODUCT…not too common, but not never-heard-of either.

So I decided to tweak Yojance’s Minimum Dollar Per Order code to set minimum order amount for a product instead of for the entire order: Continue reading “WooCommerce 2.3.8 – how to set minimum order amount for a product”

Make PHP Mail() work in AWS EC2 – Ubuntu 14.04

AWS IP addresses can be problematic for setting an email server in an EC2 instance…even with right setup email sent from the IP address can be marked as spam.

So what to do with setting up SMTP for your web applications? One alternative is to use AWS SES service. I decided not to use SES, however, because 1) each email address or domain needs to be approved and 2) there is cost associated with number of email sent out. These aren’t too bad of the restrictions but I wanted something that JUST work without configuring every time I build a website.

I went with MSMTP to use my gmail account to send email message by default. I can also overwrite the smtp setting per linux account. So if I were to host sites that are not mine, they can use their own smtp setup.
Continue reading “Make PHP Mail() work in AWS EC2 – Ubuntu 14.04”