Category Archives: Tech Tips

Gravity Forms – Disable and Remove the “Map It” Link

In the Gravity Forms generated emails, if your form has a “address” field the email notification generated by using something like {all_fields} will have a “Map It” link associated with the address, which will open Google Maps. Add this code to your theme’s functions.php file to disable / remove the “Map It” link from the email notification. // code courtesy of https://techblog.willshouse.com/?p=5249 add_filter(“gform_pre_send_email”, array($this,’gform_pre_send_email’)); function gform_pre_send_email($email) { // attempt to match the link using a regular expression $test = preg_replace(“#\<a [^>]+?\>Map It[^>]+\>#i”, ”, $email[“message”]); // if the result is not empty / blank, use it to replace the original html if(trim($test)) { $email[“message”] = $test; } return $email; } If you want to hide the “map it” link from the HTML that is displayed on a webpage ( if you confirmation has the {all_fields} merge replacement in it ) then you can add some CSS like this: <style> a.map-it-link { display: none; } </style></a>

Posted in Tech Tips, Web Development | Tagged , | 2 Comments

CPanel / WHM – Change “Default Website” Page

You may have noticed that when visiting a CPanel Server ( running WHM ) if you don’t have a site configured for the hostname that you are accessing ( or possibly if you are accessing the server via the IP address ) you will end up seeing the “default website” page, and your browser’s URL will redirect to defaultwebpage.cgi ( or /cgi-sys/defaultwebpage.cgi ) You may have searched your system and ended up finding something like this file: /usr/local/cpanel/cgi-sys/defaultwebpage.cgi However, that’s not just a plain HTML file – it’s a beefy binary cgi script. No editing is going to take place there! (nor should it) You may have also found the file that actually loads / redirects to the cgi script, which lives here: /usr/local/apache/htdocs/index.html However, I would not recommend customizing that file because it will get overwritten during a cPanel upgrade. So, what is the right way? Well it just so happens that in WHM there is a Web Template Editor that is meant for this very purpose: The Web Template Editor allows you to create placeholder web pages. These pages will appear to visitors who navigate to a site on your server that: Has not yet been configured by the domain owner (see the Default Website Page tab) Has moved (see the Account Move tab) Is experiencing a connection or firewall problem (see the Connection Selection tab) Has been suspended (see the Account Suspended tab) Info for the Default Website Template: You are editing the Default Website Template. This … Continue reading

Posted in Tech Tips | Tagged , | 2 Comments

Adium – Use Notification Center

Notification Center support Adium 1.5.4 now supports Mountain Lion’s Notification Center. By default, notifications are shown for a couple of events. You can add and remove notifications in Adium’s “Events” preferences (see our documentation on Events and Visual Notifications for details.) People have asked us how Adium decides between Notification Center and Growl on OS X 10.8 “Mountain Lion” (especially with Growl.app installed) so here is an explanation from our very own Stephen Holt: 1. Growl.app is installed, and the user has configured it to NOT use Notification Center: Notifications work as before. Notification tickets are sent to Growl.app which performs actions and displays notifications as configured by the user 2. Growl.app is installed, and the user has configured it to use Notification Center: Growl.framework detects this state from within the app and notifications are sent directly to NC. Additionally, notification tickets are sent to Growl which performs any associated actions. Growl.app displays nothing. 3. Growl.app is not installed: Growl.framework detects this state from within the app and notifications are sent directly to NC. Nothing else is done. Please note that only Growl.app version 2 or newer can be set to use Notification Center.

Posted in Tech Tips | Tagged | Leave a comment

Select a Ruby Block (scope) in Sublime Text

Coming from PHP to Ruby you may wonder if there is a way to select Ruby ( or Ruby on Rails ) block scope that starts with things like begin or def and finishes with end In PHP it was possible using the commands like Expand Selection to Scope or Expand Selection to Block and in PHP it works nicely: But in the Ruby syntax neither of these items work. So how can you select a ruby block scope in Sublime Text 2 / 3 ? Easier than you might imagine: just use “Expand Selection to Paragraph” instead

Posted in Tech Tips | Tagged , | Leave a comment

`require’: cannot load such file — ruby-oci8 (LoadError)

If you are attempting to use the Oracle OCI8 gem with Ruby, and you have correctly followed the installation instructions, but you are getting a message like: `require’: cannot load such file — ruby-oci8 (LoadError) You may want to check your ruby script and make sure that you have this at the top: require ‘oci8’ Because even though the gem is named ruby-oci8 using this: require ‘ruby-oci8′ Will cause the error: `require’: cannot load such file — ruby-oci8 (LoadError)

Posted in Tech Tips | Tagged | Leave a comment

Yamaha 4500 Generator – Won’t Start – Solved – Manual

Consumer: Have you ever rebuilt or repaired any Yamaha generators? Or maybe just a generator in general? Yamaha Generator Advice: Our most common generator is the yamaha EF2000is generator, followed by the EF4500 iSE Consumer: How do you like working on those models? Yamaha Generator Advice: I convert a lot from gas to be able to run on gas, propane, or natural gas. Are you going to buy a generator? Consumer: Ok. I got an old 4500 – Yamaha yf4500 – yf-4500 – I’m trying to get running at work that ran fine all summer. Gas is good, new spark plug that is sparking, but won’t pull start. All switches set to run/on. Any ideas what I should check tomorrow? The Internet was no help. And yes fuel valve is on and clear.

Posted in Tech Tips | Tagged , | 2 Comments

Fix Thunderbolt Display Static Noise on OS X Mavericks

(May also work on other versions of OS X) Premise: With a Macbook Pro Late 2013 running OS X Mavericks and a brand new Thunderbolt Display there is an issue where when the Macbook is connected to the Thunderbolt Display it emits a soft hissing sound – like static – or white noise. There seem to be a lot of people with this issue – one popular thread on the Apple Support Site has around 30k views to date. In a nutshell a few things that people are reporting that fix the issue for them include:

Posted in Mac, Tech Tips | Tagged , , , | 5 Comments

window.mti_element_cache – fonts.com

If you are using fonts.com for your web fonts and are getting an error like this: window.mti_element_cache You’ve probably copied and pasted in the Javascript code from fonts.com as suggested, and you may be using FireFox as your browser. This is a bit of an issue, and while adding a script tag with something like this: <script type=”text/javascript”> window[‘mti_element_cache’] = [] </script> Above where you reference the fonts.com web font javascript, it might still not work for you. One solution may be to use their CSS API instead of their javascript API as the CDN. What that means is you need to replace the line that looks like this: <script type=”text/javascript” src=”http://fast.fonts.net/jsapi/ff111ab-123-456-789.js”></script> With one that looks like this: <link type=”text/css” rel=”stylesheet” rel=”nofollow” href=”//fast.fonts.net/cssapi/ff111ab-123-456-789.css”/> Be sue to change the ff111ab-123-456-789 part to match the unique ID for your site.

Posted in Tech Tips | Tagged | Leave a comment

WordPress SEO Variables

A simple list of all the WordPress SEO replacement variables for creating dynamic titles / tags – updated as of Joost / Yoast’s SEO plugin version 1.4.23: %%sep%% %%sitename%% %%sitedesc%% %%currenttime%% %%currentdate%% %%currentday%% %%currentmonth%% %%currentyear%% %%date%% %%searchphrase%% %%page%% %%pagetotal%% %%pagenumber%% %%term404%% %%caption%% %%category%% %%excerpt%% %%excerpt_only%% %%focuskw%% %%id%% %%modified%% %%name%% %%tag%% %%title%% %%userid%% %%category_description%% %%tag_description%% %%term_description%% %%term_title%% %%pt_single%% %%pt_plural%% %%category%% %%tag%%

Posted in Tech Tips | Tagged | Leave a comment

chef client linode node.cloud ipaddress workaround

The current version of the opscode chef-server and chef-client have some issues with cloud data with linode based hosts. It basically comes down to having a lot of nil values for the node attributes even though node.cloud is not nil or null This causes issues with many cookbooks which depend on these attributes being set – like nagios and mysql. the node.cloud attribute will return something like this: => {“public_ips”=>[“1.2.3.4”], “private_ips”=>[nil], “public_ipv4″=>nil, “public_hostname”=>nil, “local_ipv4″=>nil, “local_hostname”=>nil, “provider”=>”linode”} The linode ruby gem is what is not setting these attributes correctly. The error may look like: Compiled Resource: —————— # Declared in /var/chef/cache/cookbooks/nagios/definitions/nagios_conf.rb:29:in `block in from_file’ Or mysql may not start The simplest workaround that I found was to look for the linode.rb file, which on Ubuntu is located somewhere like: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.20.0/lib/ohai/plugins/linode.rb Next I commented out the functions to return if this is a linode node or not and instead added the false value: # Identifies the linode cloud by preferring the hint, then # # Returns true or false def looks_like_linode? #hint?(‘linode’) || has_linode_kernel? false end It is a one line change and can be removed later and/or will be removed by reinstalling the chef omnibus package again – hopefully by then this linode issue will be fixed. Why this works: A lot of recipes try to be smart and if a node is on a cloud platform they will try to use the internal network address instead of the external address and fancy things like that. This change tells it “hey … Continue reading

Posted in Tech Tips | Tagged | Leave a comment