<?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>Things n&#039; Stuff Software</title>
	<atom:link href="http://geek.co.il/wp/category/software/feed" rel="self" type="application/rss+xml" />
	<link>http://geek.co.il/wp</link>
	<description>Thoughts about the universe in general</description>
	<lastBuildDate>Sun, 15 Jan 2012 12:41:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>Setting up Subversion svnserve daemon on CentOS</title>
		<link>http://geek.co.il/wp/2011/11/28/setting-up-subversion-svnserve-daemon-on-centos</link>
		<comments>http://geek.co.il/wp/2011/11/28/setting-up-subversion-svnserve-daemon-on-centos#comments</comments>
		<pubDate>Mon, 28 Nov 2011 15:04:04 +0000</pubDate>
		<dc:creator>Oded</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Apache HTTP Server]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[Secure Shell]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[svnserve]]></category>

		<guid isPermaLink="true">http://geek.co.il/wp/2011/11/28/setting-up-subversion-svnserve-daemon-on-centos</guid>
		<description><![CDATA[When you want to host a Subversion repository on your CentOS (or RHEL) server, its quite annoying that the only options available to serve your repository are SSH (using the svn+ssh:// schema in the Subversion URLs &#8211; it is basically set up out of the box, not tweaking necessary) and Apache&#8217;s mod_dav_svn (using the http:// [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to host a <a class="zem_slink" title="Apache Subversion" href="http://subversion.apache.org/" rel="homepage">Subversion</a> repository on your <a class="zem_slink" title="CentOS" href="http://www.centos.org/" rel="homepage">CentOS</a> (or <a class="zem_slink" title="Red Hat Enterprise Linux" href="http://www.redhat.com/rhel/" rel="homepage">RHEL</a>) server, its quite annoying that the only options available to serve your repository are <a class="zem_slink" title="Secure Shell" href="http://en.wikipedia.org/wiki/Secure_Shell" rel="wikipedia">SSH</a> (using the <code>svn+ssh://</code> schema in the Subversion URLs &#8211; it is basically set up out of the box, not tweaking necessary) and Apache&#8217;s mod_dav_svn (using the <code>http://</code> or <code>https://</code> schema in the Subversion URLs &#8211; this is somewhat complex to setup but good instructions are easy to find on the web).</p>
<p>The main advantage of either of these methods is security: both have easy transport security (SSH by default, Apache if you set it to server over SSL) and are easy to setup authentication for (SSH authenticate against the system&#8217;s accounts using <a class="zem_slink" title="Pluggable Authentication Modules" href="http://en.wikipedia.org/wiki/Pluggable_Authentication_Modules" rel="wikipedia">PAM</a> and Apache authenticate against basically anything with a simple setup).</p>
<p>The main disadvantage of these methods are that they are slow (SSH is apparently somewhat faster then HTTP) and when supporting multiple large projects of many developers I started running into all kinds of weird connection errors when you try to manipulate many files on many projects at the same time.</p>
<p>Subversion itself offers another alternative using their own network service called svnserve &#8211; this is a standard unix daemon that listens on a specific port and uses a native protocol to communicate with Subversion clients (using the <code>svn://</code> schema in Subversion URLs). It offers very good performance, but no transport security (encryption) by default. Another major problem with using svnserve as a network service is that while CentOS ships the binary itself (it is required as part of the way that the svn+ssh:// protocol is implemented) it doesn&#8217;t ship any support files to run it as a standalone service nor to help with its configuration. Also by default svnserve can only authenticate users using its own Apache-style password database file &#8211; which makes it unsuitable to integrate in large organizations.</p>
<p><span id="more-1878"></span></p>
<p>In this article I&#8217;ll document how I setup snvserve as a network service to support a large development environment. The requirements do not include transport security because the server is on a private network and can only be accessed by trusted computers (either local or through a VPN), but we do need to have Subversion users authenticate against a central authentication server that is used by all local services. In my setup the authentication services is Mirosoft ActiveDirectory, but the local server is setup to authenticate to the ActiveDirectory using PAM, so we will setup svnserve to use PAM and gloss over the ActiveDirectory specifics.</p>
<p>The process is as follows:</p>
<ol>
<li>Set up your server: Install CentOS 6 and configure PAM to authenticate to your central authentication. Verify that users can SSH into the server using their login credentials.</li>
<li>Set up your Subversion repository: Install subversion and use svnadmin to create your repository. In the below examples I&#8217;ve created the repository under /var/svn</li>
<li>Set up svnserve to require authentication and do the authentication using the Cyrus SASL libraries: copy the file <code>svnserve.conf</code> from your repository&#8217;s configuration directory (for example <code>/var/svn/svnserve.conf</code>) to <code>/etc/svnserve.conf</code>. Edit it and add in the <code>[general]</code> section the following lines: <code><br />
anon-access = none<br />
auth-access = write<br />
realm = The Name of Your Repository<br />
</code> make sure that all other settings in that section are commented out. Now add, at the bottom of the file, a new section like this: <code><br />
[sasl]<br />
use-sasl = true<br />
</code></li>
<li>Setup the Cyrus SASL library to work with the <code>saslauthd</code> authentication service: create the file <code>/etc/sasl2/svn.conf</code> with the following content: <code><br />
pwcheck_method: saslauthd<br />
mech_list: plain login<br />
</code></li>
<li>Start the <code>saslauthd</code> service and make sure it always run when the system start, by executing the following commands:<code><br />
# service saslauthd start<br />
# chkconfig saslauthd on<br />
</code></li>
<li>Set up <code>saslauthd</code> to allow svnserve to authenticate using the main system&#8217;s PAM configuration, by executing the following command:<code><br />
# cd /etc/pam.d<br />
# ln -s system-auth svn<br />
</code></li>
<li>Create the <a class="zem_slink" title="UNIX System V" href="http://en.wikipedia.org/wiki/UNIX_System_V" rel="wikipedia">SysV</a> initialization script for svnserve &#8211; this will allow you to start and stop svnserve using the <code>service</code> command and have it run when the system start. This is the major part that I expected CentOS to ship but is missing. Creating a good SysV script is not trivial &#8211; you can do it yourself but I suggest using the script presented here. I&#8217;ve used the script from <a href="http://mohanjith.net/blog/2007/07/svnserve-init-script.html">this blog post</a> which is not bad but its implementation of <code>status</code> didn&#8217;t report the status of a dead process, so I modified it and you can download my modified version <a title="svnserve SysV init script" href="http://geek.co.il/wp/wp-content/uploads/2011/11/svnserve.gz">here</a>. The file is compressed because of WordPress, just download it, run it through gunzip and copy the resulting file to <code>/etc/init.d/svnserve</code> and then give it &#8220;execute permissions&#8221; using: <code><br />
# chmod 755 /etc/init.d/svnserve<br />
</code></li>
<li>Create a configuration file for the service by creating and editing the file <code>/etc/sysconfig/subversion.conf</code> with this content: <code><br />
OPTIONS="--config-file=/etc/svnserve.conf -r /var/svn"<br />
</code><br />
We use the <code>-r</code> option to limit svnserve access to only our repository, so have the value there point to your actual repository if its not <code>/var/svn</code></li>
<li>Set up svnserve to run when the system start, and then start the service itself: <code><br />
# chkconfig svnserve on<br />
# service svnserve start<br />
</code></li>
</ol>
<p>And that&#8217;s it &#8211; you should have svnserve listening on port 3690 and ready to serve clients. The URL you use to access the repository should include only the server name as svnserve access is already rooted to only your repository by the configuration file. So for example if my server is called <code>svn</code> then the URL will be <code>svn://svn</code>.</p>
<p>This setup will still allow you to access the repository using the <code>svn+ssh://</code> protocol as you would under a normal setup. It can be a bit confusing as access over SSH uses different paths then over the Subversion svnserve network service, because you have to use the full path to the repository on the local file system in the <code>svn+ssh://</code> URL. To circumvent this, its possible to get the SSH access to also be rooted to your repository&#8217;s path and thus be symmetric with the above setup. To do this, create a new file at <code>/usr/local/bin/svnserve</code> and put the following code in it: <code><br />
#!/bin/bash<br />
exec /usr/bin/svnserve "$@" -r /var/svn<br />
</code><br />
Give the file &#8220;execute permissions&#8221; by running <code><br />
# chmod 755 /usr/local/bin/svnserve<br />
</code>, so it can be executed by the Subversion client instead of the system&#8217;s svnserve binary. Now both native Subversion and SSH access use basically the same URL, except for the schema part.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://waterbiscuit.wordpress.com/2011/08/04/centossubversion-configuration/">CentOS &#8211; Subversion Configuration</a> (waterbiscuit.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://stackoverflow.com/questions/7505832/passwords-and-svn">Passwords and svn</a> (stackoverflow.com)</li>
<li class="zemanta-article-ul-li"><a href="http://stackoverflow.com/questions/7520886/importing-a-subversion-repository">Importing a subversion repository</a> (stackoverflow.com)</li>
<li class="zemanta-article-ul-li"><a href="http://stackoverflow.com/questions/375869/subversion-merging-repositories">Subversion &#8211; Merging Repositories</a> (stackoverflow.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=83f84754-5ff9-460b-a839-a9c61c13faa2" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://geek.co.il/wp/2011/11/28/setting-up-subversion-svnserve-daemon-on-centos/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script day: find the oldest file in a directory structure</title>
		<link>http://geek.co.il/wp/2011/11/14/script-day-find-the-oldest-file-in-a-directory-structure</link>
		<comments>http://geek.co.il/wp/2011/11/14/script-day-find-the-oldest-file-in-a-directory-structure#comments</comments>
		<pubDate>Mon, 14 Nov 2011 16:53:57 +0000</pubDate>
		<dc:creator>Oded</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[File Management]]></category>
		<category><![CDATA[log retention]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="true">http://geek.co.il/wp/2011/11/14/script-day-find-the-oldest-file-in-a-directory-structure</guid>
		<description><![CDATA[This piece of script came in handy when I wrote a utility that &#8220;recycles&#8221; space on a logging partition: before log rotation archives the current log file, we move some old log files (depending on some archive freshness policy) to a remote storage that archives older files. The problem is that the &#8220;old archive storage&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>This piece of script came in handy when I wrote a utility that &#8220;recycles&#8221; space on a logging partition: before log rotation archives the current log file, we move some old log files (depending on some archive freshness policy) to a remote storage that archives older files.</p>
<p>The problem is that the &#8220;old archive storage&#8221; also has limited disk space and I got fed up managing the archive by hand. The solution I came up is to scan the hierarchy of  log files in the storage (logs are stored hierarchically according to origin and type) and delete old files until I have enough room to move some newer files in. That way the &#8220;old archive storage&#8221; is always kept full and keeps as much back-log as possible and does this automatically.</p>
<p>The piece of code that determines which files we want to delete works like this:</p>
<ol>
<li>Use <code>find</code> to list all the files in the directory structure</li>
<li>Pipe it to <code>perl</code> and collect all the file names in a list</li>
<li>Use perl&#8217;s sort operator to compare the modification times of each file in the list and show them in the order (i.e. oldest first)</li>
<li>Use <code>head</code> to get just the first file</li>
</ol>
<p>So it looks like this:</p>
<p><code>find /mnt/httpd_back/ -type f | perl -nle 'next unless -f; push @files, $_; END { foreach $file (sort { @a=stat($a); @b=stat($b); $a[9] &lt;=&gt; $b[9] } @files) { print $file; }}' | head -n1<br />
</code></p>
<p>Note: normally we use <code>head</code> to get some initial output and terminate the process early before it does more costly work &#8211; when <code>head</code> has enough data it terminates the pipe sending <code>SIGPIPE</code> to the upstream process and that usually terminates the process that generates the data. In this case &#8211; and in all other cases involving sort &#8211; the upstream process buffers all the data in its own memory before outputting anything, so it can sort everything, and using <code>head</code> here is just a filter to get what I want and does not actually save me from doing all the work. I could have easily done the same thing inside the perl script itself by replacing the block of  <code>print $file;</code> with <code>print $file; last;</code> &#8211; this has the same effect as using head, because <code>head</code> will send <code>SIGPIPE</code> to <code>perl</code> after getting the first print and will terminate it. Deciding which way you want to go is probably more about readability of the code and I prefer my original version because its easier to read to non-perl specialists.</p>
<p>I can then just remove that file, see if I have enough room to move in the newer log file and if no &#8211; repeat the process.</p>
<p>This would work well, I believe, but it may be inefficient if I find a bunch of small files and I want to copy in a large file. So what I did next is to take advantage of the fact that all the log files I have are named using the following simple format:</p>
<p><code>&lt;service&gt;-&lt;type&gt;_log-&lt;year&gt;&lt;month&gt;&lt;day&gt;.gz</code></p>
<p>and that allows me to easily find all the log files that record the same day and eliminate them at the same time. Subsequent moving of additional files will likely succeed because I cleared out all the log files of an entire day. If not, I can always go and clear up another day&#8217;s worth of logs.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=a8ef261f-81bb-4291-9d06-ccb32a631329" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://geek.co.il/wp/2011/11/14/script-day-find-the-oldest-file-in-a-directory-structure/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handling &#8220;Package file is invalid&#8221; problems on CyanogenMod 7</title>
		<link>http://geek.co.il/wp/2011/11/01/handling-package-file-is-invalid-problems-on-cyanogenmod-7</link>
		<comments>http://geek.co.il/wp/2011/11/01/handling-package-file-is-invalid-problems-on-cyanogenmod-7#comments</comments>
		<pubDate>Tue, 01 Nov 2011 13:59:03 +0000</pubDate>
		<dc:creator>Oded</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[CyanogenMod]]></category>
		<category><![CDATA[Motorola]]></category>

		<guid isPermaLink="true">http://geek.co.il/wp/2011/11/01/handling-package-file-is-invalid-problems-on-cyanogenmod-7</guid>
		<description><![CDATA[Update: The latest update for CyanogenMod for Milestone &#8211; version 7.1.0.3 solves this problem as well. Lately I&#8217;ve been having problems updating software on my Motorola Milestone (1, as in A853) running CyanogenMod 7.1 (thanks to Nadalbak who maintains an unofficial and unsupported port of CyanogenMod for this old device). When I start the Android [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> The latest update for CyanogenMod for Milestone &#8211; version 7.1.0.3 solves this problem as well.</p>
<p>Lately I&#8217;ve been having problems updating software on my Motorola Milestone (1, as in A853) running CyanogenMod 7.1 (thanks to <a title="Nadalbak Milestone CyanogenMod port" href="http://android.doshaska.net/">Nadalbak</a> who maintains an unofficial and unsupported port of CyanogenMod for this old device). When I start the Android Market and do an update of an existing application, I get the error &#8220;Package file is invalid&#8221; for any application. Sometimes removing an application and reinstalling it will work, but often not.</p>
<p>There could be several problems that cause this, apparently a problem with the file permissions on the file systems is common, and if this is your problem then it can be fixed by opening the terminal emulator, executing &#8220;su&#8221; to gain super-user permissions and then running &#8220;fix_permissions&#8221; (it will take a while to complete).</p>
<p>If this doesn&#8217;t solve the problem for you, then likely the problem is that you ran out of space on your &#8220;data&#8221; partition or &#8220;cache&#8221; partition. This is very common if you have a large &#8220;apps partition&#8221; on your SD card and you are in the habit of installing tons of applications &#8211; I know I am <img src='http://geek.co.il/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  .</p>
<p><span id="more-1836"></span></p>
<p>The problem is the &#8220;Dalvik cache&#8221; that gets full and apparently the operating system doesn&#8217;t clear old files from it so it will eventually run out of space.</p>
<p>I&#8217;ve tried cleaning the Dalvik cache, using Titanium backup and the OpenRecovery menu &#8211; but that doesn&#8217;t clean the cache properly for some reason, likely because it expects the cache to be on the &#8220;data&#8221; partition but in CyanogenMod 7 for Milestone the Dalvik cache is on the &#8220;cache&#8221; partition.</p>
<p>To solve the problem, boot into OpenRecovery then select &#8220;Wipe cache&#8221; from the main menu. Please note that you must wipe the entire cache partition and not just the Dalvik cache. Also make sure not to choose the similar option to wipe the data partition as that will remove all your personal data from the phone&#8230;</p>
<p>Good luck.</p>
<h4>Update:</h4>
<p>If your /cache partition is constantly overloaded in your Mileston A853 running CyanogenMode 7.1, you can disable the hosting of the apps dalvik cache under /cache by editing the system&#8217;s build.prop file. To do it follow these instructions.</p>
<ol>
<li>Start a terminal in your phone using the terminal emulator app (or an alternative &#8211; I use ConnectBot).</li>
<li>Execute <code>su</code> and approve the super user mode.</li>
<li>Execute <code>mount /system -o remount,rw</code> to allow editing the build.prop file.</li>
<li>Execute <code>vi /system/build.prop</code> to edit the file.</li>
<li>Find the instruction <code>dalvik.vm.dexopt-cache-only</code> &#8211; you can type <code>/dalvik&lt;ENTER&gt;</code> to find it. Move the cursor to the end of the line and press on &#8220;A&#8221; to start editing. Delete the &#8220;1&#8243; at the end of the that line and write &#8220;0&#8243; instead.</li>
<li>Issue an &#8220;ESC&#8221; button (in ConnectBot you can do it by pressing the camera shutter button) and then type &#8220;:x&#8221; to save the changes and leave the editor.</li>
<li>Execute <code>mount /system -o remount,ro</code> to return the system files to read only mode.</li>
<li>Reboot to OpenRecovery and use it to clear the dalvik cache and the cache partition, and then reboot the phone.</li>
<li>
</li>
</ol>
<p>Your device should now have enough space in the /cache partition.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://beast4romtheeast.wordpress.com/2011/10/13/cyanogenmod-7-1-released/">CyanogenMod 7.1 Released</a> (beast4romtheeast.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://pocketnow.com/android/netflix-for-android-officially-recognizes-cyanogenmod-roms">Netflix for Android Officially Recognizes CyanogenMod ROMs</a> (pocketnow.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=1e32da23-1c9a-4620-a589-0c6baa9af717" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://geek.co.il/wp/2011/11/01/handling-package-file-is-invalid-problems-on-cyanogenmod-7/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mounting SMB shares using URL under GNOME and KDE</title>
		<link>http://geek.co.il/wp/2011/10/25/mounting-smb-shares-using-url-under-gnome-and-kde</link>
		<comments>http://geek.co.il/wp/2011/10/25/mounting-smb-shares-using-url-under-gnome-and-kde#comments</comments>
		<pubDate>Tue, 25 Oct 2011 12:34:25 +0000</pubDate>
		<dc:creator>Oded</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[File Sharing]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="true">http://geek.co.il/wp/2011/10/25/mounting-smb-shares-using-url-under-gnome-and-kde</guid>
		<description><![CDATA[As most Linux users are aware, you can access network shares with your file browser of choice (Dolphin, Nautilus and probably others) by writing URLs into the file browser&#8217;s &#8220;location bar&#8221;. If you ever had to work with MS-Windows file server, you should know that you can also access SMB file shares using URLs &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>As most Linux users are aware, you can access network shares with your file browser of choice (Dolphin, Nautilus and probably others) by writing URLs into the file browser&#8217;s &#8220;location bar&#8221;.</p>
<p>If you ever had to work with MS-Windows file server, you should know that you can also access SMB file shares using URLs &#8211; with the schema &#8220;smb&#8221;, like this: <code>smb://file-server/share-name.</code></p>
<p><span id="more-1816"></span></p>
<p>Using a URL like that will ask the file browser to open an SMB connection to the file server and try to list the content of the share. If your file server is not of the kind that likes anonymous users, a password dialog would come up where you have to enter a user name and a password, and a domain name. Nautilus will show an authentication dialog with a &#8220;domain&#8221; field pre-filled with the domain name &#8220;WORKGROUP&#8221; (which is unlikly to be what you want), while in KDE there is no distinct field for the domain as it expects MS-Windows like &#8220;DOMAIN\user&#8221; format, which users are likely not accustomed to. If you now type in your password and ask it to be saved, at best the file browser will open the share but not save the password and you will have to type it again the next time, while at worst &#8211; the browser will not be able to list the share and prompt you for the password again and again.</p>
<p>A useful way to workaround the issue is to have the &#8220;domain&#8221; part already in the &#8220;smb://&#8221; URL &#8211; that way the authentication process and the password keyring manager already knows the correct MS-Windows domain name to log in with and will either pre-fill it in the correct field.</p>
<h3>GNOME and Nautilus</h3>
<p>In GNOME (and using the GVFS command line tools &#8211; more about it later), the format of the URL is <code>smb://domain;user@server/share</code>, so for example if your domain name is &#8220;OFFICE&#8221; and your user is &#8220;oded&#8221;, and you want to access the share &#8220;Documents&#8221; on the server &#8220;files&#8221;, then the URL will be <code>smb://OFFICE;oded@files/Documents</code>:</p>
<p><a href="http://geek.co.il/wp/wp-content/uploads/2011/10/nautilus-smb-login.png"><img class="alignnone size-full wp-image-1817" title="SMB login in Nautilus" src="http://geek.co.il/wp/wp-content/uploads/2011/10/nautilus-smb-login.png" alt="" width="648" height="385" /></a></p>
<p>The password saving feature will now work fine and you can even bookmark the location and if you save the password, then next time you can just click the bookmark to automatically connect to the share.</p>
<h3>KDE and Dolphin</h3>
<p>In KDE the format of the URL is <code>smb://domain\user@server/share</code> (similar to the user specification in MS-Windows), so using the same example above the URL will be <code>smb://OFFICE\oded@files/Documents</code>:</p>
<p><a href="http://geek.co.il/wp/wp-content/uploads/2011/10/dolphin-smb-login.png"><img class="alignnone size-full wp-image-1818" title="Dolphin SMB authentication" src="http://geek.co.il/wp/wp-content/uploads/2011/10/dolphin-smb-login.png" alt="" width="624" height="452" /></a></p>
<p>As you can see, the user name field is pre-filled with the MS-Windows user specification and you are left with only putting in the password. You can also note that Dolphin has &#8220;URL encoded&#8221; the back-slash character &#8211; don&#8217;t worry about it, it will work just fine and you can also bookmark this location and the &#8220;Remember password&#8221; will faithfully keep your password regardless if the URL is &#8220;URL encoded&#8221; or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://geek.co.il/wp/2011/10/25/mounting-smb-shares-using-url-under-gnome-and-kde/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Consolas TrueType Font for Linux</title>
		<link>http://geek.co.il/wp/2011/10/22/installing-consolas-truetype-font-for-linux</link>
		<comments>http://geek.co.il/wp/2011/10/22/installing-consolas-truetype-font-for-linux#comments</comments>
		<pubDate>Sat, 22 Oct 2011 12:48:14 +0000</pubDate>
		<dc:creator>Oded</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Stuff]]></category>
		<category><![CDATA[ClearType]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Font]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="true">http://geek.co.il/wp/2011/10/22/installing-consolas-truetype-font-for-linux</guid>
		<description><![CDATA[This is a short &#8220;how to&#8221; article on how to get and install the new Microsoft Consolas Monotype font &#8211; this is a very nice programmer font and as described in Dan Benjamin&#8217;s &#8220;Top 10 Programming Fonts&#8221; it is highly recommended for use in your programmer&#8217;s editor or IDE (As a side note, his top [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short &#8220;how to&#8221; article on how to get and install the new Microsoft <a class="zem_slink" title="Consolas" href="http://en.wikipedia.org/wiki/Consolas" rel="wikipedia">Consolas</a> Monotype font &#8211; this is a very nice programmer font and as described in <a href="http://hivelogic.com/articles/top-10-programming-fonts/">Dan Benjamin&#8217;s &#8220;Top 10 Programming Fonts&#8221;</a> it is highly recommended for use in your programmer&#8217;s editor or IDE (As a side note, his top selection, <a href="http://www.levien.com/type/myfonts/inconsolata.html">Inconsolata</a> is also very nice and I highly recommend it if you don&#8217;t feel like using Microsoft created software and/or aren&#8217;t interested in performing the steps below which may or may not be legally problematic).</p>
<p>The main problem with using Consolas on your Linux workstation, is that this font is provided by Microsoft, and while if you are running MS-Windows (or even Mac OS-X) it may already be installed &#8211; as it is bundled with many Microsoft products, us in the Linux world have no easy (and legal) way to get to use Consolas in our code editing. Unlike <a href="http://en.wikipedia.org/wiki/Core_fonts_for_the_Web">Microsoft Core Fonts for the Web</a> Consolas is not available for download &#8211; probably for the same reason the core fonts packages were pulled. But as Consolas is bundled with many Microsoft products, some are available for free download for anyone, we can use that to get us some nifty Consolas prettiness in our day to day Linux computing.</p>
<p><span id="more-1789"></span></p>
<p>The following steps will allow you to get Consolas on your system rather easily (assuming you don&#8217;t flinch at using a terminal) and without installing any Microsoft products. I&#8217;m pretty sure its also legal to do so, even when taking into account Microsoft&#8217;s EULA, and a discussion of this is at the end if you are interested. Well, into the fray!</p>
<h3>Requirements</h3>
<p>you need to have the following software packages installed. If you don&#8217;t already have them installed, they are available for all Linux operating system, probably using your built-in software management UI, such as Ubuntu&#8217;s Software Center or Fedora&#8217;s Software Management.</p>
<ul>
<li>Wine &#8211; the Microsoft Windows compatibility layer for Linux</li>
<li>cabextract &#8211; a Microsoft cabinet file format extractor</li>
</ul>
<h3>Procedure</h3>
<p>After you have these installed, lets start going to the Microsoft download center and downloading the latest edition of the free<a href="http://www.microsoft.com/download/en/details.aspx?id=13" target="_blank">PowerPoint Viewer</a>. In the page linked, click on &#8220;Download&#8221; and download the resulting file to somewhere on your computer. The default download location for Fedora is the &#8220;Downloads&#8221; directory and for Ubuntu it is the &#8220;Desktop&#8221; directory.</p>
<p>Next, let&#8217;s open a terminal window (&#8220;<code>gnome-terminal</code>&#8221; if you are running a GNOME desktop, or &#8220;<code>konsole</code>&#8221; if you are running a KDE desktop), and follow these steps:</p>
<ul>
<li><code>mkdir tmp</code> &#8211; Create a temporary directory. The process involves creating a &#8220;wine prefix&#8221; and unpacking some files into it, and I wouldn&#8217;t want to mess up an existing wine setup if you have one.</li>
<li><code>cd tmp</code> &#8211; move to the new temporary directory.</li>
<li><code>WINEPREFIX=$(pwd) wine ~/Downloads/PowerPointViewer.exe /extract:c:\\</code> &#8211; ask the PowerPoint Viewer, nicely, to extract its content to what Windows call &#8220;C:\&#8221; instead of installing it. Wine will setup a simulated &#8220;C: drive&#8221; inside your temporary directory and will then run the installer &#8211; you will have to read and agree to the PowerPoint Viewer EULA, but I don&#8217;t think you have anything to worry about (see the discussion below). For this command I&#8217;m assuming you&#8217;ve downloaded the PowerPoint Viewer executable to the &#8220;Downloads&#8221; directory. If this is not the case, you may change the command appropriately.</li>
<li><code>cabextract drive_c/ppviewer.cab -F 'CONSOLA*'</code> &#8211; The installer has put a &#8220;Microsoft Cabinet file&#8221; into the simulated &#8220;C: drive&#8221;, that contains the files we need, so here we extract the Consolas TTF files from the cabinet.</li>
<li><code>rename 'y/A-Z/a-z/;s/consola/Consolas /;s/b/Bold/;s/i/Italic/;s/z/Bold Italic/;s/ \./ Regular./' *.TTF</code> &#8211; Optional step &#8211; rename the extract files to something that a looks humanly readable. Unless you want to keep the TTF files for future use, you can skip this step.</li>
</ul>
<p>Now you can install the new fonts &#8211; open a file browser and go to your temporary directory. Under GNOME you can install the fonts by opening the font file and the font viewer window should have an &#8220;Install Font&#8221; button at the bottom right corner. Under KDE, right click the font files and select Actions-&gt;Install&#8230; and in the dialog that opens select &#8220;Personal&#8221; to install the font only for you or &#8220;System&#8221; to install the font to all the users (this will require a system administrator password). After you complete this step for all the TTF files that were created, you can copy the files elsewhere if you want to save them as backup for when you want to reinstall your computer. Finally it is recommended to remove the temporary directory and all its content &#8211; you have no further need for this.</p>
<h3>Legal Issues</h3>
<p>I am not a lawyer and the following is not actually a legal argument, but lets try to look at the above procedure through the Microsoft EULA that you have to agree to in order to get the files:</p>
<p>It is my belief that this procedure is perfectly reasonable for personal use on any device you use &#8211; paragraph 1.a of the EULA says &#8220;You may install and use any number of copies of the software on your devices.&#8221; The rest of the paragraph immediately goes and limits the use of the software but I do no believe that its possible for a license to limit the type of use you do with a software you legally obtained (as long as that use itself is not infringing on the copyright on the software). Its like buying a car and have the manufacturer say that this car may not be used to drive on dirt roads &#8211; the manufacturer may refuse to service the car after you drive on dirt roads, but he cannot sue your for violating the &#8220;terms of use&#8221;.</p>
<p>Please note that after extracting the TTF files, you <strong>may not distribute the files</strong>, i.e. copy them to other people &#8211; this is strictly prohibited both under copyright law and under paragraph 1.b of the EULA, because it will not be &#8220;complete and unmodified&#8221; copies of the PowerPoint Viewer. You may, though, distribute copies of the original PowerPoint Viewer download to friends along with these instructions <img src='http://geek.co.il/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>Regarding the legality of extracting files from the installer, the Microsoft EULA has this to say: &#8220;You may not work around any technical limitations in the software&#8221; &#8211; but we didn&#8217;t work around any technical limitations: the Microsoft software itself extracted the files for our use, so there is no technical limitation prevent us from copying files off the installer.</p>
<p>The PowerPoint cabinet also contains all the other fonts of the Microsoft <a class="zem_slink" title="ClearType" href="http://en.wikipedia.org/wiki/ClearType" rel="wikipedia">ClearType font</a> collection, of which only Calibri would be of any interest to users, the rest aren&#8217;t that interesting but then again &#8211; I hate serifs (interestingly all of the ClearType font collection fonts start with &#8220;C&#8221;).</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.makeuseof.com/tag/manage-compare-fonts-easily-font-manager-linux/">Manage &amp; Compare Fonts Easily With Font Manager [Linux]</a> (makeuseof.com)</li>
<li class="zemanta-article-ul-li"><a href="http://xpjimt.wordpress.com/2011/10/01/free-ttf-font-site/">Free TTF font site</a> (xpjimt.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.androidpolice.com/2011/10/19/get-the-new-ics-font-roboto-on-your-android-device-right-now/">Get The New ICS Font Roboto On Your Android Device Right Now</a> (androidpolice.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=788d2c5d-a313-465f-9c2c-6e494282dd79" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://geek.co.il/wp/2011/10/22/installing-consolas-truetype-font-for-linux/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Script day: automatically locate the next valid transaction in MySQL binlog</title>
		<link>http://geek.co.il/wp/2011/07/27/script-day-automatically-locate-the-next-valid-transaction-in-mysql-binlog</link>
		<comments>http://geek.co.il/wp/2011/07/27/script-day-automatically-locate-the-next-valid-transaction-in-mysql-binlog#comments</comments>
		<pubDate>Wed, 27 Jul 2011 18:08:13 +0000</pubDate>
		<dc:creator>Oded</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[Replication]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="true">http://geek.co.il/wp/2011/07/27/script-day-automatically-locate-the-next-valid-transaction-in-mysql-binlog</guid>
		<description><![CDATA[Sometimes the MySQL replication breaks due to some corruption in the binary log files. When your binary log files are corrupted, the only option (other then trying to rebuild a database of hundreds of gigabytes) is to try to skip over the corrupted region and get the slave to pick up from where the transactions [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes the <a class="zem_slink" title="MySQL" href="http://www.mysql.com" rel="homepage">MySQL</a> replication breaks due to some corruption in the binary log files. When your binary log files are corrupted, the only option (other then trying to rebuild a database of hundreds of gigabytes) is to try to skip over the corrupted region and get the slave to pick up from where the transactions are valid.</p>
<p>Locating the correct position in the binary log from which the server can carry on is difficult but can be made easier by the <code>mysqlbinlog</code> utility that can scan the binary log files and show you which position is valid using the <code>--start-position</code> to try random positions in the binary log file and see which position will let you read from the file.</p>
<p><span id="more-1764"></span>Still, testing each and every possible byte position by hand is very time consuming, not to say very boring. The following small script will allocate the next readable position in the binary log, given a beginning position (that you can see in the MySQL slave status IO position).</p>
<pre>start=1008443439
end=$(($start+20000))
binlog=mysql-bin.021468
for; do
  if mysqlbinlog -vv $binlog --start-position=$pos \
        --stop-position=$end &gt; /dev/null 2&gt;&amp;1; then
    echo $pos
    break
  fi
done</pre>
<p>[All numbers are made up, obviously - substitute your own]</p>
<p>This will echo the first position in the specified MySQL binary log, from which the log can be read correctly (assuming the corruption is smaller then 20K). You then can restart the slave after the corrupted part by issuing these commands to MySQL:</p>
<pre>STOP SLAVE;
CHANGE MASTER TO MASTER_HOST='my-master', MASTER_USER='this-slave',
MASTER_PASSWORD='my-password', MASTER_LOG_FILE='mysql-bin.021468',
MASTER_LOG_POS=1008444916;
STOP SLAVE;</pre>
<p>[Where 1008444916 is the position the script reported]</p>
<p><strong>Important note:</strong> This is only relevant when it&#8217;s affordable to lose few transactions (you should pay attention to the distance between the last position of the IO thread and the position that this script find as usable). If you fear that there may be important data in the missing transactions &#8211; don&#8217;t use this method and do rebuild your database.</p>
<h6 class="zemanta-related-title">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://sqldbpool.com/2011/07/07/mysql-replication-setup/">MySQL Replication Setup</a> (sqldbpool.com)</li>
<li class="zemanta-article-ul-li"><a href="http://kozar.wordpress.com/2011/07/17/how-to-set-up-ssh-encrypted-mysql-replication/">How To Set Up SSH Encrypted MySQL Replication</a> (kozar.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.prweb.com/releases/R1Soft_CDP_Database/Backup_MySQL_Conference/prweb5239714.htm">R1Soft Discusses CDP Backup Software for MySQL Databases at 2011 MySQL Conference and Expo</a> (prweb.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.pcworld.com/article/228786/Five_Things_You_Need_to_Know_About_MySQL.html">Five Things You Need to Know About MySQL</a> (pcworld.com)</li>
</ul>
<div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_a.png?x-id=e70f2103-60a6-4687-aa86-b6425fd15cb8" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://geek.co.il/wp/2011/07/27/script-day-automatically-locate-the-next-valid-transaction-in-mysql-binlog/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mandatory Access Control And Malware</title>
		<link>http://geek.co.il/wp/2011/07/18/mandatory-access-control-and-malware</link>
		<comments>http://geek.co.il/wp/2011/07/18/mandatory-access-control-and-malware#comments</comments>
		<pubDate>Mon, 18 Jul 2011 07:20:08 +0000</pubDate>
		<dc:creator>Oded</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Evangelism]]></category>
		<category><![CDATA[Social]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="true">http://geek.co.il/wp/2011/07/18/mandatory-access-control-and-malware</guid>
		<description><![CDATA[After listening to the virtus/malware discussion on LUG Radio&#8217;s new (but apparently one-off) show (check it out at lugradio.org, these guys are hilarious), got me thinking about how much Linux users are exposed to malware. Lets forget, for the sake of the discussion, the technical attacks as these are relatively easy to handle and Linux [...]]]></description>
			<content:encoded><![CDATA[<p>After listening to the virtus/malware discussion on LUG Radio&#8217;s new (but apparently one-off) show (<a title="LUG Radio" href="http://www.lugradio.org/">check it out at lugradio.org, these guys are hilarious</a>), got me thinking about how much Linux users are exposed to malware.</p>
<p>Lets forget, for the sake of the discussion, the technical attacks as these are relatively easy to handle and Linux operating systems are already pretty well protected against such. The main vector of attack for malware these days is Social Engineering anyway &#8211; this is how Mac <a href="http://thenextweb.com/apple/2011/05/02/bogus-macdefender-malware-campaign-targets-mac-users-using-google-images/">OS-X users get attacked by malware</a>: you browse a web site, and an image that looks like a a blinking dialog box notifies you that your computer has been infected by a virus and prompts you to download this &#8220;fix&#8221;.</p>
<p>Most of us, technically inclined users, sneer at this type of &#8220;threat&#8221;, but most people aren&#8217;t technically inclined and there are enough people out there that will be fooled by this practice time and time again. Click the image and a binary gets downloaded to your computer and if it is in the correct format it will get executed.</p>
<p><span id="more-1756"></span>This is where the Linux side of business starts (and where the &#8220;Mandatory Access Control&#8221; part of the title comes to play) &#8211; a binary that you just downloaded and executed cannot just go and do anything. Most Linux operating systems these days (at least the more popular ones) employ some sort of &#8220;Mandatory Access Control&#8221; &#8211; be it SELinux or AppArmor &#8211; which means that unless you specifically say, ahead of time, that some program can do something &#8211; then it can&#8217;t. This applies to all access including access to user files.</p>
<p>The thing is &#8211; Linux users are already well protected against the user of &#8220;downloading an executable file&#8221; and running it: You have to download the file and save it somewhere that you can find, then double click it. At which point a dialog box pops up and tells you that you can&#8217;t execute files with out the &#8220;execute bit&#8221;, so you have to open the file properties, go to permissions, figure out what the &#8220;execute bit&#8221; is and set it, click OK and try to run the file again. That is on Ubuntu &#8211; other OSs have even a worse user experience. So you see &#8211; no worries there: if a user is gullible enough to download just any file of the internet and try to run it &#8211; there&#8217;s no way they&#8217;re going to be able to do it.</p>
<h3>So what&#8217;s the problem?</h3>
<p>The problem is that if you can target Mac users and get them to download a Mac specific binary file (vs. a Windows specific executable for Windows users), then you can easily target specific (and popular) Linux distributions by getting their users binary files formatted with the appropriate software installation package format (&#8220;.deb&#8221; for Ubuntu, Debian and related OSs and &#8220;.rpm&#8221; for Fedora, SuSE and related OSs). All these operating systems, when you start downloading a file with the appropriate format, helpfully pop up a dialog that allows you to easily type in your password and install the &#8220;helpful software&#8221; <em>right into your operating system</em>!</p>
<p>Unlike getting a user to just execute a program, which will run with the user&#8217;s access level and at worst will trash the user&#8217;s files, this procedure lets loose an unverified piece of software into your operating system with full administration privileges. With that kind of access, such software can easily install its own &#8220;Mandatory Access Policy&#8221; that lets itself do whatever it wants.</p>
<p>And how does your operating system protect you from this vector? Very little if at all. At least in Ubuntu you get the very detailed &#8220;dpkg UI&#8221; dialog which presents a lot of information on the software you are going to install before you click OK &#8211; which may also expose you to additional social engineering. Fedora on the other hand does very little except show you the file name and allow you to click OK.</p>
<p>At no point there are warning to help the user decide what is the right thing to do &#8211; not that I expect this will do any good: uneducated users are very prone to just click &#8220;OK&#8221; to any dialog box that pops up without ever reading what it says, let alone considering it.</p>
<p>The Android styled &#8220;Mandatory Access Control&#8221; that has programs request specific permissions and the user is presented with this list for approval is not any better &#8211; for most users this is just another dialog that they don&#8217;t have to read if they just want to click OK.</p>
<h3>What can be done about it?</h3>
<p>Very little I&#8217;m afraid. Linux users are currently around 1~2% of total internet traffic and as long as it stays this low it unlikely malware authors will invest the extra effort to target us. But if we want to get more market share &#8211; and that means getting more uninformed people to use Linux based operating systems, then this will change.</p>
<p>I think its unhelpful to think that we can educate people to the point that these type of social engineering attacks will fail. If we really want to tackle the problem we have to be pro-active about defense, and as they say &#8211; &#8220;the best defense is a good offense&#8221; <img src='http://geek.co.il/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>What I propose should be done is that whenever a user tries to install a software using the &#8220;single click install&#8221; procedure, the confirmation dialog will be much more verbose and ask the user, not for their password, but to fill a simple multiple selection quiz: choose one of the provided reasons you want to install this software (or click &#8220;other&#8221; and type your own) and a couple of other questions like you get when you try to subscribe to a website &#8211; &#8220;where did you hear about it&#8221; and such. Not something truly drastic, just enough to get the user to think a bit more about what they are about to do.</p>
<p>After completing the dialog, the system will file all this information, along with the URL from which the software was downloaded, to a central repository on the internet (without any personally identifying information of course, not even the IP address) and interested individuals can look at these reports and vote if the software is valid or malware. Whenever an operating system is trying to install a specific piece of software from the internet, it can first look up the target in this database and if the consensus on the internet is that this is malware, then the operating system can refuse to install &#8211; very similar to how the website verification process that Internet Explorer and Mozilla Firefox use.</p>
<p>Advanced users can be spared this process (if they want to) as command line installations will not trigger this behavior and if you are really inclined there would be a checkbox in some system settings dialog that says something like &#8220;stop harassing me when I install software off the internet&#8221;.</p>
<p>So this is my proposal. What do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://geek.co.il/wp/2011/07/18/mandatory-access-control-and-malware/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>For all the people who have waited patiently, CentOS 6 is here</title>
		<link>http://geek.co.il/wp/2011/07/11/for-all-the-people-who-have-waited-patiently-centos-6-is-here</link>
		<comments>http://geek.co.il/wp/2011/07/11/for-all-the-people-who-have-waited-patiently-centos-6-is-here#comments</comments>
		<pubDate>Mon, 11 Jul 2011 18:26:57 +0000</pubDate>
		<dc:creator>Oded</dc:creator>
				<category><![CDATA[Evangelism]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="true">http://geek.co.il/wp/2011/07/11/for-all-the-people-who-have-waited-patiently-centos-6-is-here</guid>
		<description><![CDATA[After a long long time in the making, rumors of abandonment and general discomfort in the community, the CentOS people have finally pulled through and bring you the brand new (though by now several months old) CentOS 6.0. A lot of system administrators have been waiting for this (me included) so I thought I&#8217;d give [...]]]></description>
			<content:encoded><![CDATA[<p>After a long long time in the making, rumors of abandonment and general discomfort in the community, the CentOS people have finally <a href="http://planet.centos.org/">pulled through</a> and bring you the brand new (though by now several months old) <a href="http://wiki.centos.org/Manuals/ReleaseNotes/CentOS6.0">CentOS 6.0</a>.</p>
<p>A lot of system administrators have been waiting for this (me included) so I thought I&#8217;d give a heads up <img src='http://geek.co.il/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://geek.co.il/wp/2011/07/11/for-all-the-people-who-have-waited-patiently-centos-6-is-here/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How much space to put in your root partition?</title>
		<link>http://geek.co.il/wp/2011/07/08/how-much-space-to-put-in-your-root-partition</link>
		<comments>http://geek.co.il/wp/2011/07/08/how-much-space-to-put-in-your-root-partition#comments</comments>
		<pubDate>Fri, 08 Jul 2011 11:43:40 +0000</pubDate>
		<dc:creator>Oded</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Distributions]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[operating system]]></category>

		<guid isPermaLink="true">http://geek.co.il/wp/2011/07/08/how-much-space-to-put-in-your-root-partition</guid>
		<description><![CDATA[When installing a Linux computer, this is a question I&#8217;ve been asked/asked myself many times, and it shall keep on being asked because things are not static and newer operating systems need more and more room as the basic software collection that you expect to get out of the box gets larger. And the answer? [...]]]></description>
			<content:encoded><![CDATA[<p>When installing a Linux computer, this is a question I&#8217;ve been asked/asked myself many times, and it shall keep on being asked because things are not static and newer <a class="zem_slink" title="Operating system" href="http://en.wikipedia.org/wiki/Operating_system" rel="wikipedia">operating systems</a> need more and more room as the basic software collection that you expect to get out of the box gets larger.</p>
<p>And the answer? Well &#8211; it depends <img src='http://geek.co.il/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Specifically here I&#8217;m going to tackle the issue of desktop installs (i.e. the workstation for a single user), and specifically for Fedora &#8211; though it shouldn&#8217;t be much different for other operating systems in the same class &#8211; such as Ubuntu or SuSE.</p>
<p><span id="more-1743"></span>The issue is basically only interesting if you want to put all the user&#8217;s files (i.e. the /<a class="zem_slink" title="Home directory" href="http://en.wikipedia.org/wiki/Home_directory" rel="wikipedia">home directory</a>) in a different partition from the <a class="zem_slink" title="Root directory" href="http://en.wikipedia.org/wiki/Root_directory" rel="wikipedia">root file system</a>, otherwise the question is moot &#8211; just lump everything into the root partition and be done with it.</p>
<p>It is highly recommended to have a separate home partition for user files as that makes upgrading to a new version of the operating system, recovery in case of a major system failure, or even jumping to a new Linux based operating system &#8211; so much easier.</p>
<p>It is so recommended that at least Fedora and SuSE create /home partitions in their default setup.</p>
<p>So the question that arises &#8211; how much room to leave to the operating system, as everything else goes into the user&#8217;s home partition.</p>
<p>My rule of thumb in the last few years, and its mostly still correct, is <strong>16GB</strong>.</p>
<p>There&#8217;s really not much point putting in more then that, as even if you install tons of software, including huge things such as Open/Libre Office, the operating system and applications rarely take more then 10GB. Add a few things such as a small database for your pet project and some cache, and there&#8217;s really no need for more then 16GB (which is also a nice round number).</p>
<p>All this until you want to do a live operating system upgrade (<em>preupgrade</em> in Fedora-speak or <em>dist-upgrade</em> for you Ununtu/Debian users). When you want to do a full upgrade to the latest release of your operating system, while still running, your computer has to download and store all the software that has been updated in the new release &#8211; which is basically all of it &#8211; and this takes a lot of room. What prompted this post is that I wanted to do a live upgrade from Fedora 14 to Fedora 15 and needed 8.8GB of room on my root partition.</p>
<p>So &#8211; if you have upgrades in mind, don&#8217;t skimp on GBs for your root &#8211; any new harddrive packs at least 500GB, so make sure to reserve around 30 for your operating system. While it would most likely go to waste most of the time, when upgrade time comes &#8211; your life will be so much easier.</p>
<div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_a.png?x-id=c4a313ee-f007-4b4a-bb74-4972b78301bf" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://geek.co.il/wp/2011/07/08/how-much-space-to-put-in-your-root-partition/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL 5.5 on Ubuntu 10.10</title>
		<link>http://geek.co.il/wp/2011/03/02/mysql-5-5-on-ubuntu-10-10</link>
		<comments>http://geek.co.il/wp/2011/03/02/mysql-5-5-on-ubuntu-10-10#comments</comments>
		<pubDate>Wed, 02 Mar 2011 19:35:57 +0000</pubDate>
		<dc:creator>Oded</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="true">http://geek.co.il/wp/2011/03/02/mysql-5-5-on-ubuntu-10-10</guid>
		<description><![CDATA[As we all know, MySQL 5.5 is the best thing since sliced bread (or, not exactly, but that&#8217;s what everyone will have you think), but unfortunately Ubuntu&#8216;s latest and greatest server operating system &#8211; Ubuntu 10.10 Server comes with MySQL 5.1. Even the next version of Ubuntu &#8211; 11.04 Natty Narwhal &#8211; doesn&#8217;t seem to [...]]]></description>
			<content:encoded><![CDATA[<p>As we all know, MySQL 5.5 is the best thing since sliced bread (or, not exactly, but that&#8217;s what everyone will have you think), but unfortunately <a class="zem_slink" title="Ubuntu (operating system)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Ubuntu_%28operating_system%29">Ubuntu</a>&#8216;s latest and greatest server operating system &#8211; Ubuntu 10.10 Server comes with MySQL 5.1.</p>
<p>Even the next version of Ubuntu &#8211; 11.04 Natty Narwhal &#8211; doesn&#8217;t seem to deliver MySQL 5.5, so upgrading is not really an option as of yet. There is a bug report to <a title="Ubuntu bug #690925" href="https://bugs.launchpad.net/ubuntu/+source/mysql-5.1/+bug/690925" target="_blank">deliver MySQL 5.5 for Natty</a>, which is even marked as &#8220;in progress&#8221; but there&#8217;s no guarantee that it will happen.</p>
<p>So how to go about (ab)using the latest software from Oracle? One way is to build it yourself on your server, or convert the Oracle provided RPM packages using the alien tool &#8211; but its not really Ubuntu native and a mess (in both cases). Here is another approach:</p>
<p><span id="more-1698"></span></p>
<p>We can instead install native Ubuntu packages for MySQL 5.5, based on the work in progress for the Ubuntu bug listed above, by using the source packages from Clint Byrum&#8217;s <a class="zem_slink" title="Personal Package Archive" rel="wikipedia" href="http://en.wikipedia.org/wiki/Personal_Package_Archive">PPA</a> and building them locally on your Ubuntu 10.10 server.</p>
<p>It looks that this build nicely, passes all the tests and installs cleanly on an Ubuntu 10.10 server without any hassles, so here is a simple walk through:</p>
<ol>
<li><strong>Setup the PPA repository:</strong> go over to <a title="MySQL 5.5 PPA" href="https://launchpad.net/~clint-fewbar/+archive/mysql" target="_blank">Clint Byrum&#8217;s PPA (by clicking on this link)</a> and click on &#8220;Technical details about this PPA&#8221;. In the select box, choose &#8220;Lucid&#8221; &#8211; because the PPA no longer has Maverick packages, but the Lucid ones should work as well. Now in the box below that copy just the &#8220;deb-src&#8221; line and add it to the end of the <code>/etc/apt/sources.list</code> file on your Ubuntu 10.10 server. Don&#8217;t get the first &#8220;deb&#8221; line because that will add the binary repository and this can mess up your system when you do an upgrade later.</li>
<li><strong>Get the source package:</strong> create a new directory somewhere where you want to build the package and open a terminal and change to it, then run from the command line the command <code><a class="zem_slink" title="Advanced Packaging Tool" rel="wikipedia" href="http://en.wikipedia.org/wiki/Advanced_Packaging_Tool">apt-get</a> update</code> and then <code>apt-get source mysql-5.5</code>.</li>
<li><strong>Install dependencies:</strong> in the sources that were downloaded into the directory you created in the above step, you&#8217;d find a directory called <code>mysql-5.5-some-version</code>, change into it and run <code>dpkg-buildpackage</code>. The command will run and then stop after complaining about missing dependencies. copy the names of all the dependencies (without the version information) and type <code>apt-get install</code> followed by the names of all the missing packages. Complete the installation and configuration of all the required packages.</li>
<li><strong>Build the new Ubuntu package:</strong> run <code>dpkg-buildpackage</code> again and watch it complete the build and tests. The build is pretty quick &#8211; I was very impressed, but the tests take forever and a half &#8211; be patient and equip yourself with a hot beverage and something to pass the time. Finally it will report that the new <code>deb</code> packages have been successfully built.</li>
<li><strong>Install the new software:</strong> go up one directory to the directory where you downloaded the source and install any package you need using the command <code>dpkg -i</code> followed by the file names of each <code>deb</code> package you require. When installing the <code>mysql-server-core</code> package you should get a configuration screen to set up the root password for the server, so don&#8217;t forget to set it to something that is useful.</li>
<li><strong>Last minute configuration:</strong> the mysql-5.5 packages built are designed for Natty (Ubuntu 11.04) and therefor have some Natty specific features. In order to get the MySQL server to start, we need to edit the file <code>/etc/init/mysql</code> and in the <code>pre-start</code> section comment out the <code>apparmor</code> line &#8211; this will not work in Ubuntu 10.10 and will cause the server to fail to load.</li>
<li><strong>Start the server:</strong> at this point we have only to start the server by issuing the &#8220;upstart&#8221; command <code>start mysql</code>.</li>
</ol>
<h6 class="zemanta-related-title">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://coder2developer.wordpress.com/2011/02/15/mariadb/">What happened to MySQL?</a> (coder2developer.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://curiousx.wordpress.com/2010/11/26/getting-started-with-mysql-on-ubuntu/">Getting started with MySQL on Ubuntu</a> (curiousx.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://developers.slashdot.org/story/10/12/15/2254209/Oracle-Releases-MySQL-55">Oracle Releases MySQL 5.5</a> (developers.slashdot.org)</li>
</ul>
<div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_a.png?x-id=da7e3ec9-e742-46fb-bad3-b79aba19614e" alt="Enhanced by Zemanta" /></a><span class="zem-script pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://geek.co.il/wp/2011/03/02/mysql-5-5-on-ubuntu-10-10/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>

