notes

Fixing a “Bluetooth Not Available” Error on a Mac

Trash Bluetooth Preferences & Shutdown the Mac

First up, delete the Bluetooth plist file and have the Mac create a new one:

/Library/Preferences/

  1. Close System Preferences and/or any app that was trying to use or configure any Bluetooth device with the Mac
  2. From the OS X Finder, hit Command+Shift+G to summon Go To Folder and enter the following path:
  3. Locate the file named “com.apple.Bluetooth.plist” and delete it (you may see a com.apple.Bluetooth.plist.lockfile too, if so delete that as well) – this is a system folder so you will need to authenticate with an admin user
  4. Head to the Apple menu and choose “Shut Down” to power down the Mac
  5. Wait a minute or so before booting the Mac again
  6. Head to the Bluetooth menu or System Preference panel to resync your hardware

(Note this is /Library/Preferences/ not ~/Library/Preferences/)

"Lock wait timeout exceeded; try restarting transaction"

Added to my.cnf, restarted MySQL server.

transaction-isolation=READ-COMMITTED
innodb_locks_unsafe_for_binlog=1

By default, the value of innodb_locks_unsafe_for_binlog is 0 (disabled), which means that gap locking is enabled: InnoDB uses next-key locks for searches and index scans. To enable the variable, set it to 1. This causes gap locking to be disabled: InnoDB uses only index-record locks for searches and index scans.

Enabling innodb_locks_unsafe_for_binlog does not disable the use of gap locking for foreign-key constraint checking or duplicate-key checking.

The effect of enabling innodb_locks_unsafe_for_binlog is similar to but not identical to setting the transaction isolation level to READ COMMITTED:

  • Enabling innodb_locks_unsafe_for_binlog is a global setting and affects all sessions, whereas the isolation level can be set globally for all sessions, or individually per session.

  • innodb_locks_unsafe_for_binlog can be set only at server startup, whereas the isolation level can be set at startup or changed at runtime.

READ COMMITTED therefore offers finer and more flexible control than innodb_locks_unsafe_for_binlog. For additional details about the effect of isolation level on gap locking.

Starting from MySQL 5.0.2, enabling innodb_locks_unsafe_for_binlog has an additional effect. For UPDATEor DELETE statements, InnoDB holds locks only for rows that it updates or deletes. Record locks for nonmatching rows are released after MySQL has evaluated the WHERE condition. This greatly reduces the probability of deadlocks, but they can still happen. Note that enabling this variable still does not permit operations such asUPDATE to overtake other similar operations (such as another UPDATE) even when they affect different rows.

CPanel/WHM Install important file Locations

MySQL my.cnf

/etc/my.cnf

Apache Logs

General Error and Auditing Logs:
Location : /usr/local/apache/logs/error_log
Description : All exceptions caught by httpd along with standard error output from CGI applications are logged here..
The first place you should look when httpd crashes or you incur errors when accessing website.

Domain Access Logs:
Location : /usr/local/apache/domlogs/domain.com
Description : General access log file for each domain configured with cPanel.

Apache Access Logs:
Location : /usr/local/apache/logs/access_log
Description : Complete web server access log records all requests processed by the server.

MySQL Logs

MySQL General Information and Errors:
Location : /var/lib/mysql/$(hostname).err
Description : This path could vary, but is generally located in /var/lib/mysql. Could also be located at /var/log/mysqld.log

How to mark all email as read in Gmail after Mark All > Mark as Unread on iPhone

 Have you ever accidentally tapped Mark All? 

Have you ever accidentally tapped Mark All? 

 Followed by this? 

Followed by this? 

 Which lead to this?

Which lead to this?

The Fix

1: When logged-in to your Gmail account via your favorite browser, in the search box up top, search for:

 

is:unread

2: Click the down-arrow in the "select" button, then choose "all."

3: The emails on the page you're on should now be checked; however, to select all of your unread emails, you need to click where it says "Select all conversations that match this search." It will be centered, just above the top-most email, as pictured below:

4: Finally, click the "More" button, then click "Mark as read."

 
 

Sneaker History

A look at my most memorable hoops shoes over the last 20 years.

How to Install mcrypt for PHP on Mac OSX 10.9 Mavericks

The mcrypt extension is missing. Please check your PHP configuration.

mcrypt-osx-error-lion-php1.png

The above error appears after you successfully get phpMyAdmin up and running on OS X, generally you don’t have to worry about it, you only need to address the error if you are going to use a web application that requires it, for example Magento, the shopping cart software or a php framework like Laravel.

mcrypt is a file encryption method using secure techniques to exchange data. This tutorial has been tested in 10.9 Mavericks.

There are two ways to solve this issue on OSX, it depends on what your comfortable with and what you already have – this guide takes you through staying what you already have by installing and compiling code to get the extension running, an alternative is to use a packaged version of PHP which already has the mcrypt extension compiled and enabled, this for some would be an easier option to deploy – see that PHP guide here.

Xcode

Get Xcode 5.0.1 from the Apple app store, free download version, then install it from the /Applications folder it will be called ‘Install Xcode’ or just Xcode.app. You need this to use the compilers to compile the source code that you will download.

Go to Xcode preferences and then look in the ‘Locations’ button.

Select  the Xcode 5 command line tools from the Locations of Xcode.

Download and install the Command Line Tool.

Or even easier is after installing Xcode run in the command line:

 xcode-select --install

It will prompt a dialog box to install them

Getting it on in OS X Mavericks

This tutorial works mostly in the Terminal, launch it from /Applications/Utilities, change directory (cd) to the home account and make a directory that you will work in, call it mcrypt

cd ~ ; mkdir mcrypt ; cd mcrypt

Get libmcrypt 2.5.8 from Sourceforge,  this is direct download link.

Get the php code in a tar.gz or .bz2 format- (version 5.4.17 is the one that currently ships with OSX 10.9)

Check your version at the command line:

php -v

Move both of these files that you downloaded into your working directory – mcrypt in this instance and go back to Terminal

cd ~/mcrypt

Expand both files via the command line or just double click them in the Finder:

tar -zxvf libmcrypt-2.5.8.tar.gz
tar -zxvf php-5.5.8.tar.gz

Remove the compressed archives

rm *.gz

Any errors on the command line including C++ and g++ mostly are due to Xcode not being installed or the command line tools missing – if you have Xcode but still get the errors, launch Xcode and double check you have the right version (5) of the ‘Command Line Tools’

xcode5-command-line-tools

Configuring libmcrypt

Change directory into libmcrypt

cd libmcrypt-2.5.8

Libmcrypt needs to be configured, enter

./configure
make
sudo make install

With the libmcrypt configured and libraries now installed, time for to make the mcrypt extension.

Autoconf Errors

If the below error occurs after you try the following compile of mcrypt, then autoconf is not installed. (I didn’t get these errors in an upgrade to Mavericks which had autoconf prior but a new installation will need autoconf installed).

Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

Autoconf is not installed with the latest Xcode but may be present on some OS X from an upgraded older Xcode.

If you need autoconf – some more Terminal heavy lifting:

cd ~/mcrypt
curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
tar xvfz autoconf-latest.tar.gz
cd autoconf-2.69/
./configure
make
sudo make install

Compile mcrypt php Extension

cd ../php-5.5.8/ext/mcrypt/
/usr/bin/phpize

Output should be:

Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525

./configure
make
sudo make install

The result of this should be:

Installing shared extensions:     /usr/lib/php/extensions/no-debug-non-zts-20100525/

Enabling mcrypt.so  php Extension

Open /etc/php.ini and add the line below at the end

extension=mcrypt.so

If there is no php.ini file,  then you need to make one from php.ini.default in the same location like so:

sudo cp /etc/php.ini.default /etc/php.ini

And allow write capability

sudo chmod u+w  /etc/php.ini

Then add the line as above in your favourite text editor:

sudo nano /etc/php.ini

or

sudo vi /etc/php.ini

and add in the line:

extension=mcrypt.so

Restart Apache

sudo apachectl restart

That’s it, check your phpMyadmin login page or create and browse to a phpinfo.php to see if it loaded correctly, if it didn’t load you may need to declare the extensions directory in /etc/php.ini

extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20100525/"

 

 

Increase Netgear Router Speed - N150 Router (WNR1000)

After changing multiple settings in the Netgear admin panel, I finally found that by DISABLING (unchecking) "Enable WMM (Wi-Fi multimedia) settings" (Advanced > Setup > QoS Setup) I was able to increase my connection speed by 46%.

  1. Login to the control panel at routerlogin.net while connected to router's wifi network (default login: admin password: password)
  2. Click the "Advanced" tab and navigate to Setup > QoS Setup
  3. Uncheck "Enable WMM (Wi-Fi multimedia) settings"
  4. Click "Apply"

before.png

Before

before.speed.png
after.png

After

after.speed.png

Quick-fire CSS Solutions

Five easy ways to solve common CSS issues

I thought I’d put together a set simple methods to solve common CSS issues. They are simple and quick-fire and can be implemented with minimal code.

Smoothen out fonts

Remove jagged pixels from your text using rotation

transform: rotate(-0.0000000001deg);

This property will smoothen out your fonts by performing a minuscule rotation. It works well with all major browsers.

live demo

Making adjacent DIVs have the same height

Make your layouts flexible by using the super cool flex-box. Learn more about it here.

display: flex;

live demo

Centering an absolute element

Dialogue boxes and notifications can be centered quickly by aligning their position across all dimensions.

bottom: 0; left: 0; top: 0; right: 0;
margin: auto;
position: absolute;

live demo

Center align text vertically

You can align text vertically to the center of the page without using padding.

.parent { display: table;}
.child { display: table-cell; text-align: center; vertical-align: middle;}

live demo

Truncate multi-line strings properly

These properties work well with Webkit browsers and can be used to truncate multi-line text on a webpage.

display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;

live demo

 

Source: https://medium.com/p/76a7885ccff

Show more... [more]

Script and Style for 'Show more' ... 'Hide' content blocks. 

<p>This is all visible content... 
<a href="#" id="example-show" class="showLink"
onclick="showHide('example');return false;">Show more.</a>
</p>
<div id="example" class="more">
<p>This content is hidden by default...Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p><a href="#" id="example-hide" class="hideLink"
onclick="showHide('example');return false;">Hide this content.</a></p>
</div>

<style>
.more { display: none; }
a.showLink, a.hideLink {
text-decoration: none;
background: transparent url('down.gif') no-repeat left; }
a.hideLink {
background: transparent url('up.gif') no-repeat left; }
</style>

<script>
function showHide(shID) {
if (document.getElementById(shID)) {
if (document.getElementById(shID+'-show').style.display != 'none') {
document.getElementById(shID+'-show').style.display = 'none';
document.getElementById(shID).style.display = 'block';
}
else {
document.getElementById(shID+'-show').style.display = 'inline';
document.getElementById(shID).style.display = 'none';
}
}
}
</script>

This is all visible content... Show more.

This content is hidden by default...Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Hide this content.

balloon.jpg

This is all visible content... Show more.

This content is hidden by default...Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Hide this content.

<p>This is all visible content... 
<a href="#" id="example2-show" class="showLink"
onclick="showHide('example2');return false;">Show more.</a>
</p>
<div id="example2" class="more">
<p>This content is hidden by default...Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p><a href="#" id="example2-hide" class="hideLink"
onclick="showHide('example2');return false;">Hide this content.</a></p>
</div>

<style>
.more { display: none; }
a.showLink, a.hideLink {
text-decoration: none;
background: transparent url('down.gif') no-repeat left; }
a.hideLink {
background: transparent url('up.gif') no-repeat left; }
</style>

<script>
function showHide(shID) {
if (document.getElementById(shID)) {
if (document.getElementById(shID+'-show').style.display != 'none') {
document.getElementById(shID+'-show').style.display = 'none';
document.getElementById(shID).style.display = 'block';
}
else {
document.getElementById(shID+'-show').style.display = 'inline';
document.getElementById(shID).style.display = 'none';
}
}
}
</script>

iOS 7

Simplicity is often equated with minimalism. Yet true simplicity is so much more than just the absence of clutter or the removal of decoration. It’s about offering up the right things, in the right place, right when you need them. It’s about bringing order to complexity. And it’s about making something that always seems to “just work.” When you pick something up for the first time and already know how to do the things you want to do, that’s simplicity.

treasuryoflives.org

The new green hosting servers are live. 

The Treasury of Lives is proud to announce that we have moved our website onto a 100% completely solar powered, carbon free hosting company that does not use energy credits. We believe in off-setting our carbon-emissions and are proud of this step towards a greener office.

 

Subdomains

Today we added subdomains, you can test them out and create some usernames:

  • tumblr.westonhapp.com
  • wordpress.westonhapp.com
  • drupal.westonhapp.com
  • joomla.westonhapp.com


L.A.

Graffiti -- Lower Allston, just south of Cambridge.