<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3045551838493191275</id><updated>2012-02-16T17:14:54.053-08:00</updated><category term='mail'/><category term='gpg'/><category term='javascript'/><category term='perl'/><category term='postfix'/><category term='os x'/><category term='environment'/><category term='ps'/><category term='curl'/><category term='kill'/><category term='osx'/><category term='mssql'/><category term='sed'/><category term='ip'/><category term='firefox'/><category term='find'/><category term='excel'/><category term='uptime'/><category term='grep'/><category term='debian'/><category term='disk image'/><category term='video'/><category term='imagemagick'/><category term='freebsd'/><category term='chmod'/><category term='thunderbird'/><category term='wget'/><category term='lame'/><category term='linux'/><category term='apache'/><category term='mysql'/><category term='java'/><category term='x11'/><category term='perl modules'/><category term='random'/><category term='cd'/><category term='bash'/><category term='crypt'/><category term='vnc'/><category term='vb'/><category term='tar'/><category term='time'/><category term='regex'/><category term='exim'/><category term='html'/><category term='mod_rewrite'/><category term='samba'/><category term='mp3'/><category term='iptables'/><category term='gmail'/><category term='zip'/><category term='mail queue'/><title type='text'>tiplicks!</title><subtitle type='html'>linux, shell, perl, php and mysql tips and tricks</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.tiplicks.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default?start-index=26&amp;max-results=25'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>146</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-222448127226717359</id><published>2012-02-10T13:50:00.001-08:00</published><updated>2012-02-10T18:17:28.469-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='curl'/><title type='text'>Check that curl is connecting through your proxy</title><content type='html'>&lt;pre class="brush:bash;light:true"&gt;http_proxy=http://localhost:8082 curl -C - -O -# -v -A 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13' http://www.cotse.com/proxycheck2.htm &gt; index.html&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then open that html file in your browser&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-222448127226717359?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/222448127226717359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2012/02/check-that-curl-is-connecting-through.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/222448127226717359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/222448127226717359'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2012/02/check-that-curl-is-connecting-through.html' title='Check that curl is connecting through your proxy'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-6717302533176293552</id><published>2012-02-03T12:39:00.000-08:00</published><updated>2012-02-03T12:39:50.739-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Replace windows specials characters like curly quotes and ellipses in MySQL</title><content type='html'>&lt;pre class="brush:sql;light:true"&gt;UPDATE `table` SET `column` = REPLACE(`column`, 0xE28098, "'");&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, 0xE28099, "'");&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, 0xE2809C, '"');&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, 0xE2809D, '"');&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, 0xE28093, '-');&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, 0xE28094, '--');&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, 0xE280A6, '...');&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, CHAR(145), "'");&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, CHAR(146), "'");&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, CHAR(147), '"');&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, CHAR(148), '"');&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, CHAR(150), '-');&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, CHAR(151), '--');&lt;br /&gt;UPDATE `table` SET `column` = REPLACE(`column`, CHAR(133), '...');&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-6717302533176293552?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/6717302533176293552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2012/02/replace-windows-specials-characters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/6717302533176293552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/6717302533176293552'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2012/02/replace-windows-specials-characters.html' title='Replace windows specials characters like curly quotes and ellipses in MySQL'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-347395949615679190</id><published>2012-01-26T22:07:00.000-08:00</published><updated>2012-01-27T00:34:27.418-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='disk image'/><title type='text'>a few ways to force-unmount a disk image in OS X</title><content type='html'>Not that you should ever have to do this or anything.&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;sudo umount -f /Volumes/Yourdisk&lt;br /&gt;&lt;/pre&gt;&lt;pre class="brush:bash;light:true"&gt;sudo diskutil umount force /Volumes/Yourdisk&lt;br /&gt;&lt;/pre&gt;For this one you need to first get the disk location with the &lt;code&gt;mount&lt;/code&gt; or &lt;code&gt;df&lt;/code&gt; command:&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;hdiutil eject -force /dev/disk2sX&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-347395949615679190?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/347395949615679190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2012/01/few-ways-to-force-unmount-disk-image-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/347395949615679190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/347395949615679190'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2012/01/few-ways-to-force-unmount-disk-image-in.html' title='a few ways to force-unmount a disk image in OS X'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-6170044013927248469</id><published>2012-01-20T13:52:00.000-08:00</published><updated>2012-01-20T13:52:27.950-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mod_rewrite'/><title type='text'>mod_rewrite magic! Redirecting "behind the scenes"</title><content type='html'>I've posted about this &lt;a href="http://www.tiplicks.com/2008/05/use-modrewrite-to-create-fake-sites.html"&gt;before&lt;/a&gt;, but I have found another use for this trick.  A client wanted to put dynamic JSP function on one of their sites, but the site in question was a simple apache vhost that was not running the tomcat application server.  I didn't want to create a new instance of the application server and basically have to move the site just to add this little function they wanted...So, I built the JSP pages on another server (on a completely different domain) and used this mod_rewrite trick to make it appear to the user that they haven't left the site.  Beautiful!  You'd put something like this in your .htaccess file:&lt;br /&gt;&lt;pre class="brush:text;light:true"&gt;RewriteEngine On&lt;br /&gt;RewriteBase    /&lt;br /&gt;&lt;br /&gt;# first, make sure all http hosts have the www.&lt;br /&gt;RewriteCond %{HTTP_HOST} !^www\.yoursite\.com [NC]&lt;br /&gt;RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]&lt;br /&gt;&lt;br /&gt;# check for any hits to the specific application page you want to forward to.&lt;br /&gt;# the second rewritecond is very important, otherwise ALL hits will be forwarded&lt;br /&gt;# add additional rewritecond's for each app page you want forwarded&lt;br /&gt;RewriteCond %{HTTP_HOST} ^www\.yoursite\.com [NC]&lt;br /&gt;RewriteCond %{REQUEST_URI} ^/dynamic_catalog [NC]&lt;br /&gt;RewriteRule (.*) http://www.yourapplicationsite.com/%{REQUEST_URI} [L,P]&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-6170044013927248469?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/6170044013927248469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2012/01/modrewrite-magic-redirecting-behind.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/6170044013927248469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/6170044013927248469'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2012/01/modrewrite-magic-redirecting-behind.html' title='mod_rewrite magic! Redirecting &quot;behind the scenes&quot;'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-8263891536286236372</id><published>2012-01-13T13:37:00.000-08:00</published><updated>2012-01-13T13:38:27.702-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl modules'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='environment'/><title type='text'>Fixing perl environment problem on os x 10.7</title><content type='html'>When upgrading from 10.6 to 10.7 some of my perl modules seemed to break (namely DBD::mysql).  I tried to re-install via cpan and couldn't do it.  Couldn't even do a force install.&lt;br /&gt;&lt;br /&gt;Fortunately, there are alot of perl mods available through the fink package manager.  I ran:&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;sudo fink install dbd-mysql-pm5123&lt;br /&gt;&lt;/pre&gt;and it installed the module no problem.  Great.  I could then execute my perl programs from the command line.  Problem is, the path where fink puts the perl mods is not available to cron.  So, I had to specify the additional perl library paths in the crontab itself.  I added this to the top of my crontab:&lt;br /&gt;&lt;pre class="brush:text;light:true"&gt;PERL5LIB=/sw/lib/perl5/5.12.3/darwin-thread-multi-2level:/sw/lib/perl5/5.12.3:/sw/lib/perl5/darwin-thread-multi-2level:/sw/lib/perl5:/sw/lib/perl5/darwin:$PERL5LIB&lt;br /&gt;LC_ALL=C&lt;br /&gt;&lt;/pre&gt;Source: &lt;a href="http://www.peter.com.au/macosx/index.html#environment"&gt;Peter's Mac OS X Notes&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-8263891536286236372?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/8263891536286236372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2012/01/fixing-perl-environment-problem-on-os-x.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/8263891536286236372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/8263891536286236372'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2012/01/fixing-perl-environment-problem-on-os-x.html' title='Fixing perl environment problem on os x 10.7'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-2541804245132301967</id><published>2012-01-13T13:18:00.000-08:00</published><updated>2012-01-13T13:18:35.653-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl modules'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>print standard library paths to your perl modules</title><content type='html'>&lt;pre class="brush:bash;light:true"&gt;perl -le 'print foreach @INC'&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-2541804245132301967?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/2541804245132301967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2012/01/print-standard-library-paths-to-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/2541804245132301967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/2541804245132301967'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2012/01/print-standard-library-paths-to-your.html' title='print standard library paths to your perl modules'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-5012840312981968885</id><published>2012-01-13T12:36:00.000-08:00</published><updated>2012-01-13T12:36:57.751-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='os x'/><category scheme='http://www.blogger.com/atom/ns#' term='gmail'/><category scheme='http://www.blogger.com/atom/ns#' term='postfix'/><title type='text'>Fix for Postfix mail issue after upgrading from OS X 10.6 to 10.7</title><content type='html'>Postfix stops working.  It throws errors like:&lt;br /&gt;&lt;pre class="brush:text;light:true"&gt;Jan 13 12:18:52 huggybunny postfix/master[2254]: warning: process /usr/libexec/postfix/smtp pid 2299 exit status 1&lt;br /&gt;Jan 13 12:18:52 huggybunny postfix/master[2254]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I had it set up to replay through GMail.  Looks like the /etc/postfix/sasl_password file was deleted during the upgrade.  All I had to do was create it again per &lt;a href="http://www.riverturn.com/blog/?p=239"&gt;these instructions&lt;/a&gt;, reload postfix and it was good to go.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-5012840312981968885?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/5012840312981968885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2012/01/fix-for-postfix-mail-issue-after.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/5012840312981968885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/5012840312981968885'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2012/01/fix-for-postfix-mail-issue-after.html' title='Fix for Postfix mail issue after upgrading from OS X 10.6 to 10.7'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-7473892113588831630</id><published>2012-01-13T12:01:00.001-08:00</published><updated>2012-01-13T12:20:53.696-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mail queue'/><category scheme='http://www.blogger.com/atom/ns#' term='postfix'/><title type='text'>Empty the Postfix mail queue</title><content type='html'>Deletes everything.&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;sudo postsuper -d ALL&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-7473892113588831630?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/7473892113588831630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2012/01/empty-postfix-mail-queue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/7473892113588831630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/7473892113588831630'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2012/01/empty-postfix-mail-queue.html' title='Empty the Postfix mail queue'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-658074405845843491</id><published>2012-01-03T10:25:00.000-08:00</published><updated>2012-01-03T10:53:47.370-08:00</updated><title type='text'>Running Parallels 5 or 6 after upgrading to Mac OS X Lion (10.7)</title><content type='html'>Naturally, Parallels doesn't work after upgrading.  It will show you an error like "Unable to load the Parallels Driver.  Please restart your mac and try again." when you try to start a virtual machine.  They are relentless about keeping you on the teat of their upgrades.  Just like Intuit.&lt;br /&gt;&lt;br /&gt;Anyway, I found a workaround.  All I can say is that it worked for me.  Don't blame me if it blows up your computer.  I am doing this as "root" user rather than sudo-ing.  Run these commands and it should start.&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;chgrp -R wheel "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/";&lt;br /&gt;sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_hypervisor.kext";&lt;br /&gt;sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_hid_hook.kext";&lt;br /&gt;sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_usb_connect.kext";&lt;br /&gt;sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_netbridge.kext";&lt;br /&gt;sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_vnic.kext";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, after that, you might (i.e. will probably) need to run this "Parallels Desktop Launcher" script.  Perhaps even every time you run parallels (you could just replace the icon in your dock I suppose)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://art-domains.de/downloads/Launcher.zip"&gt;Launcher&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-658074405845843491?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/658074405845843491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2012/01/running-parallels-5-or-6-after.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/658074405845843491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/658074405845843491'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2012/01/running-parallels-5-or-6-after.html' title='Running Parallels 5 or 6 after upgrading to Mac OS X Lion (10.7)'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-9075831861982657223</id><published>2012-01-03T07:11:00.001-08:00</published><updated>2012-01-06T07:22:16.676-08:00</updated><title type='text'>When the Mac App store hangs on connection (10.6 or later)</title><content type='html'>&lt;ol&gt;&lt;li&gt;Close App Store and iTunes  completly (blue circle under each should disappear)&lt;/li&gt;&lt;li&gt;Open Terminal (Applications -&gt; Utilities -&gt; Terminal)&lt;/li&gt;&lt;li&gt;Run the following:&lt;br /&gt;&lt;pre class="brush:text;light:true"&gt;mv -f ~/Library/Preferences/com.apple.storeagent.plist ~/Library/Preferences/com.apple.storeagent.old.plist&lt;br /&gt;mv -f ~/Library/Preferences/com.apple.appstore.plist ~/Library/Preferences/com.apple.appstore.old.plist&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;This will reset a number of preferences about the App Store.&lt;/li&gt;&lt;li&gt;Restart your Mac! - This is key!&lt;/li&gt;&lt;li&gt;Open App Store.  you'll need to re-login&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-9075831861982657223?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/9075831861982657223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2012/01/when-mac-app-store-hangs-on-connection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/9075831861982657223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/9075831861982657223'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2012/01/when-mac-app-store-hangs-on-connection.html' title='When the Mac App store hangs on connection (10.6 or later)'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-3868236992741903366</id><published>2011-12-28T06:31:00.000-08:00</published><updated>2011-12-28T06:35:44.166-08:00</updated><title type='text'>Setting a specific proxy for Google Chrome</title><content type='html'>Like Safari, Google Chrome uses OS-level proxy settings.  But what if you need your browser on a different proxy?  Answer: you can pass proxy info to Chrome by opening it on the command line like this:&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;open -a /Applications/Google\ Chrome.app --args --proxy-server=[host]:[port]&lt;br /&gt;&lt;/pre&gt;And if you want the convenience of launching from your dock, create a wrapper script and icon using one of these methods (copied from &lt;a href="http://superuser.com/questions/271678/how-do-i-pass-command-line-arguments-to-dock-items"&gt;here&lt;/a&gt; because it's a flaky link):&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Option 1&lt;/strong&gt;: Use Automator to create an application that in effect launches Chrome with command line arguments.&lt;br /&gt;&lt;br /&gt;Start Automator and select to create an &lt;em&gt;Application&lt;/em&gt;. Double-click &lt;em&gt;Run Shell Script&lt;/em&gt; in the &lt;em&gt;Library/Utilities&lt;/em&gt; folder and replace the text content — &lt;code&gt;cat&lt;/code&gt; — with the following:&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;open -a /Applications/Google\ Chrome.app --args --proxy-server=[host]:[port]&lt;br /&gt;&lt;/pre&gt;Save anywhere you like.&lt;br /&gt;&lt;br /&gt;To replace this application's icon, &lt;em&gt;Get Info&lt;/em&gt; on your real Google Chrome, click on the icon on the top left, press &lt;code&gt;Cmd-C&lt;/code&gt;, &lt;em&gt;Get Info&lt;/em&gt; on your Chrome Automator app, click the icon, and press &lt;code&gt;Cmd-V&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Since it's a different application, the Dock will display two Chrome applications when it's running: Chrome, and your Chrome launcher.&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;strong&gt;Option 2&lt;/strong&gt;: Edit your application bundle to launch a script instead. This script will start the actual application, adding the command line argument.&lt;br /&gt;&lt;br /&gt;Right-click &lt;code&gt;Google Chrome.app&lt;/code&gt; and select &lt;em&gt;Show Package Contents&lt;/em&gt;. Go to &lt;code&gt;Contents/&lt;/code&gt; and open &lt;code&gt;Info.plist&lt;/code&gt; in &lt;em&gt;Property List Editor/Xcode&lt;/em&gt; (Apple's developer tools), or a third party &lt;code&gt;plist&lt;/code&gt; editor.&lt;br /&gt;&lt;br /&gt;Look for the entry &lt;code&gt;CFBundleExecutable&lt;/code&gt; or &lt;code&gt;Executable File&lt;/code&gt;. Remember its value (e.g. &lt;code&gt;firefox-bin&lt;/code&gt; for Firefox). Replace it with &lt;code&gt;parameterized-app.sh&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Open Terminal and enter the following:&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;touch /Applications/Firefox.app/Contents/MacOS/parameterized-app.sh&lt;br /&gt;open /Applications/Firefox.app/Contents/MacOS/parameterized-app.sh&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;An editor for the &lt;code&gt;.sh&lt;/code&gt; file will open. Set the contents of the file to:&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;#!/usr/bin/env bash&lt;br /&gt;/Applications/Firefox.app/Contents/MacOS/firefox-bin -ProfileManager&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;(using the actual executable's name you removed from &lt;code&gt;Info.plist&lt;/code&gt;, adding the desired command-line arguments)&lt;br /&gt;&lt;br /&gt;Save and close. In Terminal, enter the following:&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;chmod +x /Applications/Firefox.app/Contents/MacOS/parameterized-app.sh&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, close Terminal and move your application (which must not be running right now) to a different folder and back again. This will update &lt;em&gt;Launch Services&lt;/em&gt;, otherwise your changes will be ignored and irritate you immensely.&lt;br /&gt;&lt;br /&gt;Now, when you open your application, it will actually execute the &lt;code&gt;.sh&lt;/code&gt; file, which will in turn launch the actual executable file, sending the command line args along.&lt;br /&gt;&lt;br /&gt;It will look and behave like you expect it to, but you will need to repeat this whenever you update your application, as this will generally replace the application bundle and all the changes you made.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-3868236992741903366?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/3868236992741903366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2011/12/setting-specific-proxy-for-google.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/3868236992741903366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/3868236992741903366'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2011/12/setting-specific-proxy-for-google.html' title='Setting a specific proxy for Google Chrome'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-1722872164076507528</id><published>2011-10-28T14:11:00.001-07:00</published><updated>2011-10-28T14:15:26.248-07:00</updated><title type='text'>Shell Script to re-name file extensions</title><content type='html'>&lt;pre class="brush:bash;light:true"&gt;OLDEXT=${2/#.}&lt;br /&gt;for file in *.jpg ; do mv $file `echo $file | sed 's/\(.*\.\)jpg/\1png/'` ; done&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-1722872164076507528?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/1722872164076507528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2011/10/shell-script-to-re-name-file-extensions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/1722872164076507528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/1722872164076507528'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2011/10/shell-script-to-re-name-file-extensions.html' title='Shell Script to re-name file extensions'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-4355570496038296387</id><published>2011-07-18T12:22:00.000-07:00</published><updated>2011-07-18T12:22:11.579-07:00</updated><title type='text'>Remove multiple instances of a character (or a pattern) from a URL, then do a 301 redirect, with mod_rewrite</title><content type='html'>There was actually some html tags appearing in some of my URLs.  This hack strips tags and does a search-engine-friendly redirect.&lt;br /&gt;&lt;pre class="brush:text;light:true"&gt;RewriteCond %{REQUEST_URI} ^(.*)&lt;.*?&gt;(.*)$&lt;br /&gt;RewriteRule ^.*$ %1%2 [E=replacer:%1%2]&lt;br /&gt;RewriteCond %{ENV:replacer} !^$&lt;br /&gt;RewriteCond %{ENV:replacer} !^.*&lt;.*?&gt;.*$&lt;br /&gt;RewriteRule ^.*$ %{ENV:replacer} [R=301,L]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This part matches the tags: "&lt;.*?&gt;".  Replace that with your character or pattern.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-4355570496038296387?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/4355570496038296387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2011/07/remove-multiple-instances-of-character.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/4355570496038296387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/4355570496038296387'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2011/07/remove-multiple-instances-of-character.html' title='Remove multiple instances of a character (or a pattern) from a URL, then do a 301 redirect, with mod_rewrite'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-3668301823571200225</id><published>2011-07-14T17:48:00.000-07:00</published><updated>2011-07-14T17:48:40.337-07:00</updated><title type='text'>Check line endings of a file from command line</title><content type='html'>type 'od -c [filename]' and look for either \n (indicating LF) or \r \n (indicating CRLF)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-3668301823571200225?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/3668301823571200225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2011/07/check-line-endings-of-file-from-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/3668301823571200225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/3668301823571200225'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2011/07/check-line-endings-of-file-from-command.html' title='Check line endings of a file from command line'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-4899909392027096827</id><published>2011-07-14T17:38:00.001-07:00</published><updated>2011-07-14T18:16:30.724-07:00</updated><title type='text'>Search bash history</title><content type='html'>Not sure why I never new this, but hitting ^r in bash will put you into history search mode.  Type the beginning of the command, then just keep hitting ^R to go back in history.  Helps when you want to find a long command that you entered previously.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-4899909392027096827?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/4899909392027096827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2011/07/search-bash-history.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/4899909392027096827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/4899909392027096827'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2011/07/search-bash-history.html' title='Search bash history'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-1905329354135584700</id><published>2011-07-01T11:18:00.001-07:00</published><updated>2011-07-01T11:18:48.724-07:00</updated><title type='text'>grep pattern to match e-mail address</title><content type='html'>&lt;pre class="brush:bash"&gt;grep -Eiorh '([[:alnum:]_.]+@[[:alnum:]_]+?\.[[:alpha:].]{2,6})' file.txt&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-1905329354135584700?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/1905329354135584700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2011/07/grep-pattern-to-match-e-mail-address.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/1905329354135584700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/1905329354135584700'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2011/07/grep-pattern-to-match-e-mail-address.html' title='grep pattern to match e-mail address'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-7464152427498846400</id><published>2011-02-01T14:16:00.000-08:00</published><updated>2011-02-01T14:17:14.115-08:00</updated><title type='text'>Workaround for Snow Leopard (10.6) issue with osascript command</title><content type='html'>If you see this bizarre error when using the osascript command:&lt;br /&gt;&lt;pre class="brush:text;light:true"&gt;2011-02-01 14:11:28.727 osascript[11990:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types:  dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found.  Did find:&lt;br /&gt;        /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper&lt;br /&gt;&lt;/pre&gt;it apparently has to do with the mixing of 32 and 64-bit architectures.  I don't know what the &lt;i&gt;real&lt;/i&gt; fix is, but the workaround is to force osascript to use 32-bit like this:&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;arch -i386 /usr/bin/osascript -e '[your applescript]'&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-7464152427498846400?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/7464152427498846400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2011/02/workaround-for-snow-leopard-106-issue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/7464152427498846400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/7464152427498846400'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2011/02/workaround-for-snow-leopard-106-issue.html' title='Workaround for Snow Leopard (10.6) issue with osascript command'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-2920961177352611104</id><published>2010-12-02T12:04:00.000-08:00</published><updated>2010-12-02T12:05:20.927-08:00</updated><title type='text'>Strip leading zeroes using regex</title><content type='html'>Doesn't actually "strip", rather captures the non-laeding-zero number.  Works only on a string that only contains numbers, and is compatible with ancient regex versions.&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;^[0]+([1-9][0-9]{1,})$&lt;br /&gt;&lt;/pre&gt;NOTE: will NOT match a number that &lt;i&gt;doesn't&lt;/i&gt; have leading zeroes&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-2920961177352611104?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/2920961177352611104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2010/12/strip-leading-zeroes-using-regex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/2920961177352611104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/2920961177352611104'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2010/12/strip-leading-zeroes-using-regex.html' title='Strip leading zeroes using regex'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-4900334070573475803</id><published>2010-10-09T13:06:00.000-07:00</published><updated>2010-10-09T13:06:30.204-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><title type='text'>Neat MySQL SUBSTRING Functions</title><content type='html'>Chop off the first character of a string that matches a particular regex pattern:&lt;br /&gt;&lt;pre class="brush:sql;light:true"&gt;SELECT SKUID, CATEGORY, SUBSTRING(CATEGORY,2) FROM products WHERE CATEGORY RLIKE '^;([0-9;]{1,20});$'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Chop off the last character of a string&lt;br /&gt;&lt;pre class="brush:sql;light:true"&gt;SELECT SUBSTRING(CATEGORY,1,LENGTH(CATEGORY)-1) AS CATEGORY FROM products WHERE CATEGORY RLIKE '^([0-9;]{1,20});$';&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Extract the domain name (including subdomain) from an URL:&lt;br /&gt;&lt;pre class="brush:sql;light:true"&gt;SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(url,'://',-1),'/',1) FROM urls&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-4900334070573475803?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/4900334070573475803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2010/10/neat-mysql-substring-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/4900334070573475803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/4900334070573475803'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2010/10/neat-mysql-substring-functions.html' title='Neat MySQL SUBSTRING Functions'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-7732540927505844567</id><published>2010-10-04T15:53:00.000-07:00</published><updated>2010-10-04T15:53:36.374-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='find'/><title type='text'>Recursively delete old directories</title><content type='html'>careful with this one!&lt;br /&gt;&lt;pre class="brush:bash;light:true;"&gt;/usr/bin/find /home/user/oldlogs/ -maxdepth 1 -type d -mtime +90 -exec rm -rf {} \;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-7732540927505844567?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/7732540927505844567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2010/10/recursively-delete-old-directories.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/7732540927505844567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/7732540927505844567'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2010/10/recursively-delete-old-directories.html' title='Recursively delete old directories'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-7906749857274082411</id><published>2010-09-22T10:48:00.001-07:00</published><updated>2010-09-22T10:48:44.625-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='chmod'/><category scheme='http://www.blogger.com/atom/ns#' term='find'/><title type='text'>Use 'find' to recursively chmod files</title><content type='html'>another 'find' quickie...&lt;br /&gt;&lt;pre class="brush:bash;light:true"&gt;find /home/user/files/ -name 'myfile.sh' -exec chmod 755 {} \;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-7906749857274082411?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/7906749857274082411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2010/09/use-find-to-recursively-chmod-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/7906749857274082411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/7906749857274082411'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2010/09/use-find-to-recursively-chmod-files.html' title='Use &apos;find&apos; to recursively chmod files'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-6300981541380182851</id><published>2010-09-16T10:32:00.000-07:00</published><updated>2010-09-16T10:32:59.577-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Capitalize the first letter of a sentence with MYSQL</title><content type='html'>&lt;pre class="brush:sql;light:true"&gt;UPDATE `categories` SET category_name = CONCAT(UCASE(SUBSTRING(`category_name`, 1,1)),LOWER(SUBSTRING(`category_name`, 2)))&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-6300981541380182851?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/6300981541380182851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2010/09/capitalize-first-letter-of-sentence.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/6300981541380182851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/6300981541380182851'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2010/09/capitalize-first-letter-of-sentence.html' title='Capitalize the first letter of a sentence with MYSQL'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-2829787857215199688</id><published>2010-06-14T11:36:00.000-07:00</published><updated>2010-09-16T10:34:02.405-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>MySQL function for replacing HTML entities with their actual characters</title><content type='html'>For a more comprehensive function containing more special characters see &lt;a href="http://forums.mysql.com/read.php?98,246527"&gt;http://forums.mysql.com/read.php?98,246527&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Actually, better use that link (above).  Blogger is messing with the code below.&lt;br /&gt;&lt;br /&gt;Usage:&lt;br /&gt;&lt;pre class="brush:sql;light:true"&gt;SELECT HTML_UnEncode(firstname),HTML_UnEncode(lastname) FROM users;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;DELIMITER $$&lt;br /&gt;&lt;br /&gt;DROP FUNCTION IF EXISTS `sourcedatabase`.`HTML_UnEncode`$$&lt;br /&gt;CREATE DEFINER=`user`@`localhost` FUNCTION `HTML_UnEncode`(x VARCHAR(255)) RETURNS varchar(255) CHARSET latin1&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;DECLARE TextString VARCHAR(255) ;&lt;br /&gt;SET TextString = x ;&lt;br /&gt;&lt;br /&gt;#quotation mark&lt;br /&gt;IF INSTR( x , '&amp;quot;' )&lt;br /&gt;THEN SET TextString = REPLACE(TextString, '&amp;quot;','"') ;&lt;br /&gt;END IF ;&lt;br /&gt;&lt;br /&gt;#apostrophe &lt;br /&gt;IF INSTR( x , '&amp;apos;' )&lt;br /&gt;THEN SET TextString = REPLACE(TextString, '&amp;apos;','"') ;&lt;br /&gt;END IF ;&lt;br /&gt;&lt;br /&gt;#ampersand&lt;br /&gt;IF INSTR( x , '&amp;amp;' )&lt;br /&gt;THEN SET TextString = REPLACE(TextString, '&amp;amp;','&amp;') ;&lt;br /&gt;END IF ;&lt;br /&gt;&lt;br /&gt;#less-than&lt;br /&gt;IF INSTR( x , '&amp;lt;' )&lt;br /&gt;THEN SET TextString = REPLACE(TextString, '&amp;lt;','&lt;') ;&lt;br /&gt;END IF ;&lt;br /&gt;&lt;br /&gt;#greater-than&lt;br /&gt;IF INSTR( x , '&amp;gt;' )&lt;br /&gt;THEN SET TextString = REPLACE(TextString, '&amp;gt;','&gt;') ;&lt;br /&gt;END IF ;&lt;br /&gt;&lt;br /&gt;#non-breaking space&lt;br /&gt;IF INSTR( x , '&amp;nbsp;' )&lt;br /&gt;THEN SET TextString = REPLACE(TextString, '&amp;nbsp;',' ') ;&lt;br /&gt;END IF ;&lt;br /&gt;&lt;br /&gt;RETURN TextString ;&lt;br /&gt;&lt;br /&gt;END$$&lt;br /&gt;&lt;br /&gt;DELIMITER ;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-2829787857215199688?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/2829787857215199688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2010/06/mysql-function-for-replacing-html.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/2829787857215199688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/2829787857215199688'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2010/06/mysql-function-for-replacing-html.html' title='MySQL function for replacing HTML entities with their actual characters'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-1990258554617859181</id><published>2010-06-08T09:25:00.001-07:00</published><updated>2010-06-08T09:25:08.345-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Find duplicate records in MySQL</title><content type='html'>&lt;pre class="brush:sql;light:true"&gt;SELECT email, &lt;br /&gt; COUNT(email) AS NumOccurrences&lt;br /&gt;FROM users&lt;br /&gt;GROUP BY email&lt;br /&gt;HAVING ( COUNT(email) &gt; 1 )&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-1990258554617859181?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/1990258554617859181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2010/06/find-duplicate-records-in-mysql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/1990258554617859181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/1990258554617859181'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2010/06/find-duplicate-records-in-mysql.html' title='Find duplicate records in MySQL'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3045551838493191275.post-2977291988489711417</id><published>2010-05-20T12:54:00.001-07:00</published><updated>2010-05-20T12:55:52.353-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='sed'/><title type='text'>sed one-liner for removing HTML tags from a file</title><content type='html'>&lt;pre class="brush:bash;light:true"&gt;sed -e 's/&lt;[^&gt;]*&gt;//g' myfile.html&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3045551838493191275-2977291988489711417?l=www.tiplicks.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.tiplicks.com/feeds/2977291988489711417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.tiplicks.com/2010/05/sed-one-liner-for-removing-html-tags.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/2977291988489711417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3045551838493191275/posts/default/2977291988489711417'/><link rel='alternate' type='text/html' href='http://www.tiplicks.com/2010/05/sed-one-liner-for-removing-html-tags.html' title='sed one-liner for removing HTML tags from a file'/><author><name>Rory</name><uri>http://www.blogger.com/profile/14054424218630129032</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_AmQWb2B8T9g/Sgr9-9zIqDI/AAAAAAAAADs/oyws7l4FMhA/S220/Picture+4.jpg'/></author><thr:total>1</thr:total></entry></feed>
