<?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>Software Passion &#187; System Administration</title>
	<atom:link href="http://www.softwarepassion.com/category/system_administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.softwarepassion.com</link>
	<description>by Krzysztof Grajek</description>
	<lastBuildDate>Thu, 18 Mar 2010 17:46:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux Command Lines Tips and Tricks</title>
		<link>http://www.softwarepassion.com/linux-command-lines-tips-and-tricks/</link>
		<comments>http://www.softwarepassion.com/linux-command-lines-tips-and-tricks/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 10:59:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[linux tips]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=313</guid>
		<description><![CDATA[<span style="max-width: 100px; display: block; float: left;"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/linux_commands_tips-150x150.jpg" alt="jquery" title="css frameworks" width="100" height="100" class="size-thumbnail wp-image-278" /></span><span style="margin: 0px; padding-left: 10px; display: block; max-width: 370px; float: left;">Linux Command Lines Tips and Tricks</span> ]]></description>
			<content:encoded><![CDATA[<p><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/linux_commands_tips.jpg" rel="lightbox[313]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/linux_commands_tips-150x150.jpg" alt="linux_commands_tips" title="linux_commands_tips" width="150" height="150" class="alignleft size-thumbnail wp-image-314" /></a>Linux Command Lines Tips and Tricks<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
<a href="http://webhostinghelpguy.inmotionhosting.com/developer-tools/linux-command-line-tips-and-tricks/">Linux Command Lines Tips and Tricks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/linux-command-lines-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Special Linux Distributions That You Should Know</title>
		<link>http://www.softwarepassion.com/10-special-linux-distributions-that-you-should-know/</link>
		<comments>http://www.softwarepassion.com/10-special-linux-distributions-that-you-should-know/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 13:31:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=277</guid>
		<description><![CDATA[<span style="max-width: 100px; display: block; float: left;"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/linux001-150x150.png" alt="daniweb" title="daniweb 10 linux distros" width="100" height="100" class="size-thumbnail wp-image-278" /></span><span style="margin: 0px; padding-left: 10px; display: block; max-width: 370px; float: left;">10 Special Linux Distributions That You Should Know</span> 
]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_278" class="wp-caption alignnone" style="width: 160px"><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/linux001.png" rel="lightbox[277]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/linux001-150x150.png" alt="daniweb" title="daniweb 10 linux distros" width="100" height="100" class="size-thumbnail wp-image-278" /></a><p class="wp-caption-text">daniweb</p></div><br />
10 Special Linux Distributions That You Should Know<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
<a href="http://www.daniweb.com/news/story239006.html#">http://www.daniweb.com/news/story239006.html#</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/10-special-linux-distributions-that-you-should-know/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Android development platform on Ubuntu Linux 9.04</title>
		<link>http://www.softwarepassion.com/setting-up-android-development-platform-on-ubuntu-linux-904/</link>
		<comments>http://www.softwarepassion.com/setting-up-android-development-platform-on-ubuntu-linux-904/#comments</comments>
		<pubDate>Tue, 12 May 2009 10:05:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General Programming]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=176</guid>
		<description><![CDATA[<span style="max-width: 100px; display: block; float: left;"><img src="http://www.softwarepassion.com/wp-content/uploads/android.png" alt="android" title="android"/></span><span style="margin-bottom: 5px; padding-left: 10px; display: block; max-width: 370px; float: left;">In this post I will go step by step through the setup of your development box for Android and all its goodness.                     
</span>]]></description>
			<content:encoded><![CDATA[<p>In this post I will go step by step through the setup of your development box for Android and all its goodness. I start with fresh install of the newest and shinest Ubuntu platform 9.04, which by the way on the first look is just great. I&#8217;m a happy owner of G1 for a few months and this is the best phone I ever had so why not start writing some software on it!</p>
<p><strong>Step One.</strong></p>
<p>Before installing anything please run the following command (actually 2 commands)</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:535px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> update <span class="sy0">&amp;&amp;</span> <span class="kw2">sudo</span> <span class="kw2">apt-get</span> upgrade</div></div>
<p>Install Java! You develop on android or not Java is a must on all my machines <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:535px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace">$ <span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> sun-java6-jdk</div></div>
<p>You can now check your java installation by issuing two commands:</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:535px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace">$ java <span class="re5">-version</span></div></div>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:535px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace">$ javac <span class="re5">-version</span></div></div>
<p>You should be able to see output stating that you have java 6 installed, huuraaayy!</p>
<p><strong>Step Two.</strong></p>
<p>Download and install Android SDK<br />
You can download the latest android SDK from the android development website (developer.android.com), the link to the latest version is <a href="http://developer.android.com/sdk/1.5_r1/index.html">here</a><br />
After your download completes, unzip the file to the directory of your choice. I copy the whole folder into my home directory but the doesn&#8217;t really matter.<br />
Open up your favourite text editor (VIM of course) and add the following line at the very bottom of the .bashrc file:</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:535px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw3">export</span> <span class="re2">PATH</span>=<span class="co1">${PATH}</span>:<span class="sy0">/</span>home<span class="sy0">/</span>kris<span class="sy0">/</span>android-sdk-linux_x86-<span class="nu0">1.5</span>_r1<span class="sy0">/</span>tools</div></div>
<p><strong>Stepp Three</strong></p>
<p>Download and Install Eclipse</p>
<p>I wish I could go for the easy one here and download the version using apt-get but unfortunately not as the version in repos is 3.2 and ADT plugin requires version 3.3 or higher. You have to download the eclipse for www.eclipse.org and unpack it. Once unpacked its ready to use!</p>
<p><strong>Step Four</strong></p>
<p>Download and install Eclipse plugin<br />
This is instruction from the developer.android.com with one small modification, instead of https use http:</p>
<blockquote><p>
   1.  Start Eclipse, then select Help > Software Updates&#8230;.<br />
   2. In the dialog that appears, click the Available Software tab.<br />
   3. Click Add Site&#8230;<br />
   4. Enter the Location:</p>
<p>      <strong>http://dl-ssl.google.com/android/eclipse/<br />
</strong><br />
      If you have trouble aqcuiring the plugin, try using &#8220;http&#8221; in the Location URL, instead of &#8220;https&#8221; (https is preferred for security reasons).</p>
<p>      Click OK.<br />
   5. Back in the Available Software view, you should see the plugin listed by the URL, with &#8220;Developer Tools&#8221; nested within it. Select the checkbox next to Developer Tools and click Install&#8230;<br />
   6. On the subsequent Install window, &#8220;Android DDMS&#8221; and &#8220;Android Development Tools&#8221; should both be checked. Click Next.<br />
   7. Read and accept the license agreement, then click Finish.<br />
   8. Restart Eclipse.</p>
</blockquote>
<p>After executing all the steps above you are ready for Android development. The last step in this tutorial is to run example android projects on your linux dev machine.<br />
If you encounter an error saying :</p>
<p>An error occurred during provisioning.<br />
Cannot connect to keystore.<br />
JKS</p>
<p>Please check your java version. If its set to 1.5 than please run the following command:</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:535px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">sudo</span> update-java-alternatives <span class="re5">-s</span> java-<span class="nu0">6</span>-sun</div></div>
<p>Once you finish installing required plugins, restart your eclipse and go to Window->Preferences->Android and set up a path to your android SDK</p>
<p><strong>Step Five</strong></p>
<p>Check your configuration</p>
<p>If all went fine you can try to develop Hello World application in android. You can find the instruction on the android development site:<br />
<a href="http://developer.android.com/guide/tutorials/hello-world.html">http://developer.android.com/guide/tutorials/hello-world.html</a></p>
<p>More android tutorials to come!<br />
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/setting-up-android-development-platform-on-ubuntu-linux-904/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Backup your MS SQL Server with C#</title>
		<link>http://www.softwarepassion.com/backup-your-ms-sql-server-with-c/</link>
		<comments>http://www.softwarepassion.com/backup-your-ms-sql-server-with-c/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 11:04:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=80</guid>
		<description><![CDATA[Today I will describe some code snippets on how to backup your MS SQL Server database to a &#8216;.bak&#8217; file using C#. Later on we will zip our .bak file using open source C# zip library as bak files seems to have high compression ratio.
Backing up files require us to connect to the database server [...]]]></description>
			<content:encoded><![CDATA[<p>Today I will describe some code snippets on how to backup your MS SQL Server database to a &#8216;.bak&#8217; file using C#. Later on we will zip our .bak file using open source C# zip library as bak files seems to have high compression ratio.<br />
Backing up files require us to connect to the database server and than use of Microsoft.SqlServer.Mangement.Smo objects to create actual backup.</p>
<p>Assuming we have some private fileds ready:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">private Server sqlsrv; //initialized when connection succeedes<br />
&nbsp; &nbsp; &nbsp; &nbsp; private string dbName;<br />
&nbsp; &nbsp; &nbsp; &nbsp; private string backupFile;<br />
&nbsp; &nbsp; &nbsp; &nbsp; private string serverName;<br />
&nbsp; &nbsp; &nbsp; &nbsp; private string sqlUser;<br />
&nbsp; &nbsp; &nbsp; &nbsp; private string sqlPass;</div></div>
</pre>
<p>Lets first create a connection to our database server and initialize our Server type object:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">private bool connectToSQLServer()<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ServerConnection serverConn = new ServerConnection(this.serverName);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Log in into sqlserver<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; serverConn.LoginSecure = false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Give the login username<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; serverConn.Login = this.sqlUser;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Give the login password<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; serverConn.Password = this.sqlPass;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // create a new sql server object<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sqlsrv = new Server(serverConn);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; catch (Exception ex)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.WriteLine(ex.StackTrace);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }</div></div>
</pre>
<p>If all goes fine and we have our Server (sqlsrv) object ready we can start our backup operation:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">public bool bakBackup()<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //If the connection returns false return from this method too.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!connectToSQLServer())<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Create a new backup object<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Backup bkpDatabase = new Backup();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set the type to database<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bkpDatabase.Action = BackupActionType.Database;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // set the database name we want to actually backup<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bkpDatabase.Database = dbName;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // To get the file from me actual backup create BackupDeviceItem<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BackupDeviceItem bkpDevice = new BackupDeviceItem(this.backupFile, DeviceType.File);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // add the backup file device to our backup<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bkpDatabase.Devices.Add(bkpDevice);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // execute the actual backup using Smo<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bkpDatabase.SqlBackup(sqlsrv);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //verify if the file exist<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (File.Exists(this.backupFile))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; catch (Exception ex)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.WriteLine(&quot;Backup file couldn't be created&quot; + ex.StackTrace);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }</div></div>
</pre>
<p>As a side note I would mention that the only two folders I have found on my system where I can actually perform the backup (store tha bak file) is &#8220;C:Program FilesMicrosoft SQL ServerMSSQL.3MSSQLBackup&#8221; or &#8220;C:Program FilesMicrosoft SQL ServerMSSQL.3MSSQLData&#8221; folders, this has something to do with permissions setup and I&#8217;ll will update this post once I find the solution. You can read my post on <a href="http://stackoverflow.com/questions/728658/creating-sql-server-backup-file-bak-with-c-to-any-location/729329#729329">stackoverflow</a> regarding this issue.</p>
<p>Assuming that all went ok, lets create a zip file which will compress our bak file to the size more than 2 times smaller than the original bak file.<br />
For file comression I will use great C# library &#8216;SharpZipLib&#8217; which you can find <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib/">here</a>.<br />
Before using the snippet below you would have to add a reference to the library in your project. </p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">public static void Zip(string sourceFile, string destinationFile, int BufferSize)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FileStream fileStreamIn = new FileStream(sourceFile, FileMode.Open, FileAccess.Read);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FileStream fileStreamOut = new FileStream(destinationFile, FileMode.Create, FileAccess.Write);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ZipOutputStream zipOutputStream = new ZipOutputStream(fileStreamOut);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byte[] buffer = new byte[BufferSize];<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ZipEntry entry = new ZipEntry(Path.GetFileName(sourceFile));<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zipOutputStream.PutNextEntry(entry);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int size;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; do<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; size = fileStreamIn.Read(buffer, 0, buffer.Length);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zipOutputStream.Write(buffer, 0, size);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } while (size &gt; 0);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zipOutputStream.Close();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileStreamOut.Close();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileStreamIn.Close();<br />
&nbsp; &nbsp; &nbsp; &nbsp; }</div></div>
</pre>
<p>Looks pretty easy? Well, actually it is! As a source and destination file arguments provide full path to your file (.bak) as source and (.zip) as destination and you are done.<br />
You can of course change one name to another using simple call:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">string zipFileName = fileName.Replace(&quot;.bak&quot;, &quot;.zip&quot;);</div></div>
</pre>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/backup-your-ms-sql-server-with-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux simple backup with FTP</title>
		<link>http://www.softwarepassion.com/linux-simple-backup-with-ftp/</link>
		<comments>http://www.softwarepassion.com/linux-simple-backup-with-ftp/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 07:11:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=55</guid>
		<description><![CDATA[This is my first post under new domain &#8217;softwarepassion.com&#8217;. I&#8217;m planning to blog more from now on as I have loads of new things to blog about  .
Today I will present you with simple backup shell script I have running on one of my servers. The script is damn easy and all it does [...]]]></description>
			<content:encoded><![CDATA[<p>This is my first post under new domain &#8217;softwarepassion.com&#8217;. I&#8217;m planning to blog more from now on as I have loads of new things to blog about <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<br />
Today I will present you with simple backup shell script I have running on one of my servers. The script is damn easy and all it does is:</p>
<ol>
<li>remove any earlier backup dirs and create new empty one</li>
<li>create mysql dump for the applications you want to backup</li>
<li>create tar.gz of the entire home directory</li>
<li>create tar.gz of the apache director to preserve settings </li>
<li>create tar.gz of everything I&#8217;ve created earlier to place everything in a single file</li>
<li>ftp the file to a backup server</li>
</ol>
<p>Lets start with the first task. Removing and creating dirs is pretty simple:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">rm -Rf /root/temp_bckp<br />
mkdir /root/temp_bckp</div></div>
</pre>
<p>Creating mysql backup we can do the easiest using mysqldump utility. The command for this is:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">mysqldump --user=your_db_user your_db_name &gt; /root/temp_bckp/your_Db_name.sql --password=your_db_password<br />
echo 'sql dump finished'</div></div>
</pre>
<p>Once we got all dumps in place we can start compressing home and apache directories directory:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">tar -zcvf /root/temp_bckp/home_bckp.tar.gz /home<br />
echo 'tar of home finished'<br />
<br />
tar -zcvf /root/temp_bckp/etcapache.tar.gz /etc/apache2/<br />
echo 'tar of etc/apache finished'</div></div>
</pre>
<p>Somwhere at the top of the script we store current date as a variable and we use it to name the final backup archive:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">DATEX=`date +%d%m%y`</div></div>
</pre>
<p>Final backup archive:</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">tar -zcvf /root/temp_bckp_$DATKA.tar.gz /root/temp_bckp<br />
echo 'tar of all finished'</div></div>
</pre>
<p>When we have all zipped together we are ready to send it over to the ftp backup server, I use ncftp utility which you can easily get on debian based distros using apt-get install ncftp or aptitude install ncftp.</p>
<pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">ncftpput -u ftp_user -p ftp_password your-ftp-domain.com . temp_bckp_$DATKA.tar.gz<br />
echo 'ftp finished'</div></div>
</pre>
<p>For ftp server I personally use Linode services which are very cheap in the basic package, you can check their offers <a href="http://www.linode.com">here</a></p>
<p>Complete shell script you can download from storage43 under this <a href="http://storage43.com/file/show/46">link</a><br />
Happy backuping <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/linux-simple-backup-with-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Adobe Flash Player 9 on OpenSolaris 11.2008</title>
		<link>http://www.softwarepassion.com/install-adobe-flash-player-9-on-opensolaris-112008/</link>
		<comments>http://www.softwarepassion.com/install-adobe-flash-player-9-on-opensolaris-112008/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 12:49:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://softwarepassion.com/?p=37</guid>
		<description><![CDATA[I have just installed the newest version of OpenSolaris on my laptop, and now I&#8217;m going through the installation of the &#8216;be-or-not-to-be&#8217; software, I have noticed that the OS 11 has a nice package manager, but I couldn&#8217;t find the flash player on it. Here you have a short and easy instructions on how to [...]]]></description>
			<content:encoded><![CDATA[<p>I have just installed the newest version of OpenSolaris on my laptop, and now I&#8217;m going through the installation of the &#8216;be-or-not-to-be&#8217; software, I have noticed that the OS 11 has a nice package manager, but I couldn&#8217;t find the flash player on it. Here you have a short and easy instructions on how to install flash player on your best of the best opensolaris box:</p>
<p>1. Go to any page where you expect flash contant (e.g www.youtube.com)<br />2. Click the &#8216;install flash player&#8217;, unfortunatelly it&#8217;s not that easy (the reason I&#8217;m writing this post) but you can download it on you desktop. If this for some reason doesn&#8217;t work (I got some security errors, just use wget to get the file &#8211; wget already installed <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).<br />3. Un-gzip it.<br />4. change to root on the console (su -)<br />5. copy the libflashplayer.so to the /usr/lib/firefox/plugins directory<br />6. restart the firefox<br />7. Enjoy flash movies!! <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/install-adobe-flash-player-9-on-opensolaris-112008/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>OpenSolaris 11.2008 with Windows Vista</title>
		<link>http://www.softwarepassion.com/opensolaris-112008-with-windows-vista/</link>
		<comments>http://www.softwarepassion.com/opensolaris-112008-with-windows-vista/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 12:18:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://softwarepassion.com/?p=36</guid>
		<description><![CDATA[I don&#8217;t blog much last couple of days (actually months   ) but this one I just had too. I run into one post on Dzone (link) which was about ZFS time machine in new solaris 11.2008 and I thought that its good time I&#8217;ll give it another shot. I had some really bad [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t blog much last couple of days (actually months <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) but this one I just had too. I run into one post on Dzone (<a href="http://java.dzone.com/news/killer-feature-opensolaris-200">link</a>) which was about ZFS time machine in new solaris 11.2008 and I thought that its good time I&#8217;ll give it another shot. I had some really bad experiences using solaris/opensolaris in dual boot with Windows Vista and was a bit scared but I&#8217;m in SHOCK!!!!! I have a IBM Lenovo R61 laptop, created some additional space using Vista&#8217;s partitioner, put the live CD into the cd drive and voila!!!<br />No problems with wireless (I have to say that it works better than on ubuntu so far), no problems with dual booting either, it was just working straight away, no manual editing of the grub file, nothing, nada, zero, PERFECT!!!<br />It seems actually much faster (maybe it&#8217;s my new laptop who knows). <br />Guys at Open Solaris &#8212; keep up the good work, thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/opensolaris-112008-with-windows-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nice Surprise! &#8211; Ubuntu 7.04 with Dell laptop short story!</title>
		<link>http://www.softwarepassion.com/nice-surprise-ubuntu-704-with-dell-laptop-short-story/</link>
		<comments>http://www.softwarepassion.com/nice-surprise-ubuntu-704-with-dell-laptop-short-story/#comments</comments>
		<pubDate>Sun, 27 May 2007 01:11:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://softwarepassion.com/?p=7</guid>
		<description><![CDATA[I have just bought brand new, shiny Dell Inspiron 6400 with Windows Vista installed on it. Well, my Vista experience didn&#8217;t last long (about 2 hours) and after I had to restart my laptop several times and answer few questions everytime  I wanted to do something (basically anything). I have decided to stop all [...]]]></description>
			<content:encoded><![CDATA[<p>I have just bought brand new, shiny Dell Inspiron 6400 with Windows Vista installed on it. Well, my Vista experience didn&#8217;t last long (about 2 hours) and after I had to restart my laptop several times and answer few questions everytime  I wanted to do something (basically anything). I have decided to stop all this and go back to my favorite linux distro. I have left Vista on it as I will need it later for my university work, and decided to create a dual boot machine.<br />   Now very good piece of advice for anyone buying a Dell computer &#8211; boot your machine from the recovery disk, install Vista from scratch and get rid of all this software preinstalled, this way you know what is going on.<br />   Vista is quite resistive and wants to have all computer for itself but I had encountered a few very nice surprises.<br />   First of all, Vista has quite nice partitioner. You can partition your disk in very easy and intuitive way.<br />   Secondly and most importantly Ubuntu proved to be great again!<br />   There is no conflict with the boot loaders, the Ubuntu GRUB doesn&#8217;t mess up Vista and nicely add it to the grub options. This was really nice as when I always start messing up with GRUB something strange comes out of it <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  this is of course simple lack of understanding things but who has a time for it.<br />   But that is nothing compare to the experience after installation! Everything works perfectly (so far <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).<br />   All the function buttons, MediaDirect buttos, wireless, memory card reader, nividia graphics (well this one with a little help from automatix), basically EVERYTHING!!!<br />   I understand that this is probably a result of Canonnical and Dell cooperation and I have to say this &#8211; Thank you very much!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/nice-surprise-ubuntu-704-with-dell-laptop-short-story/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to&#8217;s: Installing Sun Studio 11 on Ubuntu 7.04 FF</title>
		<link>http://www.softwarepassion.com/how-tos-installing-sun-studio-11-on-ubuntu-704-ff/</link>
		<comments>http://www.softwarepassion.com/how-tos-installing-sun-studio-11-on-ubuntu-704-ff/#comments</comments>
		<pubDate>Sun, 29 Apr 2007 02:47:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://softwarepassion.com/?p=4</guid>
		<description><![CDATA[I have always wanted to dive into C++ world (as a rather lazy kind never did). This is my another attempt. Since FF version of Ubuntu was released few days ago, almost every day I find something new and interesting. As I&#8217;m forced to write sometimes a very small C++ application (university commitments) and a [...]]]></description>
			<content:encoded><![CDATA[<p>I have always wanted to dive into C++ world (as a rather lazy kind never did). This is my another attempt. Since FF version of Ubuntu was released few days ago, almost every day I find something new and interesting. As I&#8217;m forced to write sometimes a very small C++ application (university commitments) and a couple of months ago I have realized that Sun Studio 11 is freely available, I wanted to give it a try. Unfortunately never did, that&#8217;s because somehow I couldn&#8217;t run it under Ubuntu (sometimes you have to choose, comparing the amount of work you have to do to actually make it work or the amount of work to write the program in VIM and forget about all the gui fancy staff). Anyway FF is available and suprise, suprise, Studio 11 works almost out of the box. Here you go simple step by step guide to install this &#8220;little&#8221; precious.</p>
<p> 1. Install Java SDK and JRE 5, for some reason SS11 doesn&#8217;t work with version 6, you can however still keep the version 6 as the default one on the system.<br /> 2. Install GNU C/C++ compiler under Ubuntu:</p>
<p>         sudo apt-get install build-essential</p>
<p> 3. Download Sun Studio 11 software for Linux<br /> 4. Run the installer:<br />         change to root (su -)<br />         move the downloaded .bz2 file to the directory where you want to install the software (in my case /opt directory)<br />         run:<br />             tar -xjvvf studio11-lin-x86.tar.bz2v<br />                 ./installer &#8211;nodisplay<br /> 5. Answer a few simple questions about installation<br /> 6. Don&#8217;t worry if sdk 1.4 was not installed.<br /> 7. Change one of the awk scripts:<br />        go to /<span style="font-style: italic;">installdirectory</span>/sun/sunstudio11/prod/scripts/ver.awk<br />         and change the line:</p>
<p>                           FS=<span style="color:red;">&#8220;&#8221;| |(|)|,|t&#8221;</span>;        <br />       to:<br />             <span style="font-family:monospace;">        </span>FS=<span style="color:red;">&#8220;&#8221;| |(|)|,|t&#8221;</span>;</p>
<p> 8. Add the studio&#8217;s bin directory to your PATH:<br />        Edit .bashrc and add the following line:</p>
<p>         PATH=/opt/sun/sunstudio11/bin:$PATH; export PATH</p>
<p> 9. Run the newly installed Studio 11 with:<br />         sunstudio<br />       Note:<br />            If you have more than one JDK available and e.g version 6 is your default              one, run sunstudio command with the following flag:<br />        sunstudio=&#8217;sunstudio &#8211;jdkhome &#8216;path-to-your-jdk5or4&#8242; in my case alias               sunstudio=&#8217;sunstudio &#8211;jdkhome /usr/lib/jvm/java-1.5.0-sun-1.5.0.11&#8242;<br />             If that is the case add the alias to your .bashrc file:<br />         alias sunstudio=&#8217;sunstudio &#8211;jdkhome /usr/lib/jvm/java-1.5.0-sun-1.5.0.11&#8242;<br />             and run the command sunstudio as normal.</p>
<p>Sun Studio 11 Splash Screen on Kubuntu 7.04 FF:</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_SjX7MIMF_HI/RjQSsCex5-I/AAAAAAAAAAM/FKamy1FMyn0/s1600-h/sssplash.png" rel="lightbox[4]"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_SjX7MIMF_HI/RjQSsCex5-I/AAAAAAAAAAM/FKamy1FMyn0/s320/sssplash.png" alt="" id="BLOGGER_PHOTO_ID_5058688829233424354" border="0" /></a><br />&#8230;and working IDE:</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_SjX7MIMF_HI/RjQTbyex5_I/AAAAAAAAAAU/lVvHZKvz09A/s1600-h/sunstudio.png" rel="lightbox[4]"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_SjX7MIMF_HI/RjQTbyex5_I/AAAAAAAAAAU/lVvHZKvz09A/s320/sunstudio.png" alt="" id="BLOGGER_PHOTO_ID_5058689649572177906" border="0" /></a>Good Luck <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> 
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/how-tos-installing-sun-studio-11-on-ubuntu-704-ff/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
