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

<channel>
	<title>Tactical Coder &#187; Don</title>
	<atom:link href="http://tacticalcoder.com/blog/author/donmagee/feed/" rel="self" type="application/rss+xml" />
	<link>http://tacticalcoder.com/blog</link>
	<description>Shooting from the hip</description>
	<lastBuildDate>Wed, 25 Jan 2012 21:39:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Quick and dirty log file cleanup with python</title>
		<link>http://tacticalcoder.com/blog/2012/01/quick-and-dirty-log-file-cleanup-with-python/</link>
		<comments>http://tacticalcoder.com/blog/2012/01/quick-and-dirty-log-file-cleanup-with-python/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 21:32:44 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://tacticalcoder.com/blog/?p=250</guid>
		<description><![CDATA[I have a problem, my co-workers like to make tons of different log files for their web services and they don&#8217;t like to clean them up! Ok, so maybe I&#8217;m to blame too, but I hate that day every few months where my log partition fills up and I have to clean up after us. [...]]]></description>
			<content:encoded><![CDATA[<p>I have a problem, my co-workers like to make tons of different log files for their web services and they don&#8217;t like to clean them up! Ok, so maybe I&#8217;m to blame too, but I hate that day every few months where my log partition fills up and I have to clean up after us. So I cobbled together a small script to solve this problem once and for all (or at least until we all agree on how to solve this problem).</p>
<p>I&#8217;ve wanted to write something in python for a good lone while now. I just was never in a position to give the language a try. So I decided this was a perfect opportunity to give it a try. I used <a href="http://www.jperla.com/blog/post/a-clean-python-shell-script">this example</a> and a few other websites to get started. Overall I really enjoy writing python and I hope to find a way to use more of it in my day to day tasks.<br />
<span id="more-250"></span><br />
I just thought I&#8217;d put this here in case anyone else finds this useful. To use it just supply a path to search and any of the options you would like (deleting files, archiving them, what kind of compression, etc). Use the -h option to see all the features.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
<span style="color: #808080; font-style: italic;"># This script cleans up log files</span>
<span style="color: #808080; font-style: italic;"># Author: Don Magee</span>
<span style="color: #808080; font-style: italic;"># Date: 2012-01-23</span>
<span style="color: #808080; font-style: italic;"># Version: 1.0</span>
<span style="color: #808080; font-style: italic;"># License: MIT http://www.opensource.org/licenses/mit-license.php</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">optparse</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">glob</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">tarfile</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">datetime</span> <span style="color: #ff7700;font-weight:bold;">import</span> date
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    usage = <span style="color: #483d8b;">&quot;usage: %prog [options]&quot;</span>
    <span style="color: #dc143c;">parser</span> = <span style="color: #dc143c;">optparse</span>.<span style="color: black;">OptionParser</span><span style="color: black;">&#40;</span>usage<span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-y&quot;</span>, <span style="color: #483d8b;">&quot;--year&quot;</span>, action=<span style="color: #483d8b;">&quot;store&quot;</span>, <span style="color: #008000;">type</span>=<span style="color: #483d8b;">&quot;int&quot;</span>, dest=<span style="color: #483d8b;">&quot;filterYear&quot;</span>, default=<span style="color: #008000;">False</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;Enter the year.&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-m&quot;</span>, <span style="color: #483d8b;">&quot;--month&quot;</span>, action=<span style="color: #483d8b;">&quot;store&quot;</span>, <span style="color: #008000;">type</span>=<span style="color: #483d8b;">&quot;int&quot;</span>, dest=<span style="color: #483d8b;">&quot;filterMonth&quot;</span>, default=<span style="color: #008000;">False</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;Enter the Month.&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-d&quot;</span>, <span style="color: #483d8b;">&quot;--day&quot;</span>, action=<span style="color: #483d8b;">&quot;store&quot;</span>, <span style="color: #008000;">type</span>=<span style="color: #483d8b;">&quot;int&quot;</span>, dest=<span style="color: #483d8b;">&quot;filterDay&quot;</span>, default=<span style="color: #008000;">False</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;Enter the Day.&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-p&quot;</span>, <span style="color: #483d8b;">&quot;--path&quot;</span>, action=<span style="color: #483d8b;">&quot;store&quot;</span>, <span style="color: #008000;">type</span>=<span style="color: #483d8b;">&quot;string&quot;</span>, dest=<span style="color: #483d8b;">&quot;filterPath&quot;</span>, default=<span style="color: #008000;">False</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;Enter the path&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-a&quot;</span>, <span style="color: #483d8b;">&quot;--archive&quot;</span>, action=<span style="color: #483d8b;">&quot;store&quot;</span>, <span style="color: #008000;">type</span>=<span style="color: #483d8b;">&quot;string&quot;</span>, dest=<span style="color: #483d8b;">&quot;filterArchive&quot;</span>, default=<span style="color: #008000;">False</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;Enter the path to store the archive file (if using the -t or --tar option)&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-r&quot;</span>, <span style="color: #483d8b;">&quot;--remove&quot;</span>, action=<span style="color: #483d8b;">&quot;store_true&quot;</span>, dest=<span style="color: #483d8b;">&quot;removeFiles&quot;</span>, default=<span style="color: #008000;">False</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;Delete original files.&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-t&quot;</span>, <span style="color: #483d8b;">&quot;--tar&quot;</span>, action=<span style="color: #483d8b;">&quot;store_true&quot;</span>, dest=<span style="color: #483d8b;">&quot;tarFiles&quot;</span>, default=<span style="color: #008000;">False</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;Tar all files using bzip2 compression as a default. If --gizp or --no-compression are used then tar will be automatically used.&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'-g'</span>, <span style="color: #483d8b;">&quot;--gzip&quot;</span>, action=<span style="color: #483d8b;">&quot;store_true&quot;</span>, dest=<span style="color: #483d8b;">&quot;gzipFiles&quot;</span>, default=<span style="color: #008000;">False</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;Use GZIP compression instead of bzip2&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-n&quot;</span>, <span style="color: #483d8b;">&quot;--no-compression&quot;</span>, action=<span style="color: #483d8b;">&quot;store_true&quot;</span>, dest=<span style="color: #483d8b;">&quot;noCompression&quot;</span>, default=<span style="color: #008000;">False</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;Do not use any compression for tar.&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-l&quot;</span>, <span style="color: #483d8b;">&quot;--list&quot;</span>, action=<span style="color: #483d8b;">&quot;store_true&quot;</span>, dest=<span style="color: #483d8b;">&quot;listFiles&quot;</span>, default=<span style="color: #008000;">True</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;List all files that would be affected. This is the default option.&quot;</span><span style="color: black;">&#41;</span>
    options, args = <span style="color: #dc143c;">parser</span>.<span style="color: black;">parse_args</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> options.<span style="color: black;">filterPath</span>:
        <span style="color: #dc143c;">parser</span>.<span style="color: black;">error</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'You must enter a path to clean (try --path)'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">gzipFiles</span> <span style="color: #ff7700;font-weight:bold;">and</span> options.<span style="color: black;">noCompression</span>:
        <span style="color: #dc143c;">parser</span>.<span style="color: black;">error</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'You can not use both gzip compression and no compression. Please choose one or the other.'</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">listFiles</span> <span style="color: #ff7700;font-weight:bold;">and</span> <span style="color: black;">&#40;</span>options.<span style="color: black;">tarFiles</span> <span style="color: #ff7700;font-weight:bold;">or</span> options.<span style="color: black;">removeFiles</span><span style="color: black;">&#41;</span>:
        options.<span style="color: black;">listFiles</span> = <span style="color: #008000;">False</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># setup compression type</span>
    tarType = <span style="color: #483d8b;">&quot;w:bz2&quot;</span>
    tarExt = <span style="color: #483d8b;">'tar.bz2'</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">gzipFiles</span>:
        options.<span style="color: black;">tarFiles</span> = <span style="color: #008000;">True</span>
        tarType = <span style="color: #483d8b;">&quot;w:gz&quot;</span>
        tarExt = <span style="color: #483d8b;">'.tar.gz'</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">noCompression</span>:
        options.<span style="color: black;">tarFiles</span> = <span style="color: #008000;">True</span>
        tarType = <span style="color: #483d8b;">&quot;w&quot;</span>
        tarExt = <span style="color: #483d8b;">'.tar'</span>
&nbsp;
    archiveName = <span style="color: #483d8b;">''</span> <span style="color: #808080; font-style: italic;">#Base name for archive</span>
    today = date.<span style="color: black;">today</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    day = today.<span style="color: black;">day</span>
    month = today.<span style="color: black;">month</span>
    year = today.<span style="color: black;">year</span>
    <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>options.<span style="color: black;">filterYear</span><span style="color: black;">&#41;</span>:
        year = options.<span style="color: black;">filterYear</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>options.<span style="color: black;">filterMonth</span><span style="color: black;">&#41;</span>:
        month = options.<span style="color: black;">filterMonth</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>options.<span style="color: black;">filterDay</span><span style="color: black;">&#41;</span>:
        day = options.<span style="color: black;">filterDay</span>
&nbsp;
    filterDate = <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>year<span style="color: black;">&#41;</span> + <span style="color: #483d8b;">'-'</span> + <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>month<span style="color: black;">&#41;</span> + <span style="color: #483d8b;">'-'</span> + <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>day<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#create a tar file and open it with bzip2 compression</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">tarFiles</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">filterArchive</span>:
            archiveName = options.<span style="color: black;">filterArchive</span>
        archiveName += filterDate + <span style="color: #483d8b;">'_archive'</span> + tarExt
        archive = <span style="color: #dc143c;">tarfile</span>.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span>archiveName, tarType<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'-'</span><span style="color: #66cc66;">*</span><span style="color: #ff4500;">50</span>
    fileCount = <span style="color: #ff4500;">0</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> folder <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">glob</span>.<span style="color: #dc143c;">glob</span><span style="color: black;">&#40;</span>options.<span style="color: black;">filterPath</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Looking for old log files in: %s'</span> <span style="color: #66cc66;">%</span> folder
        <span style="color: #ff7700;font-weight:bold;">for</span> logFile <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">glob</span>.<span style="color: #dc143c;">glob</span><span style="color: black;">&#40;</span>folder + <span style="color: #483d8b;">'/*.log'</span><span style="color: black;">&#41;</span>:
            stats = <span style="color: #dc143c;">os</span>.<span style="color: #dc143c;">stat</span><span style="color: black;">&#40;</span>logFile<span style="color: black;">&#41;</span>  
            lastmodDate = <span style="color: #dc143c;">time</span>.<span style="color: black;">localtime</span><span style="color: black;">&#40;</span>stats<span style="color: black;">&#91;</span><span style="color: #ff4500;">8</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
            expDate = <span style="color: #dc143c;">time</span>.<span style="color: black;">strptime</span><span style="color: black;">&#40;</span>filterDate, <span style="color: #483d8b;">'%Y-%m-%d'</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span>  expDate <span style="color: #66cc66;">&gt;</span> lastmodDate:
                <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">listFiles</span>:
                    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'The following files will be affected:'</span>
                    <span style="color: #ff7700;font-weight:bold;">print</span> logFile, <span style="color: #dc143c;">time</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%m/%d/%y&quot;</span>, lastmodDate<span style="color: black;">&#41;</span>
&nbsp;
                <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">tarFiles</span>:
                    <span style="color: #ff7700;font-weight:bold;">try</span>:
                        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Compressing'</span>, logFile, <span style="color: #dc143c;">time</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;(older than %m/%d/%y)&quot;</span>, expDate<span style="color: black;">&#41;</span>
                        fileCount += <span style="color: #ff4500;">1</span>
                        archive.<span style="color: black;">add</span><span style="color: black;">&#40;</span>logFile<span style="color: black;">&#41;</span>
                    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">OSError</span>:
                        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Could not compress'</span>, logfile
&nbsp;
                <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">removeFiles</span>:
                    <span style="color: #ff7700;font-weight:bold;">try</span>:
                        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Removing'</span>, logFile, <span style="color: #dc143c;">time</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;(older than %m/%d/%y)&quot;</span>, expDate<span style="color: black;">&#41;</span>
                        <span style="color: #dc143c;">os</span>.<span style="color: black;">remove</span><span style="color: black;">&#40;</span>logFile<span style="color: black;">&#41;</span>  <span style="color: #808080; font-style: italic;"># commented out for testing</span>
                    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">OSError</span>:
                        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Could not remove'</span>, logFile
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> options.<span style="color: black;">tarFiles</span>:
        archive.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> fileCount == <span style="color: #ff4500;">0</span>:
            <span style="color: #dc143c;">os</span>.<span style="color: black;">remove</span><span style="color: black;">&#40;</span>archiveName<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://tacticalcoder.com/blog/2012/01/quick-and-dirty-log-file-cleanup-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chrome URL Expander name change.</title>
		<link>http://tacticalcoder.com/blog/2011/02/chrome-url-expander-name-change/</link>
		<comments>http://tacticalcoder.com/blog/2011/02/chrome-url-expander-name-change/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 13:06:04 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Chrome URL Expander]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tactical URL Expander]]></category>
		<category><![CDATA[URL Shortening]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://tacticalcoder.com/blog/?p=246</guid>
		<description><![CDATA[Chrome URL Expander is dead! Long live Tactical URL Expander. I changed the name to meet google naming guidelines. Other changes in this release is a new backend for expansion and general code cleanup. The source code can be found at here.]]></description>
			<content:encoded><![CDATA[<p>Chrome URL Expander is dead! Long live <a href="https://chrome.google.com/extensions/detail/limjcpdphjbhdldhiahblmfadfaciaok">Tactical URL Expander</a>. I changed the name to meet google naming guidelines. Other changes in this release is a new backend for expansion and general code cleanup.</p>
<p>The source code can be found at <a href="https://github.com/DonMagee/Tactical-URL-Expander">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tacticalcoder.com/blog/2011/02/chrome-url-expander-name-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable that annoying OSX dashboard.</title>
		<link>http://tacticalcoder.com/blog/2010/11/disable-that-annoying-osx-dashboard/</link>
		<comments>http://tacticalcoder.com/blog/2010/11/disable-that-annoying-osx-dashboard/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 16:41:19 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Dashboard]]></category>
		<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://tacticalcoder.com/blog/?p=239</guid>
		<description><![CDATA[I finally got around to figuring out how to disalbe the OSX dashboard. It was actually very simple and can be done from the terminal. I wrote a quick applescript to enable and disable the dashboard in case anyone would like to use that. It is very simple and you can just run the shell [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to figuring out how to disalbe the OSX dashboard. It was actually very simple and can be done from the terminal. I wrote a quick applescript to enable and disable the dashboard in case anyone would like to use that. It is very simple and you can just run the shell commands by hand if you wanted to. This is old news in the OSX world, but useful none the less.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">set</span> question <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;Do you wish to start or stop the dashboard?&quot;</span> <span style="color: #0066ff;">buttons</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Start&quot;</span>, <span style="color: #009900;">&quot;Stop&quot;</span><span style="color: #000000;">&#125;</span> default button <span style="color: #000000;">1</span>
<span style="color: #ff0033; font-weight: bold;">set</span> answer <span style="color: #ff0033; font-weight: bold;">to</span> button returned <span style="color: #ff0033; font-weight: bold;">of</span> question
&nbsp;
<span style="color: #ff0033; font-weight: bold;">if</span> answer <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Start&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
	<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;defaults write com.apple.dashboard mcx-disabled -boolean NO&quot;</span>
	<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;killall Dock&quot;</span>
	display alert <span style="color: #009900;">&quot;Dashboard has been started&quot;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">if</span> answer <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Stop&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
	<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;defaults write com.apple.dashboard mcx-disabled -boolean YES&quot;</span>
	<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;killall Dock&quot;</span>
	display alert <span style="color: #009900;">&quot;Dashboard has been stopped&quot;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://tacticalcoder.com/blog/2010/11/disable-that-annoying-osx-dashboard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nginx-manager: A tool for managing Nginx on Ubuntu/Debian Linux.</title>
		<link>http://tacticalcoder.com/blog/2010/10/nginx-manager-a-tool-for-managing-nginx-on-ubuntudebian-linux/</link>
		<comments>http://tacticalcoder.com/blog/2010/10/nginx-manager-a-tool-for-managing-nginx-on-ubuntudebian-linux/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 02:19:18 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://tacticalcoder.com/blog/?p=224</guid>
		<description><![CDATA[Last week we setup Nginx as a reverse proxy/load balancing/ssl endpoint. As with all of our projects, we selected Ubuntu Linux. We put this in place to replace a older server running pound. We wanted more web server features, and Nginx fit the bill perfectly. So far the server has been an overwhelming success. Just [...]]]></description>
			<content:encoded><![CDATA[<p>Last week we setup Nginx as a reverse proxy/load balancing/ssl endpoint. As with all of our projects, we selected Ubuntu Linux. We put this in place to replace a older server running pound. We wanted more web server features, and Nginx fit the bill perfectly.  So far the server has been an overwhelming success.</p>
<p>Just like Ubuntu/Debian does with Apache, they chose to setup Nginx with a &#8220;sites-avaliable&#8221; and &#8220;sites-enabled&#8221; folders for enabling and disabling vhosts. However unlike Apache, there seems to be no tools to make enabling and disabling a quick single command. So we are forced to make and delete the links from the &#8220;sites-available&#8221; folder to the &#8220;sites-enabled&#8221; folder and then reload the Nginx service.</p>
<p>I really liked the concept of having a tool to enable and disable sites (vhosts) for me, so I took the liberty of quickly writing up a tool that does just that.<br />
<span id="more-224"></span></p>
<p>Enter Nginx-manager. This tool is just a small bash script that automates the creation and deletion of links as well as optionally will reload the server for you. On our server we have a half-dozen websites that use this single Nginx server to handle their ssl termination as well as failover to backup servers and standard down time notices (hosted on Nginx). I will write a guide on how we setup this server in detail in the next few days. But in a nut shell we have a standard Nginx setup with each backend server having it&#8217;s own vhost file in /etc/nginx/sites-available. To enable one of these vhosts, we simple use this tool as follows.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> nginx-manager <span style="color: #660033;">-e</span> www.mysite.com</pre></div></div>

<p>and then we reload the service</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service nginx reload</pre></div></div>

<p>We can also combine these into a single command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> nginx-manager <span style="color: #660033;">-R</span> <span style="color: #660033;">-e</span> www.mysite.com</pre></div></div>

<p>Disabling a site can be done just as easily.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> nginx-manager <span style="color: #660033;">-d</span> www.mysite.com</pre></div></div>

<p>This is a very rough script. You should not use it unless you understand exactly what it is doing. It does not do anything dangerous, but you can never be too safe. It was written to meet my needs in an environment I control and is posted here only as a spring board to help you manage your systems in a more simplified fashion. To use this script, you simply need to paste the following code into a file named nginx-manager, give it executable permissions, and make sure it is in your path (I placed mine in /usr/local/bin/).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># Only root should run this script</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">whoami</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">'root'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'You must be root (or use sudo) to use this tool!'</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span>;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Path to avaliable and enabled folders</span>
<span style="color: #007800;">AVAIL_PATH</span>=<span style="color: #ff0000;">'/etc/nginx/sites-available/'</span>
<span style="color: #007800;">ENABLE_PATH</span>=<span style="color: #ff0000;">'/etc/nginx/sites-enabled/'</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> usage
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt;EOH
Usage:
	-h, --help - Displays this screen
	-e, --enabled - Enables the supplied vhost.
	-d, --disabled - Disables the supplied vhost.
	-R, --reload - Automatically restarts the nginx service.
EOH</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #007800;">LONG_OPTION_SPEC</span>=<span style="color: #ff0000;">&quot;help,reload,enable:,disable:&quot;</span>
<span style="color: #007800;">SHORT_OPTION_SPEC</span>=<span style="color: #ff0000;">&quot;hRe:d:&quot;</span>
<span style="color: #007800;">PARSED_OPTIONS</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">getopt</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;$0&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #660033;">-o</span> <span style="color: #007800;">$SHORT_OPTION_SPEC</span> <span style="color: #660033;">-l</span> <span style="color: #007800;">$LONG_OPTION_SPEC</span> <span style="color: #660033;">--</span> <span style="color: #ff0000;">&quot;$@&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">OPTIONS_RET</span>=<span style="color: #007800;">$?</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">--</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PARSED_OPTIONS</span>&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$OPTIONS_RET</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-le</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	usage;
	<span style="color: #7a0874; font-weight: bold;">exit</span>;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">RELOAD</span>=<span style="color: #c20cb9; font-weight: bold;">false</span>
<span style="color: #007800;">ACTION</span>=<span style="color: #ff0000;">'NONE'</span>
<span style="color: #007800;">VHOST</span>=<span style="color: #ff0000;">'NONE'</span>
<span style="color: #007800;">FILENAME</span>=<span style="color: #ff0000;">'NONE'</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-ge</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">do</span>
	<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">in</span>
	  <span style="color: #660033;">--help</span> <span style="color: #000000; font-weight: bold;">|</span> -h<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		usage;
		<span style="color: #7a0874; font-weight: bold;">exit</span><span style="color: #000000; font-weight: bold;">;;</span>
	  <span style="color: #660033;">--enable</span> <span style="color: #000000; font-weight: bold;">|</span> -e<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$ACTION</span> = <span style="color: #ff0000;">'NONE'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #007800;">ACTION</span>=<span style="color: #ff0000;">'ENABLE'</span>;
			<span style="color: #7a0874; font-weight: bold;">shift</span>;
			<span style="color: #007800;">FILENAME</span>=<span style="color: #007800;">$1</span>;
		<span style="color: #000000; font-weight: bold;">else</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Error! You can not supply both enable and disable!'</span>
			usage;
			<span style="color: #7a0874; font-weight: bold;">exit</span>;
		<span style="color: #000000; font-weight: bold;">fi</span><span style="color: #000000; font-weight: bold;">;;</span>
	  <span style="color: #660033;">--disable</span> <span style="color: #000000; font-weight: bold;">|</span> -d<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$ACTION</span> = <span style="color: #ff0000;">'NONE'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                        <span style="color: #007800;">ACTION</span>=<span style="color: #ff0000;">'DISABLE'</span>;
			<span style="color: #7a0874; font-weight: bold;">shift</span>;
			<span style="color: #007800;">FILENAME</span>=<span style="color: #007800;">$1</span>;
                <span style="color: #000000; font-weight: bold;">else</span>
                        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Error! You can not supply both enable and disable!'</span>
                        usage;
                        <span style="color: #7a0874; font-weight: bold;">exit</span>;
                <span style="color: #000000; font-weight: bold;">fi</span><span style="color: #000000; font-weight: bold;">;;</span>
	  <span style="color: #660033;">--reload</span> <span style="color: #000000; font-weight: bold;">|</span> -R<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #007800;">RELOAD</span>=<span style="color: #c20cb9; font-weight: bold;">true</span><span style="color: #000000; font-weight: bold;">;;</span>
	  --<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">shift</span><span style="color: #000000; font-weight: bold;">;;</span>
	  <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span> 
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Error: unknown flag $1&quot;</span>;
		usage;
		<span style="color: #7a0874; font-weight: bold;">exit</span>;
	<span style="color: #000000; font-weight: bold;">esac</span>
	<span style="color: #7a0874; font-weight: bold;">shift</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># First we need to make sure we have work to do.</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$ACTION</span> = <span style="color: #ff0000;">'NONE'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RELOAD</span> = <span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Error: no action was supplied!'</span>
        usage;
        <span style="color: #7a0874; font-weight: bold;">exit</span>;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Now that we know we have work to do, let's do it.</span>
<span style="color: #007800;">AFILE</span>=<span style="color: #800000;">${AVAIL_PATH}</span><span style="color: #800000;">${FILENAME}</span>;
<span style="color: #007800;">EFILE</span>=<span style="color: #800000;">${ENABLE_PATH}</span><span style="color: #800000;">${FILENAME}</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$ACTION</span> = <span style="color: #ff0000;">'ENABLE'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$AFILE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-h</span> <span style="color: #007800;">$EFILE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FILENAME</span> is already enabled.&quot;</span>;
			<span style="color: #7a0874; font-weight: bold;">exit</span>;
		<span style="color: #000000; font-weight: bold;">else</span>
			<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$AFILE</span> <span style="color: #007800;">$EFILE</span>;
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RELOAD</span> = <span style="color: #c20cb9; font-weight: bold;">true</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
				service nginx reload;
			<span style="color: #000000; font-weight: bold;">fi</span>		
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Site: <span style="color: #007800;">$FILENAME</span> is enabled!&quot;</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RELOAD</span> = <span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
				<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Please restart or reload nginx for your changes to take effect.'</span>
			<span style="color: #000000; font-weight: bold;">fi</span>
			<span style="color: #7a0874; font-weight: bold;">exit</span>;
		<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">else</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FILENAME</span> is not a valid vhost file&quot;</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$ACTION</span> = <span style="color: #ff0000;">'DISABLE'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-h</span> <span style="color: #007800;">$EFILE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$EFILE</span>;
        	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RELOAD</span> = <span style="color: #c20cb9; font-weight: bold;">true</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        		service nginx reload;
        	<span style="color: #000000; font-weight: bold;">fi</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Site: <span style="color: #007800;">$FILENAME</span> is disabled!&quot;</span>
                        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RELOAD</span> = <span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Please restart or reload nginx for your changes to t
ake effect.'</span>
                        <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
        	<span style="color: #7a0874; font-weight: bold;">exit</span>;
	<span style="color: #000000; font-weight: bold;">else</span>
        	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FILENAME</span> is already disabled. &quot;</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>I hope you enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://tacticalcoder.com/blog/2010/10/nginx-manager-a-tool-for-managing-nginx-on-ubuntudebian-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chrome URL Expander 1.5.4 released!</title>
		<link>http://tacticalcoder.com/blog/2010/10/chrome-url-expander-1-5-4-released/</link>
		<comments>http://tacticalcoder.com/blog/2010/10/chrome-url-expander-1-5-4-released/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 15:17:53 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Chrome URL Expander]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[URL Shortening]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://tacticalcoder.com/blog/?p=212</guid>
		<description><![CDATA[Just a quick update to Chrome URL Expander. There are not many changes in this release. I removed caching as it did not improve the extensions speed and increased memory usage. I also started staging the code for the next update with an improved UI. You can install the extension from here: Chrome URL Extension [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick update to Chrome URL Expander. There are not many changes in this release. I removed caching as it did not improve the extensions speed and increased memory usage. I also started staging the code for the next update with an improved UI.</p>
<p>You can install the extension from here: <a href="https://chrome.google.com/extensions/detail/limjcpdphjbhdldhiahblmfadfaciaok">Chrome URL Extension – chrome.google.com/extensions</a>. If you already have version 0.9.3 or newer installed you should be automatically upgraded.</p>
<p>Feel free to use this as a springboard for your projects and leave me a comment so I can follow your progress. I&#8217;m also not adverse to anyone helping me make this extension better. So feel free to fork it, fix it, or just comment on it. You can find the source on <a href="http://github.com/DonMagee/Chrome-URL-Expander" target="_blank" >GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tacticalcoder.com/blog/2010/10/chrome-url-expander-1-5-4-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chrome URL Expander 1.5.2 is live and source is published.</title>
		<link>http://tacticalcoder.com/blog/2010/05/chrome-url-expander-1-5-2-is-live-and-source-is-published/</link>
		<comments>http://tacticalcoder.com/blog/2010/05/chrome-url-expander-1-5-2-is-live-and-source-is-published/#comments</comments>
		<pubDate>Sat, 15 May 2010 04:59:31 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Chrome URL Expander]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[URL Shortening]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://tacticalcoder.com/blog/?p=162</guid>
		<description><![CDATA[Well it&#8217;s a good day. I released Chrome URL Expander 1.5.2 today. Nothing really has changed on the user side of things. I just cleaned up the code so I could get to doing something I&#8217;ve wanted to do for a while now. The source code for Chrome URL Expander is now published. I have [...]]]></description>
			<content:encoded><![CDATA[<p>Well it&#8217;s a good day. I released Chrome URL Expander 1.5.2 today. Nothing really has changed on the user side of things. I just cleaned up the code so I could get to doing something I&#8217;ve wanted to do for a while now. The source code for Chrome URL Expander is now published. I have chosen to dual license this project under both the GPLv2 and the MIT License. </p>
<p>Feel free to use this as a springboard for your projects and leave me a comment so I can follow your progress. I&#8217;m also not adverse to anyone helping me make this extension better. So feel free to fork it, fix it, or just comment on it. You can find the source on <a href="http://github.com/DonMagee/Chrome-URL-Expander" target="_blank" >GitHub</a>.</p>
<p>I&#8217;m not done with this thing  yet. I have a few more features to add and more code to cleanup still.</p>
<p>I hope you like it!</p>
]]></content:encoded>
			<wfw:commentRss>http://tacticalcoder.com/blog/2010/05/chrome-url-expander-1-5-2-is-live-and-source-is-published/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chrome URL Expander 1.5.1 is now live.</title>
		<link>http://tacticalcoder.com/blog/2010/05/chrome-url-expander-1-5-1-is-now-live/</link>
		<comments>http://tacticalcoder.com/blog/2010/05/chrome-url-expander-1-5-1-is-now-live/#comments</comments>
		<pubDate>Sat, 01 May 2010 23:07:01 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Chrome URL Expander]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[URL Shortening]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://tacticalcoder.com/blog/?p=159</guid>
		<description><![CDATA[Version 1.5.1 of the Chrome URL Expander is now live. It supports a ton of shortening services. This extension simply expands shortened urls found on web pages you visit. It does this automatically as you browse the internet. This is done by using the API found at: http://therealurl.appspot.com/. I know this is the second time [...]]]></description>
			<content:encoded><![CDATA[<p>Version 1.5.1 of the Chrome URL Expander is now live. It supports a ton of shortening services. This extension simply expands shortened urls found on web pages you visit. It does this automatically as you browse the internet.</p>
<p>This is done by using the API found at: <a href="http://therealurl.appspot.com/">http://therealurl.appspot.com/</a>. I know this is the second time I have switched backends. This new backend is even faster and supports every single url shortening service I have tried. If you find a service it does not support, please let me know and I will add it.</p>
<p>New features:<br />
Version 1.5.1 now allows options to take effect without reloading the page. It also supports changing the link&#8217;s text to reflect the title of the expanded URL.</p>
<p>Coming Soon:<br />
The next release will finally have the long awaited rollover feature!</p>
<p>You can install the extension from here: <a href="https://chrome.google.com/extensions/detail/limjcpdphjbhdldhiahblmfadfaciaok">Chrome URL Extension – chrome.google.com/extensions</a>. If you already have version 0.9.3 or newer installed you should be automatically upgraded.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://tacticalcoder.com/blog/2010/05/chrome-url-expander-1-5-1-is-now-live/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Chrome URL Expander Version 1.2.1 is now live!</title>
		<link>http://tacticalcoder.com/blog/2010/04/chrome-url-expander-version-1-2-1-is-now-live/</link>
		<comments>http://tacticalcoder.com/blog/2010/04/chrome-url-expander-version-1-2-1-is-now-live/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 03:01:43 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Chrome URL Expander]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[URL Shortening]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://tacticalcoder.com/blog/?p=155</guid>
		<description><![CDATA[Version 1.0 of the Chrome URL Expander is now live. It supports a ton of shortening services. This extension simply expands shortened urls found on web pages you visit. It does this automatically as you browse the internet. This is done by using the API found at: http://www.untiny.com New features: Version 1.2.1 now supports an [...]]]></description>
			<content:encoded><![CDATA[<p>Version 1.0 of the Chrome URL Expander is now live. It supports a ton of shortening services. This extension simply expands shortened urls found on web pages you visit. It does this automatically as you browse the internet.</p>
<p>This is done by using the API found at: <a href="http://www.untiny.com">http://www.untiny.com</a></p>
<p>New features:<br />
Version 1.2.1 now supports an improved on/off button. Turning off URL Expander will re-shorten all links back to their original form. This version also supports caching of expanded URLs. This should reduce the network traffic used and speed up sites like twitter where a refresh would cause the same queries to be made over and over again. You can control how many URLs are cached in the options.</p>
<p>You can install the extension from here: <a href="https://chrome.google.com/extensions/detail/limjcpdphjbhdldhiahblmfadfaciaok">Chrome URL Extension – chrome.google.com/extensions</a>. If you already have version 0.9.3 or newer installed you should be automatically upgraded.</p>
<p>Enjoy!</p>
<p>The following shortening services are supported:<br />
.tk, 1u.ro, 1url.com, 2pl.us, 2tu.us, 3.ly, a.gd, a.gg, a.nf, a2a.me, abe5.com, adjix.com, alturl.com, atu.ca, awe.sm, b23.ru, bacn.me, bit.ly, bkite.com, blippr.com, blippr.com, bloat.me, bt.io, budurl.com, buk.me, burnurl.com, c.shamekh.ws, cd4.me, chilp.it, chs.mx, clck.ru, cli.gs, clickthru.ca, cort.as, cuthut.com, cuturl.com, decenturl.com, df9.net, doiop.com, dwarfurl.com, easyurl.net, eepurl.com, eezurl.com, ewerl.com, fa.by, fav.me, ff.im, fff.to, fhurl.com, flic.kr, flq.us, fly2.ws, fuseurl.com, fwd4.me, gl.am, go.9nl.com, go2.me, golmao.com, goo.gl, goshrink.com, gri.ms, gurl.es, hellotxt.com, hex.io, href.in, htxt.it, hugeurl.com, hurl.ws, icanhaz.com, icio.us, idek.net, is.gd, it2.in, ito.mx, j.mp, jijr.com, kissa.be, kl.am, korta.nu, l9k.net, liip.to, liltext.com, lin.cr, linkbee.com, liurl.cn, ln-s.net, ln-s.ru, lnkurl.com, loopt.us, lru.jp, lt.tl, lurl.no, memurl.com, migre.me, minilien.com, miniurl.com, minurl.fr, moourl.com, myurl.in, ncane.com, netnet.me, nn.nf, o-x.fr, ofl.me, omf.gd, ow.ly, oxyz.info, p8g.tw, parv.us, pic.gd, ping.fm, piurl.com, plurl.me, pnt.me, poll.fm, pop.ly, poprl.com, post.ly, posted.at, ptiturl.com, qurlyq.com, rb6.me, readthis.ca, redirects.ca, redirx.com, relyt.us, retwt.me, ri.ms, rickroll.it, rly.cc, rsmonkey.com, rubyurl.com, rurl.org, s3nt.com, s7y.us, short.ie, short.to, shortna.me, shoturl.us, shrinkster.com, shrinkurl.us, shrtl.com, shw.me, simurl.net, simurl.org, simurl.us, sn.im, sn.vc, snipr.com, snipurl.com, snurl.com, sp2.ro, spedr.com, starturl.com, stickurl.com, sturly.com, su.pr, takemyfile.com, tcrn.ch, thrdl.es, tighturl.com, tiny.cc, tiny.pl, tinyarro.ws, tinytw.it, tinyurl.com, tl.gd, tnw.to, to.ly, togoto.us, tr.im, tr.my, trcb.me, tumblr.com, tw0.us, tw1.us, tw2.us, tw5.us, tw6.us, tw8.us, tw9.us, twa.lk, twi.gy, twit.ac, twitthis.com, twiturl.de, twitzap.com, twtr.us, twurl.nl, u.mavrev.com, u.nu, ub0.cc, updating.me, ur1.ca, url.co.uk, url.ie, url.inc-x.eu, url4.eu, urlborg.com, urlbrief.com, urlcut.com, urlhawk.com, urlkiss.com, urlpire.com, urlvi.be, urlx.ie, uservoice.com, ustre.am, virl.com, vl.am, wa9.la, wapurl.co.uk, wipi.es, wkrg.com, wp.me, x.hypem.com, x.se, xeeurl.com, xr.com, xrl.in, xrl.us, xurl.jp, xzb.cc, yatuc.com, ye-s.com, yep.it, yfrog.com, zi.pe, zz.gd</p>
]]></content:encoded>
			<wfw:commentRss>http://tacticalcoder.com/blog/2010/04/chrome-url-expander-version-1-2-1-is-now-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chrome URL Expander Version 1.0 is now live!</title>
		<link>http://tacticalcoder.com/blog/2010/04/chrome-url-expander-version-1-0-is-now-live/</link>
		<comments>http://tacticalcoder.com/blog/2010/04/chrome-url-expander-version-1-0-is-now-live/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 03:51:34 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Chrome URL Expander]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[URL Shortening]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://tacticalcoder.com/blog/?p=150</guid>
		<description><![CDATA[Version 1.0 of the Chrome URL Expander is now live. It supports a ton of shortening services. For the complete list check out http://www.longurlplease.com. This extension simply expands shortened urls found on web pages you visit. It does this automatically as you browse the internet. This is done by using the API found at http://www.longurlplease.com. [...]]]></description>
			<content:encoded><![CDATA[<p>Version 1.0 of the Chrome URL Expander is now live. It supports a ton of shortening services. For the complete list check out http://www.longurlplease.com. This extension simply expands shortened urls found on web pages you visit. It does this automatically as you browse the internet.</p>
<p>This is done by using the API found at <a href="http://www.longurlplease.com">http://www.longurlplease.com</a>.</p>
<p>New features:<br />
Version 1.0 now supports a on/off button that can be found to the right of your address bar. As my testing is limited to only myself. Please let me know if you find any bugs with this new feature.</p>
<p>Upcoming features:<br />
Rollover expanding &#8211; This will allow you a different method of expanding links. Rather then expanding them on page load or update, this feature will only temporarily expand links you hover your cursor over.</p>
<p>You can install the extension from here: <a href="https://chrome.google.com/extensions/detail/limjcpdphjbhdldhiahblmfadfaciaok">Chrome URL Extension – chrome.google.com/extensions</a>. If you already have version 0.9.3 installed you should be automatically upgraded.</p>
<p>Enjoy!</p>
<p>Special thanks to my friend <a href="http://twitter.com/hazard_2gnt">@hazard_2gnt</a> for designing the new icon!</p>
]]></content:encoded>
			<wfw:commentRss>http://tacticalcoder.com/blog/2010/04/chrome-url-expander-version-1-0-is-now-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chrome URL Expander 0.9.3 released.</title>
		<link>http://tacticalcoder.com/blog/2010/04/chrome-url-expander-0-9-3-released/</link>
		<comments>http://tacticalcoder.com/blog/2010/04/chrome-url-expander-0-9-3-released/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 03:34:57 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Chrome URL Expander]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[URL Shortening]]></category>

		<guid isPermaLink="false">http://tacticalcoder.com/blog/?p=142</guid>
		<description><![CDATA[Not much to say about this one. Version 0.9.3 is released. Version 1.0 is still in the works. I put this out now to add support for DOM changes. Previously, if the web page contents changed you would need to refresh the page for the extension to expand URLs. Now with version 0.9.3 Chrome URL [...]]]></description>
			<content:encoded><![CDATA[<p>Not much to say about this one. Version 0.9.3 is released. Version 1.0 is still in the works. I put this out now to add support for DOM changes. Previously, if the web page contents changed you would need to refresh the page for the extension to expand URLs. Now with version 0.9.3 Chrome URL Expander will detect this and automatically expand any URLs in the changed content.</p>
<p>You can download Chrome URL Expander <a href="https://chrome.google.com/extensions/detail/limjcpdphjbhdldhiahblmfadfaciaok">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tacticalcoder.com/blog/2010/04/chrome-url-expander-0-9-3-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

