<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Who is Chris Neale? &#187; mysql</title>
	<atom:link href="http://who-is.chrs.nl/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://who-is.chrs.nl</link>
	<description>Ineloquent online since &#039;99</description>
	<lastBuildDate>Sun, 05 Feb 2012 05:27:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Yes, this IS getting boring</title>
		<link>http://who-is.chrs.nl/2010/05/24/yes-this-is-getting-boring/</link>
		<comments>http://who-is.chrs.nl/2010/05/24/yes-this-is-getting-boring/#comments</comments>
		<pubDate>Mon, 24 May 2010 16:56:14 +0000</pubDate>
		<dc:creator>cdn</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[insanity]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://who-is.chrs.nl/?p=191</guid>
		<description><![CDATA[Upgraded most of the short linking I&#8217;ve been doing outside wordpress/la-petite-url to use yourls; except, of course, that a quick bit of sql didn&#8217;t translate everything. The MySQL insert into yourls_url select key1, target, timestamp(concat(year, '-', month, '-',day, ' 12:00:00')), &#8230; <a href="http://who-is.chrs.nl/2010/05/24/yes-this-is-getting-boring/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Upgraded most of the short linking I&#8217;ve <ins>been</ins> doing outside wordpress/la-petite-url to use yourls; except, of course, that a quick bit of sql didn&#8217;t translate everything.</p>
<p>The MySQL</p>
<p><code>insert into yourls_url select key1, target, timestamp(concat(year, '-', month, '-',day, ' 12:00:00')), '10.0.0.1', clicks from shorty_shorties;</code></p>
<p>The Problem<br />
One shorty link was hyphenated, not something yourls allows.</p>
<p>So, some .htaccess hackery required, again &#8230;</p>
<p><code>RewriteRule ^([0-9A-Za-z-]+)-([0-9A-Za-z-]+)?/?$ /yourls-go.php?id=$1$2 [L]</code></p>
]]></content:encoded>
			<wfw:commentRss>http://who-is.chrs.nl/2010/05/24/yes-this-is-getting-boring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Fix&#8221;ing WordPress database tables</title>
		<link>http://who-is.chrs.nl/2010/02/06/fixing-wordpress-database-tables/</link>
		<comments>http://who-is.chrs.nl/2010/02/06/fixing-wordpress-database-tables/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 15:41:47 +0000</pubDate>
		<dc:creator>cdn</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://who-is.chrs.nl/?p=169</guid>
		<description><![CDATA[After restoring tables from a WP mu backup (an incomplete one as it turned out) various issues presented themselves, not least an inability to submit posts (HTTP 500 not informative). A little searching revealed a likely cause (http://discuss.joyent.com/viewtopic.php?id=19116): missing auto_increment &#8230; <a href="http://who-is.chrs.nl/2010/02/06/fixing-wordpress-database-tables/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After restoring tables from a WP mu backup (an incomplete one as it turned out) various issues presented themselves, not least an inability to submit posts (HTTP 500 not informative).<br />
A little searching revealed a likely cause (<a href="http://discuss.joyent.com/viewtopic.php?id=19116">http://discuss.joyent.com/viewtopic.php?id=19116</a>): missing auto_increment on wp_{n}_posts; not only was auto_increment missing, indexes and keys were too. Later I found a hiccup in tagging, again wp_{n}_terms and related tables had missing metadata.</p>
<p>Fixes</p>
<p>Removing erroneous entries added by admin-ajax.php</p>
<p><code>delete from wp_{n}_posts where ID = 0 and post_modified = 'YYYY-MM-DD hh:mm:ss';</code></p>
<p>Add primary index before restoring auto_increment</p>
<p><code>alter table wp_{n}_posts add primary key (ID);<br />
alter table wp_{n}_posts change ID `ID` bigint(20) unsigned NOT NULL auto_increment;</code></p>
<p>Add remaining keys</p>
<p><code>alter table wp_{n}_posts add key post_name (post_name);<br />
alter table wp_{n}_posts add key type_status_date (post_type, post_status, post_date, ID);<br />
alter table wp_{n}_posts add key post_parent (post_parent);</code></p>
<p>Future backups</p>
<p><code>mysqldump --opt wordpress &gt; wordpress.sql</code></p>
<p>Just using &#8211;add-drop-table insufficent in some cases.</p>
]]></content:encoded>
			<wfw:commentRss>http://who-is.chrs.nl/2010/02/06/fixing-wordpress-database-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Short Links and IDNs : Part Deux</title>
		<link>http://who-is.chrs.nl/2009/08/25/short-links-and-idns-part-deux/</link>
		<comments>http://who-is.chrs.nl/2009/08/25/short-links-and-idns-part-deux/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 07:43:23 +0000</pubDate>
		<dc:creator>cdn</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[idn]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[tiny]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[uri]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://who-is.chrs.nl/?p=47</guid>
		<description><![CDATA[This will be part two of Short Links, IDNs and (WordPress). lessn and shorty &#8211; standalone host-your-own short-url services http://get-shorty.com/forum/viewtopic.php?id=21 http://&#424;.ws/shorty http://www.subtraction.com/2006/01/17/get-shorty http://www.subtraction.com/2006/08/24/announcing-s lessn is very simple, you get one username / password and next to no interface &#8211; does &#8230; <a href="http://who-is.chrs.nl/2009/08/25/short-links-and-idns-part-deux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This will be part two of Short Links, IDNs and (WordPress).</p>
<p>lessn and shorty &#8211; standalone host-your-own short-url services</p>
<p>http://get-shorty.com/forum/viewtopic.php?id=21</p>
<p><a href="http://&#424;.ws/shorty/">http://&#424;.ws/shorty</a></p>
<p>http://www.subtraction.com/2006/01/17/get-shorty</p>
<p>http://www.subtraction.com/2006/08/24/announcing-s</p>
<p><a href="http://shauninman.com/archive/2009/08/17/less_n">lessn</a> is <u>very</u> simple, you get one username / password and next to no interface &#8211; does have bookmarklet</p>
<p>shorty could give you multiple users (database allows for it); however, that part of the interface seems to be absent &#8211; +ve human-readable links; excluding backwards&ndash;s dot double&ndash;u ess <img src='http://who-is.chrs.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Looking at http://yourls.org/ too, how many different schemes does one need&#8253;</p>
]]></content:encoded>
			<wfw:commentRss>http://who-is.chrs.nl/2009/08/25/short-links-and-idns-part-deux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Short Links, IDNs (and WordPress)</title>
		<link>http://who-is.chrs.nl/2009/08/23/short-links-idns-and-wordpress/</link>
		<comments>http://who-is.chrs.nl/2009/08/23/short-links-idns-and-wordpress/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 10:26:20 +0000</pubDate>
		<dc:creator>cdn</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[idn]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[tiny]]></category>
		<category><![CDATA[uri]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://who-is.chrs.nl/?p=12</guid>
		<description><![CDATA[Having been caught up in the wheels of the bandwagon, I&#8217;ve been playing with short link generators that you self–host. Disconnected thoughts: been playing with short url technologies, WordPress and the inevitable short domain names, IDNs that look cool / &#8230; <a href="http://who-is.chrs.nl/2009/08/23/short-links-idns-and-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Having been caught up in the wheels of the bandwagon, I&#8217;ve been playing with short link generators that you self–host.</p>
<p>Disconnected thoughts:</p>
<p>been playing with short url technologies, WordPress and the inevitable short domain names, <abbr title="Internationaliƨed Domain Name">IDN</abbr>s that look cool / shorter.</p>
<p>Choices influenced by Zeldman’s &#8220;Shorten this&#8221; [<a href="http://www.zeldman.com/2009/08/10/shorten-this/">http://zeldman.com/x/50</a>] and the comments attached to it.</p>
<p>WordPress plug-ins for shorter links &#8211; <a href="http://wordpress.org/extend/plugins/shortlink/">short link</a>, <a href="http://wordpress.org/extend/plugins/short-url-plugin/">short url</a>, <a href="http://wordpress.org/extend/plugins/le-petite-url/">la petite url</a> [ or le petite url &lt;sic&gt;, «le petit url» might be correct, mais my GCSE French didn’t cover the web ].</p>
<p>causerelatedmarketing.co.uk &#8211; a mouthful (especially with yyyy/mm/slug on the end); <a href="http://crm♻.ws/">crm♻.ws</a> is much more manageable for 140 character stuff</p>
<p>♻ influenced by @<a href="http://twitter.com/daringfireball">daringfireball</a> / John Gruber’s <a href="http://✪df.ws/">✪df.ws</a> &#8211; even went to <a href="http://dynadot.com/">the same registrar</a>!</p>
<p>Initially set up shorturl (used exactly as Zeldman does, except under the default letter); with <a href="http://twitter.com/WiseRecycling/status/3391565416">a single tweet</a> to test.</p>
<p>l p u [1.06] : allows http:// in prefix, then prints that after blog’s domain leading to http://example.comhttp://short-domain.tld/ as prefix to short links &#8211; need to make $blogurl = &#8221;; rather than get_bloginfo(&#8216;siteurl&#8217;);</p>
<p>produces short links of definable length out of any of a-z, A-Z and 0-9 or a combination; these are generated at the point of  a post’s publication, or alteration in the case that l p u [1.06] has been added to an existing self&amp;ndash;hosted WordPress blog [ wordpress.com blogs get an <a href="http://en.blog.wordpress.com/2009/08/14/shorten/">auto-generated wp.me short link</a> ]</p>
<p>short link works in a different way, making use of a post’s numeric ID as its short URL &#8211; this doesn&#8217;t require an existing post to be altered to be available</p>
<p>crm♻.ws is just an alias (ServerAlias, <a href="http://httpd.apache.org/docs/2.0/mod/mod_vhost_alias.html">mod_vhost_alias</a>) of causerelatedmarketing.co.uk</p>
<p>/domains/c/a/causerelatedmarketing.co.uk and<br />
/domains/x/n/xn--crm-k05a.ws are both symbolic links to the same place in the filesystem, xn--crm-k05a.ws being the punycode representation</p>
<p>none really handle having a different domain for your short URLs very neatly without some hacking</p>
<p>WordPress plugins</p>
<p>ShortURL &#8230; return $shortlink; instead of return get_bloginfo(&#8216;url&#8217;) . &#8220;/&#8221; . $shortlink;<br />
.htaccess tweaked :<br />
RewriteCond %{HTTP_HOST} ^xn--crm-k05a\.ws$<br />
RewriteRule ^u/([0-9]+)$ u.php?$1|$2<br />
(adding RewriteCond)</p>
<p>PHP-centric tech., since I don&#8217;t grok perl, python, ruby</p>
<p>SQL ess cue ell [ sequel? ] &#8211; was listening to Sitepoint podcast &#8230;</p>
<p>Lots of .htaccess mod_rewrite hackery needed when a site reports itself as domain0.tld0 when visited at domain1.tld1; the judicious use of RewriteCond %{HTTP_HOST} certainly helps, especially when one filesystem is seen as different sites, subdirectories of the root; shopping.chrs.nl being a sibling of who-is.chrs.nl, itself an alias of domain0.tld0.</p>
<p><del><a href="http://wordpress.org/extend/plugins/twitter-blog/">Twitter Blog</a> plug-in hacked about so that la-petite-url links used instead of bit.ly &#8211; and since I didn&#8217;t have a recent enough php, <a href="http://uk.php.net/json_decode">json_decode</a>() is missing&#8230; and the replacement function has output in the form of an array, not an object.</del></p>
]]></content:encoded>
			<wfw:commentRss>http://who-is.chrs.nl/2009/08/23/short-links-idns-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

