<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="https://www.w3.org/2005/Atomm">
    <title>Mind Mining Medium</title>
    <link href="https://tech.karbassi.com/atom.xml" rel="self"/>
    <link href="https://tech.karbassi.com/"/>
    <updated>2018-05-13T00:09:39+00:00</updated>
    <id>https://tech.karbassi.com/</id>
    <author>
        <name>Ali Karbassi</name>
        <email>ali@karbassi.com</email>
    </author>

    
    <entry>
        <title>Copy (cp) with progress bar</title>
        <link href="https://tech.karbassi.com/2013/04/10/cp-with-progress/"/>
        <updated>2013-04-10T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2013/04/10/cp-with-progress</id>
        <content type="html">&lt;p&gt;Many times you’d like to see the progress of a copy but sadly &lt;code class=&quot;highlighter-rouge&quot;&gt;cp&lt;/code&gt; doesn’t have that feature.&lt;/p&gt;

&lt;p&gt;Many posts online will show bash scripts that pipe &lt;code class=&quot;highlighter-rouge&quot;&gt;cp&lt;/code&gt; into &lt;code class=&quot;highlighter-rouge&quot;&gt;grep&lt;/code&gt;/&lt;code class=&quot;highlighter-rouge&quot;&gt;awk&lt;/code&gt;/etc or use tools like &lt;code class=&quot;highlighter-rouge&quot;&gt;pv&lt;/code&gt;. Alas, there is a much more simple way. Use &lt;code class=&quot;highlighter-rouge&quot;&gt;rsync&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rsync &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--progress&lt;/span&gt; SOURCE_FOLDER DESTINATION_FOLDER
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Throw the &lt;code class=&quot;highlighter-rouge&quot;&gt;--stats&lt;/code&gt; flag for some stats after the transfer is done.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rsync &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--stats&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--progress&lt;/span&gt; SOURCE_FOLDER DESTINATION_FOLDER
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
    </entry>
    
    <entry>
        <title>Apache time sensitive conditions</title>
        <link href="https://tech.karbassi.com/2013/03/25/apache-time-sensitive-content/"/>
        <updated>2013-03-25T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2013/03/25/apache-time-sensitive-content</id>
        <content type="html">&lt;p&gt;If you’d like to do time sensitive conditionals on Apache, the following will help you get started. This is useful if you’d like certain content to be displayed based on time.&lt;/p&gt;

&lt;div class=&quot;language-apache highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;err&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;#config timefmt=&quot;%Y%m%d%H%M&quot; --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;#if expr=&quot;$DATE_LOCAL &amp;lt; 201303281140&quot; --&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;#include virtual=&quot;before.html&quot;--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;#elif expr=&quot;$DATE_LOCAL &amp;gt;= 201303281140 &amp;amp;&amp;amp; $DATE_LOCAL &amp;lt;= 201303281205&quot;--&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;#include virtual=&quot;during.html&quot;--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;#else--&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;#include virtual=&quot;after.html&quot;--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;#endif--&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What we do here is set the time format to &lt;code class=&quot;highlighter-rouge&quot;&gt;%Y%m%d%H%M&lt;/code&gt; which is year, month, day, hour, minute. For example “201303281140” for March 28th, 2013 at 11:40am.&lt;/p&gt;

&lt;p&gt;Then if the current server time is before set time, we display &lt;code class=&quot;highlighter-rouge&quot;&gt;before.html&lt;/code&gt;; if the time is during our two times, we display &lt;code class=&quot;highlighter-rouge&quot;&gt;during.html&lt;/code&gt;; else we display &lt;code class=&quot;highlighter-rouge&quot;&gt;after.html&lt;/code&gt;.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Unroot and Reset the Sprint Galaxy Nexus - Mac</title>
        <link href="https://tech.karbassi.com/2012/09/29/unroot-and-reset-sprint-galaxy-nexus/"/>
        <updated>2012-09-29T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2012/09/29/unroot-and-reset-sprint-galaxy-nexus</id>
        <content type="html">&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;: The following steps WILL format the device. Be sure to do a complete backup before preceeding.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Download the &lt;a href=&quot;http://developer.android.com/sdk/index.html&quot;&gt;Android SDK&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install the SDK as instructed.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Follow the instructions on this page from the Android SDK’s “&lt;a href=&quot;http://developer.android.com/sdk/installing/adding-packages.html&quot;&gt;Adding Platforms and Packages&lt;/a&gt;”&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Check and install the “Android SDK Platform-Tools” only.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You should have a directory called &lt;code class=&quot;highlighter-rouge&quot;&gt;android-sdk-mac_x86&lt;/code&gt;. Within that, there should be directory called &lt;code class=&quot;highlighter-rouge&quot;&gt;Platform-Tools&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Go as instructed to the “&lt;a href=&quot;http://forums.androidcentral.com/sprint-galaxy-nexus/206954-guide-return-stock-odin-tars-fastboot-imgs.html\#post2140080&quot;&gt;Return To Stock (ODIN TARS &amp;amp; FASTBOOT IMGS)&lt;/a&gt;” page. Second post will have the FASTBOOT images. For stock Jelly Bean search for &lt;strong&gt;FH05&lt;/strong&gt;. There is 6 files that need to download.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Place all the downloaded files inside &lt;code class=&quot;highlighter-rouge&quot;&gt;android-sdk-mac_x86/platform-tools/&lt;/code&gt; directory.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Shut down the device, then press and hold Volume Up, Volumn Down, and Power at the same time. This will enter to the bootloader.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Connect the device via USB to the computer.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Open terminal and go into the “platform-tools” directory.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Enter the following lines, one at a time.
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./fastboot flash boot boot.img
./fastboot flash bootloader bootloader.img
./fastboot flash recovery recovery.img
./fastboot flash system system.img
./fastboot flash radio radio-cdma.img
./fastboot flash radio radio-lte.img
./fastboot &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Enter the following to lock the device also.
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./fastboot oem lock
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

</content>
    </entry>
    
    <entry>
        <title>Solving 'stdin: is not a tty' error</title>
        <link href="https://tech.karbassi.com/2011/11/09/stdin-is-not-a-tty/"/>
        <updated>2011-11-09T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2011/11/09/stdin-is-not-a-tty</id>
        <content type="html">&lt;p&gt;The “stdin: is not a tty” warning kept on popping up when &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh&lt;/code&gt;-ing to a few servers. I’ve learned that the problem is because I had &lt;code class=&quot;highlighter-rouge&quot;&gt;mesg n&lt;/code&gt; on top of my &lt;code class=&quot;highlighter-rouge&quot;&gt;.bash_rc&lt;/code&gt; file. Quick fix is to wrap it around an if statement, like so:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;tty &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
   &lt;/span&gt;mesg n
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
    </entry>
    
    <entry>
        <title>'Hello' spam clogging mailboxes</title>
        <link href="https://tech.karbassi.com/2010/09/24/hello-spam/"/>
        <updated>2010-09-24T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2010/09/24/hello-spam</id>
        <content type="html">&lt;p&gt;A new influx of spam is making its way around the internet in the form of a very simple “Hello” email and an attachment. Mainly they consist the subject “Hello” and an attachment. The attachment is just an HTML file with some ‘encrypted’ code in there. The file itself doesn’t contain any viruses.&lt;/p&gt;

&lt;p&gt;I decrypted the code and it produced:&lt;/p&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;http-equiv=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;refresh&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;0;url=http://BADURL.HERE&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;100%&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;border=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;0&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;tr&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;bgcolor=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;#556688&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;align=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;center&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://www.pullsoft.com/htmlpower.htm&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;font&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;face=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Arial, Helvetica, sans-serif&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;color=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;#FFFFFF&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;size=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;-1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;This Web Page was protected by HTMLPower,  Click here to Register&lt;span class=&quot;nt&quot;&gt;&amp;lt;/font&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Things that I found funny about this:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Gmail engineers haven’t been able to stop this. This could be because it’s not widespread yet.&lt;/li&gt;
  &lt;li&gt;Whoever created this spam wasn’t smart enough to encrypt their own code. They used a tool provided by &lt;a href=&quot;http://www.pullsoft.com/htmlpower.htm&quot;&gt;Pullsoft&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;They used a &lt;code class=&quot;highlighter-rouge&quot;&gt;meta refresh&lt;/code&gt; rather than a Javascript &lt;code class=&quot;highlighter-rouge&quot;&gt;window.location=http://BADURL.HERE;&lt;/code&gt;. They are already assuming the target has Javascript turned on to decrypt their “code”.&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
    
    <entry>
        <title>Object Type in Javascript</title>
        <link href="https://tech.karbassi.com/2009/12/18/object-type-in-javascript/"/>
        <updated>2009-12-18T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/12/18/object-type-in-javascript</id>
        <content type="html">&lt;p&gt;Someone noted the interesting line that I use to find the object type.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;getType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;obj&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;undefined&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'undefined'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;obj&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'null'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;call&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;']'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;call&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;']'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I posted the &lt;a href=&quot;http://tech.karbassi.com/static/posts/2009-12-18/type-detection-qunit.html&quot;&gt;QUnit test suite&lt;/a&gt;. I’ve tested it in IE6-8, Safari 4, and Firefox 3.5.6. It would be greatly appreciated if you post your results.&lt;/p&gt;

&lt;p&gt;While the typical method of using &lt;a href=&quot;https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/typeof_Operator&quot;&gt;typeof&lt;/a&gt; or &lt;a href=&quot;https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/instanceof_Operator&quot;&gt;instanceof&lt;/a&gt; may produce results, they have their faults.&lt;/p&gt;

&lt;p&gt;Douglas Crockford writes about &lt;a href=&quot;http://javascript.crockford.com/remedial.html&quot;&gt;type detection&lt;/a&gt; and his methods work for most cases, but not all.&lt;/p&gt;

&lt;p&gt;On a side note, the reason why the &lt;code class=&quot;highlighter-rouge&quot;&gt;Object.prototype.getType&lt;/code&gt; doesn’t check for &lt;code class=&quot;highlighter-rouge&quot;&gt;undefined&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;null&lt;/code&gt; is because neither of those have properties, that is, they are not an &lt;code class=&quot;highlighter-rouge&quot;&gt;Object&lt;/code&gt;. That said, they cannot call any functions.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Pure JavaScript Flatten Array</title>
        <link href="https://tech.karbassi.com/2009/12/17/pure-javascript-flatten-array/"/>
        <updated>2009-12-17T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/12/17/pure-javascript-flatten-array</id>
        <content type="html">&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; &lt;a href=&quot;http://aurgasm.us/press/globe/BostonGlobe_Aurgasm_2005.07.31_pg1.jpg&quot;&gt;Paul Irish&lt;/a&gt; thought it would be grand to point out that my test case here isn’t the best. It’s good to note that the following functions work for all values in your array. I would suggest checking out the &lt;a href=&quot;http://tech.karbassi.com/static/posts/2009-12-17/flatten-qunit.html&quot;&gt;QUnit testing page&lt;/a&gt; to see other examples.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While working on my current project I needed a way to turn a heavily nested array and flatten it. There are some nice JavaScript libraries that have functions to do so, such as Underscore’s &lt;a href=&quot;http://documentcloud.github.com/underscore/#flatten&quot;&gt;_.flatten&lt;/a&gt; and Prototype’s &lt;a href=&quot;http://www.prototypejs.org/api/array/flatten&quot;&gt;.flatten&lt;/a&gt; to name a few.&lt;/p&gt;

&lt;p&gt;However, with &lt;a href=&quot;https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/Array/Reduce#Example.3a_Flatten_an_array_of_arrays&quot;&gt;reduce&lt;/a&gt; being implemented only in JavaScript 1.8 and not wanting to include a whole JavaScript library to do one task, I decided to write my own. You may want to take a look at the &lt;a href=&quot;http://tech.karbassi.com/static/posts/2009-12-17/flatten-qunit.html&quot;&gt;QUnit testing page&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;native-function&quot;&gt;Native Function&lt;/h3&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flatten&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[];&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;l&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
        &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;call&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;']'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;concat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/^&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;array|collection|arguments|object&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;$/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flatten&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Usage:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;given&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]]]]]]]]]];&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flatten&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;given&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 'value' =&amp;gt; [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;array-object-extend&quot;&gt;Array Object Extend:&lt;/h3&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;flatten&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flatten&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[];&lt;/span&gt;
   &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;l&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
       &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;call&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;']'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
       &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;concat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/^&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;array|collection|arguments|object&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;$/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flatten&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;call&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;flat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Usage:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;given&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]]]]]]]]]];&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;given&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;flatten&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 'value' =&amp;gt; [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>lala extremely flawed</title>
        <link href="https://tech.karbassi.com/2009/12/12/lala-extremely-flawed/"/>
        <updated>2009-12-12T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/12/12/lala-extremely-flawed</id>
        <content type="html">&lt;p&gt;A week ago I wrote about how I used &lt;a href=&quot;http://tech.karbassi.com/2009/12/08/web-apps-feeding-web-apps/&quot;&gt;web apps to feed into other web apps&lt;/a&gt;, more specifically I talked about &lt;a href=&quot;http://www.lala.com&quot;&gt;lala&lt;/a&gt; and it’s “&lt;a href=&quot;http://www.lala.com/musicmover/uploader&quot;&gt;lala music mover&lt;/a&gt;”.&lt;/p&gt;

&lt;p&gt;Recently a thought formed; while watching how lala’s music mover worked, I noticed that it wasn’t checking anything &lt;em&gt;other&lt;/em&gt; than the &lt;a href=&quot;http://en.wikipedia.org/wiki/ID3&quot;&gt;ID3&lt;/a&gt; tag. I ran a real quick experiment.&lt;/p&gt;

&lt;p&gt;To test this out, I found a song that I didn’t already have. “&lt;a href=&quot;http://lala.com/zyhS&quot;&gt;Fireflies&lt;/a&gt;” by “Owl City” seemed a great fit. I made a clean iTunes library, created a sample mp3 and added it to iTunes. Then, I just edited the ID3 tag to match some basic information about the Fireflies track. Finally I made the lala mover rescan my library. Surprisingly when I checked lala, they had added it to my library.&lt;/p&gt;

&lt;p&gt;What does this teach us? The lala mover does nothing but check for ID3 tags. But really, I just saved 10¢. It’s not possible to download the track from lala being that they think I already own the track.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2009-12-12/1-lala-fireflies.png&quot; alt=&quot;lala-fireflies&quot; /&gt;
&lt;img src=&quot;http://tech.karbassi.com/images/posts/2009-12-12/2-lala-fireflies-none.png&quot; alt=&quot;lala-fireflies-none&quot; /&gt;
&lt;img src=&quot;http://tech.karbassi.com/images/posts/2009-12-12/3-itunes-sample-mp3.png&quot; alt=&quot;itunes-sample-mp3&quot; /&gt;
&lt;img src=&quot;http://tech.karbassi.com/images/posts/2009-12-12/4-ID3-sample.png&quot; alt=&quot;ID3-sample&quot; /&gt;
&lt;img src=&quot;http://tech.karbassi.com/images/posts/2009-12-12/5-ID3-firefly.png&quot; alt=&quot;ID3-firefly&quot; /&gt;
&lt;img src=&quot;http://tech.karbassi.com/images/posts/2009-12-12/6-itunes-firefly.png&quot; alt=&quot;itunes-firefly&quot; /&gt;
&lt;img src=&quot;http://tech.karbassi.com/images/posts/2009-12-12/7-lal-mover.png&quot; alt=&quot;lal-mover&quot; /&gt;
&lt;img src=&quot;http://tech.karbassi.com/images/posts/2009-12-12/8-lala-fireflies-have.png&quot; alt=&quot;lala-fireflies-have&quot; /&gt;&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Web Apps Feeding Web Apps</title>
        <link href="https://tech.karbassi.com/2009/12/08/web-apps-feeding-web-apps/"/>
        <updated>2009-12-08T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/12/08/web-apps-feeding-web-apps</id>
        <content type="html">&lt;p&gt;I just realized that I’ve been feeding web apps with other web apps, and all for free.&lt;/p&gt;

&lt;p&gt;I listen to &lt;a href=&quot;http://last.fm&quot;&gt;last.fm&lt;/a&gt; via &lt;a href=&quot;http://github.com/MagicMoo/SweetFM&quot;&gt;sweet.fm&lt;/a&gt; which downloads my &lt;em&gt;loved&lt;/em&gt; tracks to my iTunes; those are then matched or uploaded to &lt;a href=&quot;http://www.lala.com&quot;&gt;lala.com’s&lt;/a&gt; catalog with their &lt;a href=&quot;http://www.lala.com/musicmover/uploader&quot;&gt;lala music mover&lt;/a&gt; app, and finally the tracks are &lt;a href=&quot;http://www.audioscrobbler.net/&quot;&gt;scrobbled&lt;/a&gt; back to last.fm.&lt;/p&gt;

&lt;p&gt;The cycle of last.fm &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;gt;&lt;/code&gt; sweet.fm &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;gt;&lt;/code&gt; iTunes &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;gt;&lt;/code&gt; lala &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;gt;&lt;/code&gt; last.fm keeps my library growing. Moreover, I get one free listen to new tracks on lala.&lt;/p&gt;

&lt;p&gt;So after a week of using this process, I’ve added over two thousand songs to lala that I can listen to anywhere, anytime.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Tip: Recursively Open TextMate Project Folders</title>
        <link href="https://tech.karbassi.com/2009/10/14/tip-recursively-open-textmate-project-folders/"/>
        <updated>2009-10-14T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/10/14/tip-recursively-open-textmate-project-folders</id>
        <content type="html">&lt;p&gt;Quick tip time! This time it’s about one of the best text editors for the mac, &lt;a href=&quot;http://macromates.com/&quot;&gt;TextMate&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Did you know that you can recursively expand project folders in TextMate by holding down the option key (⌥) and clicking the folder to open.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Download all mp3 on a webpage</title>
        <link href="https://tech.karbassi.com/2009/09/29/download-all-mp3-on-a-webpage/"/>
        <updated>2009-09-29T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/09/29/download-all-mp3-on-a-webpage</id>
        <content type="html">&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Be sure to escape any urls are are using. Characters like &lt;code class=&quot;highlighter-rouge&quot;&gt;(&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;)&lt;/code&gt;, and others need to be escaped. This can be done by putting a backslash before them. For example: &lt;code class=&quot;highlighter-rouge&quot;&gt;\(&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;\)&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ever wanted to download all the audio files off a particular webpage? You could manually click and save each one or load up terminal and use this one-liner. &lt;strong&gt;Remember&lt;/strong&gt; to only use this for sites that are allowing you do download their content free of charge; stealing is wrong!&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; SITEURL | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-oie&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ftp&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;www&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\.\(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;wav&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;m4a&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ogg&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;mp4&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; | sort | uniq | awk &lt;span class=&quot;s1&quot;&gt;'{print &quot;curl -sOL &quot;$1&quot; &amp;amp;&quot;}'&lt;/span&gt; | /bin/sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A quick explanation of what is happening.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; SITEURL
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is downloading the SITEURL (which you should replace with the url of the site/file you want to scrape) but not outputting it nor showing the download progress. This is because of the &lt;code class=&quot;highlighter-rouge&quot;&gt;-s&lt;/code&gt; flag that is thrown.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-oie&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ftp&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;www&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\.\(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;wav&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;m4a&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ogg&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\|&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;mp4&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is parsing/scraping the site/file that we just downloaded for urls that match our regular expression. What we are looking for is urls that start with &lt;code class=&quot;highlighter-rouge&quot;&gt;http&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;https&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;ftp&lt;/code&gt;, or &lt;code class=&quot;highlighter-rouge&quot;&gt;www&lt;/code&gt; and that end with &lt;code class=&quot;highlighter-rouge&quot;&gt;mp3&lt;/code&gt;,  &lt;code class=&quot;highlighter-rouge&quot;&gt;wav&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;m4a&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;ogg&lt;/code&gt;, or &lt;code class=&quot;highlighter-rouge&quot;&gt;mp4&lt;/code&gt;. You can add your own file extensions; just follow the pattern.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sort | uniq
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sorts, and only displays the unique urls. No need for duplicates!&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;awk &lt;span class=&quot;s1&quot;&gt;'{print &quot;curl -sOL &quot;$1&quot; &amp;amp;&quot;}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Displays the urls as an output of &lt;code class=&quot;highlighter-rouge&quot;&gt;curl -sOL MP3URL &amp;amp;&lt;/code&gt;, which will actually download the file in the background. The &lt;code class=&quot;highlighter-rouge&quot;&gt;-O&lt;/code&gt; flag will create a file and the &lt;code class=&quot;highlighter-rouge&quot;&gt;-L&lt;/code&gt; flag will follow any url redirection.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/bin/sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, the whole process is ran through the bash (shell) command.&lt;/p&gt;

&lt;p&gt;You shouldn’t see any output because everything is ran in the background. Just wait for the files to be created in the directory you are in.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Snow Leopard and Bash Colors</title>
        <link href="https://tech.karbassi.com/2009/08/31/snow-leopard-and-bash-colors/"/>
        <updated>2009-08-31T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/08/31/snow-leopard-and-bash-colors</id>
        <content type="html">&lt;p&gt;One little problem people—including myself—have been running into is bash color codes. Many &lt;code class=&quot;highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt; files have the following (or similar):&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_NC&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[0m'&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# No Color&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_WHITE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[1;37m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_BLACK&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[0;30m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_BLUE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[0;34m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_BLUE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[1;34m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_GREEN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[0;32m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_GREEN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[1;32m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_CYAN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[0;36m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_CYAN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[1;36m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_RED&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[0;31m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_RED&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[1;31m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_PURPLE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[0;35m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_PURPLE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[1;35m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_BROWN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[0;33m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_YELLOW&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[1;33m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_GRAY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[1;30m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_GRAY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\e[0;37m'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The solution is to use &lt;code class=&quot;highlighter-rouge&quot;&gt;\033&lt;/code&gt; as the escape code rather than &lt;code class=&quot;highlighter-rouge&quot;&gt;\e&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Setup some colors to use later in interactive shell or scripts&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_NC&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[0m'&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# No Color&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_WHITE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[1;37m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_BLACK&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[0;30m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_BLUE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[0;34m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_BLUE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[1;34m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_GREEN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[0;32m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_GREEN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[1;32m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_CYAN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[0;36m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_CYAN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[1;36m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_RED&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[0;31m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_RED&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[1;31m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_PURPLE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[0;35m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_PURPLE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[1;35m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_BROWN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[0;33m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_YELLOW&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[1;33m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_GRAY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[1;30m'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;COLOR_LIGHT_GRAY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\033[0;37m'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
    </entry>
    
    <entry>
        <title>MacPorts on Snow Leopard</title>
        <link href="https://tech.karbassi.com/2009/08/31/macports-on-snow-leopard/"/>
        <updated>2009-08-31T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/08/31/macports-on-snow-leopard</id>
        <content type="html">&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Update in 2010:&lt;/strong&gt; I would highly suggest moving away from MacPorts/Fink and to use &lt;a href=&quot;http://mxcl.github.com/homebrew/&quot;&gt;Homebrew&lt;/a&gt; by &lt;a href=&quot;http://methylblue.com/&quot;&gt;Max Howell&lt;/a&gt;.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; The nice people at MacPorts have update the package to v1.8.0. You can follow &lt;a href=&quot;http://trac.macports.org/post/macports-180-now-available/&quot;&gt;their instructions&lt;/a&gt; to upgrade to the latest stable version. I would suggest the &lt;a href=&quot;http://distfiles.macports.org/MacPorts/MacPorts-1.8.0-10.6-SnowLeopard.dmg&quot;&gt;MacPorts v1.8.0 for OS X 10.6 DMG&lt;/a&gt; file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After installing Snow Leopard, you may want to install the MacPorts.
Follow the following steps to get it up and running:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Download and install &lt;a href=&quot;http://developer.apple.com/mac/&quot;&gt;XCode&lt;/a&gt; from ADC.&lt;/li&gt;
  &lt;li&gt;Open up the Terminal&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;svn co http://svn.macports.org/repository/macports/trunk/base/&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;cd base&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;./configure&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;make&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo make install&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo /opt/local/bin/port -v selfupdate&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo port upgrade --enforce-variants&lt;/code&gt; (Did not work for me)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo port upgrade outdated&lt;/code&gt; (Did not work for me)&lt;/li&gt;
&lt;/ol&gt;

</content>
    </entry>
    
    <entry>
        <title>Setting terminal tab titles</title>
        <link href="https://tech.karbassi.com/2009/08/28/setting-terminal-tab-titles/"/>
        <updated>2009-08-28T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/08/28/setting-terminal-tab-titles</id>
        <content type="html">&lt;p&gt;I’ve always hated the fact that I would have 5-10 tabs open in Terminal, and they would all say &lt;code class=&quot;highlighter-rouge&quot;&gt;bash&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2009-08-28/screen1.png&quot; alt=&quot;1&quot; title=&quot;Mac Terminal Example&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After doing some quick research, I stumbled on &lt;a href=&quot;http://pseudogreen.org/blog/set_tab_names_in_leopard_terminal.html&quot;&gt;decent solution&lt;/a&gt; on setting window and tab names in the Leopard Terminal.&lt;/p&gt;

&lt;p&gt;You can add the following code block to either your &lt;code class=&quot;highlighter-rouge&quot;&gt;.bash_profile&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;function &lt;/span&gt;set_window_and_tab_title
&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-z&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$title&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
        &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;root&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;fi

    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;tmpdir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;~/Library/Caches/&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;FUNCNAME&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;_temp
    &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;cmdfile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$tmpdir&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$title&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Set window title&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;]0;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\a&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Set tab title&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CURRENT_TAB_TITLE_PID&lt;/span&gt;:+1&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
        &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;kill&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$CURRENT_TAB_TITLE_PID&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;fi
    &lt;/span&gt;mkdir &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$tmpdir&lt;/span&gt;
    ln /bin/sleep &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cmdfile&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cmdfile&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; 10 &amp;amp;
    &lt;span class=&quot;nv&quot;&gt;CURRENT_TAB_TITLE_PID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;jobs&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; %+&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;disown&lt;/span&gt; %+
    &lt;span class=&quot;nb&quot;&gt;kill&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-STOP&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$CURRENT_TAB_TITLE_PID&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;command &lt;/span&gt;rm &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cmdfile&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;PROMPT_COMMAND&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'set_window_and_tab_title &quot;${PWD##*/}&quot;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2009-08-28/screen2.png&quot; alt=&quot;2&quot; title=&quot;Shell settings&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Restart bash and everything should be working, hunky-dory. One problem you’ll notice is that when you try to close a session, terminal will prompt you about running processes. This is a side-affect of forking the process. A quick fix is to set the &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;Prompt before closing&quot;&lt;/code&gt; in &lt;code class=&quot;highlighter-rouge&quot;&gt;Preferences &amp;gt; Settings &amp;gt; Shell&lt;/code&gt; to “Never”.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Better array search</title>
        <link href="https://tech.karbassi.com/2009/07/21/better-array-search/"/>
        <updated>2009-07-21T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/07/21/better-array-search</id>
        <content type="html">&lt;p&gt;During the journey of finding a better linear array search function in javascript, I decided to write my own. I decided to take a different approach. Here’s the outcome.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;small_search&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;x00'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;substring&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With an array of less than 150 elements, it is much faster than Dustin Diaz’s &lt;a href=&quot;http://www.dustindiaz.com/top-ten-javascript/&quot;&gt;in_array&lt;/a&gt; function. While they aren’t the same, his can be adapted to return the index also.&lt;/p&gt;

&lt;p&gt;The only downside with my function is that it becomes much slower after the array length is larger than 150 elements. So, if you have a small array, go ahead and use this, otherwise use Dustin’s.&lt;/p&gt;

&lt;h3 id=&quot;times&quot;&gt;Times&lt;/h3&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Array Length&lt;/th&gt;
      &lt;th&gt;small_search&lt;/th&gt;
      &lt;th&gt;in_array&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;5&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;0.020ms&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;0.098ms&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;10&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;0.024ms&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;0.084ms&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;50&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;0.042ms&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;0.095ms&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;100&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;0.069ms&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;0.106ms&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;150&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;0.087ms&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;0.111ms&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;300&lt;/td&gt;
      &lt;td&gt;0.203ms&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;0.137ms&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;500&lt;/td&gt;
      &lt;td&gt;0.418ms&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;0.132ms&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;1000&lt;/td&gt;
      &lt;td&gt;0.813ms&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;0.138ms&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;5000&lt;/td&gt;
      &lt;td&gt;3.530ms&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;0.312ms&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;10000&lt;/td&gt;
      &lt;td&gt;6.718ms&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;0.441ms&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Test it out on your own and come back with results.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>How To: Splitting large text files into smaller ones</title>
        <link href="https://tech.karbassi.com/2009/05/29/how-to-splitting-large-text-files-into-smaller-ones/"/>
        <updated>2009-05-29T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/05/29/how-to-splitting-large-text-files-into-smaller-ones</id>
        <content type="html">&lt;p&gt;Let’s say you have a &lt;strong&gt;huge&lt;/strong&gt; text file with couple million lines. Now you want to split it up into 100, 200, or 300 line files. Bash makes it pretty easy with &lt;code class=&quot;highlighter-rouge&quot;&gt;split&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In Bash:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;split &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; 500 file.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That splits up the file &lt;code class=&quot;highlighter-rouge&quot;&gt;file.txt&lt;/code&gt; into 500 line chunks. What is produced are files such as &lt;code class=&quot;highlighter-rouge&quot;&gt;xaa&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;xab&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;xac&lt;/code&gt; and so on.&lt;/p&gt;

&lt;p&gt;Be sure to do &lt;code class=&quot;highlighter-rouge&quot;&gt;man split&lt;/code&gt; for more options.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>How To: Remove Duplicate Lines From A File</title>
        <link href="https://tech.karbassi.com/2009/05/28/how-to-remove-duplicate-lines-from-a-file/"/>
        <updated>2009-05-28T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/05/28/how-to-remove-duplicate-lines-from-a-file</id>
        <content type="html">&lt;p&gt;Sure you can load up a bulky editor and use its tools to do that, but why not do it in much faster in bash with &lt;code class=&quot;highlighter-rouge&quot;&gt;awk&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In Bash:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;awk &lt;span class=&quot;s1&quot;&gt;'!x[$0]++'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;.txt &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; out.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Wasn’t that easy?&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>How To: Find the size of a directory</title>
        <link href="https://tech.karbassi.com/2009/05/28/how-to-find-the-size-of-a-directory/"/>
        <updated>2009-05-28T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/05/28/how-to-find-the-size-of-a-directory</id>
        <content type="html">&lt;p&gt;Sometimes it’s very useful to know how much content is in a directory without opening a GUI interface.&lt;/p&gt;

&lt;p&gt;In Bash:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;du &lt;span class=&quot;nt&quot;&gt;-cks&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | sort &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; | awk &lt;span class=&quot;s1&quot;&gt;'\''BEGIN { split(&quot;KB,MB,GB,TB&quot;, Units, &quot;,&quot;); } { u = 1;while ($1 &amp;gt;= 1024){$1 = $1 / 1024;u += 1;}$1 = sprintf(&quot;%.1f %s&quot;, $1, Units[u]);print $0;}'&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' | tail -11
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I would suggest adding this to your bash aliases as &lt;code class=&quot;highlighter-rouge&quot;&gt;ducks&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Output looks something like so:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;~ &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; ducks

4.0 KB p
72.0 KB Music
24.1 MB Sites
35.0 MB Downloads
433.3 MB Dropbox
937.5 MB Movies
3.5 GB Library
6.3 GB Desktop
11.7 GB Documents
16.5 GB Pictures
39.5 GB total

~ &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; _
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; My good friend &lt;a href=&quot;http://www.twitter.com/file_cabinet&quot;&gt;Clayton&lt;/a&gt; suggested a much simpler way. The only problem is that the output is not sorted.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;du &lt;span class=&quot;nt&quot;&gt;-hd1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The output is the whole directory. I truncated the output to show the last 11.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;~ &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; du &lt;span class=&quot;nt&quot;&gt;-hd&lt;/span&gt; 1 | tail &lt;span class=&quot;nt&quot;&gt;-11&lt;/span&gt;

6.3G    ./Desktop
12G     ./Documents
212M    ./Downloads
433M    ./Dropbox
3.6G    ./Library
8.0K    ./Movies
72K     ./Music
17G     ./Pictures
0B      ./Public
24M     ./Sites
40G     &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;

~ &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;_
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Update #2:&lt;/strong&gt; Some systems do not accept the &lt;code class=&quot;highlighter-rouge&quot;&gt;-d&lt;/code&gt; flag. This can be replaced with the &lt;code class=&quot;highlighter-rouge&quot;&gt;--max-depth&lt;/code&gt; flag, like so:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;du &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt; —max-depth 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Keyboard Shortcut to Help Search Box</title>
        <link href="https://tech.karbassi.com/2009/05/27/keyboard-shortcut-to-help-search-box/"/>
        <updated>2009-05-27T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/05/27/keyboard-shortcut-to-help-search-box</id>
        <content type="html">&lt;p&gt;If you haven’t figured out how Mac OS X 10.5 (Leopard) help search box allows you to search menu items, check out &lt;a href=&quot;http://www.youtube.com/watch?v=ggoTQqNXOQs&quot;&gt;Chris Pirillo demoing the feature&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The problem for me is that I’m a keyboard person. Over 90% of my day, I barely touch the mouse. Now, to get to the help search bar with your keyboard, just press:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;⌘ (Command) + ⇧ (Shift) + ? (Question Mark)&lt;/code&gt;&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Find &amp; Replace in Linux/Mac</title>
        <link href="https://tech.karbassi.com/2009/05/27/find-replace-in-linuxmac/"/>
        <updated>2009-05-27T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/05/27/find-replace-in-linuxmac</id>
        <content type="html">&lt;p&gt;This is a quick one liner to find and replace strings in *nix. You can use this in your Mac terminal or Unix prompt.&lt;/p&gt;

&lt;p&gt;In Bash:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;find &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;nt&quot;&gt;-exec&lt;/span&gt; sed &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/FIND/REPLACE/g'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;find &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;nt&quot;&gt;-exec&lt;/span&gt; sed &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/signin/login/g'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
    </entry>
    
    <entry>
        <title>Command, Option, &amp; Shift Symbols in Unicode</title>
        <link href="https://tech.karbassi.com/2009/05/27/command-option-shift-symbols-in-unicode/"/>
        <updated>2009-05-27T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/05/27/command-option-shift-symbols-in-unicode</id>
        <content type="html">&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Ratty in the comment noted that &amp;#x238B; is actually the ESC key button not the power button.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Update 2012:&lt;/strong&gt; Added more symbols.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Unicode does define some other characters which are sort of Mac-specific.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Character&lt;/th&gt;
      &lt;th&gt;Entity Code&lt;/th&gt;
      &lt;th&gt;Entity Name&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;⌘&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#x2318&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#8984&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Command Key symbol&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⌥&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#x2325&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#8997&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Option Key symbol&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⇧&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#x21E7&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#8679&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Shift Key symbol&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⎋&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#x238B&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#9099&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;ESC Key symbol&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⇪&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#x21ea&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#8682&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Capslock symbol&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⏎&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#x23ce&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#9166&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Return symbol&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⌫&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#x232b&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;#9003&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Delete / Backspace symbol&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The Power Button and Shift Key are not Mac-specific. The power button is described as “broken circle with northwest arrow”, or an escape character from ISO 9995-7. The shift key is described as an “outline up-arrow”.&lt;/p&gt;

&lt;p&gt;Even though these are defined in standard Unicode, there is &lt;strong&gt;no guarantee&lt;/strong&gt; that they will exist in the font of the receiving browser, but they’re at least globally defined, so they’re fair game.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>See how many Kernel Panics your Mac has had</title>
        <link href="https://tech.karbassi.com/2009/05/26/see-how-many-kernel-panics-your-mac-has-had/"/>
        <updated>2009-05-26T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/05/26/see-how-many-kernel-panics-your-mac-has-had</id>
        <content type="html">&lt;p&gt;In bash:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; /Library/Logs/PanicReporter/ | wc &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; /Library/Logs/DiagnosticReports/ | wc &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I’ve had &lt;em&gt;5&lt;/em&gt;.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Firefox &amp; Input Field Width</title>
        <link href="https://tech.karbassi.com/2009/05/26/firefox-input-field-width/"/>
        <updated>2009-05-26T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/05/26/firefox-input-field-width</id>
        <content type="html">&lt;p&gt;Hate the 2 pixel difference you get when you apply a width on your input fields in Firefox?&lt;/p&gt;

&lt;p&gt;Try this in CSS:&lt;/p&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;textarea&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;-moz-box-sizing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;border-box&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
    </entry>
    
    <entry>
        <title>Scroll to bottom of page.</title>
        <link href="https://tech.karbassi.com/2009/05/22/scroll-to-bottom-of-page/"/>
        <updated>2009-05-22T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/05/22/scroll-to-bottom-of-page</id>
        <content type="html">&lt;p&gt;In javascript:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
    </entry>
    
    <entry>
        <title>How To FULLY Disable Spotlight in Leopard</title>
        <link href="https://tech.karbassi.com/2009/05/12/how-to-fully-disable-spotlight-in-leopard/"/>
        <updated>2009-05-12T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/05/12/how-to-fully-disable-spotlight-in-leopard</id>
        <content type="html">&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; This is changing system settings that may or may not be attached to other tools. After an extensive search on the internet, one of these tools affected by the following steps is &lt;a href=&quot;http://www.apple.com/macosx/features/timemachine.html&quot;&gt;TimeMachine&lt;/a&gt; / &lt;a href=&quot;http://www.apple.com/timecapsule/&quot;&gt;TimeCapsule&lt;/a&gt;. If you are using them, I would &lt;strong&gt;not&lt;/strong&gt; follow these steps. Rule of thumb: if you think it will mess up your system and you don’t want to worry about that, don’t do it.&lt;/p&gt;

&lt;h3 id=&quot;quick-way&quot;&gt;Quick way&lt;/h3&gt;

&lt;h4 id=&quot;disable&quot;&gt;Disable:&lt;/h4&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl unload &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchDaemons/com.apple.metadata.mds.plist&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl unload &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchAgents/com.apple.Spotlight.plist&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;re-enable&quot;&gt;re-enable:&lt;/h4&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl load &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchDaemons/com.apple.metadata.mds.plist&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl load &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchAgents/com.apple.Spotlight.plist&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;explanation&quot;&gt;Explanation&lt;/h3&gt;

&lt;h4 id=&quot;stop-and-disable-the-background-server&quot;&gt;Stop and disable the background server:&lt;/h4&gt;

&lt;h5 id=&quot;kill-the-daemon&quot;&gt;Kill the Daemon:&lt;/h5&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl unload &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchDaemons/com.apple.metadata.mds.plist&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h5 id=&quot;re-enable-the-daemon&quot;&gt;Re-enable the Daemon:&lt;/h5&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl load &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchDaemons/com.apple.metadata.mds.plist&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;stop-and-disable-the-spotlight-application-itself&quot;&gt;Stop and disable the spotlight application itself:&lt;/h4&gt;

&lt;h5 id=&quot;kill-the-agent&quot;&gt;Kill the Agent:&lt;/h5&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl unload &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchAgents/com.apple.Spotlight.plist&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h5 id=&quot;re-enable-the-agent&quot;&gt;Re-enable the Agent:&lt;/h5&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl load &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchAgents/com.apple.Spotlight.plist&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You may get an error on the last command; just ignore it.&lt;/p&gt;

&lt;h3 id=&quot;what-it-does&quot;&gt;What it does&lt;/h3&gt;

&lt;p&gt;We stop the process from running and tell the system to fully disable it.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl unload &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchDaemons/com.apple.metadata.mds.plist&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we need to stop the agent for the user and everyone else.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl unload &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchAgents/com.apple.Spotlight.plist&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;the-re-enable-spotlight-back-again&quot;&gt;The re-enable Spotlight back again:&lt;/h3&gt;

&lt;p&gt;If you need to re-enable the process, you can run the following line.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl load &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchDaemons/com.apple.metadata.mds.plist&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The following line re-enable the Spotlight agent.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl load &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/System/Library/LaunchAgents/com.apple.Spotlight.plist&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The reason you get the error is that you are effectively executing the command as root, but the root user hasn’t any running instance of Spotlight. On the other hand, only the root user is able to disable the automatic start of Spotlight. Thus the need for the &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;Done!&lt;/p&gt;

&lt;p&gt;There’s no need to reboot your computer after following these steps.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Automatically Block Facebook Applications Updated!</title>
        <link href="https://tech.karbassi.com/2009/01/22/automatically-block-facebook-applications-updated/"/>
        <updated>2009-01-22T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2009/01/22/automatically-block-facebook-applications-updated</id>
        <content type="html">&lt;p&gt;Two years later, I decided to take a look at my old, old, OLD Greasemonkey script to see if it was still working. This is after two minor updates on Facebook and one &lt;strong&gt;major&lt;/strong&gt; update that changed the whole design and structure.&lt;/p&gt;

&lt;p&gt;Surprisingly, the script works exactly like it should. I made one minor update, but after many tests, it works for me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you have any suggestions, comments, or concerns, be sure to comment below.&lt;/strong&gt; If you find any situations where it doesn’t work, please leave a comment and I will check it out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To use this script&lt;/strong&gt;, you need &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/748&quot;&gt;Greasemonkey&lt;/a&gt; add-on. Once you have it, just go here and click install: &lt;a href=&quot;http://userscripts.org/scripts/show/12393&quot;&gt;http://userscripts.org/scripts/show/12393&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here’s the code:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// Auto-Block Facebook Apps
//
// Version 1.2
//
// Date Written: 2007-09-18
// Last Modified: 2009-01-22 02:18 PM (14:18)
//
// (c) Copyright 2007 Ali Karbassi.
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to &quot;Install User Script&quot;.
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select &quot;Auto-Block Facebook Apps&quot;, and click Uninstall.
//
// --------------------------------------------------------------------
//
// WHAT IT DOES:
// After the facebook profile page is loaded, it finds all the
// applications that your friends have invited you to and blocks them.
// Do not worry though, you can go to
// http://facebook.com/privacy.php?view=platform&amp;amp;tab=all and unblock
// them
//
// NOTE: This does not alter, delete, edit, add, or anything else to
//       your facebook profile. Just remove or disable this script and
//       everything will be displayed the same as it used to
// --------------------------------------------------------------------
//
// ==UserScript==
// @name        Auto-Block Facebook Apps 1.2
// @author      Ali Karbassi
// @namespace   http://www.karbassi.com
// @description This script will block app invites sent to you by friends.
//              After the facebook profile page is loaded, it finds all the
//              applications that your friends have invited you to and blocks
//              them. Do not worry though, you can go
//              http://facebook.com/privacy.php?view=platform&amp;amp;tab=all and
//              unblock them.
// @include     http://*facebook.tld/home.php*
// @include     http://*facebook.tld/reqs.php*
// ==/UserScript==
// Find Subdomain
var subDomain = getSubDomain();

// Get links on the front page/request page
var anchors = document.getElementsByTagName('a');
var appReqExp = /reqs\.php#confirm_(\d*)_(.*)/;

for (var i = 0; i &amp;lt; anchors.length; i++) {
  if (appReqExp.exec(anchors[i].href)) {
    prep(RegExp.$1, anchors[i]);
  }
}

// Remove any notifications about apps.
removeNotifications();

// Functions
// PLEASE DO NOT TOUCH IF YOU HAVE NO IDEA WHAT YOU'RE DOING.
// YOU MIGHT BREAK IT.
// Prepares everything. When things are correct, it calls BlockApp.
function prep(appID, appNode) {
  var postformMatch = /name=&quot;post_form_id&quot; value=&quot;(\w+)&quot;/;
  var post_form_id = 0;

  GM_xmlhttpRequest({
    method: 'GET',
    url: 'http://www.facebook.com/apps/block.php?id=' + appID
         + '&amp;amp;action=block',
    headers: {
      'User-Agent': window.navigator.userAgent,
      'Accept': 'text/html',
    },
    onload: function(responseDetails) {
      var searchString = 'This will not prevent you from seeing';
      if( (responseDetails.status == 200)
          &amp;amp;&amp;amp; (responseDetails.responseText.indexOf(searchString) != -1) ) {

        // Show that we are working on it.
        appNode.removeAttribute('href');
        appNode.innerHTML = 'Reading confirmation page...';

        postformMatch.exec(responseDetails.responseText);

        // Calls function to block the app
        BlockApp(RegExp.$1, appID, appNode);
      }
    }
  });
}

function BlockApp(post_form_id, appID, appNode) {
  GM_xmlhttpRequest({
    method: 'POST',
    url: 'http://' + subDomain + 'facebook.com/apps/block.php?id=' + appID
         + '&amp;amp;action=block',
    headers: {
      'User-Agent': window.navigator.userAgent,
      'Accept': 'text/xml',
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    data: 'post_form_id=' + post_form_id + '&amp;amp;save=1',
    onload: function(responseDetails) {
      if (responseDetails.status == 200) {
        appNode.innerHTML = 'App Blocked!'
        appNode.href = 'http://facebook.com/reqs.php';
      }
    },
    onerror: function(responseDetails) {
      appNode.removeAttribute('href');
      appNode.innerHTML = 'App Block failed!';
    }
  });
}

function removeNotifications() {
  var inputs = document.getElementsByTagName('input');
  for (var i = 0; i &amp;lt; inputs.length; i++) {
    if (inputs[i].value == 'Ignore') {
      for (var j = 0; j &amp;lt; inputs[i].attributes.length; j++) {
        if ( (inputs[i].attributes[j].nodeName == 'onclick') &amp;amp;&amp;amp;
        (inputs[i].attributes[j].nodeValue.indexOf('click_add_platform_app') != -1) ) {
          var js = (inputs[i].attributes[j].nodeValue).split(' ');
          js.shift();
          js = js.join(' ');
          location.href = 'javascript:' + js;
        }
      }
    }
  }
}

function getSubDomain() {
  var subDomainRegExp = /http:\/\/(.*\.)facebook\.com/;
  var subDomain = '';
  if (subDomainRegExp.exec(document.location) != 0) {
    subDomain = RegExp.$1;
  }
  return subDomain;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Twitter style text counter in jQuery</title>
        <link href="https://tech.karbassi.com/2008/10/27/twitter-style-text-counter-in-jquery/"/>
        <updated>2008-10-27T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/10/27/twitter-style-text-counter-in-jquery</id>
        <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/89943077@N00/2866119475/&quot;&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-10-27/punch.jpg&quot; alt=&quot;1&quot; title=&quot;Punch Chart on Rapha&amp;euml;l&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I. Love. jQuery. I can’t say how much I love jQuery because some people might get jealous because jQuery might out-rank them in the scale of 0 to jAWESOME!&lt;/p&gt;

&lt;p&gt;Enough drooling and leg humping. In a recent project, we needed a counter to display the number of characters the user had left in a text area. Nothing to hard or interesting. This sort of thing has been out there for years. The problem is, all the scripts I’ve found would automatically truncate the text. That is, if the user has 100 characters and they enter 105 characters, the 101 to 105th characters are gone. This is very annoying!&lt;/p&gt;

&lt;p&gt;Rather than control the user and annoy them, we wanted to take the method Twitter does; Warn the user, don’t allow them to submit until the warning is fixed. That is, if the text counter is negative, they cannot submit, but once it’s 0 or greater, it’s fair game.&lt;/p&gt;

&lt;p&gt;To add to the fun, we needed visual cues, i.e. colours! After some search and no luck, I sat down and wrote this little beauty. &lt;strong&gt;It’s version 1 so be nice.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can always grab a from the &lt;a href=&quot;http://plugins.jquery.com/project/twittercounter&quot;&gt;jQuery Plugin Repository&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cm&quot;&gt;/*
 * twitterCounter
 *
 * Displays a counter with the remaining text.
 *
 * Example:
 *  $('#description').twitterCounter(
 *  {
 *     limit: 140,
 *     counter: '#textcounter',
 *
 *     okSize: 140,
 *     okStyle: '.ok',
 *
 *     watchSize: 20,
 *     watchStyle: '.watch',
 *
 *     warningSize: 10,
 *     warningStyle: '.warning',
 *
 *     errorSize: 0,
 *     errorStyle: '.error',
 *  });
 *
 * $Version: 2008-10-24
 * Copyright (c) 2008 Ali Karbassi
 * ali.karbassi@gmail.com
 */&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;jQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;twitterCounter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;curSize&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;charsLeft&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'limit'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;curSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;types&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'ok'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'watch'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'warning'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'error'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{};&lt;/span&gt;
   &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;types&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;s1&quot;&gt;'Max'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Size'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
         &lt;span class=&quot;s1&quot;&gt;'Style'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Style'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;substring&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'.'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Style'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;substring&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'#'&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Style'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;substring&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Style'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Style'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
         &lt;span class=&quot;s1&quot;&gt;'Type'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Style'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;substring&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'.'&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'class'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'id'&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
   &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;types&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;types&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Last Element check&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;types&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;nextEl&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;types&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;charsLeft&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;nextEl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Max'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;charsLeft&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Max'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;clean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;charsLeft&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Max'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;clean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'counter'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;charsLeft&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Add an event so the counter updates when the user types.&lt;/span&gt;
   &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;one&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'keyup'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;twitterCounter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;clean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Type'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'class'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;types&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
         &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'counter'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;hasClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'counter'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;removeClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'counter'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Style'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'counter'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Style'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Uninstall Inquisitor and/or Glims</title>
        <link href="https://tech.karbassi.com/2008/10/16/uninstall-inquisitor-andor-glims/"/>
        <updated>2008-10-16T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/10/16/uninstall-inquisitor-andor-glims</id>
        <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/87569910@N00/2530972208/&quot;&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-10-16/schoschie.jpg&quot; alt=&quot;1&quot; title=&quot;Schoschie vs. Apple&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recently I’ve giving &lt;a href=&quot;http://www.machangout.com/&quot;&gt;Glims&lt;/a&gt; a try. Even though it &lt;strong&gt;tries&lt;/strong&gt; to combine what Inquisitor and Saft both do into one single free application, I was very disappointed in the ease of use and look.&lt;/p&gt;

&lt;p&gt;Before trying Glims, I had to uninstall (remove) &lt;a href=&quot;http://www.inquisitorx.com/safari/&quot;&gt;Inquisitor&lt;/a&gt; that was already running on my version of &lt;a href=&quot;http://www.webkit.org&quot;&gt;Webkit&lt;/a&gt; and Safari. To do this, I opened up terminal and typed the following commands (with my password that is):&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;rm &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/Library/InputManagers/Inquisitor/&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;rm &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/Library/Receipts/inquisitor*&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;rm &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;~/Library/Application Support/Inquisitor/&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After couple hours of use, I wanted to switch back to Inquisitor, which meant that I had to remove Glims. To do that action, I pulled up terminal, yet again, and typed the follow:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;rm &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/Library/InputManagers/Glims/&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;rm &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;~/Library/Application Support/Glims/&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That should take care of everything, leaving my computer nice and clean.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Primes in Ruby</title>
        <link href="https://tech.karbassi.com/2008/09/10/primes-in-ruby/"/>
        <updated>2008-09-10T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/09/10/primes-in-ruby</id>
        <content type="html">&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-09-10/discrete.jpg&quot; alt=&quot;1&quot; title=&quot;26/366 Discrete Mathematical Structures&quot; /&gt;&lt;/p&gt;

&lt;p&gt;While working on some homework for a mathematics course, I ran into a problem; I needed a list of primes. I could manually produce a list of 10, maybe 20 primes but what’s the fun in that. Having my trusty MacBook near me, I loaded up TextMate and started to write a simple Ruby program to produce primes.&lt;/p&gt;

&lt;p&gt;After a few minutes, the code turned into something much bigger than I expected. Researching to see if my formulas were correct, I continued on to create a separate file for this class. The outcome produced this:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Primes&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;attr_reader&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:primes&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;initialize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;len&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;nil&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;nil?&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;state&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Numeric&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@primes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;abs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;sqrt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ceil&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
         &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;state&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;divmod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;state&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;false&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;state&lt;/span&gt;
        &lt;span class=&quot;vi&quot;&gt;@primes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;vi&quot;&gt;@primes&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To run, we do:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;primes&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Output&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# ------&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 2&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 3&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 5&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 7&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 11&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 13&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 17&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 19&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 23&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 29&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I know this isn’t perfect, but it was a fun 20 minute side project. If you want to improve on it, just head over to my &lt;a href=&quot;http://gist.github.com/10159&quot; title=&quot;Ruby class to return primes&quot;&gt;gist&lt;/a&gt;.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Quickly, and efficiently, mass rename files in bash</title>
        <link href="https://tech.karbassi.com/2008/06/18/quickly-and-efficiently-mass-rename-files-in-bash/"/>
        <updated>2008-06-18T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/06/18/quickly-and-efficiently-mass-rename-files-in-bash</id>
        <content type="html">&lt;p&gt;Quick tip for everyone who is using Mac OS X, Unix, or anything with bash. If you want to mass rename a bunch of files, there isn’t a simple way of doing it. Either you would have to do it manually (&lt;code class=&quot;highlighter-rouge&quot;&gt;mv ryan.txt steve.txt&lt;/code&gt;) or you could use this simple line of code.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ryan.*&quot;&lt;/span&gt; | awk &lt;span class=&quot;s1&quot;&gt;'{print(&quot;mv &quot;$1&quot; &quot;$1)}'&lt;/span&gt; | sed &lt;span class=&quot;s1&quot;&gt;'s/ryan/steve/2'&lt;/span&gt; | /bin/sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Let me explain it quickly. Let’s say you have a whole folder of files named &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;ryan.*&quot;&lt;/code&gt; (such as &lt;code class=&quot;highlighter-rouge&quot;&gt;ryan.txt&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;ryan.gif&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;ryan.php&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;ryan.asp&lt;/code&gt;, etc.) and you want to rename them to &lt;code class=&quot;highlighter-rouge&quot;&gt;steve.*&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The first part displays a list of files that match the wildcard of ryan.* then it is piped to the second part (&lt;code class=&quot;highlighter-rouge&quot;&gt;awk '{print(&quot;mv &quot;$1&quot; &quot;$1)}'&lt;/code&gt;). This part prints a list of commands such as &lt;code class=&quot;highlighter-rouge&quot;&gt;mv ryan.txt ryan.txt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Well, that’s close but you want to move ryan.txt to steve.txt, not itself. This is where the third part comes in. What &lt;code class=&quot;highlighter-rouge&quot;&gt;sed&lt;/code&gt; does in this situation is replace &lt;strong&gt;any&lt;/strong&gt; instance of ryan with steve. The last part runs the whole thing as a list of shell commands.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>CSS Font List</title>
        <link href="https://tech.karbassi.com/2008/05/27/css-font-list/"/>
        <updated>2008-05-27T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/05/27/css-font-list</id>
        <content type="html">&lt;p&gt;While designing a simple website for a friend, I noticed that I knew nothing about the different font families I could use. While I have tons of fonts on my computer, I can’t use those on the web.&lt;/p&gt;

&lt;p&gt;I did a quick Google search and found a small list and here it is for you.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'American Typewriter', 'Courier New', Courier, Monaco, mono&quot;&gt;‘American Typewriter’, ‘Courier New’, Courier, Monaco, mono&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'Arial Rounded MT Bold', Helvetica, Arial, sans-serif&quot;&gt;‘Arial Rounded MT Bold’, Helvetica, Arial, sans-serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:Baskerville, Georgia, Garamond, 'Times New Roman', Times, serif&quot;&gt;Baskerville, Georgia, Garamond, ‘Times New Roman’, Times, serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'Book Antiqua', Georgia, Garamond, 'Times New Roman', Times, serif&quot;&gt;‘Book Antiqua’, Georgia, Garamond, ‘Times New Roman’, Times, serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'Bookman Old Style', Georgia, Garamond, 'Times New Roman', Times, serif&quot;&gt;‘Bookman Old Style’, Georgia, Garamond, ‘Times New Roman’, Times, serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'Brush Script MT', 'Comic Sans', sans-serif&quot;&gt;‘Brush Script MT’, ‘Comic Sans’, sans-serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:Chalkboard, 'Comic Sans', sans-serif&quot;&gt;Chalkboard, ‘Comic Sans’, sans-serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:Didot, Georgia, Garamond, 'Times New Roman', Times, serif&quot;&gt;Didot, Georgia, Garamond, ‘Times New Roman’, Times, serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:Futura, Impact, Helvetica, Arial, sans-serif&quot;&gt;Futura, Impact, Helvetica, Arial, sans-serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'Gill Sans', 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif&quot;&gt;‘Gill Sans’, ‘Lucida Grande’, ‘Lucida Sans Unicode’, Verdana, Helvetica, Arial, sans-serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif&quot;&gt;‘Helvetica Neue’, Helvetica, Arial, sans-serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'Hoefler Text', Garamond, Georgia, 'Times New Roman', Times, serif&quot;&gt;‘Hoefler Text’, Garamond, Georgia, ‘Times New Roman’, Times, serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'Lucida Grande', 'Lucida Sans Unicode', Lucida, Verdana, Helvetica, Arial, sans-serif&quot;&gt;‘Lucida Grande’, ‘Lucida Sans Unicode’, Lucida, Verdana, Helvetica, Arial, sans-serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'Marker Felt', 'Comic Sans' sans-serif&quot;&gt;‘Marker Felt’, ‘Comic Sans’ sans-serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:Myriad, Helvetica, Arial, sans-serif&quot;&gt;Myriad, Helvetica, Arial, sans-serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:Optima, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif&quot;&gt;Optima, ‘Lucida Grande’, ‘Lucida Sans Unicode’, Verdana, Helvetica, Arial, sans-serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:Palatino, 'Book Antiqua', Georgia, Garamond, 'Times New Roman', Times, serif&quot;&gt;Palatino, ‘Book Antiqua’, Georgia, Garamond, ‘Times New Roman’, Times, serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:Cochin, Georgia, Garamond, 'Times New Roman', Times, serif&quot;&gt;Cochin, Georgia, Garamond, ‘Times New Roman’, Times, serif&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-family:'Goudy Old Style', garamond, 'book antiqua', 'Times New Roman', Times, serif sequence&quot;&gt;‘Goudy Old Style’, garamond, ‘book antiqua’, ‘Times New Roman’, Times, serif sequence&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
    
    <entry>
        <title>Safari 3.1.1 and Saft 10.0.7</title>
        <link href="https://tech.karbassi.com/2008/04/16/safari-311-and-saft-1007/"/>
        <updated>2008-04-16T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/04/16/safari-311-and-saft-1007</id>
        <content type="html">&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-04-16/saft.jpg&quot; alt=&quot;Saft needs to be updated to handle Safari 3.1.1&quot; title=&quot;Saft needs to be updated to handle Safari 3.1.1&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I have always used &lt;a href=&quot;http://webkit.org/&quot;&gt;Webkit&lt;/a&gt; ever since switching to &lt;a href=&quot;http://www.apple.com/safari/&quot;&gt;Safari&lt;/a&gt; as my general browser. Being that I’m always getting the newest build, I know what’s coming when Safari decides to upgrade.&lt;/p&gt;

&lt;p&gt;Since &lt;a href=&quot;http://www.apple.com/support/downloads/safari311.html&quot;&gt;Apple updated Safari from 3.1 to 3.1.1&lt;/a&gt;, Saft, a wonderful “addon/plugin/what-have-you”, breaks. I know Hao Li at &lt;a href=&quot;http://haoli.dnsalias.com&quot;&gt;haoli.dnsalias.com&lt;/a&gt; will be updating it pretty soon, but I have found a quick fix until that is done.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Quit Safari.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Navigate to &lt;code class=&quot;highlighter-rouge&quot;&gt;Applications/Saft.app&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Control click to show package contents.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Open bundle and go to &lt;code class=&quot;highlighter-rouge&quot;&gt;Contents&lt;/code&gt;, then &lt;code class=&quot;highlighter-rouge&quot;&gt;Resources&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;Saft.bundle&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;Contents&lt;/code&gt;. You’re full path should be &lt;code class=&quot;highlighter-rouge&quot;&gt;Applications/Saft.app/Contents/Resources/Saft.bundle/Contents&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Double click or open &lt;code class=&quot;highlighter-rouge&quot;&gt;Info.plist&lt;/code&gt; in your favorite text editor.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Change &lt;code class=&quot;highlighter-rouge&quot;&gt;SaftSupportedSafariBuild&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;5525.18&lt;/code&gt;. This is to match the current Safari version/build. It will then look like this:
    &lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;SaftSupportedSafariBuild&lt;span class=&quot;nt&quot;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;array&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;string&amp;gt;&lt;/span&gt;5525.18&lt;span class=&quot;nt&quot;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Save and relaunch Safari.&lt;/li&gt;
&lt;/ol&gt;

</content>
    </entry>
    
    <entry>
        <title>How To Run Adium Aim Yahoo Msn Icq And Gtalk</title>
        <link href="https://tech.karbassi.com/2008/04/12/how-to-run-adium-aim-yahoo-msn-icq-and-gtalk/"/>
        <updated>2008-04-12T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/04/12/how-to-run-adium-aim-yahoo-msn-icq-and-gtalk</id>
        <content type="html">&lt;p&gt;Being that not all locations allow all ports to be accessed through their gateway to the internet, sometimes you will run into problems in connecting to your &lt;abbr title=&quot;Instant Messaging&quot;&gt;IM&lt;/abbr&gt; programs such as &lt;a href=&quot;http://www.apple.com/macosx/features/ichat.html&quot;&gt;iChat&lt;/a&gt; or, even better, &lt;a href=&quot;http://www.adiumx.com/&quot;&gt;Adium&lt;/a&gt;. The following steps should work for &lt;a href=&quot;http://www.pidgin.im/&quot;&gt;Pidgin&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, we know that all internet access points (WiFi spots, hotels, etc)  will allow Port 80. This is because it is the port most web servers output websites. You can see what other ports are used for on Wikipedia’s &lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers&quot;&gt;List of TCP and UDP port&lt;/a&gt; numbers page.&lt;/p&gt;

&lt;p&gt;So, we’re going to switch our Adium to connect through 80 and 443 (secure HTTP, or HTTPS as most refer to it as).&lt;/p&gt;

&lt;h3 id=&quot;aim&quot;&gt;AIM&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-04-12/AdiumAIM.jpg&quot; alt=&quot;Adium AIM&quot; title=&quot;Adium AIM&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Let’s start with the most common messenger, AIM . Set the &lt;strong&gt;port to 443&lt;/strong&gt; and the server should be the default for your application. At the time of this it is &lt;strong&gt;login.oscar.aol.com&lt;/strong&gt;.&lt;/p&gt;

&lt;h3 id=&quot;yim&quot;&gt;YIM&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-04-12/AdiumYIM.jpg&quot; alt=&quot;Adium YIM&quot; title=&quot;Adium YIM&quot; /&gt;&lt;/p&gt;

&lt;p&gt;For Yahoo, set the &lt;strong&gt;port to 80&lt;/strong&gt; and login server to &lt;strong&gt;scs.msg.yahoo.com&lt;/strong&gt;.&lt;/p&gt;

&lt;h3 id=&quot;msn&quot;&gt;MSN&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-04-12/AdiumMSN.jpg&quot; alt=&quot;Adium MSN&quot; title=&quot;Adium MSN&quot; /&gt;&lt;/p&gt;

&lt;p&gt;For MSN , set the &lt;strong&gt;port to 80&lt;/strong&gt; and the login server to &lt;strong&gt;messenger.hotmail.com&lt;/strong&gt;. Also check the “&lt;strong&gt;Connect via HTTP&lt;/strong&gt;” box. This allows access through port 80.&lt;/p&gt;

&lt;h3 id=&quot;google-talk&quot;&gt;Google Talk&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-04-12/AdiumGTalk.jpg&quot; alt=&quot;Adium GTalk&quot; title=&quot;Adium GTalk&quot; /&gt;&lt;/p&gt;

&lt;p&gt;For Google Talk, or I’d imagine any Jabber network, set the Transport Layer Security. Also be sure to check &lt;strong&gt;“Force old-style SSL”&lt;/strong&gt; and &lt;strong&gt;“Require SSL/TLS”&lt;/strong&gt;. If you check “Do strict certificate checks”, you will get a message box every time you try to load up Adium to accept a certificate. I have left this on, but I do know for a fact if you uncheck this, that message will not bother you again.&lt;/p&gt;

&lt;h3 id=&quot;icq&quot;&gt;ICQ&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-04-12/AdiumICQ.jpg&quot; alt=&quot;Adium ICQ&quot; title=&quot;Adium ICQ&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Lastly, if you are still using ICQ, you can set your &lt;strong&gt;port to 443&lt;/strong&gt; and login server to &lt;strong&gt;login.oscar.aol.com&lt;/strong&gt;. I wouldn’t suggest using ICQ anymore because it’s a pretty ~bad~ old service. Check out the &lt;a href=&quot;http://en.wikipedia.org/wiki/ICQ#Criticism&quot;&gt;criticisms on wikipedia&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, if you restart your Adium (or whatever client you are using), you should have connection to the IM protocols.&lt;/p&gt;

&lt;h3 id=&quot;draw-backs&quot;&gt;Draw backs&lt;/h3&gt;

&lt;p&gt;Some of the drawbacks to this method is that your data is being sent over an unsecured port, and therefore can be subject to any sniffers. If you are paranoid about your chats, I’d suggest using an online version such as &lt;a href=&quot;http://www.meebo.com/&quot;&gt;Meebo&lt;/a&gt; which does go through HTTPS.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Safari 3.1 and Pith Helmet</title>
        <link href="https://tech.karbassi.com/2008/03/19/safari-31-and-pith-helmet/"/>
        <updated>2008-03-19T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/03/19/safari-31-and-pith-helmet</id>
        <content type="html">&lt;p&gt;Recently Apple updated their browser Safari to version 3.1. It does boast new features that us web developers love, but it also crashes some hacks we also love. Note that I’m not calling them “plug-ins”. Read the &lt;a href=&quot;http://daringfireball.net/2007/10/un_in_unsupported&quot;&gt;reasoning behind this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, one of my favorite Safari hacks has been Pith Helmet and with the
new update, it is considered “broken.”&lt;/p&gt;

&lt;h3 id=&quot;heres-how-to-fix-it&quot;&gt;Here’s how to fix it:&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Quit Safari.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Navigate to &lt;code class=&quot;highlighter-rouge&quot;&gt;/Library/Application Support/SIMBL/Plugins/PithHelmet.bundle.&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Control click to show package contents.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Open bundle and go to Contents.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Double click or open &lt;code class=&quot;highlighter-rouge&quot;&gt;info.plist&lt;/code&gt; in your favorite text editor.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Change &lt;code class=&quot;highlighter-rouge&quot;&gt;MaxBundleVersion&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;5525.13&lt;/code&gt;. This is to match the current Safari version/build.&lt;/p&gt;

    &lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;MaxBundleVersion&lt;span class=&quot;nt&quot;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;string&amp;gt;&lt;/span&gt;5525.13&lt;span class=&quot;nt&quot;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Save and relaunch Safari.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

</content>
    </entry>
    
    <entry>
        <title>Facebook News Feed Filter</title>
        <link href="https://tech.karbassi.com/2008/03/13/facebook-news-feed-filter/"/>
        <updated>2008-03-13T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/03/13/facebook-news-feed-filter</id>
        <content type="html">&lt;p&gt;While stumbling around on Facebook, it seems like they accidentally released (or to me for a second) a new front page. The front page we usually see is the News Feed. The new page is the same News Feed, but filtered.&lt;/p&gt;

&lt;p&gt;I took the liberty to take some pictures.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-03-13/screen1.png&quot; alt=&quot;1&quot; title=&quot;Facebook's New News Feed Filter?&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-03-13/screen2.png&quot; alt=&quot;2&quot; title=&quot;Facebook's New News Feed Filter?&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-03-13/screen3.png&quot; alt=&quot;3&quot; title=&quot;Facebook's New News Feed Filter?&quot; /&gt;&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Must Have Free Mac Apps</title>
        <link href="https://tech.karbassi.com/2008/01/17/must-have-mac-apps-part-i-free-apps/"/>
        <updated>2008-01-17T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/01/17/must-have-mac-apps-part-i-free-apps</id>
        <content type="html">&lt;p&gt;A few friends of mine have recently switched over to Mac(Macintosh). I have been using my Macbook for some time now and have grown accustom to some applications. This will be a two part article. The following will be &lt;strong&gt;free&lt;/strong&gt; applications.&lt;/p&gt;

&lt;p&gt;This is the first tool I load on any Mac I use. What &lt;a href=&quot;http://www.blacktree.com/?quicksilver&quot;&gt;Quicksilver&lt;/a&gt; does is allow you to launch any application without actually looking inside the Finder/Application folder. Still confused? Check out &lt;a href=&quot;http://lifehacker.com/software/quicksilver/hack-attack-a-beginners-guide-to-quicksilver-247129.php&quot;&gt;many&lt;/a&gt; &lt;a href=&quot;http://www.youtube.com/watch?v=EBvFUhTqKK4&quot;&gt;resources&lt;/a&gt; that &lt;a href=&quot;http://guides.macrumors.com/Quicksilver&quot;&gt;explain&lt;/a&gt; all the ways to use Quicksilver.&lt;/p&gt;

&lt;p&gt;If you use any sort of &lt;abbr title=&quot;Instant Messaging&quot;&gt;IM&lt;/abbr&gt; such as &lt;abbr title=&quot;AOL Instant Messenger&quot;&gt;AIM&lt;/abbr&gt;, Yahoo, MSN, ICQ, Google Talk, or others, then &lt;a href=&quot;http://www.adiumx.com/&quot;&gt;Adium&lt;/a&gt; is perfect for you. It combines them all without any adds or an ugly design.&lt;/p&gt;

&lt;p&gt;WILL. PLAY. ANYTHING. Well, just about everything. &lt;a href=&quot;http://www.videolan.org/vlc/&quot;&gt;VLC&lt;/a&gt; does play more than Quicktime and the interface does integrate well into Mac OS X.&lt;/p&gt;

&lt;p&gt;A must have. &lt;a href=&quot;http://growl.info&quot;&gt;Growl&lt;/a&gt; displays little notifications on your screen for a few seconds. Great for anything and everything. A lot of programs use this.&lt;/p&gt;

&lt;p&gt;Mac OS X has a wonderful power management system. To conserve power it first dims your display before going to screensaver. As useful as that is, sometimes you can’t have your screen dim or go to screensaver. One example is when you are giving a presentation or watching/reading something. &lt;a href=&quot;http://lightheadsw.com/caffeine/&quot;&gt;Caffeine&lt;/a&gt; sits on your menu bar. To turn it on, click it. To turn it off, click it again. It’s that simple.&lt;/p&gt;

&lt;p&gt;Currently the best browser out there. Even though Safari is bundled with Mac OS X, I have grown to love &lt;a href=&quot;http://www.firefox.com&quot;&gt;Firefox&lt;/a&gt; a lot more. There is so much to say about Firefox. I would suggest reading “&lt;a href=&quot;http://mozillalinks.org/wp/2007/06/feature-by-feature-firefox-vs-safari/&quot;&gt;Feature by feature: Firefox vs. Safari&lt;/a&gt;” or doing your own &lt;a href=&quot;http://www.google.com/search?q=mac+browsers&quot;&gt;research&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/tools/&quot;&gt;Flickr Uploadr&lt;/a&gt; is the best thing for uploading to Flickr. Enough said.&lt;/p&gt;

&lt;p&gt;While Quicktime handles most types of videos, one problem is runs into is Windows Media files (mpg, mpeg, etc). &lt;a href=&quot;http://www.flip4mac.com/&quot;&gt;Flip4Mac&lt;/a&gt; fixes this problem.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://sourceforge.net/projects/cotvnc/&quot;&gt;Chicken of the VNC&lt;/a&gt; is a VNC client for Mac OS X. A VNC client allows you to connect, display, and use a remote computer. The different between this and Microsoft’s Remote Desktop is the speed and usability. Although both are free, I prefer this over Microsoft’s product.&lt;/p&gt;

&lt;p&gt;If you use Last.fm, then &lt;a href=&quot;http://www.last.fm/group/iScrobbler&quot;&gt;iScrobbler&lt;/a&gt; is a perfect tool for your iTunes collection. It beats out Last.fm’s own app. It does everything you need without taking up much space or resources.&lt;/p&gt;

&lt;p&gt;As an avid webcomic reader I read around 10 different comics almost daily. This produces the problem of loading all those websites. &lt;a href=&quot;http://www.joar.com/istrip/&quot;&gt;iStrip&lt;/a&gt; takes care of all that in a very simple, yet intuitive interface. I just hope it was opensource, but alas it is not. It does have 100s of webcomics already.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://mozy.com/?code=7HG3N1&quot;&gt;Mozy&lt;/a&gt; currently offers 2GB of free storage. I would suggest anyone to check them out. It automatically backs-up your important documents and application settings. It does a nightly backup and it can be configured to your hearts content.&lt;/p&gt;

&lt;p&gt;While Flip4Mac fixes Windows Media for Quicktime, &lt;a href=&quot;http://perian.org/&quot;&gt;Parian&lt;/a&gt; fixes most others.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://homepage.mac.com/holtmann/eidac/software/smcfancontrol2/index.html&quot;&gt;smcFanControl&lt;/a&gt; is an amazing app that allows you to control your Mac’s fan. This is a must have for any user of Macbook or Macbook Pro.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://wakaba.c3.cx/s/apps/unarchiver.html&quot;&gt;The Unarchiver&lt;/a&gt; is so much better than the industry “standard” StuffIt Expander. I’ve learned that StuffIt Expander is &lt;strong&gt;EXTREMELY&lt;/strong&gt; bloated and can be completely replaced with this or some others tools.&lt;/p&gt;

&lt;p&gt;As a regular IRC user, I have tested out many apps for just that. Not many have come close to mIRC on Windows, but &lt;a href=&quot;http://colloquy.info/&quot;&gt;Colloquy&lt;/a&gt; has come the closest.&lt;/p&gt;

&lt;p&gt;I am lucky to own a very nice digital camera but it does not have GPS. Geotagging is a must for avid photographers, however &lt;a href=&quot;http://craig.stanton.net.nz/software/Geotagger.html&quot;&gt;Geotagger&lt;/a&gt; solves that problem. All it requires is Google Earth (which is a free application) and your photographs. Easy as that.&lt;/p&gt;

&lt;p&gt;BitTorrent has taken over the world as the best way to share media files. While many believe it is only used for illegal uses, it is actually being used by many reliable sources, such as NASA. &lt;a href=&quot;http://www.transmissionbt.com&quot;&gt;Transmission&lt;/a&gt; is by far the best tool for just that.&lt;/p&gt;

&lt;p&gt;I wouldn’t suggest &lt;a href=&quot;http://lipidity.com/software/trimmit/&quot;&gt;Trimmit&lt;/a&gt; for everyone, but for a select few, this is a must have. Trimmit removes ‘pointless’ languages and other things from programs. I would think twice before using this on all your applications while it &lt;strong&gt;may&lt;/strong&gt; cause problems. The developer says it is completely safe. I haven’t ran into any problems myself, but take that with a grain of salt.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Futurama: Bender's Big Score - Binary Joke</title>
        <link href="https://tech.karbassi.com/2008/01/15/futurama-benders-big-score-binary-joke/"/>
        <updated>2008-01-15T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/01/15/futurama-benders-big-score-binary-joke</id>
        <content type="html">&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; It seems that &lt;a href=&quot;http://001100010010011110100001101101110011.com&quot;&gt;001100010010011110100001101101110011.com&lt;/a&gt; doesn’t exist anymore. Also, &lt;a href=&quot;http://ilovebender.com&quot;&gt;ilovebender.com&lt;/a&gt; has been bought out by &lt;a href=&quot;http://doubletwist.com&quot;&gt;doubletwist.com&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-01-15/screen1.png&quot; alt=&quot;1&quot; title=&quot;Bender's Big Score - Binary&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In &lt;a href=&quot;http://www.imdb.com/title/tt0471711/&quot;&gt;Futurama: Bender’s Big Score&lt;/a&gt;, Bender reads off a series of 0’s and 1’s to travel through time. Now I won’t go much into the movie, but the writers are known for their geek humor. You should really go buy the movie. It’s pretty cheap at &lt;a href=&quot;http://www.amazon.com/Futurama-Benders-Score-John-DiMaggio/dp/B000UZDO62&quot;&gt;Amazon&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2008-01-15/screen2.png&quot; alt=&quot;2&quot; title=&quot;Bender's Big Score - Binary&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now, if you take the whole thing by itself, it’s not a 16-bit code, but 32-bit. I believe IBM made a few super computers that handle 32-bit binary. With that said, we can’t just pump it into a binary-to-ASCII converter. Watching the movies I noticed that the binary code he reads is symmetrical. If you take the first half of each line you will notice that the binary is translated to 1, 2, 3, 4, 5, and 6. Wow, that simple.&lt;/p&gt;

&lt;p&gt;If you type the actual string out into google, you will notice that the producers have actually registered the domain &lt;a href=&quot;http://001100010010011110100001101101110011.com&quot;&gt;001100010010011110100001101101110011.com&lt;/a&gt; and displayed just one image. How nice of them. Unlike the site &lt;a href=&quot;http://ilovebender.com&quot;&gt;ilovebender.com&lt;/a&gt;, there is no other information on the page.&lt;/p&gt;

&lt;p&gt;They have set up a nice auto-responder to anything that goes to bender@ilovebender.com. It reads:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Dear New Friend,&lt;/p&gt;

  &lt;p&gt;Thank you for writing to me, Bender. It really means a lot to me. Not many humans contact me because I am so rude and impatient. You’re starting to get on my nerves now. Quit buggin’ me, meatbag!&lt;/p&gt;

  &lt;p&gt;P.S. - Buy my DVD.&lt;/p&gt;

  &lt;p&gt;Love,&lt;/p&gt;

  &lt;p&gt;Bender&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I’m glad to see writers, producers, directors, and whoever involved taking the extra measure to make the experience more enjoyable. Now go by the DVD.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Game that makes you think: Passage</title>
        <link href="https://tech.karbassi.com/2008/01/12/game-that-makes-you-think-passage/"/>
        <updated>2008-01-12T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/01/12/game-that-makes-you-think-passage</id>
        <content type="html">&lt;p&gt;&lt;a href=&quot;http://hcsoftware.sourceforge.net/passage/&quot;&gt;![Passage Screenshot][1]&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s been a long while since I’ve sat down and played a video game, especially on my macbook. Today I ran into a simple, yet very thought-provoking game, &lt;a href=&quot;http://hcsoftware.sourceforge.net/passage/&quot;&gt;Passage&lt;/a&gt;. Albeit, the game can be played on Windows, Linux, and Mac.  As you can see in the screenshot above, it’s a 8-bit type game with simple controls. I highly suggest you play the game once, then read the &lt;a href=&quot;http://hcsoftware.sourceforge.net/passage/statement.html&quot;&gt;Creator’s Statement&lt;/a&gt;. An excerpt is below:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;It presents an entire life, from young adulthood through old age and death, in the span of five minutes. Of course, it’s a game, not a painting or a film, so the choices that you make as the player are crucial. There’s no ‘right’ way to play Passage, just as there’s no right way to interpret it.&lt;/p&gt;
&lt;/blockquote&gt;

</content>
    </entry>
    
    <entry>
        <title>How to change bash prompt</title>
        <link href="https://tech.karbassi.com/2008/01/03/how-to-change-bash-prompt/"/>
        <updated>2008-01-03T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/01/03/how-to-change-bash-prompt</id>
        <content type="html">&lt;p&gt;Some people have asked me how I changed my bash/terminal prompt from the default prompt to what I have. It’s actually a very simple process.&lt;/p&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;![Change Terminal Prompt&lt;/td&gt;
      &lt;td&gt;Step 1]&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;First, load up Terminal and open up your &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.bash_profile&lt;/code&gt; file. (FYI, be sure to read the &lt;a href=&quot;http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html&quot;&gt;difference between .bash_profile and .bashrc&lt;/a&gt;.)&lt;/p&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;![Change Terminal Prompt&lt;/td&gt;
      &lt;td&gt;Step 2]&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Then type the following:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PS1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\w&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;gt;: &quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PS2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot; &amp;gt; &quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There are a lot of possible things you can enter. Here are some of them that work well:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;Command&lt;/th&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;Description&lt;/th&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;Example&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\a&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;ASCII bell character&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;–&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\d&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;the current date&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;Sun Feb 08&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\H&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;hostname&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;Ginger.local&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\h&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;shortened hostname&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;Ginger&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\u&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;your username&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;dave&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\w&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;current working directory&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;/Applications/Network&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\W&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;basename of the current working directory&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;Network&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\T&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;current time (12-hour HH:MM:SS format)&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;01:16:49&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\t&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;current time (HH:MM:SS format)&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;13:16:49&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\@&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;current time (12-hour AM/PM format)&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;1:16 PM&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\n&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;new line&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;–&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;print a backslash&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;\&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Table via &lt;a href=&quot;http://www.macdevcenter.com/pub/a/mac/2004/02/24/bash.html?page=2&quot;&gt;MacDevCenter.com&lt;/a&gt;.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>CheckUp - How to uninstall</title>
        <link href="https://tech.karbassi.com/2008/01/03/checkup-how-to-uninstall/"/>
        <updated>2008-01-03T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2008/01/03/checkup-how-to-uninstall</id>
        <content type="html">&lt;p&gt;I love installing, previewing, reviewing, alpha-, beta-, gamma- testing applications. This includes applications that might not work, might cause problems for me later on, or just plain suck. I have run into many of these programs/applications before. The last problem I want to deal with is not being able to &lt;strong&gt;fully&lt;/strong&gt; remove it.&lt;/p&gt;

&lt;p&gt;The latest of these problems has been &lt;a href=&quot;http://www.app4mac.com/checkup.html&quot;&gt;CheckUp&lt;/a&gt; by &lt;a href=&quot;http://www.app4mac.com/&quot;&gt;app4mac&lt;/a&gt;. As of this article, it’s in Preview 2. The reason why it’s called that is because many programmers are moving away from “beta” in the public eye being that &lt;strong&gt;every&lt;/strong&gt; web 2.0 website out there uses that word. This is basically Beta version #2.&lt;/p&gt;

&lt;p&gt;That being said, I will not talk about the application itself. I am will show you how to fully remove the application from Mac.&lt;/p&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;![Terminal&lt;/td&gt;
      &lt;td&gt;Remove Checkup]&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;First load up Terminal (in Finder go to &lt;code class=&quot;highlighter-rouge&quot;&gt;Utlities &amp;gt; Terminal.app&lt;/code&gt;). In terminal type:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;rm /Library/LaunchDaemons/com.app4mac.CheckUpAgent.plist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It will ask for your root password and once you type it in, it will remove the Launch Daemon.&lt;/p&gt;

&lt;p&gt;Next, remove the Application itself by physically removing it from your Application Folder and put it in your Trash.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>RSS Links Updated</title>
        <link href="https://tech.karbassi.com/2007/12/03/rss-links-updated/"/>
        <updated>2007-12-03T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/12/03/rss-links-updated</id>
        <content type="html">&lt;p&gt;I have updated my RSS Feed locations. Please update your reader to http://feeds.feedburner.com/karbassi/tech.&lt;/p&gt;

&lt;p&gt;The RSS for the comments are located at http://feeds.feedburner.com/karbassi/tech/comments.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Leopard: Turn off Bonjour (mDNSResponder)</title>
        <link href="https://tech.karbassi.com/2007/11/06/leopard-turn-off-bonjour-mdnsresponder/"/>
        <updated>2007-11-06T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/11/06/leopard-turn-off-bonjour-mdnsresponder</id>
        <content type="html">&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: [jaqkar ]noted in the comments that this does not work in Snow Leopard and because of good reason. As stated in the Apple Support Document &lt;a href=&quot;http://support.apple.com/kb/HT3789&quot;&gt;Mac OS X v10.6: Disabling mDNSResponder will disable DNS&lt;/a&gt;, “Mac OS X v10.6 uses the mDNSResponder process for unicast DNS (Domain Name System) functions, as well as Bonjour functions. Disabling the mDNSResponder process will also disable unicast DNS resolution, and without unicast DNS resolution, Mac OS X v10.6 cannot resolve hostnames such as www.apple.com.” On Apple’s Support site, there are instructions to disable Bonjour if need be.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I recently upgrades to Leopard and the operating system has been great. After installing my core set of programs, I noticed that &lt;a href=&quot;http://developer.apple.com/opensource/internet/bonjour.html&quot;&gt;mDNSResponder&lt;/a&gt; was going nuts. Being that I am on an university network, there are hundreds on the current sub-network. By default, Leopard has a “feature” that lists all the local computers (windows or mac) that it finds. This is called &lt;a href=&quot;http://en.wikipedia.org/wiki/Bonjour_%28software%29&quot;&gt;Bonjour&lt;/a&gt; You may know about this via &lt;a href=&quot;http://www.apple.com/ichat/&quot;&gt;iChat&lt;/a&gt;, or other programs. Sure, that’s nice, but does it take up &lt;em&gt;lots&lt;/em&gt; processes. Again, this would be nice upon request, but the task is done repeatedly. The load on your system just gets out of hand.&lt;/p&gt;

&lt;p&gt;After some research, I found that there is a Launch Daemon for this. Here’s how you turn it off, but don’t worry, you can turn it back on anytime, without restarts or anything.&lt;/p&gt;

&lt;p&gt;Load up Terminal (&lt;code class=&quot;highlighter-rouge&quot;&gt;Applications &amp;gt; Utilities &amp;gt; Terminal.app&lt;/code&gt;) and type the following.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl unload &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To turn it back on, just do the opposite:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;launchctl load &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Solution to The Spanner's &quot;A bit of fun&quot; challenge</title>
        <link href="https://tech.karbassi.com/2007/10/25/solution-to-the-spanners-a-bit-of-fun-challenge/"/>
        <updated>2007-10-25T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/10/25/solution-to-the-spanners-a-bit-of-fun-challenge</id>
        <content type="html">&lt;p&gt;A while back, &lt;a href=&quot;http://www.thespanner.co.uk/&quot;&gt;The Spanner&lt;/a&gt;’s very own Gareth Heyes posted a &lt;a href=&quot;http://www.thespanner.co.uk/2007/10/10/a-bit-of-fun/&quot;&gt;decent challenge&lt;/a&gt;. As I stated in &lt;a href=&quot;http://tech.karbassi.com/2007/10/10/javascript-octal-to-ascii/&quot;&gt;a previous posting&lt;/a&gt; I took on the challenge. It didn’t take as long as I thought it would, but it was still challenging. I’ve waited a while before posting the actual code I used; that way people can figure it out themselves without any spoilers. That being said, it’s about time I posted how I did it. Remember, my code might, and probably is, different than what you may have used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I use &lt;code class=&quot;highlighter-rouge&quot;&gt;console.debug&lt;/code&gt;, which is from &lt;a href=&quot;http://www.getfirebug.com/&quot;&gt;Firebug&lt;/a&gt; for &lt;a href=&quot;http://www.mozilla.com/en-US/firefox/&quot;&gt;Firefox&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 55 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 50 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 51 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 51 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 53 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 50 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 51 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 54 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 50 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 55 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 53 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 51 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 51 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 54 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 55 59'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;


&lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ncr2c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/&amp;amp;#x&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;([\d&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;a-f&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;]{2,4})&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;;/gi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fromCharCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;0x&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;octToAscii&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'%'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;\\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;n&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;notMatchedYet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;notMatchedYet&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;charAt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;running&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;partial&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fromCharCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;running&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/%40%/g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%40&amp;lt;br /&amp;gt;%&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Split up string into array&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;parts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// New parts&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// convert number into character code value&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;parts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;step1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fromCharCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;parseInt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;parts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]));&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Join all the values together&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;step1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;step1: %o&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Split again at the ';' point&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;';'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Pointless empty element at the end.&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;step2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// We still need the ';' at the end of each element&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;step2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;';'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;step2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ncr2c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Join all the values together, again.&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;step2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;step2: %o&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Split again by '%' point&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step3&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'%5C'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Pointless element in the beginning&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;step3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;step3: %o&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step4&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// convert number into character code value&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;step4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;octToAscii&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Our Answer&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;step4: %o&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;step4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hope this helps someone out there.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Replace Picasa with Flickr</title>
        <link href="https://tech.karbassi.com/2007/10/23/replace-picasa-with-flickr/"/>
        <updated>2007-10-23T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/10/23/replace-picasa-with-flickr</id>
        <content type="html">&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2007-10-23/gbar.png&quot; alt=&quot;Google Photo to Flickr&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Okay, maybe the title is a little misleading, but that’s what I wanted to do. I love &lt;a href=&quot;http://www.google.com&quot;&gt;Google&lt;/a&gt; for mostly everything, but one thing &lt;a href=&quot;http://www.yahoo.com&quot;&gt;Yahoo&lt;/a&gt; did right was to snatch up &lt;a href=&quot;http://www.flickr.com&quot;&gt;Flickr&lt;/a&gt;. Flickr has so much more to offer that &lt;a href=&quot;http://picasaweb.google.com/&quot;&gt;Picasa&lt;/a&gt; doesn’t. One side note though; Flickr doesn’t have a desktop photo organizer, but that’s no real loss for me.&lt;/p&gt;

&lt;p&gt;Nevertheless, I love how Google has started to add their “gbar” (Google Bar) to the top of all their applications. Even though they aren’t consistent, it’s nice to see, and use. After a while, I noticed myself clicking on Photo when I wanted to go to Flickr, not Picasa. Well, rather than fix my own stupid mistake and not click the link, I decided to fix the link and make it point to Flickr instead. Sorry Google, but I just enjoy Flickr more.&lt;/p&gt;

&lt;p&gt;Here’s how I did it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To use this script&lt;/strong&gt;, you need &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/748&quot;&gt;Greasemonkey&lt;/a&gt; add-on. Once you have it, just go here and click install: &lt;a href=&quot;http://userscripts.org/scripts/show/13244&quot;&gt;http://userscripts.org/scripts/show/13244&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// Google Photo Link with Flickr&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Version 1.0&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Date Written: 2007-10-23&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Last Modified: 2007-10-23 7:56 PM (19:56)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// (c) Copyright 2007 Ali Karbassi.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Released under the GPL license&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// http://www.gnu.org/copyleft/gpl.html&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// --------------------------------------------------------------------&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// This is a Greasemonkey user script.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Then restart Firefox and revisit this script.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Under Tools, there will be a new menu item to &quot;Install User Script&quot;.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Accept the default configuration and install.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// To uninstall, go to Tools/Manage User Scripts,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// select &quot;Google Photo Link with Flickr&quot;, and click Uninstall.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// --------------------------------------------------------------------&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// WHAT IT DOES:&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// After the facebook profile page is loaded, it finds all the&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// applications that your friends have invited you to and blocks them.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Do not worry though, you can go to&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// http://facebook.com/privacy.php?view=platform&amp;amp;tab=all and unblock&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// them&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// NOTE: This does not alter, delete, edit, add, or anything else to&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//       your facebook profile. Just remove or disable this script and&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//       everything will be displayed the same as it used to&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// --------------------------------------------------------------------&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// ==UserScript==&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// @name        Google Photo Link with Flickr 1.0&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @author      Ali Karbassi&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @namespace   http://www.karbassi.com&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @description Replaces the link on the Google Bar that says Photo from going to Picasa to Flickr.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @include     http://*.google.com*&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @include     http://google.com*&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// ==/UserScript==&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;bar&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'gbar'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;textContent&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Photos'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;c1&quot;&gt;// Replace the link from Picasa to Flickr; Sorry Google :(&lt;/span&gt;
                &lt;span class=&quot;nx&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'http://www.flickr.com'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

                &lt;span class=&quot;c1&quot;&gt;// Replace the text from Photo to Flickr&lt;/span&gt;
                &lt;span class=&quot;nx&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;textContent&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Flickr'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

                &lt;span class=&quot;c1&quot;&gt;// We found it, so there is no reason to continue.&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Unmount all mounted Apple Filing Protocol (AFP) volumes</title>
        <link href="https://tech.karbassi.com/2007/10/11/unmount-all-mounted-apple-filing-protocol-afp-volumes/"/>
        <updated>2007-10-11T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/10/11/unmount-all-mounted-apple-filing-protocol-afp-volumes</id>
        <content type="html">&lt;p&gt;I travel from location to location, jumping from one wireless access point to another. While I love my mac, but I’ve always hated that it stalls whenever I reconnect to a wireless network because I didn’t unmount my &lt;abbr title=&quot;Apple Filing Protocol&quot;&gt;AFP&lt;/abbr&gt;s before disconnecting. The operating system would give me the &lt;a href=&quot;http://en.wikipedia.org/wiki/Spinning_wait_cursor&quot;&gt;spinner of death&lt;/a&gt; for a few minutes before it stopped.&lt;/p&gt;

&lt;p&gt;I set out to fix this problem. More after the break.&lt;/p&gt;

&lt;p&gt;First, I wrote a script that will unmount all AFP mounts.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Unmount all Apple Filing Protocol (AFP) volumes that are currently&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# mounted&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Version 1.0&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Date Written: 2007-10-11&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Last Modified: 2007-10-11 02:03 PM (14:03)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# (c) Copyright 2007 Ali Karbassi.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Released under the GPL license&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# http://www.gnu.org/copyleft/gpl.html&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;df | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'afp'&lt;/span&gt; | wc &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; | sed &lt;span class=&quot;s1&quot;&gt;'s| ||g'&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'0'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;then
  &lt;/span&gt;umount &lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;df | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'afp'&lt;/span&gt; | sed &lt;span class=&quot;s1&quot;&gt;'s|.* /|/|'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Save the above to any location. I have a folder in my user directory called Scripts, so this file is located at &lt;code class=&quot;highlighter-rouge&quot;&gt;~/Scripts/unmountAllAFP.sh&lt;/code&gt;. Be sure to &lt;code class=&quot;highlighter-rouge&quot;&gt;chmod +x&lt;/code&gt; this file. You can do this like so:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chmod +x unmountAllAFP.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then you will need to install &lt;a href=&quot;http://www.bernhard-baehr.de/&quot;&gt;SleepWatcher&lt;/a&gt; (current version as of now is 2.0.4).&lt;/p&gt;

&lt;p&gt;After this is installed, load up terminal and follow along.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~
touch .sleep
chmod 0700 .sleep
mate .sleep
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note that I use &lt;a href=&quot;http://macromates.com/&quot;&gt;TextMate&lt;/a&gt;. You can replace &lt;code class=&quot;highlighter-rouge&quot;&gt;mate&lt;/code&gt; with &lt;code class=&quot;highlighter-rouge&quot;&gt;nano&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Once you have the &lt;code class=&quot;highlighter-rouge&quot;&gt;.sleep&lt;/code&gt; file open, add the absolute location of the script you want to run when your mac goes to sleep. For this example, we want our unmounting script to run. You should have the following in the file.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;~/Scripts/unmountAllAFP.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s it. This will run every-time your mac goes to sleep.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Javascript: Octal to ASCII</title>
        <link href="https://tech.karbassi.com/2007/10/10/javascript-octal-to-ascii/"/>
        <updated>2007-10-10T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/10/10/javascript-octal-to-ascii</id>
        <content type="html">&lt;p&gt;Gareth Heyes posted a &lt;a href=&quot;http://www.thespanner.co.uk/2007/10/10/a-bit-of-fun/&quot;&gt;fun little challenge&lt;/a&gt; and I couldn’t help but attack it. It took me longer than I thought. Not to be a spoiler, but at some point you have to convert octals to &lt;abbr title=&quot;American Standard Code for Information Interchange&quot;&gt;ASCII&lt;/abbr&gt; values. Now, I have done decimal to ASCII, binary to ASCII, and even hex to ASCII, but never octal to ASCII. Searching around, I found everyone seemed to use PHP, &lt;abbr title=&quot;Active Server Pages&quot;&gt;ASP&lt;/abbr&gt;, or some sort of “higher” level programming.&lt;/p&gt;

&lt;p&gt;I found some really old code on some google cache, which I lost the url to, and it seemed to work. By working, I mean, the idea was right, the code wasn’t. After fooling around with it for a bit, I got something like the following.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;octToAscii&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'%'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;\\&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;n&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;notMatchedYet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;notMatchedYet&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;charAt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;running&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;partial&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fromCharCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;running&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;temp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/%40%/g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%40&amp;lt;br /&amp;gt;%&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Gareth posted his answer as follows, but I cleaned up the styling a little to be more readable.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 55 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 50 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 51 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 51 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 53 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 50 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 51 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 54 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 50 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 55 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 53 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 51 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 52 59 38 35 120 51 48 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 51 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 54 59 38 35 120 51 52 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 49 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 53 59 38 35 120 51 54 59 38 35 120 50 53 59 38 35 120 51 53 59 38 35 120 52 51 59 38 35 120 51 49 59 38 35 120 51 52 59 38 35 120 51 55 59'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fromCharCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&amp;amp;#x/g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;';'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fromCharCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;parseInt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;unescape&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;);
d='';

for(i = 1; i &amp;lt; c.length; i++)
    d += String.fromCharCode(parseInt(c[i],8));

alert(d);
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;2018 update&lt;/strong&gt;: Just for fun.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;octToAscii&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;// Base 10&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;str&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fromCharCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;parseInt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;// Base 16&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&amp;amp;#x/g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;';'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fromCharCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;parseInt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;// Base 8&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;unescape&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;)
    .map(function(c) { return String.fromCharCode(parseInt(c, 8)); })
    .join('');

  return str;
};

console.log( octToAscii(c) );
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Programming Child Names or &quot;What not to name your children&quot;</title>
        <link href="https://tech.karbassi.com/2007/10/08/programming-child-names-or-what-not-to-name-your-children/"/>
        <updated>2007-10-08T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/10/08/programming-child-names-or-what-not-to-name-your-children</id>
        <content type="html">&lt;p&gt;Am I being too much of a geek to even consider this? I always thought it would be super cute (and nerdy) to name your child after something you love. Okay, maybe not for all loves, but it works for some loves. People name their children after their parents, grandparents, celebrities, and even pets; so why not name a child after programming languages. Maybe it’s too much of a commitment to name your child after a programming language, but maybe a pet.&lt;/p&gt;

&lt;p&gt;Here’s a short list of programming languages that could be names also. Bare with me.&lt;/p&gt;

&lt;dl&gt;
   &lt;dt&gt;Perl, Ruby&lt;/dt&gt;
      &lt;dd&gt;&quot;Pearl&quot; and &quot;Ruby&quot;; Both could be said to be named after jewels.&lt;/dd&gt;

   &lt;dt&gt;C, C++&lt;/dt&gt;
      &lt;dd&gt;Alright, you shouldn't name your child just one letter, but you can name him or her which starts with the character C. &lt;strong&gt;Examples&lt;/strong&gt;: Chris, Chad, Christy, Caroline, etc. Now, if you could make your child name their child with a C&lt;/dd&gt;

   &lt;dt&gt;PHP/ASP/JSP&lt;/dt&gt;
      &lt;dd&gt;You have to have a last name that starts with P. So, let's say you're last name is Perkins. You can name your children, Phillip Hurburt Perkins, Allison Susan Perkins, or Jenny Sandra Perkins.&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;On the other hand, you could always name a new programming language after your child. That would be incredibly sweet also. &lt;strong&gt;You decide: &lt;em&gt;too geeky or reasonable?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Javascript: ucfirst</title>
        <link href="https://tech.karbassi.com/2007/10/08/javascript-ucfirst/"/>
        <updated>2007-10-08T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/10/08/javascript-ucfirst</id>
        <content type="html">&lt;p&gt;In &lt;a href=&quot;http://www.php.net&quot;&gt;PHP&lt;/a&gt; there is &lt;a href=&quot;http://us.php.net/ucfirst&quot;&gt;ucfirst&lt;/a&gt; whose purpose is to uppercase the first letter of the string. While working in Javascript I ran into a problem where I wanted to do this. I searched high and low and couldn’t find a native function that would do this. So, I ended up writing my own.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ucfirst&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// Split the string into words if string contains multiple words.&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\s&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;+/g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

        &lt;span class=&quot;c1&quot;&gt;// Splits the word into two parts. One part being the first letter,&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// second being the rest of the word.&lt;/span&gt;
        &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;parts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;(\w)(\w&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

        &lt;span class=&quot;c1&quot;&gt;// Put it back together but uppercase the first letter and&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// lowercase the rest of the word.&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;parts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toUpperCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;parts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// Rejoin the string and return.&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A quick example on how to use it:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;hello my name is ali karbassi.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//hello my name is ali karbassi.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//HELLO MY NAME IS ALI KARBASSI.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toUpperCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//hello my name is ali karbassi.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//Hello My Name Is Ali Karbassi&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ucfirst&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; &lt;a href=&quot;http://tech.karbassi.com/2007/10/08/javascript-ucfirst/?dsq=8795098#comment-8795098&quot;&gt;Adam&lt;/a&gt; noted another way to do this.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\b([&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;a-z&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;])&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/gi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toUpperCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Automatically Block Facebook Applications</title>
        <link href="https://tech.karbassi.com/2007/09/19/automatically-block-facebook-applications/"/>
        <updated>2007-09-19T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/09/19/automatically-block-facebook-applications</id>
        <content type="html">&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2007-09-19/blocked.png&quot; alt=&quot;Facebook Blocked Applications Header&quot; /&gt;&lt;/p&gt;

&lt;p&gt;While working on the next version of my &lt;a href=&quot;http://tech.karbassi.com/2007/08/27/facebook-profile-cleaner/&quot;&gt;Facebook Profile Cleaner&lt;/a&gt;, I noticed something that I was doing. Every time I would log into Facebook, I would have 3-5 new application invites. Personally, I don’t care too much about them (if you didn’t know already). I set out to see if I could come up with a way to automatically block them upon sign on/request.&lt;/p&gt;

&lt;p&gt;That task seemed pretty easy, but it didn’t turn out to be. First of all, Facebook hides their “Block Application” button on you. The first place you see it is on the application’s page itself. Second, on the &lt;a href=&quot;http://facebook.com/reqs.php&quot;&gt;user’s request page&lt;/a&gt;. it only shows an &lt;strong&gt;add&lt;/strong&gt; and &lt;strong&gt;ignore&lt;/strong&gt;. If you click ignore, it ignores that specific request, not any future ones. This gets real annoying when a ton of your friends decide to add (and send you requests) of the same application. And third, I was worried that maybe I would want to remove a block later. However Facebook was kind enough to provide a page to “remove” blocked applications. By going to &lt;a href=&quot;http://facebook.com/privacy.php?view=platform&amp;amp;tab=all&quot;&gt;http://facebook.com/privacy.php?view=platform&amp;amp;tab=all&lt;/a&gt;, the second half of the page will list applications you have blocked. Notice they are listed by the order they were blocked; most recently blocked will be on the bottom.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://tech.karbassi.com/images/posts/2007-09-19/blocked2.png&quot; alt=&quot;Facebook Blocked Applications&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That being said, I set out to actually &lt;strong&gt;block&lt;/strong&gt; each application invite I get. After a few hours here and there, I finally got it fully working. The code should be clean enough for anyone interested enough to walk though. But note that if you just want the application and don’t care for the actual code, then just install it and be on your merry way :).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you have any suggestions, comments, or concerns, be sure to comment below.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To use this script&lt;/strong&gt;, you need &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/748&quot;&gt;Greasemonkey&lt;/a&gt; add-on. Once you have it, just go here and click install: &lt;a href=&quot;http://userscripts.org/scripts/show/12393&quot;&gt;http://userscripts.org/scripts/show/12393&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here’s the code:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// Auto-Block Facebook Apps&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Version 1.0&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Date Written: 2007-09-18&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Last Modified: 2007-09-19 12:51 PM (12:51)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// (c) Copyright 2007 Ali Karbassi.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Released under the GPL license&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// http://www.gnu.org/copyleft/gpl.html&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// --------------------------------------------------------------------&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// This is a Greasemonkey user script.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Then restart Firefox and revisit this script.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Under Tools, there will be a new menu item to &quot;Install User Script&quot;.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Accept the default configuration and install.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// To uninstall, go to Tools/Manage User Scripts,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// select &quot;Auto-Block Facebook Apps&quot;, and click Uninstall.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// --------------------------------------------------------------------&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// WHAT IT DOES:&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// After the facebook profile page is loaded, it finds all the&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// applications that your friends have invited you to and blocks them.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Do not worry though, you can go to&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// http://facebook.com/privacy.php?view=platform&amp;amp;tab=all and unblock&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// them&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// NOTE: This does not alter, delete, edit, add, or anything else to&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//       your facebook profile. Just remove or disable this script and&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//       everything will be displayed the same as it used to&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// --------------------------------------------------------------------&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// ==UserScript==&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// @name        Auto-Block Facebook Apps 1.0&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @author      Ali Karbassi&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @namespace   http://www.karbassi.com&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @description This script will block app invites sent to you by friends. After the facebook profile page is loaded, it finds all the applications that your friends have invited you to and blocks them. Do not worry though, you can go to http://facebook.com/privacy.php?view=platform&amp;amp;tab=all and unblock them.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @include     http://facebook.com/home.php*&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @include     http://*.facebook.com/home.php*&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @include     http://facebook.com/reqs.php*&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @include     http://*.facebook.com/reqs.php*&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// ==/UserScript==&lt;/span&gt;



&lt;span class=&quot;c1&quot;&gt;// Find Subdomain&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;subDomain&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;getSubDomain&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Get links on the front page/request page&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;anchors&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;appReqExp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/reqs&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;php#confirm_&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;(\d&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;anchors&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;appReqExp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;anchors&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;prep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;RegExp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;anchors&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Remove any notifications about apps.&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;removeNotifications&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;


&lt;span class=&quot;c1&quot;&gt;// Functions&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// PLEASE DO NOT TOUCH IF YOU HAVE NO IDEA WHAT YOU'RE DOING. YOU MIGHT BREAK IT.&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Prepares everything. When things are correct, it calls BlockApp.&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;prep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;appID&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;appNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;postformMatch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/name=&quot;post_form_id&quot; value=&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;(\w&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;&quot;/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;post_form_id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;GM_xmlhttpRequest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'GET'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'http://www.facebook.com/apps/block.php?id='&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;appID&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'&amp;amp;action=block'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'User-Agent'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;navigator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;userAgent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'Accept'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'text/html'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;onload&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;responseDetails&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;responseDetails&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;responseDetails&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;responseText&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'This will not prevent you from seeing'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;c1&quot;&gt;// Show that we are working on it.&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;appNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;removeAttribute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'href'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;appNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHTML&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Reading confirmation page...'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

          &lt;span class=&quot;nx&quot;&gt;postformMatch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;responseDetails&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;responseText&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

          &lt;span class=&quot;c1&quot;&gt;// Calls function to block the app&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;BlockApp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;RegExp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;appID&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;appNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;BlockApp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;post_form_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;appID&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;appNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;GM_xmlhttpRequest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'POST'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'http://'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;subDomain&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'facebook.com/apps/block.php?id='&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;appID&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'&amp;amp;action=block'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'User-Agent'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;navigator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;userAgent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'Accept'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'text/xml'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'Content-Type'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'application/x-www-form-urlencoded'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'post_form_id='&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;post_form_id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'&amp;amp;save=1'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;onload&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;responseDetails&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;responseDetails&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;responseDetails&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;responseText&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'You have blocked this application'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;appNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHTML&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'App Blocked!'&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;appNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'http://facebook.com/reqs.php'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;onerror&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;responseDetails&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;appNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;removeAttribute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'href'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;appNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHTML&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'App Block failed!'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;removeNotifications&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;inputs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'input'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Ignore'&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;attributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;attributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;nodeName&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'onclick'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;attributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;nodeValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'click_add_platform_app'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;js&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;attributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;nodeValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;js&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'javascript:'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;getSubDomain&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;subDomainRegExp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/http:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\/\/(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\.)&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;facebook&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;com/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;subDomain&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;subDomainRegExp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;subDomain&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;RegExp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;subDomain&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Facebook Profile Cleaner</title>
        <link href="https://tech.karbassi.com/2007/08/27/facebook-profile-cleaner/"/>
        <updated>2007-08-27T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/08/27/facebook-profile-cleaner</id>
        <content type="html">&lt;p&gt;I use &lt;a href=&quot;http://www.facebook.com&quot;&gt;Facebook&lt;/a&gt; the way you should; for keeping track of my friends, their information, planning events, discussing things, etc. I don’t believe that Facebook should be another &lt;a href=&quot;http://www.myspace.com&quot;&gt;MySpace&lt;/a&gt; (a popularity contest).&lt;/p&gt;

&lt;p&gt;That being aside, I didn’t enjoy the fact that Facebook now allows “apps” (applications/widgets) to be added to profiles. Sure, some applications are useful, but like MySpace, it gets annoying. So, with that I created a &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/748&quot;&gt;Greasemonkey&lt;/a&gt; script to remove, per se, all those apps. You can also specify others, such as “Mini-Feed”, “Education”, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To use this script&lt;/strong&gt;, you need &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/748&quot;&gt;Greasemonkey&lt;/a&gt; add-on. Once you have it, just go here and click install: &lt;a href=&quot;http://userscripts.org/scripts/show/11747&quot;&gt;http://userscripts.org/scripts/show/11747&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I spent around 1 hour and whipped it up and it works better wonders. To me, it loads the page faster. Here’s the code:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// Facebook Profile Cleaner&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Version 1.0&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Date Written: 2007-08-26&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Copyright (c) 2007, Ali Karbassi&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Released under the GPL license&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// http://www.gnu.org/copyleft/gpl.html&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// --------------------------------------------------------------------&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// This is a Greasemonkey user script.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Then restart Firefox and revisit this script.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Under Tools, there will be a new menu item to &quot;Install User Script&quot;.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Accept the default configuration and install.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// To uninstall, go to Tools/Manage User Scripts,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// select &quot;Facebook Profile Cleaner&quot;, and click Uninstall.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// --------------------------------------------------------------------&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// WHAT IT DOES:&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// After the facebook profile page is loaded, it finds all the&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// applications that are not in the list below and 'removes' them. By&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// remove, I mean, not display them.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// NOTE: This does not alter, delete, edit, add, or anything else to&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//       your facebook profile. Just remove or disable this script and&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//       everything will be displayed the same as it used to&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// --------------------------------------------------------------------&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// ==UserScript==&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @name           Facebook Profile Cleaner&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @namespace      http://tech.karbassi.com/&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @description    Removes applications from all profiles. Clean out&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//                 all those annoying applications people add. This&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//                 script will remove all the applications (plus&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//                 others if specified) from any facebook profile&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//                 you view.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// @include        http://*.facebook.com/*&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// ==/UserScript==&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Comment out the ones you don't want displayed&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Note: This list is the 'original' apps&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;AppsToKeep&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
		&lt;span class=&quot;s1&quot;&gt;'box_app_2407511955'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;	&lt;span class=&quot;c1&quot;&gt;// Mutual Friends&lt;/span&gt;
		&lt;span class=&quot;s1&quot;&gt;'box_app_2356318349'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;	&lt;span class=&quot;c1&quot;&gt;// Local Network Friends&lt;/span&gt;
		&lt;span class=&quot;c1&quot;&gt;//'box_app_2503140832',	// Friends in Other Networks&lt;/span&gt;
		&lt;span class=&quot;s1&quot;&gt;'box_app_2305272732'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;	&lt;span class=&quot;c1&quot;&gt;// Photos&lt;/span&gt;
		&lt;span class=&quot;c1&quot;&gt;//'box_app_2347471856',	// Notes&lt;/span&gt;
		&lt;span class=&quot;c1&quot;&gt;//'box_app_2361831622',	// Groups&lt;/span&gt;
		&lt;span class=&quot;c1&quot;&gt;//'box_app_2341989679',	// Mini-Feed&lt;/span&gt;
		&lt;span class=&quot;s1&quot;&gt;'box_app_2327158227'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;	&lt;span class=&quot;c1&quot;&gt;// Information&lt;/span&gt;
		&lt;span class=&quot;s1&quot;&gt;'box_app_2297529396'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;	&lt;span class=&quot;c1&quot;&gt;// Education and Work&lt;/span&gt;
		&lt;span class=&quot;c1&quot;&gt;//'box_app_2386512837',	// Gifts&lt;/span&gt;
		&lt;span class=&quot;s1&quot;&gt;'box_app_2719290516'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;	&lt;span class=&quot;c1&quot;&gt;// The Wall&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;


&lt;span class=&quot;c1&quot;&gt;// DO NOT EDIT&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Well, unless you know what you're doing&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;inArray&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;--&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;pageDivs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'div'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Delete application divs&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;pageDivs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;pageDivs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'box_app_'&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;AppsToKeep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;inArray&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;pageDivs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;nx&quot;&gt;pageDivs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'none'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Cols and Colgroups</title>
        <link href="https://tech.karbassi.com/2007/08/16/cols-and-colgroups/"/>
        <updated>2007-08-16T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/08/16/cols-and-colgroups</id>
        <content type="html">&lt;p&gt;Who loves working with tables in HTML(Hypertext Markup Language) or XHTML(Extensible HyperText Markup Language)?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;sarcasm&amp;gt;&lt;/code&gt; I know I do! &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;/sarcasm&amp;gt;&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Recently I’ve been working with trying to get a column in a table to format correctly. It’s something very simple; I have 3 columns and X rows. I want the first column to be aligned left while the other columns to aligned right. Also, I want to style each column differently. Going through &lt;a href=&quot;http://www.w3.org&quot;&gt;W3C&lt;/a&gt;’s &lt;a href=&quot;http://www.w3.org/TR/html4&quot;&gt;HTML 4.01 Specification&lt;/a&gt;, I found &lt;a href=&quot;http://www.w3.org/TR/html4/struct/tables.html#h-11.2.4&quot;&gt;column groups&lt;/a&gt;. After a few minutes of reading, it looked like exactly what I needed.&lt;/p&gt;

&lt;p&gt;I grabbed &lt;a href=&quot;http://www.w3.org/TR/html4/struct/tables.html#sample&quot;&gt;W3C’s sample table&lt;/a&gt; to test with. Wow, that didn’t work. I dumped their code into a page (and fixed it so it validates with XHTML 1.0 Strict) so you can see it’s not what they say it should be. Surprisingly it doesn’t work the way they say it does.&lt;/p&gt;

&lt;p&gt;I went looking for some answers and &lt;a href=&quot;http://archivist.incutio.com/viewlist/css-discuss/79793&quot;&gt;Mark J. Reed&lt;/a&gt;  said it best:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;First, you should know that due to the CSS rendering model, &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;col&amp;gt;&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;colgroup&amp;gt;&lt;/code&gt; are both severely limited in what styling they support (at least outside of IE, which violates the CSS rendering model to provide them more power, breaking other things in the process). To be precise, there are only four things you’re allowed to do with a table-column (individual or group) style:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;set the background color&lt;/li&gt;
    &lt;li&gt;set the width&lt;/li&gt;
    &lt;li&gt;set up a border&lt;/li&gt;
    &lt;li&gt;control visibility&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;That’s it. You can’t make a column bold or in a different font or give it centered text or any of the other things that seem perfectly reasonable before you dive into the detailed requirements of the CSS spec.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So what now? Will HTML5 fix this? I rather not use some hack to do something that should work already.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Mac Tip #2: Automatic iTunes Podcast Playlist</title>
        <link href="https://tech.karbassi.com/2007/07/20/mac-tip-2-automatic-itunes-podcast-playlist/"/>
        <updated>2007-07-20T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/07/20/mac-tip-2-automatic-itunes-podcast-playlist</id>
        <content type="html">&lt;p&gt;I show you how to listen to your podcasts continuously. I hope you like it.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Mac Tip #1: Setting Two Sound Settings</title>
        <link href="https://tech.karbassi.com/2007/07/11/mac-tip-1-setting-two-sound-settings/"/>
        <updated>2007-07-11T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/07/11/mac-tip-1-setting-two-sound-settings</id>
        <content type="html">&lt;p&gt;Mac Tip #1: A very simple how to on how to set two different sound settings.&lt;/p&gt;

&lt;iframe width=&quot;600&quot; height=&quot;450&quot; src=&quot;http://www.youtube.com/embed/xV3f-98XTf4&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
</content>
    </entry>
    
    <entry>
        <title>What is detroit.app.Application?</title>
        <link href="https://tech.karbassi.com/2007/06/27/what-is-detroitappapplication/"/>
        <updated>2007-06-27T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/06/27/what-is-detroitappapplication</id>
        <content type="html">&lt;p&gt;Recently &lt;a href=&quot;http://docs.google.com&quot;&gt;Google Docs &amp;amp; Spreadsheets&lt;/a&gt; released a &lt;a href=&quot;http://google-d-s.blogspot.com/2007/06/entirely-new-way-to-stay-organized.html&quot;&gt;new version&lt;/a&gt; of their wonderful application. It’s a wonderful new interface and foreshadows what Google Docs is going to turn into.&lt;/p&gt;

&lt;p&gt;Like always, I went snooping around to see what I could find. It’s usually fun to see what they didn’t implement yet. Taking a look at the &lt;a href=&quot;http://docs.google.com/doclist/client/js/434292853-doclist_local.js&quot;&gt;javascript source&lt;/a&gt; (notice the link might change) I found something very interesting.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;ac&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_P&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Ca&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;k&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;[detroit.app.Application] Not implemented&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Apart from it being “Google Code” (no useful variable names), it shows that their is an application called “detroit.app” being developed. There is a &lt;a href=&quot;http://maps.google.com/maps?q=2000+Town+Center,+Suite+1900,+Southfield,+MI+(Google+Detroit)&quot;&gt;Google Sales office in Detroit&lt;/a&gt;, but apart from that, I could not find anything related.&lt;/p&gt;

&lt;p&gt;Most applications will have a codename before it’s final release. So now our part is to figure out what “detroit.app.Application” is.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; There seems to be many calls to “detroit.ui.” however. One of them is “detroit.ui.Pager”. The name “detroit” could be the code-name for the next release.&lt;/p&gt;
&lt;/blockquote&gt;

</content>
    </entry>
    
    <entry>
        <title>Presentations coming to Google Docs &amp; Spreadsheets.</title>
        <link href="https://tech.karbassi.com/2007/06/27/presentations-coming-to-google-docs-spreadsheets/"/>
        <updated>2007-06-27T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/06/27/presentations-coming-to-google-docs-spreadsheets</id>
        <content type="html">&lt;p&gt;Taking a snoop into the new (&lt;a href=&quot;http://www.techcrunch.com/2007/06/26/google-docs-gets-folders-now-what-about-gmail/&quot;&gt;mentioned everywhere&lt;/a&gt;) Google Doc &amp;amp; Spreadsheets javascript, I found an the icon for Presentation. Presentation is basically Keynote on Mac or Powerpoint on Windows.&lt;/p&gt;

&lt;p&gt;The Presentation icon &lt;img src=&quot;http://tech.karbassi.com/images/posts/2007-06-27/presentation.gif&quot; alt=&quot;Presentation Icon&quot; title=&quot;Presentation Icon&quot; /&gt; might join the already implemented are the Google Document icon &lt;img src=&quot;http://tech.karbassi.com/images/posts/2007-06-27/document.gif&quot; alt=&quot;Document Icon&quot; title=&quot;Document Icon&quot; /&gt; and Google Spreadsheet icon &lt;img src=&quot;http://tech.karbassi.com/images/posts/2007-06-27/spreadsheet.gif&quot; alt=&quot;Spreadsheet Icon&quot; title=&quot;Spreadsheet Icon&quot; /&gt;.&lt;/p&gt;

&lt;p&gt;It seems Google is pushing towards the Office App that has been rumored.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Conky</title>
        <link href="https://tech.karbassi.com/2007/03/06/conky/"/>
        <updated>2007-03-06T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/03/06/conky</id>
        <content type="html">&lt;p&gt;I’ve been asked several times about how I set up my &lt;a href=&quot;http://conky.sourceforge.net/&quot;&gt;Conky&lt;/a&gt;. First a little about Conky. It is a light-weight system monitor, according to their website, but you &lt;a href=&quot;http://conky.sourceforge.net/screenshots.html&quot;&gt;can do much more&lt;/a&gt;. You can show basic system stats to grab RSS Feeds to show your Media Player (&lt;a href=&quot;http://amarok.kde.org/&quot;&gt;Amarok&lt;/a&gt; for me) status.&lt;/p&gt;

&lt;p&gt;Now onto my configurations. Rather than explain each thing, I will show you how mine is set up (without the RSS, weather, and Amarok).&lt;/p&gt;

&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# UBUNTU-CONKY
# A comprehensive conky script, configured for use on
# Ubuntu / Debian Gnome, without the need for any external scripts.
#
# Based on conky-jc and the default .conkyrc.
# INCLUDES:
# - tail of /var/log/messages
# - netstat connections to your computer
#
# -- Pengo (conky@pengo.us)
#
&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# set to yes if you want tormo to be forked in the background
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;background&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;no&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;cpu_avg_samples&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;net_avg_samples&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2&lt;/span&gt;

&lt;span class=&quot;err&quot;&gt;out_to_console&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;no&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Create own window instead of using desktop (required in nautilus)
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;own_window&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;yes&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;own_window_type&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;override&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;own_window_transparent&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;yes&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;own_window_hints&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;undecorated,below,sticky,skip_taskbar,skip_pager&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;own_window_colour&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;brown&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Use double buffering (reduces flicker, may not work for everyone)
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;double_buffer&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;yes&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Subtract file system buffers from used memory?
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;no_buffers&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;yes&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# fiddle with window
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;use_spacer&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;yes&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;use_xft&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;no&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Update interval in seconds
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;update_interval&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Minimum size of text area
# minimum_size 250 5
&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Draw shades?
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;draw_shades&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;no&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;draw_borders&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;no&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Text stuff
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;draw_outline&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;no&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# amplifies text if yes
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;draw_borders&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;no&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;xftfont&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;Monospace:&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;xftalpha&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;0.8&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;uppercase&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;no&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# set to yes if you want all text to be in uppercase
&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Stippled borders?
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;stippled_borders&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;3&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# border margins
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;border_margin&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;9&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# border width
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;border_width&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;10&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Default colors and also border colors, grey90 == #e5e5e5
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;default_color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;gray&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Text alignment, other possible values are commented
#alignment top_left
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;alignment&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;top_right&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#alignment bottom_left
#alignment bottom_right
&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Gap between borders of screen and text
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;gap_x&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;gap_y&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;10&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# stuff after 'TEXT' will be formatted on screen
&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;TEXT&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}$alignc$sysname&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$kernel&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$machine&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}$alignc${exec&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;whoami}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;@&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$nodename&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;orange}INFORMATION&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${hr&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}Date:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}${time&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;%A,%d&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;%B}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}Time:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}${time&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;%k:%M:%S}${alignr}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}Uptime:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}$uptime&lt;/span&gt;

&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;orange}CPU&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${hr&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;Freq:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${freq}MHz&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${alignr}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}Load:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${loadavg}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}$cpubar&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${cpugraph&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;FCD116}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}NAME&lt;/span&gt;             &lt;span class=&quot;err&quot;&gt;PID&lt;/span&gt;       &lt;span class=&quot;err&quot;&gt;CPU%&lt;/span&gt;      &lt;span class=&quot;err&quot;&gt;MEM%${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;1}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;1}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;cpu&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;1}&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;mem&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;1}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;cpu&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2}&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;mem&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;3}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;3}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;cpu&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;3}&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;mem&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;3}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;4}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;4}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;cpu&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;4}&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;mem&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;4}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;5}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;5}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;cpu&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;5}&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;mem&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;5}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;6}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;6}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;cpu&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;6}&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;mem&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;6}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;7}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;7}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;cpu&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;7}&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;mem&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;7}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;8}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;8}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;cpu&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;8}&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;mem&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;8}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;9}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;9}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;cpu&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;9}&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;mem&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;9}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;10}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;10}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;cpu&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;10}&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;${top&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;mem&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;10}&lt;/span&gt;

&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;orange}MEMORY&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${hr&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;RAM:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;$memperc%&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}${membar&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;6}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;Swap:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt;  &lt;span class=&quot;err&quot;&gt;$swapperc%&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}${swapbar&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;6}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;

&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;orange}DISK&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${hr&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;Linux&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;(${fs_size&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;/})${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${fs_bar&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;6&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;/}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;Windows&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;(${fs_size&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;/media/windows})${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt;  &lt;span class=&quot;err&quot;&gt;${fs_bar&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;6&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;/media/windows}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;Storage&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;(${fs_size&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;/media/storage})${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${fs_bar&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;6&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;/media/storage}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;Web&lt;/span&gt;     &lt;span class=&quot;err&quot;&gt;(${fs_size&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;/media/web})${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt;  &lt;span class=&quot;err&quot;&gt;${fs_bar&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;6&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;/media/web}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;

&lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;orange}NETWORK&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;(${addr&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;eth0})&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${hr&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;2}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;Down:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${downspeed&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;eth0}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;k/s&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${alignr}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}Up:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${upspeed&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;eth0}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;k/s${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;${downspeedgraph&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;eth0&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;25,140&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;ff0000}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${alignr}${upspeedgraph&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;eth0&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;25,140&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;00ff00}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;Total:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${totaldown&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;eth0}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${alignr}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}Total:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${totalup&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;eth0}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;Inbound:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${tcp_portmon&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;32767&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;count}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}Outbound:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${tcp_portmon&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;32768&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;61000&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;count}${alignr}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}Total:${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;white}&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;${tcp_portmon&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;65535&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;count}${color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;000000}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Create a list of installed packages</title>
        <link href="https://tech.karbassi.com/2007/01/21/create-a-list-of-installed-packages/"/>
        <updated>2007-01-21T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/01/21/create-a-list-of-installed-packages</id>
        <content type="html">&lt;p&gt;Ever wanted to know what applications are actually installed on your system? Sure you can view the applications via the applications bar, but there are so many other applications not shown there.&lt;/p&gt;

&lt;p&gt;Also, what if you have your system with all the applications you want and want to install them again on another PC (or after a reinstall)? &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=261366&quot;&gt;Cynical&lt;/a&gt; shows us how to do that with a few simple steps.&lt;/p&gt;

&lt;p&gt;To output this information to a file in your home directory you would use:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dpkg &lt;span class=&quot;nt&quot;&gt;--get-selections&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; installed-software
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;installed-software&lt;/code&gt; is actually just a text file. You can open it to view it, but don’t modify it if you don’t know what you’re doing. It might screw up the next step.&lt;/p&gt;

&lt;p&gt;If you wanted to use the list to reinstall this software on a fresh Ubuntu setup or on another computer, just do the following steps:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dpkg &lt;span class=&quot;nt&quot;&gt;--set-selections&lt;/span&gt; &amp;lt; installed-software
dselect
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get autoremove
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get autoclean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Convert any (or most) files to another format</title>
        <link href="https://tech.karbassi.com/2007/01/20/convert-any-or-most-files-to-another-format/"/>
        <updated>2007-01-20T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/01/20/convert-any-or-most-files-to-another-format</id>
        <content type="html">&lt;p&gt;So, I was stuck with an OpenOffice text document (&lt;code class=&quot;highlighter-rouge&quot;&gt;.odt&lt;/code&gt;) and the place were I was at didn’t have OpenOffice. They were using a Microsoft Office version (2000/XP I believe). What was I to do? A presentation due and I had no way of accessing my files.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://media-convert.com/&quot;&gt;Media Convert&lt;/a&gt; to the rescue. Yes, I know I sound like an advertisement, but this website has saved me multiple times. With just an internet connection, I can convert a OpenOffice Text Document to a &lt;code class=&quot;highlighter-rouge&quot;&gt;.doc&lt;/code&gt; in a few seconds.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Gnome and Google Calendar</title>
        <link href="https://tech.karbassi.com/2007/01/16/gnome-and-google-calendar/"/>
        <updated>2007-01-16T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/01/16/gnome-and-google-calendar</id>
        <content type="html">&lt;p&gt;Britt Selvitelle writes on how to combine &lt;a href=&quot;http://lukewarmtapioca.com/2006/12/8/google-calendar-meet-ubuntu&quot;&gt;Google Calendar and Ubuntu&lt;/a&gt;. His post is based on &lt;a href=&quot;http://www.gnome.org/~clarkbw/&quot;&gt;Bryan Clark’s&lt;/a&gt; post on &lt;a href=&quot;http://www.gnome.org/~clarkbw/blog/Mashing_Google_Calendar_and_GNOME&quot;&gt;Mashing Google Calendar and GNOME&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let’s get down to business.&lt;/p&gt;

&lt;p&gt;First open up a &lt;code class=&quot;highlighter-rouge&quot;&gt;terminal&lt;/code&gt; by going to &lt;strong&gt;Applications &amp;gt; Accessories &amp;gt; Terminal&lt;/strong&gt; (in Ubuntu) or press &lt;code class=&quot;highlighter-rouge&quot;&gt;Alt + F2&lt;/code&gt; and type in &lt;code class=&quot;highlighter-rouge&quot;&gt;terminal&lt;/code&gt;. Now that you have a terminal open, let’s get down to viewing your history.&lt;/p&gt;

&lt;p&gt;Ubuntu users type:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/usr/lib/evolution-webcal/evolution-webcal &lt;span class=&quot;nv&quot;&gt;$GOOGLE_ICAL_URL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For any other &lt;a href=&quot;http://www.gnome.org/&quot;&gt;GNOME&lt;/a&gt; environment:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/usr/libexec/evolution-webcal &lt;span class=&quot;nv&quot;&gt;$GOOGLE_ICAL_URL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I hope you notice the difference.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>View and Change bash history</title>
        <link href="https://tech.karbassi.com/2007/01/14/view-and-change-bash-history/"/>
        <updated>2007-01-14T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/01/14/view-and-change-bash-history</id>
        <content type="html">&lt;p&gt;Always wanted to know what you have been doing via bash? Did you know bash keeps a history of that? Here is a quick way to check it and an easy way to change the history limit.&lt;/p&gt;

&lt;p&gt;First open up a &lt;code class=&quot;highlighter-rouge&quot;&gt;terminal&lt;/code&gt; by going to &lt;code class=&quot;highlighter-rouge&quot;&gt;Applications &amp;gt; Accessories &amp;gt; Terminal&lt;/code&gt; (in Ubuntu) or press &lt;code class=&quot;highlighter-rouge&quot;&gt;Alt + F2&lt;/code&gt; and type in &lt;code class=&quot;highlighter-rouge&quot;&gt;terminal&lt;/code&gt;. Now that you have a terminal open, let’s get down to viewing your history.&lt;/p&gt;

&lt;p&gt;To view your history via the terminal, type:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;history&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will show the whole list.&lt;/p&gt;

&lt;p&gt;To view your history in a editor (to save for later), just type:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;history&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; ~/history.txt
vim ~/history.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What &lt;code class=&quot;highlighter-rouge&quot;&gt;history -w ~/history.txt&lt;/code&gt; does is save the &lt;code class=&quot;highlighter-rouge&quot;&gt;history&lt;/code&gt; to a file named &lt;code class=&quot;highlighter-rouge&quot;&gt;history.txt&lt;/code&gt; on your home folder (&lt;code class=&quot;highlighter-rouge&quot;&gt;cd ~/&lt;/code&gt;). The next command opens up the file for viewing in &lt;code class=&quot;highlighter-rouge&quot;&gt;vim&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; For more information about &lt;code class=&quot;highlighter-rouge&quot;&gt;history&lt;/code&gt; be sure to use the man pages by doing:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;man &lt;span class=&quot;nb&quot;&gt;history&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now to change your bash history length, just open up your &lt;code class=&quot;highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt; by doing so:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vim ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once open, at the top add.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HISTFILESIZE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;3000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see, the limit can be changed.&lt;/p&gt;

&lt;p&gt;Bash keeps it’s own history in a file. You can view that file as stated before, or by opening &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.bash_history&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can search through your bash_history by piping your history file into grep like so:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;history&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;search term here&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;history&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;wget&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
    </entry>
    
    <entry>
        <title>Remove temp folder contents on shutdown</title>
        <link href="https://tech.karbassi.com/2007/01/14/remove-temp-folder-contents-on-shutdown/"/>
        <updated>2007-01-14T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/01/14/remove-temp-folder-contents-on-shutdown</id>
        <content type="html">&lt;p&gt;A few days ago Codejacked wrote an article talking about &lt;a href=&quot;http://www.codejacked.com/delete-your-temp-files-on-shutdown/&quot;&gt;Delete your TEMP files on shutdown&lt;/a&gt; for Windows. As much as I loved the article, I have recently switched over to &lt;a href=&quot;http://www.ubuntu.com&quot;&gt;Ubuntu&lt;/a&gt;. Like all operating systems, GNU Linux has temporary files also. Here’s how to delete them on shutdown.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Back up what you’re going to working on.
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Open the file in &lt;code class=&quot;highlighter-rouge&quot;&gt;vim&lt;/code&gt;
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;vim /etc/init.d/sysklogd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Find the following section
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;c&quot;&gt;# ...&lt;/span&gt;
 stop&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
 log_begin_msg &lt;span class=&quot;s2&quot;&gt;&quot;Stopping system log daemon...&quot;&lt;/span&gt;
 start-stop-daemon &lt;span class=&quot;nt&quot;&gt;--stop&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--quiet&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--oknodo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--exec&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$binpath&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--pidfile&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$pidfile&lt;/span&gt;
 log_end_msg &lt;span class=&quot;nv&quot;&gt;$?&lt;/span&gt;
 &lt;span class=&quot;c&quot;&gt;# ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Add the following line after &lt;code class=&quot;highlighter-rouge&quot;&gt;log_end_msg $?&lt;/code&gt; or before &lt;code class=&quot;highlighter-rouge&quot;&gt;;;&lt;/code&gt;.
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; rm &lt;span class=&quot;nt&quot;&gt;-fr&lt;/span&gt; /tmp/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; /tmp/.??&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Save the file and you’re set!&lt;/li&gt;
&lt;/ol&gt;

</content>
    </entry>
    
    <entry>
        <title>Change default editor</title>
        <link href="https://tech.karbassi.com/2007/01/14/change-default-editor/"/>
        <updated>2007-01-14T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/01/14/change-default-editor</id>
        <content type="html">&lt;p&gt;There is a quick way to change your default editor, whichever you want.&lt;/p&gt;

&lt;p&gt;First open up a &lt;code class=&quot;highlighter-rouge&quot;&gt;terminal&lt;/code&gt; by going to &lt;code class=&quot;highlighter-rouge&quot;&gt;Applications &amp;gt; Accessories &amp;gt; Terminal&lt;/code&gt; (in Ubuntu) or press &lt;code class=&quot;highlighter-rouge&quot;&gt;Alt + F2&lt;/code&gt; and type in &lt;code class=&quot;highlighter-rouge&quot;&gt;terminal&lt;/code&gt;. Now that you have a terminal open, let’s get down to viewing your history.&lt;/p&gt;

&lt;p&gt;Open up &lt;code class=&quot;highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt; by typing:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vim ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now to change your bash default editor find.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;EDITOR
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, if you can’t find that, just add this to the top.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;EDITOR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;vim
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Personally I like &lt;code class=&quot;highlighter-rouge&quot;&gt;vim&lt;/code&gt;. You can use &lt;code class=&quot;highlighter-rouge&quot;&gt;pico&lt;/code&gt; (&lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/bin/pico&lt;/code&gt;), &lt;code class=&quot;highlighter-rouge&quot;&gt;nano&lt;/code&gt; (&lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/bin/nano&lt;/code&gt;), or any other editor you like.&lt;/p&gt;

&lt;p&gt;Like always, you can learn more about this by doing the following:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;man bash
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
    </entry>
    
    <entry>
        <title>Show My Computer, My Documents, and Trash</title>
        <link href="https://tech.karbassi.com/2007/01/13/show-my-computer-my-documents-and-trash/"/>
        <updated>2007-01-13T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/01/13/show-my-computer-my-documents-and-trash</id>
        <content type="html">&lt;p&gt;If you are/were a Windows user, you are used to having “My Computer”, “My Documents” and/or “Recycle Bin” icons on your desktop. Well, Ubuntu can do this also. Here are 3 simple sets to do this.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Hit ALT-F2 and type: &lt;code class=&quot;highlighter-rouge&quot;&gt;gconf-editor&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Select &lt;code class=&quot;highlighter-rouge&quot;&gt;Apps &amp;gt; Nautilus &amp;gt; Desktop&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Check/uncheck the boxes for &lt;code class=&quot;highlighter-rouge&quot;&gt;computer_icon_visible&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;documents_icon_visible&lt;/code&gt;, or &lt;code class=&quot;highlighter-rouge&quot;&gt;trash_icon_visible&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Source: &lt;a href=&quot;http://ubuntu-tutorials.com/2006/12/07/how-to-include-my-computer-or-my-documents-icon-your-desktop-ubuntu-510-6061-610/&quot;&gt;ubuntu-tutorials.com&lt;/a&gt;&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Bash Aliases</title>
        <link href="https://tech.karbassi.com/2007/01/12/bash-aliases/"/>
        <updated>2007-01-12T00:00:00+00:00</updated>
        <id>https://tech.karbassi.com/2007/01/12/bash-aliases</id>
        <content type="html">&lt;p&gt;Alias is a command that enables a replacement of a word with another string. It’s mainly used for abbreviating a system command, or for adding default arguments to a command which one regularly uses.&lt;/p&gt;

&lt;p&gt;Under Ubuntu your bash alias is under your directory. To view your current collection of aliases all you need to do is load up a terminal. To do this just go to &lt;code class=&quot;highlighter-rouge&quot;&gt;Applications &amp;gt; Accessories &amp;gt; Termininal&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once there, type the following:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This changes the directory to the location of your folder. For me when that command is completed I see:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ali@ali-desktop:~&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now enter the following:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vim .bashrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will open up your bash configuration file. There are many options already in there and much more you can add. For what we are trying to do, find this:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Alias definitions.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# You may want to put all your additions into a separate file like&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# ~/.bash_aliases, instead of adding them here directly.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# See /usr/share/doc/bash-doc/examples in the bash-doc package.&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#if [ -f ~/.bash_aliases ]; then&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#   . ~/.bash_aliases&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As it states, just uncomment (by removing the &lt;code class=&quot;highlighter-rouge&quot;&gt;#&lt;/code&gt;’s) if statement. After you do so, it should look something like so:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Alias definitions.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# You may want to put all your additions into a separate file like&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# ~/.bash_aliases, instead of adding them here directly.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# See /usr/share/doc/bash-doc/examples in the bash-doc package.&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; ~/.bash_aliases &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; ~/.bash_aliases
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Save the file and close &lt;code class=&quot;highlighter-rouge&quot;&gt;vim&lt;/code&gt;. Now back in the terminal type:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vim .bash_aliases
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That will open up &lt;code class=&quot;highlighter-rouge&quot;&gt;vim&lt;/code&gt; again but the file you will probably see will be blank. (However, some of you might not have a blank file, that’s okay). Add the following to the file.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;alias ls&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'ls —color=auto'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ll&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'ls -l'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;la&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'ls -A'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'ls -CF'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Remember, you can add any other command you might want. I have added a few more to mine.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;restartpc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'sudo shutdown -r 0 RESTARTING PC'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'sudo aptitude install'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;uninstall&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'sudo aptitude remove'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;upgrade&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'sudo aptitude -y update &amp;amp;&amp;amp; sudo aptitude -y upgrade &amp;amp;&amp;amp; sudo aptitude -y dist-upgrade &amp;amp;&amp;amp; sudo aptitude -y autoclean'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Close the file and reload the terminal. This will reload your bash profile and thus contain your aliases. To check your list of aliases, type &lt;code class=&quot;highlighter-rouge&quot;&gt;alias&lt;/code&gt; in your terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Be careful with the &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo&lt;/code&gt; command.&lt;/p&gt;
</content>
    </entry>
    

</feed>