<?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>Antarctic Nest of Icephoenix</title>
	<atom:link href="http://icephoenix.us/feed/" rel="self" type="application/rss+xml" />
	<link>http://icephoenix.us</link>
	<description></description>
	<lastBuildDate>Fri, 25 Nov 2011 20:55:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WordPress MU Upgrade and Permalinks 404 Erros</title>
		<link>http://icephoenix.us/stuff/wordpress-mu-upgrade-and-permalinks-404-erros/</link>
		<comments>http://icephoenix.us/stuff/wordpress-mu-upgrade-and-permalinks-404-erros/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 20:55:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Just messing...]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://icephoenix.us/?p=147</guid>
		<description><![CDATA[WordPress MU upgrade(from 2.x to 3.2.1) was a rather simple process surprisingly! Having completed it in a matter of couple hours for a fairly large blogging network, I was a happy camper up till the moment when permalinks started giving &#8230; <a href="http://icephoenix.us/stuff/wordpress-mu-upgrade-and-permalinks-404-erros/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress MU upgrade(from 2.x to 3.2.1) was a rather simple process surprisingly! Having  completed it in a matter of couple hours for a fairly large blogging network, I was a happy camper up till the moment when permalinks started giving 404s.</p>
<p>What followed is painstaking process where I verified everysingle aspect of configuration from Apache&#8217;s mod_rewrite setup to htaccess rules to WordPress&#8217;s network site configs. Everything looked correctly. </p>
<p>Googling around for a good hour I came across <a href="http://mansurovs.com/tech/404-errors-on-permalinks-after-wordpress-3-1-upgrade">this site</a>, which pointed to the incompatibility of some plugins with WP3. In my case problem lied in a plugin called <strong>Top Level Categories</strong>, which I had to disable to get the permalinks working.</p>
]]></content:encoded>
			<wfw:commentRss>http://icephoenix.us/stuff/wordpress-mu-upgrade-and-permalinks-404-erros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MongoDB distinct count</title>
		<link>http://icephoenix.us/4quicklookup/mongodb-distinct-count/</link>
		<comments>http://icephoenix.us/4quicklookup/mongodb-distinct-count/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 02:07:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[4QuickLookUp]]></category>

		<guid isPermaLink="false">http://icephoenix.us/?p=141</guid>
		<description><![CDATA[List of disctinct values for a FIELD in COLLECTION: db.COLLECTION.distinct("FIELDNAME", {}) Count of the same: db.COLLECTION.distinct("FIELDNAME", {}).count]]></description>
			<content:encoded><![CDATA[<p>List of disctinct values for a FIELD in COLLECTION:<br />
<code>db.COLLECTION.distinct("FIELDNAME", {})</code></p>
<p>Count of the same:<br />
<code>db.COLLECTION.distinct("FIELDNAME", {}).count</code></p>
]]></content:encoded>
			<wfw:commentRss>http://icephoenix.us/4quicklookup/mongodb-distinct-count/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install Xapian 1.2.5 PHP bindings on Ubuntu Lucid Lynx</title>
		<link>http://icephoenix.us/php/how-to-install-xapian-1-2-5-php-bindings-on-ubuntu-lucid-lynx/</link>
		<comments>http://icephoenix.us/php/how-to-install-xapian-1-2-5-php-bindings-on-ubuntu-lucid-lynx/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 20:24:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux/UNIX]]></category>
		<category><![CDATA[Notes For Myself]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://icephoenix.us/?p=131</guid>
		<description><![CDATA[Starting from version 1.2.x, Xapian repository on Ubuntu does not contain php5-xapian package apparently due to the license incompatability between GPL and PHP license(great&#8230;) Issue is discussed somewhat at length here. But in the meantime, folks suggesting to build PHP &#8230; <a href="http://icephoenix.us/php/how-to-install-xapian-1-2-5-php-bindings-on-ubuntu-lucid-lynx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Starting from version 1.2.x, Xapian repository on Ubuntu does not contain php5-xapian package <img src='http://icephoenix.us/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  apparently due to the license incompatability between GPL and PHP license(great&#8230;)<br />
Issue is discussed somewhat at length <a href="http://trac.xapian.org/ticket/191" target="_blank">here</a>.</p>
<p>But in the meantime, folks suggesting to build PHP bindings for Xapian manually on Ubuntu and Debian. Here is a quick command trail that shows how to install Xapian 1.2.5 PHP bindings on Ubuntu Lucid(10.04), also tested on Ubuntu 10.10 and 11.04:</p>
<p>1. Edit /etc/apt/sources.list and add the following lines to it:</p>
<pre class="brush: bash; title: ;">
deb http://ppa.launchpad.net/xapian-backports/xapian-1.2/ubuntu lucid main
deb-src http://ppa.launchpad.net/xapian-backports/xapian-1.2/ubuntu lucid main
</pre>
<p>2. Get some required packages:</p>
<pre class="brush: bash; title: ;">
sudo apt-get update
sudo apt-get build-dep xapian-bindings
sudo apt-get install php5-dev php5-cli
sudo apt-get install devscripts
</pre>
<p>3. Fetch sources and build:</p>
<pre class="brush: bash; title: ;">
apt-get source xapian-bindings
cd xapian-bindings-1.2.5
rm debian/control
env PHP_VERSIONS=5 debian/rules maint
debuild -e PHP_VERSIONS=5 -us -uc
</pre>
<p>This will generate .deb file in the folder, one level up.</p>
<p>4. Finally, install php5-xapian extenstion:</p>
<pre class="brush: bash; title: ;">
cd ..
sudo dpkg -i php5-xapian*.deb
</pre>
<p>5. Verify that you got it running:</p>
<pre class="brush: bash; title: ;">
php -i | grep Xapian
</pre>
<p>Information about this process is taken from <a href="https://launchpad.net/~xapian-backports/+archive/xapian-1.2">here</a> and <a href="http://lists.tartarus.org/pipermail/xapian-discuss/2011-May/008226.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://icephoenix.us/php/how-to-install-xapian-1-2-5-php-bindings-on-ubuntu-lucid-lynx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto-splitting video file in equal chunks with ffmpeg and python</title>
		<link>http://icephoenix.us/notes-for-myself/auto-splitting-video-file-in-equal-chunks-with-ffmpeg-and-python/</link>
		<comments>http://icephoenix.us/notes-for-myself/auto-splitting-video-file-in-equal-chunks-with-ffmpeg-and-python/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 09:47:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Notes For Myself]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://icephoenix.us/?p=118</guid>
		<description><![CDATA[Recently I needed to upload a whole bunch of long video files. Maximum allowed length for each video was just few minutes, while the actual length of files I tried to upload were about an hour each. FFmpeg is really &#8230; <a href="http://icephoenix.us/notes-for-myself/auto-splitting-video-file-in-equal-chunks-with-ffmpeg-and-python/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to upload a whole bunch of long video files. Maximum allowed length for each video was just few minutes, while the actual length of files I tried to upload were about an hour each. FFmpeg is really great for splitting the video files and Python is quite handy for automating the task. Combining two together in this handy little script(see below). The script below takes a video file and a chunk size in seconds and splits the video file into chunks using ffmpeg, so each chunk is self contained, playable video.</p>
<p>Source code:</p>
<pre class="brush: python; title: ;">
#!/usr/bin/env python

import subprocess
import re
import math
from optparse import OptionParser

length_regexp = 'Duration: (\d{2}):(\d{2}):(\d{2})\.\d+,'
re_length = re.compile(length_regexp)

def main():

    (filename, split_length) = parse_options()
    if split_length &lt;= 0:
        print &quot;Split length can't be 0&quot;
        raise SystemExit

    output = subprocess.Popen(&quot;ffmpeg -i '&quot;+filename+&quot;' 2&gt;&amp;1 | grep 'Duration'&quot;,
                            shell = True,
                            stdout = subprocess.PIPE
                            ).stdout.read()
    print output
    matches = re_length.search(output)
    if matches:
        video_length = int(matches.group(1)) * 3600 + \
                        int(matches.group(2)) * 60 + \
                        int(matches.group(3))
        print &quot;Video length in seconds: &quot;+str(video_length)
    else:
        print &quot;Can't determine video length.&quot;
        raise SystemExit

    split_count = math.ceil(video_length/float(split_length))
    if(split_count == 1):
        print &quot;Video length is less then the target split length.&quot;
        raise SystemExit

    split_cmd = &quot;ffmpeg -i '&quot;+filename+&quot;' -vcodec copy &quot;
    for n in range(0, split_count):
        split_str = &quot;&quot;
        if n == 0:
            split_start = 0
        else:
            split_start = split_length * n

        split_str += &quot; -ss &quot;+str(split_start)+&quot; -t &quot;+str(split_length) + \
                    &quot; '&quot;+filename[:-4] + &quot;-&quot; + str(n) + &quot;.&quot; + filename[-3:] + \
                    &quot;'&quot;
        print &quot;About to run: &quot;+split_cmd+split_str
        output = subprocess.Popen(split_cmd+split_str, shell = True, stdout =
                               subprocess.PIPE).stdout.read()

def parse_options():
    parser = OptionParser()    

    parser.add_option(&quot;-f&quot;, &quot;--file&quot;,
                        dest = &quot;filename&quot;,
                        help = &quot;file to split, for example sample.avi&quot;,
                        type = &quot;string&quot;,
                        action = &quot;store&quot;
                        )
    parser.add_option(&quot;-s&quot;, &quot;--split-size&quot;,
                        dest = &quot;split_size&quot;,
                        help = &quot;split or chunk size in seconds, for example 10&quot;,
                        type = &quot;int&quot;,
                        action = &quot;store&quot;
                        )
    (options, args) = parser.parse_args()

    if options.filename and options.split_size:

        return (options.filename, options.split_size)

    else:
        parser.print_help()
        raise SystemExit

if __name__ == '__main__':

    try:
        main()
    except Exception, e:
        print &quot;Exception occured running main():&quot;
        print str(e)
</pre>
<p>Or download it here: <a href="http://icephoenix.us/wp-content/uploads/2011/04/ffmpeg-split.zip">splitting video file script link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://icephoenix.us/notes-for-myself/auto-splitting-video-file-in-equal-chunks-with-ffmpeg-and-python/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Build OpenLDAP 2.3.x from sources on Ubuntu</title>
		<link>http://icephoenix.us/linuxunix/build-openldap-2-3-x-from-sources-on-ubuntu/</link>
		<comments>http://icephoenix.us/linuxunix/build-openldap-2-3-x-from-sources-on-ubuntu/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 03:30:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux/UNIX]]></category>
		<category><![CDATA[Notes For Myself]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[bdb]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[openldap]]></category>
		<category><![CDATA[slapd]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://icephoenix.us/?p=109</guid>
		<description><![CDATA[It happened so that I needed to build a particular version of OpenLDAP on Ubuntu and use that instead of the one in Ubuntu&#8217;s repository. Here is a quick guide as to how it worked for me: 1. Get BDB &#8230; <a href="http://icephoenix.us/linuxunix/build-openldap-2-3-x-from-sources-on-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It happened so that I needed to build a particular version of OpenLDAP on Ubuntu and use that instead of the one in Ubuntu&#8217;s repository. Here is a quick guide as to how it worked for me:</p>
<p>1. Get BDB 4.3 sources from Oracle&#8217;s site(<a href="http://www.oracle.com/technetwork/database/berkeleydb/downloads/index-082944.html" target="_blank">link</a>)</p>
<p>2. Compile BDB and install it:</p>
<pre class="brush: bash; light: true; title: ;">
tar –xvzf db-4.3.29.tar.gz
cd db-4.3.29/build_unix
./configure --prefix=/usr/local/bdb43
make
sudo make install
</pre>
<p>3. Get OpenLDAP source(<a href="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release">ftp link</a>)<br />
4. Compile and install it:</p>
<pre class="brush: bash; light: true; title: ;">
tar xzvf openldap-2.3.35.tgz
cd openldap
export CPPFLAGS=&quot;-I/usr/local/bdb43/include -D_GNU_SOURCE&quot;
export LDFLAGS=&quot;-L/usr/local/lib -L/usr/local/bdb43/lib -R/usr/local/bdb43lib&quot;
export LD_LIBRARY_PATH=&quot;/usr/local/bdb43/lib&quot;
./configure --prefix=/usr/local/openldap
</pre>
<p>If you&#8217;re installing version 2.3.x or anything before 2.4.15 you will need to manually patch OpenLDAP otherwise you&#8217;ll get this error:<br />
<em>../../include/ldap_pvt_thread.h:64: error: missing binary operator before token &#8220;(&#8220;</em><br />
Patch file is available in this <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505421">bug report</a><br />
Or already patched file for OpenLDAP version 2.3.35 you can <a href="http://icephoenix.us/wp-content/uploads/2011/04/ldap_pvt_thread.h">download here</a></p>
<p>If you&#8217;re installing anything >= 2.4.15, you can skip the patch.</p>
<p>Once patch is applied just run:</p>
<pre class="brush: bash; light: true; title: ;">
make depend
make
make test  #this will take a while to run
make install
</pre>
<p>Common Errors:<br />
<strong>configure: error: Berkeley DB version mismatch</strong><br />
<strong>Solution: </strong>Most likely you didn&#8217;t LDFLAGS and LD_LIBRARY_PATH as noted above</p>
<p><strong>getpeereid.c:52: error: storage size of &#8216;peercred&#8217; isn&#8217;t known</strong><br />
You need to include -D_GNU_SOURCE flag, to avoid incompatibility with glibc</p>
<p><strong>../../include/ldap_pvt_thread.h:64: error: missing binary operator before token &#8220;(&#8220;</strong><br />
<strong>Solution: </strong> Apply patch as noted above</p>
<p><strong>error while loading shared libraries: libdb-4.3.so: cannot open shared object file: No such file or directory</strong><br />
<strong>Solution:</strong> Add libdb-4.3 to shared libs cache:</p>
<pre class="brush: bash; light: true; title: ;">
sudo echo &quot;/usr/local/bdb43/lib&quot; &gt; /etc/ld.so.conf.d/slapd.conf
lddconfig -v
</pre>
]]></content:encoded>
			<wfw:commentRss>http://icephoenix.us/linuxunix/build-openldap-2-3-x-from-sources-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Getting around open_basedir restriction on Plesk</title>
		<link>http://icephoenix.us/php/getting-around-open_basedir-restriction-on-plesk/</link>
		<comments>http://icephoenix.us/php/getting-around-open_basedir-restriction-on-plesk/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 17:49:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Notes For Myself]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[apache plesk php]]></category>

		<guid isPermaLink="false">http://icephoenix.us/?p=106</guid>
		<description><![CDATA[Almost every time I do a deploy on Plesk-based hosting server, I hit the same roadblock: PHP Warning:  realpath() [&#60;a href='function.realpath'&#62;function.realpath&#60;/a&#62;]: open_basedir restriction in effect. Since I tend to keep my app-code outside of webroot, this restriction is somewhat a &#8230; <a href="http://icephoenix.us/php/getting-around-open_basedir-restriction-on-plesk/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Almost every time I do a deploy on Plesk-based hosting server, I hit the same roadblock:</p>
<div id="_mcePaste">PHP Warning:  realpath() [&lt;a href='function.realpath'&gt;function.realpath&lt;/a&gt;]: open_basedir restriction in effect.</div>
<p>Since I tend to keep my app-code outside of webroot, this restriction is somewhat a problem. Well, luckily, the fix is simple enough.</p>
<p>1. Add file <strong>vhost.conf</strong> to <strong>/var/www/vhosts/YOURDOMAIN/conf</strong> folder with the following:<br />
<code><br />
&lt;Directory /var/www/vhosts/YOURDOMAIN/httpdocs/&gt;<br />
&lt;IfModule sapi_apache2.c&gt;<br />
php_admin_value open_basedir none<br />
&lt;/IfModule&gt;<br />
&lt;IfModule mod_php5.c&gt;<br />
php_admin_value open_basedir none<br />
&lt;/IfModule&gt;<br />
&lt;/Directory&gt;<br />
</code></p>
<p>2. Reload server configuration, either via Plesk admin or through CLI:<br />
<code><br />
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=yourdomain<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://icephoenix.us/php/getting-around-open_basedir-restriction-on-plesk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 Video Encoding with FFmpeg</title>
		<link>http://icephoenix.us/notes-for-myself/html5-video-encoding-with-ffmpeg/</link>
		<comments>http://icephoenix.us/notes-for-myself/html5-video-encoding-with-ffmpeg/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 18:50:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Notes For Myself]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[mp4]]></category>
		<category><![CDATA[ogg]]></category>

		<guid isPermaLink="false">http://icephoenix.us/?p=123</guid>
		<description><![CDATA[Encoding Ogg video ffmpeg -i SOURCEFILE.avi -vcodec libtheora OUTFILE.ogg Encoding MP4 ffmpeg -i SOURCEFILE.avi -vcodec libx264 -vpre slow OUTFILE.mp4 Encoding WebM ffmpeg -i SOURCEFILE.avi -vcodec libvpx -acodec vorbis OUTFILE.webm Resizing video: ffmpeg -i SOURCEFILE.avi -s WIDTHxHEIGHT OUTFILE.ogg WIDTH, HEIGHT new &#8230; <a href="http://icephoenix.us/notes-for-myself/html5-video-encoding-with-ffmpeg/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Encoding Ogg video</p>
<pre class="brush: bash; light: true; title: ;">
ffmpeg -i SOURCEFILE.avi -vcodec libtheora OUTFILE.ogg
</pre>
<p>Encoding MP4</p>
<pre class="brush: bash; light: true; title: ;">
ffmpeg -i SOURCEFILE.avi -vcodec libx264 -vpre slow OUTFILE.mp4
</pre>
<p>Encoding WebM</p>
<pre class="brush: bash; light: true; title: ;">
ffmpeg -i SOURCEFILE.avi -vcodec libvpx -acodec vorbis  OUTFILE.webm
</pre>
<p>Resizing video:</p>
<pre class="brush: bash; light: true; title: ;">
ffmpeg -i SOURCEFILE.avi -s WIDTHxHEIGHT OUTFILE.ogg
</pre>
<p>WIDTH, HEIGHT new width and height in pixels. </p>
]]></content:encoded>
			<wfw:commentRss>http://icephoenix.us/notes-for-myself/html5-video-encoding-with-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gnome Do, Docky, upgrade to Ubuntu 10.10 and an odd case of /var/lib/dpkg/tmp.ci/md5sums</title>
		<link>http://icephoenix.us/stuff/gnome-do-docky-upgrade-to-ubuntu-10-10-and-an-odd-case-of-varlibdpkgtmp-cimd5sums/</link>
		<comments>http://icephoenix.us/stuff/gnome-do-docky-upgrade-to-ubuntu-10-10-and-an-odd-case-of-varlibdpkgtmp-cimd5sums/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 00:59:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Just messing...]]></category>
		<category><![CDATA[Linux/UNIX]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://icephoenix.us/?p=103</guid>
		<description><![CDATA[So I finally upgraded to 10.10, a bit behind the curve but whatever. For the most part it went surprisingly swimmingly. I only had 2 issues First one &#8211; gnome-do docky theme was gone. And apprently it&#8217;s gone for good &#8230; <a href="http://icephoenix.us/stuff/gnome-do-docky-upgrade-to-ubuntu-10-10-and-an-odd-case-of-varlibdpkgtmp-cimd5sums/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So I finally upgraded to 10.10, a bit behind the curve but whatever. For the most part it went surprisingly swimmingly. I only had 2 issues <img src='http://icephoenix.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First one &#8211; gnome-do docky theme was gone. And apprently it&#8217;s gone for good and now it is a separate project. Fix is as simple as:</p>
<p><code><br />
sudo apt-get install docky</code></p>
<p>Fixed that right away.</p>
<p>Second issue was a bit more annoying. Problem was with updating linux-firmware package. For some reason dpkg was throwing and error saying that &#8216;<strong>/var/lib/dpkg/tmp.ci/md5sums: Is a directory</strong>&#8216;. After messing around fix for that was basically this:<br />
<code><br />
sudo bash<br />
cd /var/lib/dpkg/info<br />
rm -rf linux-firwmare*<br />
apt-get upgrade<br />
</code><br />
What happen is /var/lib/dpkg/info/linux-firmware.md5sums got corrupted and instead of being a file it became a directory point to postfix&#8217;s folder(in my case). I had some hard drive issues few weeks ago, so probably fsck did this&#8230; oh well, can&#8217;t blame it <img src='http://icephoenix.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://icephoenix.us/stuff/gnome-do-docky-upgrade-to-ubuntu-10-10-and-an-odd-case-of-varlibdpkgtmp-cimd5sums/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress shortcode for ShareThis buttons</title>
		<link>http://icephoenix.us/php/wordpress-shortcode-for-sharethis-buttons/</link>
		<comments>http://icephoenix.us/php/wordpress-shortcode-for-sharethis-buttons/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 02:45:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://icephoenix.us/?p=100</guid>
		<description><![CDATA[I like using ShareThis for social sharing button, but one thing that was certainly missing for the default ShareThis WordPress plugin were shortcodes. Luckily WordPress makes it really easy adding them So to get shortcode for ShareThis integration just add &#8230; <a href="http://icephoenix.us/php/wordpress-shortcode-for-sharethis-buttons/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I like using ShareThis for social sharing button, but one thing that was certainly missing for the <a href="http://help.sharethis.com/integration/wordpress" target="_blank">default ShareThis WordPress plugin</a> were shortcodes. Luckily WordPress makes it really easy adding them <img src='http://icephoenix.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  So to get shortcode for ShareThis integration just add the following few lines to the end of the <strong>functions.php</strong> in your theme folder:<br />
<code><br />
/**<br />
* Creates sharethis shortcode<br />
*/<br />
if (function_exists('st_makeEntries')) :<br />
add_shortcode('sharethis', 'st_makeEntries');<br />
endif;<br />
</code></p>
<p>Once that&#8217;s done you can use <strong>[sharethis]</strong> shortcode anywhere on the page/post to get sharing buttons rendered there. Short and sweet <img src='http://icephoenix.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://icephoenix.us/php/wordpress-shortcode-for-sharethis-buttons/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to setup local PHP debugging with PHPStorm and Xdebug</title>
		<link>http://icephoenix.us/php/how-to-setup-local-php-debugging-with-phpstorm-and-xdebug/</link>
		<comments>http://icephoenix.us/php/how-to-setup-local-php-debugging-with-phpstorm-and-xdebug/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 04:34:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[phpstorm]]></category>
		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://icephoenix.us/?p=90</guid>
		<description><![CDATA[I am checking out a new IDE on the block &#8211; PHPStorm&#8230; well, new for me anyway For Java and Python, Eclipse is all I need, but when coding in PHP, I am not a big IDE guy, for me, &#8230; <a href="http://icephoenix.us/php/how-to-setup-local-php-debugging-with-phpstorm-and-xdebug/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am checking out a new IDE on the block &#8211; <a href="http://www.jetbrains.com/phpstorm/" target="_blank">PHPStorm</a>&#8230; well, new for me anyway <img src='http://icephoenix.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For Java and Python, Eclipse is all I need, but when coding in PHP, I am not a big IDE guy, for me, Vi is still the weapon of choice. But when it comes to debugging complex apps(yeah you can write those in PHP too <img src='http://icephoenix.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , Vi doesn&#8217;t quite cut it. There are plugins for it to provide debugging capabilities(or rather Vimified interface to Xdebug), but half of the time it doesn&#8217;t work and the other half of the time it&#8217;s not what I am looking for. So far, I&#8217;ve been a user of Komodo IDE, I still have the old version 4 up and running here and do most of my debugging in it. It&#8217;s nice on one side, but somewhat cumbersome on the other.</p>
<p>Anyway, one major thing that always kept me from trying new IDEs is debugger setup. I tend to spend 10 minutes trying to setup debugging in new IDE, get frustrated, say fuck it, and get back to Komodo. This short blog post is to capture how I setup debugging in PHPStorm using Xdebug.<br />
There is a video about this as to how to get a remote debugging working, but not much info about how to get a local one for folks who is on Linux(Ubuntu in my case).<br />
So there we go:</p>
<h1>Xdebug Setup</h1>
<p><strong>Step 0.</strong> Get phpize. If you&#8217;re on Ubuntu it&#8217;s as simple as running sudo apt-get install php5-dev<br />
<strong> Step 1.</strong> Get Xdebug, it&#8217;s pure awesomeness. Just go here: http://xdebug.org/find-binary.php and follow the instructions. Note: you can also try installing it from pecl or Ubuntu repository, but I had <a href="http://icephoenix.us/php/xdebug-doesnt-show-local-variables-in-komodo-netbeans-or-eclipse-pdt/">problems with these methods before</a>.<br />
<strong> Step 2.</strong> I recommend not to follow the last step of Xdebug install instructions where it says to add zend_extension line to the php.ini file. Cleaner way of enabling Xdebug and then configuring it is to add a file <strong>xdebug.ini</strong> to <strong>/etc/php5/conf.d/</strong> folder with the following contents:</p>
<pre class="brush: bash; light: true; title: ;">
;xdebug configuration
zend_extension = /usr/lib/php5/20090626/xdebug.so
xdebug.remote_host = 127.0.0.1
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
</pre>
<p>This <strong>xdebug.ini</strong> will be picked up by both CLI and Apache and makes it easier to control without messing with the central config file.<br />
Once apache is restarted and xdebug succesfully loaded, time to look at phpStorm&#8217;s side.</p>
<p><strong>Step 3.</strong> Get <a href="https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en">Xdebug helper extension</a> for Chrome or <a href="https://addons.mozilla.org/en-US/firefox/addon/58688/">similar for Firefox</a> is very handy. Get one so you can enable/disable debugging sessions from the browser. Make sure you set it up such that is loads up on your local domain. For example, if your project runs on myproject.local, your setup will prob look like this:</p>
<p><a href="http://icephoenix.us/wp-content/uploads/2010/12/phpstorm-debugging-img-1.png"><img class="alignnone size-full wp-image-91" title="Xdebug helper setup" src="http://icephoenix.us/wp-content/uploads/2010/12/phpstorm-debugging-img-1.png" alt="" width="434" height="616" /></a></p>
<h1><span style="color: #444444;">PHPStorm Debugging Setup</span></h1>
<p>This is a bit less straightforward, but here I go anyway. Here are my assumptions:<br />
My project is running localy at <strong>http://myproject.local</strong><br />
It&#8217;s stored locally in <strong>/home/user/Projects/myproject/public</strong> ,which is also a DocumentRoot for myproject.local Vhost config in Apache. There are &#8216;library&#8217; and &#8216;application&#8217; folders outside of DocRoot however.</p>
<p><strong>Step 1</strong>. In PHPStorm, setup path to web browser(<strong>File-&gt;Settings-&gt;Web Browsers</strong>). It actually detected all paths correctly except for Chrome, which I had to set manually(in my case it was in <strong>/usr/bin/google-chrome</strong>)</p>
<p><strong>Step 2.</strong> Setup run configuration &#8211; <strong>Run-&gt;Edit Configurations</strong>. That screen is kinda odd, but here is how I got it going.<br />
* Create new configuration, with type PHP on Server</p>
<p><a href="http://icephoenix.us/wp-content/uploads/2010/12/phpstorm-debugging-img-2.png"><img class="alignnone size-full wp-image-92" title="phpstorm debugging img 2" src="http://icephoenix.us/wp-content/uploads/2010/12/phpstorm-debugging-img-2-e1293683282384.png" alt="" width="332" height="241" /></a></p>
<p>* Create new server(click on the <strong>&#8230;</strong> button next to &#8220;Server&#8221; dropdown). I picked server type &#8220;Local&#8221; and set webroot to &#8220;<strong>http://myproject.local</strong>&#8220;. On the &#8220;<strong>Mappings</strong>&#8221; tab I set local path to <strong>/home/user/Projects/myproject/public</strong><br />
* Save that server and select it in the Run Configurations<br />
Ultimately my config looked as following:<br />
<a href="http://icephoenix.us/wp-content/uploads/2010/12/phpstorm-debugging-img-3.png"><img class="alignnone size-full wp-image-93" title="phpstorm debugging img 3" src="http://icephoenix.us/wp-content/uploads/2010/12/phpstorm-debugging-img-3.png" alt="" width="816" height="681" /></a></p>
<p>This looks like it. Now opening up a file inside that project and &#8216;running&#8217; it will actually bring up a new Chrome window with a page and put PHPStorm in listening mode on port 9000 for Xdebug connections. You&#8217;ll need to activate &#8216;Xdebug helper&#8217; in that window, after that all interactions with the server will be intercepted by Xdebug and PHPStorm.</p>
]]></content:encoded>
			<wfw:commentRss>http://icephoenix.us/php/how-to-setup-local-php-debugging-with-phpstorm-and-xdebug/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

