<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.8.4" -->
<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/"
	>

<channel>
	<title>http://blog.sLajax.com</title>
	<link>http://blog.slajax.com</link>
	<description>secure lightweight ajax solutions</description>
	<pubDate>Wed, 16 Dec 2009 07:39:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
			<item>
		<title>MacOSX Skin on Ubuntu Linux</title>
		<link>http://blog.slajax.com/2008/09/09/macosx-skin-on-ubuntu-linux/</link>
        <customfield>linux-desktop/Screenshot-Desktop-preview.jpg</customfield>
		<comments>http://blog.slajax.com/2008/09/09/macosx-skin-on-ubuntu-linux/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 19:39:44 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[skins]]></category>

		<guid isPermaLink="false">http://blog.slajax.com/?p=68</guid>
		<description><![CDATA[Anyone who has seen my desktops knows that I'm a big fan of the MacOSX sleek design, however much prefer the flexibility and freedom of Ubuntu [1]. Even on windows, I'd rather install cygwin and skin my operating system using FlyAKiteOSx [2]. That said, I had never been able to really emulate this feel on linux, and as much as I love the advanced compiz effects manager, I missed the sleakness of the window settings that come with Mac Designs. I found a really good walk through [3] however that shows how to customize your Ubuntu desktop to look like OSx leopard, and by the screen shots below, you can see it does a pretty decent job. It also looks really cool with the compiz cube effect [4], which I wasn't able to capture in a screenshot.   [5]   [6]   [7]  Not bad eh? Now I have that bandwagon feel, without the over head and lame usage of a proprietary operating system! So next time you think someone is on the 'mac bandwagon'. Think twice!

[1] http://blog.slajax.com/2008/08/12/why-i-only-use-linux-at-work/
[2] http://osx.portraitofakite.com/
[3] http://maketecheasier.com/turn-your-ubuntu-hardy-to-mac-osx-leopard/2008/07/23/
[4] http://www.youtube.com/watch?v=RaYqVrCfeHQ
[5] http://blog.slajax.com/wp-content/uploads/2008/09/screenshot-desktop.png
[6] http://blog.slajax.com/wp-content/uploads/2008/09/screenshot-desktop1.png
[7] http://blog.slajax.com/wp-content/uploads/2008/09/screenshot-desktop2.png]]></description>
			<content:encoded><![CDATA[<p>Anyone who has seen my desktops knows that I&#8217;m a big fan of the MacOSX sleek design, however much prefer the flexibility and <a target="_blank" href="http://blog.slajax.com/2008/08/12/why-i-only-use-linux-at-work/">freedom of Ubuntu</a>. Even on windows, I&#8217;d rather install cygwin and skin my operating system using <a href="http://osx.portraitofakite.com/">FlyAKiteOSx</a>. That said, I had never been able to really emulate this feel on linux, and as much as I love the advanced compiz effects manager, I missed the sleakness of the window settings that come with Mac Designs. I found a <a target="_blank" href="http://maketecheasier.com/turn-your-ubuntu-hardy-to-mac-osx-leopard/2008/07/23/">really good walk through</a> however that shows how to customize your Ubuntu desktop to look like OSx leopard, and by the screen shots below, you can see it does a pretty decent job. It also looks really cool with the <a target="_blank" href="http://www.youtube.com/watch?v=RaYqVrCfeHQ">compiz cube effect</a>, which I wasn&#8217;t able to capture in a screenshot.  <a href="http://blog.slajax.com/wp-content/uploads/2008/09/screenshot-desktop.png"><img height="358" width="574" alt="" src="http://blog.slajax.com/wp-content/uploads/2008/09/screenshot-desktop.png" title="screenshot-desktop" class="aligncenter size-thumbnail wp-image-69" /></a>  <a href="http://blog.slajax.com/wp-content/uploads/2008/09/screenshot-desktop1.png"><img height="354" width="568" alt="" src="http://blog.slajax.com/wp-content/uploads/2008/09/screenshot-desktop1.png" title="screenshot-desktop1" class="aligncenter size-thumbnail wp-image-70" /></a>  <a href="http://blog.slajax.com/wp-content/uploads/2008/09/screenshot-desktop2.png"><img height="355" width="570" alt="" src="http://blog.slajax.com/wp-content/uploads/2008/09/screenshot-desktop2.png" title="screenshot-desktop2" class="aligncenter size-thumbnail wp-image-71" /></a>  Not bad eh? Now I have that bandwagon feel, without the over head and lame usage of a proprietary operating system! So next time you think someone is on the &#8216;mac bandwagon&#8217;. Think twice!</p>]]></content:encoded>
			<wfw:commentRss>http://blog.slajax.com/2008/09/09/macosx-skin-on-ubuntu-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why I only use Linux at work.</title>
		<link>http://blog.slajax.com/2008/08/12/why-i-only-use-linux-at-work/</link>
        <customfield>ubuntu_logo.jpg</customfield>
		<comments>http://blog.slajax.com/2008/08/12/why-i-only-use-linux-at-work/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 16:55:50 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.slajax.com/?p=45</guid>
		<description><![CDATA[Thanks to the awesome CTO [1] and Senior Python Programmer [2] at fotoglif.com [3] where I worked previously, Linux has become much more then a novelty in my tool set. While working there, I made the decision that I would go forth and adopt Ubuntu as my exclusive desktop of choice in all new projects simply because of how practical and customizable the operating system is.
Since then I have picked up more then a few new tricks, and have converted 3 (that I know of) below average windows users into fully functional members of the Linux community.
Now lets get down to the features that make Linux a much more flexible desktop for solving an ever changing number of work related issues, and red tape.

1) Workspace. Better Workspace.

Upon arriving at my new job, I was less then stoked to see that every person in the place had a second LCD monitor except for me. Desktop space can be a real pain in the ass for a UI programmer because of the constant refreshing required to see changes in the browser. Albeit I am a master of the alt tab, and have been known to ninja kick my way through a few builds this way, it's less then a good way to avoid carpel tunnel [4]. So the answer is simple in this case. Multiple desktops, which as you can see, can be easily integrated into the compiz window manager to make a pretty awesome cubic 3 dimensional desktop experience. From the following video, you'll be able to see the reason why I no longer care if I have a second monitor. I'm too busy flipping from desktop to desktop:


2) Software. Free Software.
This is a pretty good reason no matter what the situation is, however almost anyone who has worked in a larger company can tell you about the headache that its normally required to interface with the IT department so that you can get a piece of software that will assist you in your task. Well with Linux, the answer is as simple as sudo apt-get install software-package or if you can't find it, build it. The later being a motto that I have adopted more and more recently.
3) Security and piece of mind
I've worked at a few places where management is more then aggressive about banning and prohibiting any sort of IM, or un-work-related surfing activities. This often spawns rumors of packet sniffing, and other things that are less then desirable to me. The answer to this is simply an SSH tunnel. Very simply any Linux machine can be tunneled using the following ssh command:
ssh -D port username@hostname.com
Once this is done, you can then use System -&#62; Preference Network Proxy to point your connection to localhost:port using a SOCKS proxy.
I normally refrain from setting the proxy at this level however because it is fairly global. Instead I set the proxy in each application (mail, im, firefox) independently, allowing for better customization. For Firefox this is particularly important if you are running a localhost development environment. I suggest you use Foxy Proxy [5] to configure patterns for host names that use the proxy and host names that do not. Now that you are tunneling through your favourite remote server, you have the piece of mind knowing that your web traffic is not open to prying eyes.
And there you have it. These are the 3 main reasons why I have decided to exlcusively use Linux/Ubuntu for any work related project. It should be kept in mind that these reasons are much more particular to Linux in a whole then Ubuntu [6] itself, which is simply my perferred flavor of Linux. Also, there are many other great reasons, such as cron jobs, lynx, raggle and plain CLI that make Linux perfect as a work desktop, so I'd be happy to hear why you do you don't perfer Linux.

[1] http://walled.net
[2] http://agentultra.com
[3] http://fotoglif.com
[4] http://agentultra.comhttp://en.wikipedia.org/wiki/Carpal_tunnel_syndrome
[5] http://foxyproxy.mozdev.org/
[6] http://ubuntu.org]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Thanks to the awesome <a title="Walled.net" href="http://walled.net" target="_blank">CTO</a> and <a title="Agent Ultra" href="http://agentultra.com" target="_blank">Senior Python Programmer</a> at <a title="fotoglif.com - it pays to share" href="http://fotoglif.com" target="_blank">fotoglif.com</a> where I worked previously, Linux has become much more then a novelty in my tool set. While working there, I made the decision that I would go forth and adopt Ubuntu as my exclusive desktop of choice in all new projects simply because of how practical and customizable the operating system is.</p>
<p style="text-align: left;">Since then I have picked up more then a few new tricks, and have converted 3 (that I know of) below average windows users into fully functional members of the Linux community.</p>
<p style="text-align: left;">Now lets get down to the features that make Linux a much more flexible desktop for solving an ever changing number of work related issues, and red tape.</p>

<p style="text-align: left;">1) <strong>Workspace. Better Workspace.
</strong>
<p style="text-align: left;">Upon arriving at my new job, I was less then stoked to see that every person in the place had a second LCD monitor except for me. Desktop space can be a real pain in the ass for a UI programmer because of the constant refreshing required to see changes in the browser. Albeit I am a master of the alt tab, and have been known to ninja kick my way through a few builds this way, it&#8217;s less then a good way to avoid <a title="Carpal Tunnel" href="http://agentultra.comhttp://en.wikipedia.org/wiki/Carpal_tunnel_syndrome" target="_blank">carpel tunnel</a>. So the answer is simple in this case. Multiple desktops, which as you can see, can be easily integrated into the compiz window manager to make a pretty awesome cubic 3 dimensional desktop experience. From the following video, you&#8217;ll be able to see the reason why I no longer care if I have a second monitor. I&#8217;m too busy flipping from desktop to desktop:</p>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/ZxfSwzhSn1c&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/ZxfSwzhSn1c&amp;hl=en&amp;fs=1" allowfullscreen="true"></embed></object>
<p style="text-align: left;">2) <strong>Software. Free Software.</strong></p>
<p style="text-align: left;">This is a pretty good reason no matter what the situation is, however almost anyone who has worked in a larger company can tell you about the headache that its normally required to interface with the IT department so that you can get a piece of software that will assist you in your task. Well with Linux, the answer is as simple as sudo <em>apt-get install software-package</em> or<em> if you can&#8217;t find it, build it</em>. The later being a motto that I have adopted more and more recently.</p>
<p style="text-align: left;">3) <strong>Security and piece of mind</strong></p>
<p style="text-align: left;">I&#8217;ve worked at a few places where management is more then aggressive about banning and prohibiting any sort of IM, or un-work-related surfing activities. This often spawns rumors of packet sniffing, and other things that are less then desirable to me. The answer to this is simply an <em>SSH tunnel</em>. Very simply any Linux machine can be tunneled using the following ssh command:</p>
<p style="text-align: left;">ssh -D port username@hostname.com</p>
<p style="text-align: left;">Once this is done, you can then use System -&gt; Preference Network Proxy to point your connection to localhost:port using a SOCKS proxy.</p>
<p style="text-align: left;">I normally refrain from setting the proxy at this level however because it is fairly global. Instead I set the proxy in each application (mail, im, firefox) independently, allowing for better customization. For Firefox this is particularly important if you are running a localhost development environment. I suggest you use <a title="Foxy Proxy" href="http://foxyproxy.mozdev.org/" target="_blank">Foxy Proxy</a> to configure patterns for host names that use the proxy and host names that do not. Now that you are tunneling through your favourite remote server, you have the piece of mind knowing that your web traffic is not open to prying eyes.</p>
<p style="text-align: left;">And there you have it. These are the 3 main reasons why I have decided to exlcusively use Linux/Ubuntu for any work related project. It should be kept in mind that these reasons are much more particular to Linux in a whole then <a title="Ubuntu" href="http://ubuntu.org" target="_blank">Ubuntu</a> itself, which is simply my perferred flavor of Linux. Also, there are many other great reasons, such as cron jobs, lynx, raggle and plain CLI that make Linux perfect as a work desktop, so I&#8217;d be happy to hear why you <strong>do</strong> you <strong>don&#8217;t</strong> perfer Linux.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.slajax.com/2008/08/12/why-i-only-use-linux-at-work/feed/</wfw:commentRss>
		</item>
		<item>
		<title>xentheon &#8211; where is my mind</title>
		<link>http://blog.slajax.com/2008/02/14/xentheon-where-is-my-mind/</link>
        <customfield></customfield>
		<comments>http://blog.slajax.com/2008/02/14/xentheon-where-is-my-mind/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 00:43:36 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://blog.slajax.com/2008/02/14/xentheon-where-is-my-mind/</guid>
		<description><![CDATA[This is probably one of the coolest source code visualizations I have ever seen. I'm not exactly sure how they did it. Points to whomever can explain it!read more [1] &#124; digg story [2]

[1] http://www.100mb.nl/
[2] http://digg.com/linux_unix/xentheon_where_is_my_mind]]></description>
			<content:encoded><![CDATA[This is probably one of the coolest source code visualizations I have ever seen. I&#8217;m not exactly sure how they did it. Points to whomever can explain it!<br/><br/><a href="http://www.100mb.nl/">read more</a> | <a href="http://digg.com/linux_unix/xentheon_where_is_my_mind">digg story</a>]]></content:encoded>
			<wfw:commentRss>http://blog.slajax.com/2008/02/14/xentheon-where-is-my-mind/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bash Installation Script</title>
		<link>http://blog.slajax.com/2007/07/30/bash-installation-script/</link>
        <customfield>bash.gif</customfield>
		<comments>http://blog.slajax.com/2007/07/30/bash-installation-script/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 21:53:05 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://slajax.com/blog/2007/07/30/bash-installation-script/</guid>
		<description><![CDATA[So I got bored of always manually installing the content management system, so i wrote a little bash script to take care of all the good stuff. I haven't written bash in a long time, but I really like it. It's some of the most useful code I've ever written. So powerful.


# !/bin/sh
# @title: CMS bash install script
# @dev: Kyle Campbell - kc@slajax.com
# @purpose: -simple walk through of cms installation tasks
#           -delete plesk generated directories and extract latest cms tar
#     -connect to mysql and load clean data structure
#     -generate unique lib/includes/db.php file for specific install
##################################################

##########################
# Step 1:  get domain for install #
########################

echo "[setup]: Please enter the domain you are configuring the cms for:"
 read domain

#####################
# Step 2: confirm spelling #
####################

echo "[setup]: Ok, installing for for domain: $domain, right? (y/n)"
 read confirmDomain

################################################
# Step 3: echo out the install path and confirm this install path #
################################################

if [ $confirmDomain == "y" ]
 then
         echo "[setup]: ok, here we go, installing to /var/www/vhosts/$domain/httpdocs/, ready? (y/n)"
 else
         echo "[setup]: installation aborted. go rtfm already."
  exit
fi
 read confirmDir

#####################################################################
# Step 4: if install path is confirmed, remove plesk generated files and dirs, then install cms #
#####################################################################

if [ $confirmDir == "y" ]
 then
  if [ -d "/var/www/vhosts/$domain/httpdocs" ]
   then
    echo "[setup]: cleaning directory and unpacking latest cms archive."

    if [ -f "/var/www/vhosts/$domain/httpdocs/index.html" ]
     then
                                                echo "[setup]: deleting file: index.html"
      sudo rm -R /var/www/vhosts/$domain/httpdocs/index.html
    fi
    if [ -f "/var/www/vhosts/$domain/httpdocs/favicon.ico" ]
     then
                                                echo "[setup]: deleting file: favicon.ico"
      sudo rm -R /var/www/vhosts/$domain/httpdocs/favicon.ico
    fi
    if [ -d "/var/www/vhosts/$domain/httpdocs/css/" ]
     then
                                                echo "[setup]: deleting dir: /css/"
      sudo rm -R /var/www/vhosts/$domain/httpdocs/css/
    fi
                         if [ -d "/var/www/vhosts/$domain/httpdocs/img/" ]
     then
                                                echo "[setup]: deleting dir: /img/"
      sudo rm -R /var/www/vhosts/$domain/httpdocs/img/
    fi
                                if [ -d "/var/www/vhosts/$domain/httpdocs/picture_library/" ]
     then
                                                echo "[setup]: deleting dir: /picture-library/"
      sudo rm -R /var/www/vhosts/$domain/httpdocs/picture_library/
    fi
                                if [ -d "/var/www/vhosts/$domain/httpdocs/plesk-stat/" ]
     then
                                                echo "[setup]: deleting dir: /plesk-stat/"
      sudo rm -R /var/www/vhosts/$domain/httpdocs/plesk-stat/
    fi
                                if [ -d "/var/www/vhosts/$domain/httpdocs/test/" ]
     then
                                                echo "[setup]: deleting dir: /test/"
      sudo rm -R /var/www/vhosts/$domain/httpdocs/test/
    fi
    if [ -f "/home/KyleC/cms/installCms.tar" ]
     then
      echo "[setup]: unpacking cms files..."
      sudo tar -xvf /home/KyleC/cms/installCms.tar
     else
      echo "[setup]: cms install archive not present. exiting."
      exit
    fi
   else
    echo "[setup]: this directory does not exist. have the domain created first."
    echo "[setup]: installation aborted. go rtfm already.  please continue manually."
    exit
  fi
 else
  echo "[setup]: installation aborted. go rtfm already. please continue manually."
  exit
fi


################################################
# Step 5:  set ownerships and permissions for new install path #
###############################################

echo "[setup]: ok done unpacking, now we need to set the correct permissions. Please provide directory user:"
 read userPerms

if [ $userPerms != "" ]
 then
  if [ -d "/var/www/vhosts/$domain/httpdocs/" ]
   then
    echo "[setup]: setting permissions $userPerms.psacln for core files"
     sudo chown -R $userPerms.psacln /var/www/vhosts/$domain/httpdocs/*
     sudo chown -R $userPerms.psacln /var/www/vhosts/$domain/httpdocs/.htaccess
     sudo chmod -R 0777 /var/www/vhosts/$domain/httpdocs/sql/
        sudo chmod -R 0777 /var/www/vhosts/$domain/httpdocs/uploaded/
     sudo chmod -R 0777 /var/www/vhosts/$domain/httpdocs/lib/includes/db.php

    echo "[setup]: done setting permissions."
  fi
 else
  echo "[setup]: invalid input, please continue manually from permissions step."
                echo "[setup]: installation aborted. go rtfm already.  please continue manually."
fi


######################################################
# Step 6: installing database and configuring constants for application #
#####################################################
echo "[setup]: please enter database name:"
 read database

echo "[setup]: please enter user name for database '$database':"
 read username

echo "[setup]: please enter password for databas user '$username':"
 read dbpass

echo "[setup]: ok, lets import the database structure now..."

 sudo mysql --verbose --host=mysql-host --user=$username --password=$dbpass $database < /var/www/vhosts/$domain/httpdocs/sql/installCms.sql

echo "[setup]: database configured, creating config file for cms now..."


sudo cat > /var/www/vhosts/$domain/httpdocs/lib/includes/db.php 
]]></description>
			<content:encoded><![CDATA[So I got bored of always manually installing the content management system, so i wrote a little bash script to take care of all the good stuff. I haven&#8217;t written bash in a long time, but I really like it. It&#8217;s some of the most useful code I&#8217;ve ever written. So powerful.

<div class='codeWrapper'><div class='codeTitle'>bash<span class='codeInstruct'>hover edges to scroll</span></div><code><pre>&nbsp;
<span style="color: #808080; font-style: italic;"># !/bin/sh</span>
<span style="color: #808080; font-style: italic;"># @title: CMS bash install script</span>
<span style="color: #808080; font-style: italic;"># @dev: Kyle Campbell - kc@slajax.com</span>
<span style="color: #808080; font-style: italic;"># @purpose: -simple walk through of cms installation tasks</span>
<span style="color: #808080; font-style: italic;">#           -delete plesk generated directories and extract latest cms tar</span>
<span style="color: #808080; font-style: italic;">#     -connect to mysql and load clean data structure</span>
<span style="color: #808080; font-style: italic;">#     -generate unique lib/includes/db.php file for specific install</span>
<span style="color: #808080; font-style: italic;">##################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;">##########################</span>
<span style="color: #808080; font-style: italic;"># Step 1:  get domain for install #</span>
<span style="color: #808080; font-style: italic;">########################</span>
&nbsp;
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: Please enter the domain you are configuring the cms for:"</span>
 <span style="color: #000066;">read</span> domain
&nbsp;
<span style="color: #808080; font-style: italic;">#####################</span>
<span style="color: #808080; font-style: italic;"># Step 2: confirm spelling #</span>
<span style="color: #808080; font-style: italic;">####################</span>
&nbsp;
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: Ok, installing for for domain: $domain, right? (y/n)"</span>
 <span style="color: #000066;">read</span> confirmDomain
&nbsp;
<span style="color: #808080; font-style: italic;">################################################</span>
<span style="color: #808080; font-style: italic;"># Step 3: echo out the install path and confirm this install path #</span>
<span style="color: #808080; font-style: italic;">################################################</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$confirmDomain</span> == <span style="color: #ff0000;">"y"</span> <span style="color: #66cc66;">&#93;</span>
 <span style="color: #b1b100;">then</span>
         <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: ok, here we go, installing to /var/www/vhosts/$domain/httpdocs/, ready? (y/n)"</span>
 <span style="color: #b1b100;">else</span>
         <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: installation aborted. go rtfm already."</span>
  <span style="color: #000066;">exit</span>
<span style="color: #b1b100;">fi</span>
 <span style="color: #000066;">read</span> confirmDir
&nbsp;
<span style="color: #808080; font-style: italic;">#####################################################################</span>
<span style="color: #808080; font-style: italic;"># Step 4: if install path is confirmed, remove plesk generated files and dirs, then install cms #</span>
<span style="color: #808080; font-style: italic;">#####################################################################</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$confirmDir</span> == <span style="color: #ff0000;">"y"</span> <span style="color: #66cc66;">&#93;</span>
 <span style="color: #b1b100;">then</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -d <span style="color: #ff0000;">"/var/www/vhosts/$domain/httpdocs"</span> <span style="color: #66cc66;">&#93;</span>
   <span style="color: #b1b100;">then</span>
    <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: cleaning directory and unpacking latest cms archive."</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -f <span style="color: #ff0000;">"/var/www/vhosts/$domain/httpdocs/index.html"</span> <span style="color: #66cc66;">&#93;</span>
     <span style="color: #b1b100;">then</span>
                                                <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: deleting file: index.html"</span>
      sudo rm -R /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/index.html
    <span style="color: #b1b100;">fi</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -f <span style="color: #ff0000;">"/var/www/vhosts/$domain/httpdocs/favicon.ico"</span> <span style="color: #66cc66;">&#93;</span>
     <span style="color: #b1b100;">then</span>
                                                <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: deleting file: favicon.ico"</span>
      sudo rm -R /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/favicon.ico
    <span style="color: #b1b100;">fi</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -d <span style="color: #ff0000;">"/var/www/vhosts/$domain/httpdocs/css/"</span> <span style="color: #66cc66;">&#93;</span>
     <span style="color: #b1b100;">then</span>
                                                <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: deleting dir: /css/"</span>
      sudo rm -R /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/css/
    <span style="color: #b1b100;">fi</span>
                         <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -d <span style="color: #ff0000;">"/var/www/vhosts/$domain/httpdocs/img/"</span> <span style="color: #66cc66;">&#93;</span>
     <span style="color: #b1b100;">then</span>
                                                <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: deleting dir: /img/"</span>
      sudo rm -R /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/img/
    <span style="color: #b1b100;">fi</span>
                                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -d <span style="color: #ff0000;">"/var/www/vhosts/$domain/httpdocs/picture_library/"</span> <span style="color: #66cc66;">&#93;</span>
     <span style="color: #b1b100;">then</span>
                                                <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: deleting dir: /picture-library/"</span>
      sudo rm -R /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/picture_library/
    <span style="color: #b1b100;">fi</span>
                                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -d <span style="color: #ff0000;">"/var/www/vhosts/$domain/httpdocs/plesk-stat/"</span> <span style="color: #66cc66;">&#93;</span>
     <span style="color: #b1b100;">then</span>
                                                <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: deleting dir: /plesk-stat/"</span>
      sudo rm -R /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/plesk-stat/
    <span style="color: #b1b100;">fi</span>
                                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -d <span style="color: #ff0000;">"/var/www/vhosts/$domain/httpdocs/test/"</span> <span style="color: #66cc66;">&#93;</span>
     <span style="color: #b1b100;">then</span>
                                                <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: deleting dir: /test/"</span>
      sudo rm -R /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/<span style="color: #000066;">test</span>/
    <span style="color: #b1b100;">fi</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -f <span style="color: #ff0000;">"/home/KyleC/cms/installCms.tar"</span> <span style="color: #66cc66;">&#93;</span>
     <span style="color: #b1b100;">then</span>
      <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: unpacking cms files..."</span>
      sudo tar -xvf /home/KyleC/cms/installCms.tar
     <span style="color: #b1b100;">else</span>
      <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: cms install archive not present. exiting."</span>
      <span style="color: #000066;">exit</span>
    <span style="color: #b1b100;">fi</span>
   <span style="color: #b1b100;">else</span>
    <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: this directory does not exist. have the domain created first."</span>
    <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: installation aborted. go rtfm already.  please continue manually."</span>
    <span style="color: #000066;">exit</span>
  <span style="color: #b1b100;">fi</span>
 <span style="color: #b1b100;">else</span>
  <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: installation aborted. go rtfm already. please continue manually."</span>
  <span style="color: #000066;">exit</span>
<span style="color: #b1b100;">fi</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">################################################</span>
<span style="color: #808080; font-style: italic;"># Step 5:  set ownerships and permissions for new install path #</span>
<span style="color: #808080; font-style: italic;">###############################################</span>
&nbsp;
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: ok done unpacking, now we need to set the correct permissions. Please provide directory user:"</span>
 <span style="color: #000066;">read</span> userPerms
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$userPerms</span> != <span style="color: #ff0000;">""</span> <span style="color: #66cc66;">&#93;</span>
 <span style="color: #b1b100;">then</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -d <span style="color: #ff0000;">"/var/www/vhosts/$domain/httpdocs/"</span> <span style="color: #66cc66;">&#93;</span>
   <span style="color: #b1b100;">then</span>
    <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: setting permissions $userPerms.psacln for core files"</span>
     sudo chown -R <span style="color: #0000ff;">$userPerms</span>.psacln /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/*
     sudo chown -R <span style="color: #0000ff;">$userPerms</span>.psacln /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/.htaccess
     sudo chmod -R <span style="color: #cc66cc;">0777</span> /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/sql/
        sudo chmod -R <span style="color: #cc66cc;">0777</span> /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/uploaded/
     sudo chmod -R <span style="color: #cc66cc;">0777</span> /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/lib/includes/db.php
&nbsp;
    <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: done setting permissions."</span>
  <span style="color: #b1b100;">fi</span>
 <span style="color: #b1b100;">else</span>
  <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: invalid input, please continue manually from permissions step."</span>
                <span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: installation aborted. go rtfm already.  please continue manually."</span>
<span style="color: #b1b100;">fi</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">######################################################</span>
<span style="color: #808080; font-style: italic;"># Step 6: installing database and configuring constants for application #</span>
<span style="color: #808080; font-style: italic;">#####################################################</span>
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: please enter database name:"</span>
 <span style="color: #000066;">read</span> database
&nbsp;
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: please enter user name for database '$database':"</span>
 <span style="color: #000066;">read</span> username
&nbsp;
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: please enter password for databas user '$username':"</span>
 <span style="color: #000066;">read</span> dbpass
&nbsp;
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: ok, lets import the database structure now..."</span>
&nbsp;
 sudo mysql --verbose --<span style="color: #0000ff;">host=</span>mysql-host --<span style="color: #0000ff;">user=</span><span style="color: #0000ff;">$username</span> --<span style="color: #0000ff;">password=</span><span style="color: #0000ff;">$dbpass</span> <span style="color: #0000ff;">$database</span> &lt; /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/sql/installCms.sql
&nbsp;
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"[setup]: database configured, creating config file for cms now..."</span>
&nbsp;
&nbsp;
sudo cat &gt; /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/lib/includes/db.php &lt;&lt;End-of-message
&lt;?
        global \<span style="color: #0000ff;">$db</span>;
        \<span style="color: #0000ff;">$database_server</span> = <span style="color: #ff0000;">'mysql-host'</span>;
        \<span style="color: #0000ff;">$database_user</span> = <span style="color: #ff0000;">'$username'</span>;
        \<span style="color: #0000ff;">$database_password</span> = <span style="color: #ff0000;">'$dbpass'</span>;
        \<span style="color: #0000ff;">$database_name</span> = <span style="color: #ff0000;">'$database'</span>;
        global \<span style="color: #0000ff;">$tbl_prefix</span>;
        \<span style="color: #0000ff;">$tbl_prefix</span> = <span style="color: #ff0000;">'cxcmscore_'</span>;
?&gt;
End-of-message
&nbsp;
sudo chmod -R <span style="color: #cc66cc;">0644</span> /var/www/vhosts/<span style="color: #0000ff;">$domain</span>/httpdocs/lib/includes/db.php
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">""</span>
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">""</span>
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"###############################################################################"</span>
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"#"</span>
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"# [setup]: configurationa file generated at: /var/www/vhosts/$domain/httpdocs/lib/includes/db.php"</span>
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"# [setup]: The CMS is now installed. if you have questions about this script please email kyle@slajax.com"</span>
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"#"</span>
<span style="color: #000066;">echo</span> <span style="color: #ff0000;">"###############################################################################"</span>
&nbsp;
<span style="color: #000066;">exit</span>
&nbsp;</pre></code></div>

There you have it. Not only can I write pretty AJAX scripts, but I&#8217;m a damn good system administrator too!]]></content:encoded>
			<wfw:commentRss>http://blog.slajax.com/2007/07/30/bash-installation-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Open source or DEATH!</title>
		<link>http://blog.slajax.com/2007/05/04/open-source-or-death/</link>
        <customfield>opensource_or_death.gif</customfield>
		<comments>http://blog.slajax.com/2007/05/04/open-source-or-death/#comments</comments>
		<pubDate>Fri, 04 May 2007 18:19:29 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[other]]></category>
		<category><![CDATA[comics]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[xkcd]]></category>

		<guid isPermaLink="false">http://slajax.com/blog/2007/05/04/open-source-or-death/</guid>
		<description><![CDATA[

Thanks to Inviz [1] for this great comic posted via #mootools on irc.freenode.net

[1] http://inviz.ru/]]></description>
			<content:encoded><![CDATA[<img src="/wp-content/assets/imgs/open_source.png" width="555"/>

Thanks to <a href="http://inviz.ru/" target="_blank">Inviz</a> for this great comic posted via #mootools on irc.freenode.net]]></content:encoded>
			<wfw:commentRss>http://blog.slajax.com/2007/05/04/open-source-or-death/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

