WordPress: CREATE TABLE `wp_redirection_404` mysql error

Wordpress  Create Table  Wp Redirection 404  Error

If you’re getting the following error:

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near `’KEY ‘referrer’ (‘referrer’) ) DEFAULT CHARACTER SET utf8’` at line 12]

CREATE TABLE ‘wp_redirection_404’ ( ‘id’ int(11) unsigned NOT NULL AUTO_INCREMENT,
‘created’ datetime NOT NULL, ‘url’ varchar(255) NOT NULL DEFAULT ”, ‘agent’ varchar(255) DEFAULT NULL,
‘referrer’ varchar(255) DEFAULT NULL, ‘ip’ int(10) unsigned NOT NULL, PRIMARY KEY (‘id’), KEY ‘created’
(‘created’), KEY ‘url’ (‘url’), KEY ‘ip’ (‘ip’,’id’) KEY ‘referrer’
(‘referrer’) ) DEFAULT CHARACTER SET utf8;

Most likely you need to edit the plugin file:

wp-content/plugins/redirection/models/database.php

and add a comma around line 195:

KEY `ip` (`ip`,`id`)

needs to be changed to:

KEY `ip` (`ip`,`id`),

This is a flaw with the `upgrade_to_231` function which is not called very often.

Posted in Tech Tips, Web Development | Tagged , , , , | 1 Comment

Quicksilver: Disable Shelf Popup

As of a recent release of Quicksilver (around B68 3927) the shelf module has been revised (version 1.2.3 5/9/12) and it will now pop up on the left side of the screen if you hover your mouse cursor near the center of the screen:

Disable Shelf Popup Quicksilver

I love quicksilver but personally find this a little annoying. As far as I can tell there is no visible option to customize where the settings are for the shelf’s behavior, but if you don’t use it you can disable the shelf in Quicksilver’s plugins module:

Disable Shelf Popup

If there is a way to disable the shelf from appearing on the left side you may be able to access it directly with something like the defaults write command. This command turns previews on:

defaults write com.blacktree.quicksilver “QSLoadImagePreviews” YES

Posted in Mac, Software, Tech Tips | Tagged , , , | 2 Comments

Dotcloud – Warning: Identity file not accessible: No such file or directory.

If you’re using dotcloud and realize that you’re getting this error:

Warning: Identity file ~/.dotcloud/dotcloud.key not accessible: No such file or directory.

You are probably using the old version of the API / CLI. Make sure you upgrade both the CLI and API and also the application.

You may also want to use the `dotcloud info yourapp.www` to get information such as the ssh connect string (`username@host`) and correct port.

The correct for direct ssh would be:

`ssh [email protected] -i ~/.dotcloud/dotcloud.key -p 5678`

Make sure to replace the port numbers and domain string appropriately.

See this article: http://docs.dotcloud.com/guides/copy/

Posted in Tech Tips, Web Development | Tagged , , | Leave a comment

Email body is missing, please drop a line.

Email body is missing, please drop a line.

Email body is missing, please drop a line.

Google Analytics E-mail reporting requires that you enter a body in your e-mail

Posted in Tech Tips, Web Development | Tagged , | Leave a comment

WordPress: Get all terms for a post

Get all terms for a Post in WordPressFirst you need to get the available taxonomies so that you can pass them to the `wp_get_object_terms` function to get all of the terms / categories / tags / custom tax terms associated with a single post:

$taxonomies = get_taxonomies(”,’names’);
print_r($taxonomies); //optional for debugging

That will likely return something like this:

Array
(
[category] => category
[post_tag] => post_tag
[nav_menu] => nav_menu
[link_category] => link_category
[post_format] => post_format
[product_type] => product_type
[product_cat] => product_cat
[product_tag] => product_tag
[product_shipping_class] => product_shipping_class
[shop_order_status] => shop_order_status
)

Next you can use the `wp_get_object_terms` function, passing the post’s ID(s) and the list of taxonomies to get all of the terms associated:

global $post; //optional if you are inside the “loop”
$terms = wp_get_object_terms($post->ID,$taxonomies);
print_r($terms); //optional for debugging

Array
(
[0] => stdClass Object
(
[term_id] => 2
[name] => Blogroll
[slug] => blogroll
[term_group] => 0
[term_taxonomy_id] => 2
[taxonomy] => link_category
[description] =>
[parent] => 0
[count] => 7
)

[1] => stdClass Object
(
[term_id] => 14
[name] => Lightweight
[slug] => lightweight
[term_group] => 0
[term_taxonomy_id] => 14
[taxonomy] => product_cat
[description] =>
[parent] => 0
[count] => 1
)

[2] => stdClass Object
(
[term_id] => 15
[name] => tag1
[slug] => tag1
[term_group] => 0
[term_taxonomy_id] => 15
[taxonomy] => product_tag
[description] =>
[parent] => 0
[count] => 1
)

[3] => stdClass Object
(
[term_id] => 5
[name] => simple
[slug] => simple
[term_group] => 0
[term_taxonomy_id] => 5
[taxonomy] => product_type
[description] =>
[parent] => 0
[count] => 1
)

)

And that’s how you get all terms for a post in wordpress. I decided to write this after unsuccessfully searching for the terms below. Leave a comment if this helped you or if you have a fix / improvement / question.

  • wordpress get all terms post
  • wordpress get all taxonomies
  • wordpress get all terms
  • wordpress get all terms post
Posted in Web Development | Tagged , , , | 1 Comment

NoSleep for Mac OS X

NoSleep for Mac OS X is a program to prevent your MacBook from sleeping. On a MacBook Air, MacBook Pro, or Macbook with traditional clamshell mode, an external display, mouse, and keyboard must be attached in order to maintain the running closed-lid clamshell state. Thanks NoSleep we can now remove those hardware limitations and run a Mac laptop with the lid closed and no hardware attached.

The problem I was facing was that when I had a keyboard, trackpad, and external monitor attached and removed the power supply / power adapter my macbook would go to sleep.

Now thanks to NoSleep I can easily toggle the sleep mode to keep the computer awake.

This is similar to the Caffeine extension which can keep your monitor awake during presentations – it also sits in the menu bar.

Prevent Macbook From Sleeping With Lid Closed

Download NoSleep from Google Code

Posted in Mac, Software, Tech Tips | Tagged , , , | 3 Comments

How to do a Random Drawing / pick at random using Excel

Are you running a contest or sweepstakes an need a system to pick random winners out of a pool of names? You could take the old-school approach of writing names on business cards and pulling them out of a fishbowl, or you could use Microsoft Excel.

Put the names in an excel sheet. add a column and put `=RAND()` in it. it will give a random number that is recalculated every time a change is made on the sheet. choose that column and click sort “a-z” (or z-a). it won’t matter because each time you do it will randomize the names. Just pick the top one (or top 10) after sorting it.

Excel: Pick a Random Winner

Posted in Random, Security, Tech Tips | Tagged , , , , , , , | 1 Comment

Android Market Share Surges in Q1 2012

Q1 NPD number is out. Android surged to 61%. iOS dropped to 29%.

Compare that with ComScore’s February number: Android 50.1%, iOS 30.2%

###Worldwide profit estimate by Asymco
– Apple: 73%
– Samsung 26%
– Everyone else: 1%

In Cupertino “ecosystem”, 80% of iOS developers lose money

##OS Share of Smartphone Phones
OS Share of Smartphone Phones

##2012 Q1 Profit Shares of 8 Mobile Phone Vendors
2012 Q1 Profit Shares of 8 Mobile Phone Vendors

Source

Posted in Mac, Marketing, Software, Tech Opinion | Tagged , , , , | Leave a comment

Reset 1Password Keyboard Shortcuts – Solved

You’ll see from the 1password support site that there is a bug having to do with resetting the default shortcut keys. There are two versions of 1Password, one installed from their website and one installed from the app store.

If you use the one from the app store, you an delete these two files to reset all the preferences:

Folder:
~/Library/Containers/com.agilebits.onepassword-osx/Data/Library/Preferences/

Files
com.agilebits.onepassword-osx.plist
com.agilebits.onepassword-osx.plist.lockfile

ps: You may want to make a backup of these.

If you’ve downloaded the program from their website, you will find the plist file located instead at:

~/Library/Preferences/ws.agile.1Password.plist

You can also open these 1Password plist preference files with a program like `PlistEdit Pro.app` and simply find the following two values and delete them:

ShortcutRecorder bookmarks
ShortcutRecorder restoreForm

For some related information, see the help article on their support forum.

Reset 1Password Keyboard Shortcuts

Posted in Mac, Software, Tech Tips | Tagged , , , , | 2 Comments

Where can I download rdpclip for Windows XP?

rdpclip.exe is the main executable for File Copy and gives functionality to Terminal Services (remote desktop) server that allows you to copy and paste between server and client.

File Copy is an extension to Terminal Services server that lets you copy and paste between the server and the client. RdpClip lets you copy and paste files between a terminal session and a client console session.

Download RDPCLIP by visiting

http://download.microsoft.com/download/win2000platform/rdpclip/1.0/NT5/EN-US/rdpclip_hotfix.exe

download rdpclip for windows xp

Posted in Software, Tech Tips | Tagged , , , , , | Leave a comment