PHP – Removing alpha characters from an entire array using closure
Here’s a quick way to remove all alpha characters from an array using PHP closures (PHP 5.3+) array_walk($myarray, function(&$element){ $element = trim($element,"ABCDEFGHIJKLMNOPQRSTUVWXYZ");...
View ArticleFix: LoadError: no such file to load — mysql2/mysql2 with jRuby and Warbler
I recently transitioned a Ruby on Rails Passenger server to jRuby with Tomcat and encountered an error caused by the Gemfile. “no such file to load — mysql2/mysql2 LoadError: no such file to load —...
View ArticlePreserve remote IP address with HAProxy on CENTOS
If you install HAProxy on your server, you will notice that the remote IP address in the logs and webapps will display the IP of the proxy and not the remote IP address of the client. You can set...
View ArticleReset vCenter Single Sign On Master Password VMWare 5.1
In order to reset the vCenter Single Sign On Master Password running on a Windows server for the admin@system-domain user, you will need to have local admin access and SQL Server Management Studio...
View ArticleMigrating vCenter to new Windows 2012 Server
Here are some notes on a recent migration I completed for vCenter. The source machine was a Windows 2008 R2 Server box that was running vCenter 5.1 and the new machine was a Dell R320 running Windows...
View ArticleFix: Windows 7 clients unable to connect to Samba 3
If you are using Samba 3 and have issues with Windows 7 clients connecting to the share, the easiest fix is to upgrade to Samba 4. A recent Windows security update released in Fall 2014 causes an error...
View ArticleCustom OmniAuth Callback URL
If you have Ruby on Rails App and want to use a custom OmniAuth Callback URL (Something other than /auth), there is a configuration value that you can set. /config/initializers/omniauth.rb...
View ArticlePermit nested attributes in Rails 4
In order to use nested attributes in Rails 4, one must use the params.require method inside controller with the _attributes keyword and the list of fields inside the nested model. This is a good option...
View ArticleRails – jQuery generating extra HTML headers after AJAX call
If you get the following extra HTML headers after using the jQuery AJAX method on a page and immediately clicking on another link: 0 HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate...
View ArticleEasiest way to filter out text in a MySQL field
Example: Removing the “.0” from an Excel import into MySQL MYTABLE – The MySQL Table Name FIELDNAME – The field you wish to edit the data Make sure you have a primary key defined, I usually set mine...
View Article
More Pages to Explore .....