<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Life is a State of Mind</title>
	<atom:link href="http://delivorias.me/feed/" rel="self" type="application/rss+xml" />
	<link>http://delivorias.me</link>
	<description>Collected thoughts and actions from life in Edinburgh</description>
	<lastBuildDate>Mon, 16 Jan 2012 14:36:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='delivorias.me' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Life is a State of Mind</title>
		<link>http://delivorias.me</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://delivorias.me/osd.xml" title="Life is a State of Mind" />
	<atom:link rel='hub' href='http://delivorias.me/?pushpress=hub'/>
		<item>
		<title>2011 in review</title>
		<link>http://delivorias.me/2012/01/15/2011-in-review/</link>
		<comments>http://delivorias.me/2012/01/15/2011-in-review/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 14:02:00 +0000</pubDate>
		<dc:creator>Christos Delivorias</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://delivorias.me/?p=563</guid>
		<description><![CDATA[The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog. Here&#8217;s an excerpt: A San Francisco cable car holds 60 people. This blog was viewed about 2,300 times in 2011. If it were a cable car, it would take about 38 trips to carry that many people. Click here to see the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=563&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.</p>
<p><a href="http://delivorias.me/2011/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" alt="" width="100%" /></a></p>
<p>Here&#8217;s an excerpt:</p>
<blockquote><p>A San Francisco cable car holds 60 people. This blog was viewed about <strong>2,300</strong> times in 2011. If it were a cable car, it would take about 38 trips to carry that many people.</p></blockquote>
<p><a href="http://delivorias.me/2011/annual-report/">Click here to see the complete report.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/delivorias.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/delivorias.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/delivorias.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/delivorias.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/delivorias.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/delivorias.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/delivorias.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/delivorias.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/delivorias.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/delivorias.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/delivorias.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/delivorias.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/delivorias.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/delivorias.wordpress.com/563/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=563&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://delivorias.me/2012/01/15/2011-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>55.958832 -3.215253</georss:point>
		<geo:lat>55.958832</geo:lat>
		<geo:long>-3.215253</geo:long>
		<media:content url="http://1.gravatar.com/avatar/fa33466c9c1e40ddd2d633b4b8b37891?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">cmd</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" medium="image" />
	</item>
		<item>
		<title>Customising OSX</title>
		<link>http://delivorias.me/2012/01/15/customising-osx/</link>
		<comments>http://delivorias.me/2012/01/15/customising-osx/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 12:45:48 +0000</pubDate>
		<dc:creator>Christos Delivorias</dc:creator>
				<category><![CDATA[imac]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[ZSH]]></category>
		<category><![CDATA[IMAC]]></category>

		<guid isPermaLink="false">http://delivorias.me/?p=537</guid>
		<description><![CDATA[As I wrote some time ago, I recently migrated from linux to OSX. Since this OS was very new to me, it took me a while to figure out which applications were useful to me and which customisations added to my productivity. This article is a list for people new to OSX and want to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=537&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><a href="http://delivorias.files.wordpress.com/2012/01/p1861_big.jpg"><img class="aligncenter  wp-image-547" title="p1861_big" src="http://delivorias.files.wordpress.com/2012/01/p1861_big.jpg?w=483&#038;h=483" alt="" width="483" height="483" /></a></p>
<p>As I wrote some time ago, I recently <a title="Switching to an iMac" href="http://delivorias.me/2011/01/05/switching-to-an-imac/">migrated from linux to OSX</a>. Since this OS was very new to me, it took me a while to figure out which applications were useful to me and which customisations added to my productivity. This article is a list for people new to OSX and want to hit the ground running. It is basically the article I would have liked to have found when I first migrated.<span id="more-537"></span></p>
<p>Frist off let me start with the applications I&#8217;ve found to be the most useful and then pass on to the productivity customisations I&#8217;ve attempted.</p>
<p>The apps that are absolutely essential to me are:</p>
<ul>
<li><a href="http://www.google.com/mac/" target="_blank">Google Chrome</a>, for the plugins, but Safari is a close second for the zoom function when double tapping.</li>
<li><a href="www.spotify.com/" target="_blank">Spotify</a>, for the ease of finding music and playing it anywhere with a Premium account.</li>
<li><a href="http://www.skype.com" target="_blank">Skype</a>, essential tele-comms.</li>
<li><a href="http://netnewswireapp.com/mac" target="_blank">NetNewsWire</a>, RSS reader, ad-supported.</li>
<li><a href="http://www.haystacksoftware.com/arq/" target="_blank">Arq</a>, off-site (AWS) backups.</li>
<li><a href="http://www.iterm2.com/" target="_blank">iTerm2</a></li>
<li><a href="http://www.parallels.com/uk/products/desktop/" target="_blank">Parallels</a>, for some simulation programs for uni that only run on windows.</li>
<li><a href="http://www.caseapps.com/sofacontrol/" target="_blank">SofaControl</a> + <a href="http://www.plexapp.com/" target="_blank">Plex</a>. The ideal media player setup.</li>
<li><a href="https://agilebits.com/onepassword" target="_blank">1password</a> + <a href="https://www.dropbox.com/" target="_blank">Dropbox</a>: Always set up secure long passwords, access them from all the machines, and only remember <a href="http://xkcd.com/936/" target="_blank">one password</a>.</li>
<li><a href="http://www.inmethod.com/air-video/download.html" target="_blank">Air Video Server</a>: Play any movie on the iPad, that&#8217;s stored on the iMac. All videos are streamed over WiFi.</li>
<li><a href="http://lightheadsw.com/caffeine/" target="_blank">Caffeine</a> + <a href="http://stereopsis.com/flux/" target="_blank">Flux</a>: Two ways to control the luminosity of the screen. 50% Brightness and 3200K after dark is ideal for me.</li>
<li><a href="http://www.evernote.com/evernote/" target="_blank">Evernote</a> +<a href="http://www.mindnode.com/" target="_blank">MindNode</a>: Notes and ideas.</li>
<li><a href="http://handbrake.fr/downloads.php" target="_blank">Handbrake</a> + <a href="http://www.videolan.org/vlc/download-macosx.html" target="_blank">VLC</a>: video conversion and playback.</li>
<li><a href="http://www.iggsoftware.com/ibank/" target="_blank">iBank</a>: Finances&#8217; handling</li>
<li><a href="http://remoteless.no/" target="_blank">Remoteless</a> helper: To control Spotify on the iMac from the ipad.</li>
<li><a href="http://daisydiskapp.com/" target="_blank">DaisyDisk</a>: Disk Utilisation</li>
<li><a href="https://spideroak.com/" target="_blank">SpiderOak</a>/Dropbox: File sharing. SpiderOak is much safer. You can use your own git server and the encryption keys stay with you not the company.</li>
<li><a href="http://www.irradiatedsoftware.com/sizeup/" target="_blank">SizeUp</a>: Window position management</li>
<li><a href="http://www.teamviewer.com/en/index.aspx" target="_blank">TeamViewer</a>: Fix my mom&#8217;s PC from a distance!</li>
<li><a href="http://www.chachatelier.fr/latexit/" target="_blank">LatTeXiT</a>/TeXShop: LaTeX equation editor and editor with PDF preview.</li>
<li><a href="http://www.tweetdeck.com/" target="_blank">TweetDeck</a>: Multiple account plus Unicode.</li>
<li><a href="http://www.sophos.com/en-us/products/free-tools/sophos-antivirus-for-mac-home-edition.aspx" target="_blank">Sophos Anti-virus</a>: It is kind of a myth that Macs <a href="http://www.theinquirer.net/inquirer/news/2029303/virus-mac-invulnerable" target="_blank">don&#8217;t</a><a href="http://www.sophos.com/en-us/press-office/press-releases/2006/02/macosxleap.aspx" target="_blank">need</a> antivirus.</li>
<li><a href="http://seashore.sourceforge.net/" target="_blank">Seahorse</a>/<a href="http://gimp.lisanet.de/Website/Download.html" target="_blank">GIMP</a>: Simple image manipulation.</li>
<li></li>
</ul>
<p>A special mention to this list must be <a href="http://projects.tynsoe.org/en/geektool/" target="_blank">GeekTool</a> with regards to customisation. This tool has allowed me to set up and show quite a few useful information on my desktop. You can see the screengrab below for an example.</p>
<p><a href="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-14-at-18-06-28.png"><img class="aligncenter size-full wp-image-539" title="Screen Shot 2012-01-14 at 18.06.28" src="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-14-at-18-06-28.png?w=604&#038;h=339" alt="" width="604" height="339" /></a></p>
<p>This tool adds weather info, iCal appointments, TODOtxt list, date/time, and activity status all on the desktop. Quite easily customisable as well via scripts.</p>
<p>The other powerful feature that exists within OSX is of course the command line. It&#8217;s not a complete UNIX environment but with the help of <a href="http://mxcl.github.com/homebrew/" target="_blank">Homebrew</a> most of the UNIX tools can be compiled and installed easily.</p>
<p>By running:</p>
<p><pre class="brush: bash;">
brew install aspell --lang=en-GB
</pre></p>
<p>you get a spell-checker that is ideal for correcting LaTeX files:</p>
<p><pre class="brush: bash;">
aspell -c --mode tex filename
</pre></p>
<p>I install most brew recipes with:</p>
<p><pre class="brush: bash;">
brew install spark todo-txt agrep dos2unix fortune gawk git gnu-sed htop multitail psgrep rename sqlite ssh-copy-id wget
</pre></p>
<p>You can get more brewing! recipes <a href="https://github.com/mxcl/homebrew/tree/master/Library/Formula" target="_blank">here</a>.</p>
<p>The rest of the work I do is on the command line. For this I use iTerm2 which has to be the terminal OSX should&#8217;ve had for a long time. Multiple tabs and easy customisation make it a treat to work with.</p>
<p>I use the Solarized color theme for both iTerm2 and ViM. You can find both <a href="http://ethanschoonover.com/solarized" target="_blank">here</a>. I find it to be the most eye-pleasing theme and also the most legible. There is both a dark and light theme depending on your preference. With some scripting you could even have the light theme during the morning (with natural light) and switch to the dark theme at night.</p>
<p>I&#8217;m come back to ViM customisation, but not before I mention a really cool customization for the zsh. I&#8217;ve been using <a title="zsh + Ubuntu" href="http://delivorias.me/2010/03/16/zsh-ubuntu/" target="_blank">zsh for a while now</a> (In greek only, sorry). I&#8217;ve spent some time trying to customise my Prompt to show relevant information but also look pleasant to the eye. I think <a href="https://github.com/robbyrussell/oh-my-zsh" target="_blank">oh-my-zsh</a> achieves both and then more. Functions, autocompletes, aliases and ready made <a href="https://github.com/robbyrussell/oh-my-zsh/tree/master/themes" target="_blank">themes</a>. You can see some screenshots of various themes <a href="https://github.com/robbyrussell/oh-my-zsh/wiki/Themes" target="_blank">here</a>. You can install it quite easily like so:</p>
<p><pre class="brush: bash;">
wget --no-check-certificate &lt;a href=&quot;https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh&quot;&gt;https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh&lt;/a&gt; -O - | sh
</pre></p>
<p>or by cloning the git repo:</p>
<p><pre class="brush: bash;">
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
</pre></p>
<p>For me I&#8217;ve settled to the <a href="https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/fino.zsh-theme" target="_blank">fino</a> theme. You can see a screenshot below.</p>
<p><a href="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-14-at-17-11-05.png"><img class="aligncenter size-full wp-image-544" title="Screen Shot 2012-01-14 at 17.11.05" src="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-14-at-17-11-05.png?w=604&#038;h=68" alt="" width="604" height="68" /></a></p>
<p>At the prompt, aside from user and hostname info, you also get PWD and the git brach and status of the directory you are.</p>
<p>As for the rest of the terminal configuration I want to mention the ViM customisations since I&#8217;ve already said some things on <a title="Επικόλληση στο GNU Screen" href="http://delivorias.me/2010/08/31/%ce%b5%cf%80%ce%b9%ce%ba%cf%8c%ce%bb%ce%bb%ce%b7%cf%83%ce%b7-%cf%83%cf%84%ce%bf-gnu-screen/" target="_blank">GNU Screen</a> (Again apologies, this is in Greek. I will try and translate them into English if there&#8217;s any interest.).</p>
<p>My ViM config file emphasises on functionality. I like having line numbers visible at all times, and I&#8217;ve also deactivated the arrows navigation in order to force me to use the h,j,k,l navigation keys. I&#8217;m also using Pathogen in order to load modules like the TagList, TaskList, NERDTree, and the solarized color theme of course. You can see the end result below.</p>
<p><a href="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-00-43.png"><img class="aligncenter size-full wp-image-548" title="ViM" src="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-00-43.png?w=604&#038;h=757" alt="" width="604" height="757" /></a></p>
<p>At the bottom of the screen what you&#8217;re seeing is the <a href="https://github.com/Lokaltog/vim-powerline" target="_blank">PowerLine plugi</a>n. A very nifty tool that provides immediate information about the file you&#8217;re editing. There&#8217;s also a visual cue whether you&#8217;re in (n)ormal mode or (i)nsert mode.</p>
<div id="attachment_549" class="wp-caption aligncenter" style="width: 614px"><a href="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-07-45.png"><img class="size-full wp-image-549" title="Screen Shot 2012-01-15 at 12.07.45" src="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-07-45.png?w=604&#038;h=72" alt="" width="604" height="72" /></a><p class="wp-caption-text">Normal Mode</p></div>
<div id="attachment_550" class="wp-caption aligncenter" style="width: 614px"><a href="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-08-02.png"><img class="size-full wp-image-550" title="Screen Shot 2012-01-15 at 12.08.02" src="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-08-02.png?w=604&#038;h=74" alt="" width="604" height="74" /></a><p class="wp-caption-text">Insert Mode</p></div>
<p>I&#8217;m also in the process of turning my ViM setup into a complete Python IDE, but unfortunately I&#8217;m having som estrange issues compiling ViM from source on OSX with python support. Any thoughts as to how I can do this? I have followed advice so far from these <a href="http://blog.dispatched.ch/2009/05/24/vim-as-python-ide/" target="_blank">really</a> <a href="http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/" target="_blank">good</a> sources for this setup.</p>
<p>The only other aspect I wanted to have was a way to sync these rc config files between my iMac and my MBP. I wanted the customisations made on one machine to be automatically reflected on the other. The way I did this, although you could do the same with Dropbox, is via iCloud. I saw somewhere online that if two Macs are syncing to the same iCloud account, as mine are, then the directory ~/Library/Mobile\ Documents/ is automatically synced between the machines with the same account. so what I did is placed all my rcfiles and .vim directory in that location and soft linked to them from home, e.g.:</p>
<div id="attachment_552" class="wp-caption aligncenter" style="width: 614px"><a href="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-30-341.png"><img class="size-full wp-image-552" title="Screen Shot 2012-01-15 at 12.30.34" src="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-30-341.png?w=604&#038;h=39" alt="" width="604" height="39" /></a><p class="wp-caption-text">Soft Links</p></div>
<p>This will create a link to the sync&#8217;ed version of vimrc which can be accessed by your local ViM installation.</p>
<p>I hope you&#8217;ve found this article useful in some way. Let me know in the comments if you have a cool/useful customisation you&#8217;ve done that you&#8217;d like to share.</p>
<p>As usual you can find all the config files used for this setup in my <a href="https://github.com/cmdel/config-rc-files" target="_blank">GitHub repo</a>. Fork away!</p>
<p>P.S. I should also mention that the font seen in these screengrabs is the Open Font &#8211; Anonymous Pro. You can <a href="http://www.ms-studio.com/FontSales/anonymouspro.html">get it here.</a></p>
<br /> Tagged: <a href='http://delivorias.me/tag/imac-2/'>IMAC</a>, <a href='http://delivorias.me/tag/zsh/'>ZSH</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/delivorias.wordpress.com/537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/delivorias.wordpress.com/537/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/delivorias.wordpress.com/537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/delivorias.wordpress.com/537/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/delivorias.wordpress.com/537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/delivorias.wordpress.com/537/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/delivorias.wordpress.com/537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/delivorias.wordpress.com/537/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/delivorias.wordpress.com/537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/delivorias.wordpress.com/537/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/delivorias.wordpress.com/537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/delivorias.wordpress.com/537/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/delivorias.wordpress.com/537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/delivorias.wordpress.com/537/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=537&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://delivorias.me/2012/01/15/customising-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>55.958832 -3.215253</georss:point>
		<geo:lat>55.958832</geo:lat>
		<geo:long>-3.215253</geo:long>
		<media:content url="http://1.gravatar.com/avatar/fa33466c9c1e40ddd2d633b4b8b37891?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">cmd</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2012/01/p1861_big.jpg" medium="image">
			<media:title type="html">p1861_big</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-14-at-18-06-28.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-14 at 18.06.28</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-14-at-17-11-05.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-14 at 17.11.05</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-00-43.png" medium="image">
			<media:title type="html">ViM</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-07-45.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-15 at 12.07.45</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-08-02.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-15 at 12.08.02</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2012/01/screen-shot-2012-01-15-at-12-30-341.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-15 at 12.30.34</media:title>
		</media:content>
	</item>
		<item>
		<title>Multicommodity network flow in Java</title>
		<link>http://delivorias.me/2011/12/27/multicommodity-network-flow-in-java/</link>
		<comments>http://delivorias.me/2011/12/27/multicommodity-network-flow-in-java/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 23:50:56 +0000</pubDate>
		<dc:creator>Christos Delivorias</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OR]]></category>
		<category><![CDATA[mcnf]]></category>
		<category><![CDATA[or]]></category>

		<guid isPermaLink="false">http://delivorias.me/?p=516</guid>
		<description><![CDATA[Problem Statement In a previous post I presented an approach to solve the shortest path problem using different implementations of algorithms. The shortest path problem is a classic and important combinatorial optimisation problem. It often appears as a subproblem when solving difficult combinatorial problems like the multicommodity network flow (MCNF) problems. The problem is to route a set [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=516&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Problem Statement</h2>
<p>In a <a title="Dynamic Programming in JAVA for PERT (Program Evaluation and Review Technique)" href="http://delivorias.me/2011/05/22/dynamic-programming-in-java-for-pert-program-evaluation-and-review-technique/" target="_blank">previous post</a> I presented an approach to solve the shortest path problem using different implementations of algorithms. The shortest path problem is a classic and important combinatorial optimisation problem. It often appears as a subproblem when solving difficult combinatorial problems like the multicommodity network flow (MCNF) problems.</p>
<p>The problem is to route a set of demands (commodities) through a network<a id="1" href="#fn1"><sup>1</sup></a> with limited arc capacities. The inherent assumption with the following implementation is that the commodities can be shipped in fractions, hence are divisible.<span id="more-516"></span></p>
<p>The technique that is implemented in the Java code is the Column Generation a.k.a. the <a title="Dantzig-Wolfe DEcomposition" href="http://en.wikipedia.org/wiki/Dantzig%E2%80%93Wolfe_decomposition" target="_blank">Dantzig-Wolfe Decomposition.</a> This technique has many applications to practical problems. For instance routing data packets through telephone networks, routing electricity demand in power grids, routing vehicles on the road network, allocating airline crews to flights, production scheduling and planning, etc.</p>
<p>The column generation algorithm can be interpreted as applying the Simplex Method to a Linear Problem with a huge number of columns. Only a few columns are present at the start, other columns are <em>generated</em> when needed.</p>
<h2>Problem Example</h2>
<p>Taking the small network shown below as an example, we can state that all edges are bidirectional with a cost of 1 and a total capacity of 2.5 (D-F has 2.6)</p>
<p><a href="http://delivorias.files.wordpress.com/2011/12/screen-shot-2011-12-26-at-22-50-32.png"><img class="aligncenter size-full wp-image-517" title="MCNF_network" src="http://delivorias.files.wordpress.com/2011/12/screen-shot-2011-12-26-at-22-50-32.png?w=604" alt=""   /></a></p>
<p>If the commodities:</p>
<ul>
<li>A-F: 3 units</li>
<li>e-D: 2 units</li>
</ul>
<div>need to be shipped, then arc C-D is overloaded. This problem could be solved as a standard Linear Programming (LP) constraint problem, using an LP solver, but it becomes intractable and inefficient when dealing with huge networks.</div>
<div></div>
<div>This is why column generation, by creating paths on a need to have basis and decomposing the problem into smaller sub-problems, provides a much better and more efficient solution.</div>
<h2>Implementation</h2>
<div></div>
<div>The Java code will solve both the small network problem shown above as well as the UK transport network shown below.</div>
<div></div>
<div><a href="http://delivorias.files.wordpress.com/2011/12/screen-shot-2011-12-26-at-23-13-46.png"><img class="aligncenter size-full wp-image-518" title="MCNF_large_network" src="http://delivorias.files.wordpress.com/2011/12/screen-shot-2011-12-26-at-23-13-46.png?w=604&#038;h=394" alt="" width="604" height="394" /></a></div>
<div>with commodities: INV-DOV: 1.5 units, EDI-PLY: 2 units.</div>
<div></div>
<div>The requirements of the assignment were to read a data file of specific format, construct the graph, perform the D-W algorithm to find the solution to the MCNF problem and report for each commodity the routing by which it is shipped and the cost of shipping via that route, and also in the case of fractional shippings report the paths along with the percentage of commodity using them.</div>
<div>For this work the Graph.java was provided (although there is an implementation of it with the PERT article) and also a wrapper for the LP solver library was provided.</div>
<div></div>
<div>In order to be able to succesfully run this code you&#8217;ll need to install the lp_solve library and access it via the LP class wrapper, in order to pass the LP problem to the solver and get the optimal value for the solution. The library used is lp_solve 5.5, which is implemented in C and offered under a GNU LGPL licence<a id="2" href="#fn2"><sup>2</sup></a>.</div>
<div></div>
<div>As usual you can find the <a href="https://github.com/cmdel/MCNF" target="_blank">complete code on Github</a>.</div>
<div></div>
<p><span style="font-size:11px;"><br />
</span></p>
<h2>References</h2>
<p><a id="fn1" href="#1">1</a>. The network in the present example is defined as a graph V, which is a set of vertices V= {1,&#8230;n}.</p>
<p>It also includes a set j in E of (directed) edges specified by a start and end verted and also the cost and cpacity of each vertex: Cj, CAPj.</p>
<p>Finally a set i in C of commodities which is given by the source and target of each commodity: Si, Ti, and the demand Di.</p>
<p><a id="fn2" href="#2">2</a>. You can find the library at <a href="http://lpsolve.sourceforge.net" target="_blank">http://lpsolve.sourceforge.net</a>. To use it on Windows you need to copy the shared libraries lpsolve55.dll, lpsolve55j.dll as well as the interface lpsolve55ja.jar into the project workspace.</p>
<p>To compile use:</p>
<pre>javac -cp lpsolve55ja.jar;. Mcnf.java</pre>
<p>To run the program use:</p>
<pre>java -cp lpsolve55ja.jar;. Mcnf</pre>
<h3>Remark</h3>
<p>For OSX you&#8217;ll needto compile from source. Change to the <code>lib/mac</code> directory and edit the file <code>build_osx</code>. Change the directory paths as indicated in the comments. Follow the compilation instructions to get the binaries of the solver</p>
<br /> Tagged: <a href='http://delivorias.me/tag/java/'>Java</a>, <a href='http://delivorias.me/tag/mcnf/'>mcnf</a>, <a href='http://delivorias.me/tag/or-2/'>or</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/delivorias.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/delivorias.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/delivorias.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/delivorias.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/delivorias.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/delivorias.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/delivorias.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/delivorias.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/delivorias.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/delivorias.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/delivorias.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/delivorias.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/delivorias.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/delivorias.wordpress.com/516/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=516&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://delivorias.me/2011/12/27/multicommodity-network-flow-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>55.958832 -3.215253</georss:point>
		<geo:lat>55.958832</geo:lat>
		<geo:long>-3.215253</geo:long>
		<media:content url="http://1.gravatar.com/avatar/fa33466c9c1e40ddd2d633b4b8b37891?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">cmd</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2011/12/screen-shot-2011-12-26-at-22-50-32.png" medium="image">
			<media:title type="html">MCNF_network</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2011/12/screen-shot-2011-12-26-at-23-13-46.png" medium="image">
			<media:title type="html">MCNF_large_network</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamic Programming in JAVA for PERT (Program Evaluation and Review Technique)</title>
		<link>http://delivorias.me/2011/05/22/dynamic-programming-in-java-for-pert-program-evaluation-and-review-technique/</link>
		<comments>http://delivorias.me/2011/05/22/dynamic-programming-in-java-for-pert-program-evaluation-and-review-technique/#comments</comments>
		<pubDate>Sun, 22 May 2011 16:50:20 +0000</pubDate>
		<dc:creator>Christos Delivorias</dc:creator>
				<category><![CDATA[OR]]></category>
		<category><![CDATA[Dynamic]]></category>

		<guid isPermaLink="false">http://delivorias.me/?p=506</guid>
		<description><![CDATA[Dynamic programming is a useful mathematical technique for making a sequence of inter-related decisions. It provides a systematic procedure for determining the optimal combination of decisions, given the constraints at hand. In contrast to linear programming, there is no standard formulation for the mathematical problem. Hence each problem requires analysis and modelling for itself. A [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=506&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://delivorias.files.wordpress.com/2011/05/wpid-screenshot2011-05-22at14-41-31-2011-05-7-22-05.png?w=475&#038;h=250" alt="wpid-screenshot2011-05-22at14-41-31-2011-05-7-22-05.png" width="475" height="250" /></p>
<p>Dynamic programming is a useful mathematical technique for making a sequence of inter-related decisions. It provides a systematic procedure for determining the optimal combination of decisions, given the constraints at hand. In contrast to linear programming, there is no standard formulation for the mathematical problem. Hence each problem requires analysis and modelling for itself. A large number of algorithms are also available for this field of problems.(1)<br />
The example above, taken from Hillier &amp; Lieberman’s “Introduction to Operational Research”, describe the Program Evaluation and Review Technique (2) the interdependent tasks A, B, C, D, and E. Each task has an estimated time of completion -3, 4, 5, 3, and 4 respectively-. Unless process C finishes, task E cannot begin to execute.<br />
This process is commonly used in project management scenarios, when inter-related events need to have their predecessors completed before taking up a certain task.</p>
<p>The purpose of this scenario is to find the expected time of completion for this project. The uncertainty comes from the fact that each of the times of completion are estimations. Therefore the scenario needs to be run multiple times and then the expected completion time to be calculated. The distribution of the completion times will be outputted as the result.</p>
<p>There are three milestones to this project:</p>
<ol style="list-style-type:decimal;">
<li>Parse an ASCII data file and construct a Graph to represent the problem.</li>
<li>Find the critical path through the graph.</li>
<li>Calculate the experimental distribution of the total project duration, given distributions for the completion time of each sub-task.</li>
</ol>
<p><span id="more-506"></span></p>
<p>A. Task 1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>The files will have the following syntactic and semantic structure:</p>
<pre>0        0        0        0
A        1        2        3        0
B        2        3.5        8        0        A
C        6        9        18        0        B
D        4        5.5        10        0        C
E        1        4.5        5        0        C
F        4        4        10        0        E
G        5        6.5        11        0        D
H        5        8        17        0        E        G
I         3        7.5        9        0        C
J        3        9        9        0        F        I
K       4        4        4        0        J
L        1        5.5        7        0        J
M       1        2        3        0        H
N        5        5.5        9        0        K        L
Z        0        0        0        A B C D E F G H I J K L M N</pre>
<p>The first column is the [name] of the milestone.<br />
The second column is the [opt]imistic estimate of duration.<br />
The third column is the most [likely] estimate of duration.<br />
The fourth column is the [pess]imistic estimate of duration.<br />
From then on the remaining characters indicate preceding milestones that this milestone [depends] on.</p>
<p>Once all the lines have been read, they’ll be used to construct the graph of the project. This graph will use the methods in the Graph class of the code.<br />
From the time of completion selection a random variate will be selected based on the likely, best and worst case scenarios.</p>
<p>The duration of each activity will be <strong>a Normally Distributed Random Variate (NDRV)</strong> with mean μ=(o+4m+p)/6 and variance σ^2=(p-o)2/36, where o, m, p the given optimistic, likely, and pessimistic times of completion.<br />
JAVA’s Random class was used to generate Normally distributed random numbers N(0,1). This value was then multiplied by the variance calculated above for the times of completion and subsequently the newly calculated mean was added to this value to produce an NDRV(μ, σ^2).</p>
<p>B. Task 2<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>For the critical path method, different algorithms were tried. Dijkstra’s algorithm had to be modified to work for the critical path. Since Dijkstra’s algorithm works efficiently to find the minimum cost path, the time of completions had to be inverted in order to look for the lowest inverted time. This didn’t produce optimal solution, plus had additional problems with potential 0 time of completion or negative times.<br />
The Backwards propagation algorithm could not handle a terminal node with all edges having 0 time of completion and thus couldn’t start at all.<br />
The forwards propagation algorithm couldn’t handle large costs deeper in the graph and thus did not produce an optimal solution. It did however produce feasible solutions.<br />
The algorithm finally utilised was the Backwards propagating Bellman-Ford(BF) algorithm. The Bellman–Ford algorithm computes single-source shortest paths in a weighted digraph. Bellman–Ford runs in O(|V|·|E|) time, where |V| and |E| are the number of vertices and edges respectively. (3) An added benefit of the BF algorithm is that it can identify negative cycles and break the execution.</p>
<p>C. Task 3<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>The mean, variance, and distribution of the simulation will be outputted on the terminal and a small GUI showing the histogram. Normally to calculate the variance of the data set, two passes of the data would be required. One to calculate the expected value of the series and a second to calculate the residuals of the values to the expected value.<br />
var = Sum(Xi-Xmu)^2)/N , for all i belongs to N</p>
<p>However by decomposing the above formula, it is possible to do this with one run, to minimise the time of execution:<br />
var = (Sum(Xi))^2/N &#8211; (Sum/N)^2 , for all i belongs to N</p>
<p>The bin size is set at 1 for the min-max range of (30,59), although by calculating the range of the series the following formula can be used to determine the optimal bin size (W):</p>
<p>W=3.49xSDxN^(-1/3), where SD is the sample standard deviation and N the available data point. (4)</p>
<p>Conclusion<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
The final outcome indicates that for the case102.dat (included in the repo) the statistical output of the simulation and the logarithmic histogram are:</p>
<pre>Experiment's mean value for the critical length paths: 43.41049912306386
Experiment's variance value for the critical length paths: 12.700112769478892
Critical Path: 0 - E - O - P - Q - Z
Bin        Prob        LogHist                Count
30        0%               |                0/10000
31        0%               |                0/10000
32        0%               |@                5/10000
33        0.2%             |@@@                22/10000
34        0.2%             |@@@                25/10000
35        0.8%             |@@@@        83/10000
36        1.6%             |@@@@@        155/10000
37        2.8%             |@@@@@        279/10000
38        4.4%             |@@@@@@        440/10000
39        6.3%             |@@@@@@        626/10000
40        8.4%             |@@@@@@        840/10000
41        9.8%             |@@@@@@        983/10000
42        11.6%            |@@@@@@@        1164/10000
43        11.2%            |@@@@@@@        1120/10000
44        10.3%            |@@@@@@        1028/10000
45        9.2%             |@@@@@@        920/10000
46        7.7%             |@@@@@@        774/10000
47        5.7%             |@@@@@@        570/10000
48        3.8%             |@@@@@        375/10000
49        2.6%             |@@@@@        257/10000
50        1.6%             |@@@@@        162/10000
51        0.9%             |@@@@        93/10000
52        0.4%             |@@@                44/10000
53        0.2%             |@@@                22/10000
54        0.1%             |@                6/10000
55        0%               |@                3/10000
56        0%               |                1/10000
57        0%               |                0/10000
58        0%               |                0/10000
59        0%               |                0/10000</pre>
<p>This histogram exhibits the normal distribution expected from the simulation with the mean and distribution provided by the o, m , p times of the milestones.</p>
<p>This project was awarded 72/100 marks.</p>
<p>As usual the source for this project can be checked out and forked at <a href="https://github.com/cmdel/javaPERT">https://github.com/cmdel/javaPERT</a>.</p>
<p>REFERENCES<br />
============</p>
<ol style="list-style-type:decimal;">
<li><a href="http://en.wikipedia.org/wiki/Dynamic_programming#Algorithms_that_use_dynamic_programming">http://en.wikipedia.org/wiki/Dynamic_programming#Algorithms_that_use_dynamic_programming</a></li>
<li><a href="http://en.wikipedia.org/wiki/Program_Evaluation_and_Review_Technique">http://en.wikipedia.org/wiki/Program_Evaluation_and_Review_Technique</a></li>
<li><a href="http://en.wikipedia.org/wiki/Bellman–Ford_algorithm">http://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm</a></li>
<li><span style="color:#b3b5af;">Scott, 1979. On optimal and data-based histograms. Biometrika, 66:605-610.</span></li>
</ol>
<br /> Tagged: <a href='http://delivorias.me/tag/dynamic/'>Dynamic</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/delivorias.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/delivorias.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/delivorias.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/delivorias.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/delivorias.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/delivorias.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/delivorias.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/delivorias.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/delivorias.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/delivorias.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/delivorias.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/delivorias.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/delivorias.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/delivorias.wordpress.com/506/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=506&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://delivorias.me/2011/05/22/dynamic-programming-in-java-for-pert-program-evaluation-and-review-technique/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>55.958832 -3.215253</georss:point>
		<geo:lat>55.958832</geo:lat>
		<geo:long>-3.215253</geo:long>
		<media:content url="http://1.gravatar.com/avatar/fa33466c9c1e40ddd2d633b4b8b37891?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">cmd</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2011/05/wpid-screenshot2011-05-22at14-41-31-2011-05-7-22-05.png" medium="image">
			<media:title type="html">wpid-screenshot2011-05-22at14-41-31-2011-05-7-22-05.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Discrete-time bank queue simulation in JAVA</title>
		<link>http://delivorias.me/2011/02/06/discrete-time-bank-queue-simulation/</link>
		<comments>http://delivorias.me/2011/02/06/discrete-time-bank-queue-simulation/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 15:48:05 +0000</pubDate>
		<dc:creator>Christos Delivorias</dc:creator>
				<category><![CDATA[Προγραμματισμος]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[simulation]]></category>

		<guid isPermaLink="false">http://delivorias.me/?p=476</guid>
		<description><![CDATA[As part of the MSc course I&#8217;m currently undertaking, there&#8217;s a great need to understand optimality of processes and operations. One of them is the problem of queues while serving customers. The following is my submission for the assignment of the Simulation (MATH110281) course. The deliverable of this course was to simulate a simple bank [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=476&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://delivorias.files.wordpress.com/2011/02/98363334_31cf837f03.jpg"><img class="aligncenter size-full wp-image-477" title="queue" src="http://delivorias.files.wordpress.com/2011/02/98363334_31cf837f03.jpg?w=604" alt=""   /></a></p>
<p>As part of the MSc course I&#8217;m currently undertaking, there&#8217;s a great need to understand optimality of processes and operations. One of them is the problem of queues while serving customers. The following is my submission for the assignment of the Simulation (MATH11028<a id="1" href="#fn1"><sup>1</sup></a>) course.</p>
<p>The deliverable of this course was to simulate a simple bank queue with three scenarios. The first scenario was single server (employee serving customers) and an exponential random time of arrival and an Erland random number of completion. Both these numbers were derived from Java&#8217;s <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/Random.html" target="_blank">Random</a> class. The myRandom class, included in the public Git repository<a id="2" href="#fn2"><sup>2</sup></a>, and it was created by my lecturer Andreas Grothey. It is basically an implementation of generating an erlang variate Erl(λ, μ) and en exponential one Exp(μ), from a uniformly distributed Gaussian distribution<a id="3" href="#fn3"><sup>3</sup></a>.</p>
<p><!-- p.p1 {margin: 0.0px 0.0px 12.0px 0.0px; text-indent: 21.2px; font: 12.0px 'Gill Sans Light'} span.s1 {letter-spacing: 0.0px} -->For this assignment, different scenarios for managing a bank queue were requested from the bank manager. The first scenario involved a queue with single server with an exponential distribution for arrival. The average of customers arriving was 19 per hour. The completion times were given by an Erlang distribution. The number of customers served per hour were 20. The day in all simulations was taken to last 8 work-hours. The result of this scenario was that out of 164 arrivals, all customers were served with 85.4% (140 customers) having waited more than 6 minutes in the queue.</p>
<p>The second scenario  involved extending the queue to multiple servers.  An <a href="http://download.oracle.com/javase/6/docs/api/java/util/ArrayList.html" target="_blank">ArrayList</a> was used to keep track of servers’ status and time of completion.  This scenario produced non optimal results, since there ware 22.8% of customers waiting more than 6 minutes. The maximum queue for this scenario was 17 customers.</p>
<p>The third and final scenario was to implement different average numbers of customers for each of the 8 hours in the work day. The additional decision was to implement a strategy of opening and closing server positions when demand increases.  The demand criterion was selected to be the length of the queue at any given time. There were different scenarios to try out, but the sole setting that met the constraint was when the queue did not exceed 6 customers.</p>
<p><span id="more-476"></span></p>
<p><a href="http://delivorias.files.wordpress.com/2011/02/screen-shot-2011-01-14-at-12-22-25.png"><img class="aligncenter size-full wp-image-487" title="Statistical data" src="http://delivorias.files.wordpress.com/2011/02/screen-shot-2011-01-14-at-12-22-25.png?w=604&#038;h=637" alt="" width="604" height="637" /></a></p>
<blockquote>
<p style="text-align:center;">The plots above were generated with R<a id="4" href="#fn4"><sup>4</sup></a> after out-putting the Java stdout to a file called &#8220;fraction&#8221;. From there the contents of that file were passed though awk in order to sieve the fraction values from all other data into a file called &#8220;fraction2&#8243;.  The latter file was used as the dataset in R. The history for the commands used in R are <a href="https://github.com/cmdel/Queue-Simulation/blob/93769b55bf3c4dd405a10efe6866287f9509d77d/src/.Rhistory" target="_blank">here</a>.</p>
</blockquote>
<p><!-- p.p1 {margin: 0.0px 0.0px 12.0px 0.0px; text-indent: 21.2px; font: 12.0px 'Gill Sans Light'} span.s1 {letter-spacing: 0.0px} -->The figure above shows at the top part, the procession of the fraction throughout the day. The blue horizontal line is the constraint ceiling of 5% (0.05).</p>
<p>The results for this scenario were run over 100 trial iterations, in order to calculate an average value for the percentage of customers that wait more than 6 minutes in the queue.  This value was resulting at 3.2% ;well within the limit. If the queue tolerance was extended to being more than 7, the average fraction was outside the limit of 5%.</p>
<p>The two diagrams show the time-series of the fraction of customers waiting more than 6 minutes (top) and the number of servers that are engaged at each discrete interval. The red vertical lines are indicating the events at which the hour changes. Therefore they denote the 8 1-hour segment during the day and the servers corresponding to each hour. It is evident that the third, fourth, seventh, and eighth hour of the day demanded the most servers.</p>
<p>An average value of servers per event is also outputted as a means of showing the hours in most need of additional servers. Again the hour slots mentioned above stand out as the highest values.</p>
<p><!-- p.p1 {margin: 0.0px 0.0px 6.0px 21.2px; text-indent: -21.3px; font: 12.0px 'Gill Sans Light'} span.s1 {letter-spacing: 0.0px} span.s2 {font: 12.0px 'Gill Sans'; letter-spacing: 0.0px} --></p>
<blockquote>
<p style="text-align:left;">Avg servers for hour 1 : 2.0</p>
<p style="text-align:left;">Avg servers for hour 2 : 1.98</p>
<p style="text-align:left;">Avg servers for hour 3 : <strong>2.641509433962264</strong></p>
<p style="text-align:left;">Avg servers for hour 4 : <strong>2.323529411764706</strong></p>
<p style="text-align:left;">Avg servers for hour 5 : 2.25</p>
<p style="text-align:left;">Avg servers for hour 6 : 2.3307086614173227</p>
<p style="text-align:left;">Avg servers for hour 7 : <strong>2.580952380952381</strong></p>
<p style="text-align:left;">Avg servers for hour 8 : <strong>3.278787878787879</strong></p>
</blockquote>
<p style="text-align:left;">The result of the simulation indicates that the bank will require a minimum of two people per hour for all hours of the work day, aside from the end-of-day hour (16.00-17.00) were an additional employee will be required a the service tills.</p>
<p style="text-align:left;">&nbsp;</p>
<h2>Footnotes</h2>
<p><a id="fn1" href="#1">1</a>.</p>
<p>The structure of Simulation course I sat through. This is here mainly to give people an idea as to what is expected from this course.</p>
<p><strong>Aims:</strong></p>
<p><em>Many Management problems are far too complex to be solved solely by Mathematical Analysis. Simulation (Monte-Carlo) methods were developed during the Second World War to solve difficult problems in Mathematical Physics. This module shows how discrete event simulation is increasingly used to investigate the behaviour of complex stochastic systems in Management. The course includes hands-on construction of simulation models using the package SIMUL8.</em></p>
<p><strong>Syllabus summary:</strong></p>
<p>Generating Uniform random numbers using Linear Congruential methods. Tests of randomness including Frequency and Serial tests and Lattice behaviour. Generating Random Variates from distributions: Inversion of the cumulative distribution function and Envelope Rejection methods. Generating variates from standard distributions including normal, gamma, beta, Poisson, binomial. Theory and simulation of Poisson and other birth-death processes. Discrete event simulation: Entity, Event, Activity, Attribute, and Set. Event and Three-Phase approaches to model construction. An example in JAVA. Design and analysis of experiments: Use of random number seeds. Variance Reduction including Antithetic and Control Variates. Analysis of autocorrelated output data. Use of the SIMUL8 package to build and experiment on models of manufacturing and management systems. Project work for continuous assessment part of course.<br />
<a id="fn1" href="#1">Back to post</a>.</p>
<hr />
<p><a id="fn2" href="#2">2</a>.</p>
<p>You can clone, fork, review this code at:</p>
<p><a href="https://github.com/cmdel/Queue-Simulation" target="_blank">https://github.com/cmdel/Queue-Simulation</a></p>
<p>git@github.com:cmdel/Queue-Simulation.git (For cloning in Eclipse or the command line)</p>
<p><a id="fn2" href="#2">Back to post</a>.</p>
<hr />
<p><a id="fn3" href="#3">3</a>.</p>
<p><img class="alignnone" title="Erlang distribution" src="http://www.xycoon.com/images/erl260.gif" alt="" width="386" height="221" /><img class="alignnone" title="Exponential distribution" src="http://www.xycoon.com/images/exp260.gif" alt="" width="376" height="139" /></p>
<p><a id="fn3" href="#3">Back to post</a></p>
<hr />
<p><a id="fn4" href="#4">4</a>.</p>
<p><a href="http://www.r-project.org/" target="_blank">http://www.r-project.org/</a></p>
<p><a id="fn4" href="#4">Back to post</a></p>
<br /> Tagged: <a href='http://delivorias.me/tag/java/'>Java</a>, <a href='http://delivorias.me/tag/simulation/'>simulation</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/delivorias.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/delivorias.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/delivorias.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/delivorias.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/delivorias.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/delivorias.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/delivorias.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/delivorias.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/delivorias.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/delivorias.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/delivorias.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/delivorias.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/delivorias.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/delivorias.wordpress.com/476/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=476&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://delivorias.me/2011/02/06/discrete-time-bank-queue-simulation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>55.958832 -3.215253</georss:point>
		<geo:lat>55.958832</geo:lat>
		<geo:long>-3.215253</geo:long>
		<media:content url="http://1.gravatar.com/avatar/fa33466c9c1e40ddd2d633b4b8b37891?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">cmd</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2011/02/98363334_31cf837f03.jpg" medium="image">
			<media:title type="html">queue</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2011/02/screen-shot-2011-01-14-at-12-22-25.png" medium="image">
			<media:title type="html">Statistical data</media:title>
		</media:content>

		<media:content url="http://www.xycoon.com/images/erl260.gif" medium="image">
			<media:title type="html">Erlang distribution</media:title>
		</media:content>

		<media:content url="http://www.xycoon.com/images/exp260.gif" medium="image">
			<media:title type="html">Exponential distribution</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu post-install &#8220;One script to rule them all&#8221;</title>
		<link>http://delivorias.me/2011/01/18/ubuntu-post-install-one-script-to-rule-them-all/</link>
		<comments>http://delivorias.me/2011/01/18/ubuntu-post-install-one-script-to-rule-them-all/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 17:51:06 +0000</pubDate>
		<dc:creator>Christos Delivorias</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ZSH]]></category>

		<guid isPermaLink="false">http://delivorias.me/?p=456</guid>
		<description><![CDATA[I&#8217;ve written before (in Greek) about my woes with the pulse audio server in Ubuntu. Every time I fixed it, the whole system crumbled when I performed an update, let alone an upgrade. What I eventually did is to practically give up. I just didn&#8217;t have enough time to work on it in order to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=456&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://delivorias.files.wordpress.com/2011/01/terminal.png"><img class="aligncenter" title="Sandwich" src="http://imgs.xkcd.com/comics/sandwich.png" alt="" width="360" height="299" /><br />
</a>I&#8217;ve written <a title="Ubuntu Sound" href="http://delivorias.me/2010/03/10/ubuntu-hp-laptop-sound-nightmare/" target="_blank">before</a> (in Greek) about my woes with the pulse audio server in Ubuntu. Every time I fixed it, the whole system crumbled when I performed an update, let alone an upgrade. What I eventually did is to practically give up. I just didn&#8217;t have enough time to work on it in order to fix it. The workaround I resorted to was to keep my /home partition fully encrypted on its own partition and then everytime I wanted to upgrade to a later distribution I did a clean re-install of Ubuntu.</p>
<p>The drawbacks of this was that I was still spending too much time re-installing all my tools and applications from scratch. Their configurations were safe in the hidden folders in my /home directory. The process of finding everything and keeping track of what I used and manually install them was getting laborious.</p>
<p>So in the true linux spirit, I did what I guess anyone of you reading this post would do. I just created a small script to get me back to how my system used to be. This script will make a backup copy of the existing repository list first and then replace it will a list that will include all the necessary entries to install the software I need [File1:Lines2-3].</p>
<p>Then a few necessary encryption keys are installed so that certain repositories can be authenticated [File1:Lines4-8]. And from then on there&#8217;s a very long line with every single piece of binary I want installed [File1:Line10]. If I find I&#8217;m using a new application very often I will add it in the list here and add its repositories in the scripts repository list.<span id="more-456"></span></p>
<p>A few statistics packages I use are then added, as well as the libraries to decrypt and play DVDs [File1:Lines13-15].</p>
<p>A few screenlets I&#8217;m using are next [File1:Lines20-22].</p>
<p>It also gets my .rc files from github [File1:Lines26-27].</p>
<p>Finally it will install wine for the windows application I want to run, e.g. in this case Spotify [File1:Lines31].</p>
<p>And this is pretty much it. The script is kept simple so that it&#8217;s easy to extend to your needs. Just add the application&#8217;s repository in the list, add any optional keys to your keychain, and finally add the installation name of the application to the list to be installed. Conversely, just remove anything you don&#8217;t want to install.</p>
<p>This script is put here for anyone wanting something similar and not knowing where to start. Copy and share, no attribution needed. Also implied in this that this script comes as it is. I&#8217;m not making claims that it won&#8217;t hurt your installation. I&#8217;ve tested it on  many occasions and it works. The system it&#8217;s supposed to be used anyway is a manilla one so I guess it won&#8217;t matter if you mess it up. You can just re-install it.</p>
<h4>File1:</h4>
<p><pre class="brush: bash;">
#!/bin/bash
cp /etc/apt/sources.list /etc/apt/sources.list.bak
cp maverick.sources.list /etc/apt/sources.list
add-apt-repository ppa:tiheum/equinox
add-apt-repository ppa:am-monkeyd/nautilus-elementary-ppa
add-apt-repository ppa:bisigi/dev # Needs to change to /ppa when it's available
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2EBC26B60C5A2783 F9A2F76A9D1A0061 A040830F7FAC5991 16126D3A3E5C1192 DCF9F87B6DFBCBAE D6FDC9D0 FC5D50C5 2D9A3C5B 0AAFAD78 A69241F1 D67FC6EAE2A11821
apt-key adv --recv-keys --keyserver pgp.mit.edu 5044912E #dropbox key
apt-get --yes --quiet update &amp;&amp; apt-get --yes --quiet dist-upgrade
apt-get --yes --quiet install clamav clamtk build-essential checkinstall cdbs devscripts dh-make fakeroot libxml-parser-perl check avahi-daemon sun-java6-jre sun-java6-plugin equivs vlc mplayer libxine1-ffmpeg gxine mencoder mpeg2dec vorbis-tools id3v2 mpg321 mpg123 libflac++6 ffmpeg libmp4v2-0 totem-mozilla icedax tagtool easytag id3tool lame nautilus-script-audio-convert libmad0 libjpeg-progs libquicktime1 flac faac faad sox ffmpeg2theora libmpeg2-4 uudeview flac libmpeg3-1 mpeg3-utils mpegdemux liba52-0.7.4-dev  ubuntu-restricted-extras gsfonts gsfonts-x11 flashplugin-nonfree simple-ccsm wine playonlinux glipper unace rar unrar zip unzip p7zip-full p7zip-rar sharutils uudeview mpack lha arj cabextract file-roller chromium-browser chromium-browser-l10n acroread dia quanta gnome-do docky yakuake guake backintime-common backintime-gnome trash-cli git-core bisigi-themes community-themes nautilus-dropbox elementary-theme elementary-icon-theme elementary-wallpapers conky tint2 screenlets python-simplejson python-twitter compiz-fusion-plugins-extra screen zsh vim htop mutt irssi deja-dup faenza-icon-theme appmenu-gtk indicator-appmenu indicator-applet-appmenu gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer0.10-gnonlin gstreamer0.10-pitfdll gstreamer0.10-sdl gstreamer0.10-plugins-bad-multiverse gstreamer0.10-schroedinger gstreamer0.10-plugins-ugly-multiverse totem-gstreamergstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer0.10-gnonlin gstreamer0.10-pitfdll gstreamer0.10-sdl gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly-multiverse totem-gstreamer gstreamer-dbus-media-service gstreamer-tools

# Statistical tools
apt-get --yes --quiet install r-base-dev octave
wget http://downloads.sourceforge.net/project/sofastatistics/sofastatistics/0.9.24/sofa_0.9.24-1_all.deb?r=http%3A%2F%2Fwww.sofastatistics.com%2Fdownloads.php&amp;ts=1295372877&amp;use_mirror=switch
dpkg -i sofa_0.9.24-1_all.deb
# DVD libraries
apt-get --yes --quiet install libdvdread4 &amp;&amp; /usr/share/doc/libdvdread4/./install-css.sh
# Install maintenance
apt-get clean
apt-get autoclean
apt-get autoremove
# Screenlets
wget http://twitterscreenlet.googlecode.com/files/TwitterScreenlet-0.3.1.tar.gz &amp;&amp; tar vxzf TwitterScreenlet-0.3.1.tar.gz &amp;&amp; mkdir -p ~/.screenlets &amp;&amp; mv Twitter ~/.screenlets &amp;&amp; rm -rf TwitterScreenlet-0.3.1.tar.gz
wget http://gnome-look.org/CONTENT/content-files/102890-FolderView.tar.gz &amp;&amp; tar vxzf 102890-FolderView.tar.gz  --directory ~/.screenlets &amp;&amp; rm -rf 102890-FolderView.tar.gz
wget http://gnome-look.org/CONTENT/content-files/71034-3-pingus.tar.gz &amp;&amp; tar vxzf 71034-3-pingus.tar.gz  --directory ~/.screenlets &amp;&amp; rm -rf 71034-3-pingus.tar.gz*
#bash /usr/share/elementary-desktop/configure.sh # Elementary configuration

# .rc files from repo
wget -q --no-check-certificate http://github.com/cmdel/rc-configs/raw/master/.screenrc
wget--no-check-certificate -q http://github.com/cmdel/rc-configs/raw/master/.zshrc
# Create the file to keep all known hosts for autocomplete
touch ~/.hosts
# Wine configuration
su - cmd -c 'winecfg &amp;&amp; wget http://www.spotify.com/download/Spotify%20Installer.exe &amp;&amp; wine Spotify\ Installer.exe' &amp;&amp; chsh `whoami` -s /bin/zsh &amp;&amp; exit

</pre></p>
<p>This is the file with the repositories that are necessary.</p>
<h4>File2:</h4>
<p><pre class="brush: bash;">
# Ubuntu Maverick Meerkat 10.10 Sources list
#
# Repository List based on standard maverick with many extra packages
#
# If you get errors about missing keys, lookup the key in this file
# and run these commands (replace KEY with the key number):
#
# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com KEY

# Ubuntu supported packages
deb http://fi.archive.ubuntu.com/ubuntu/ maverick main restricted multiverse universe
deb http://fi.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
deb http://fi.archive.ubuntu.com/ubuntu/ maverick-updates main restricted multiverse universe
deb http://security.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu maverick-proposed main restricted universe multiverse
deb-src http://fi.archive.ubuntu.com/ubuntu/ maverick main restricted multiverse universe
deb-src http://fi.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
deb-src http://fi.archive.ubuntu.com/ubuntu/ maverick-updates main restricted multiverse universe
deb-src http://security.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu maverick-proposed main restricted universe multiverse

#Canonical 'partner' Repository
deb http://archive.canonical.com/ubuntu maverick partner
deb http://archive.canonical.com/ubuntu maverick-backports partner
deb http://archive.canonical.com/ubuntu maverick-updates partner
deb http://archive.canonical.com/ubuntu maverick-security partner
deb http://archive.canonical.com/ubuntu maverick-proposed partner
deb-src http://archive.canonical.com/ubuntu maverick partner
deb-src http://archive.canonical.com/ubuntu maverick-backports partner
deb-src http://archive.canonical.com/ubuntu maverick-updates partner
deb-src http://archive.canonical.com/ubuntu maverick-security partner
deb-src http://archive.canonical.com/ubuntu maverick-proposed partner

#Third Parties Latest Software
deb http://extras.ubuntu.com/ubuntu maverick main
deb-src http://extras.ubuntu.com/ubuntu maverick main

#medibuntu ********* Must chage to Maverick *******
# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2EBC26B60C5A2783
deb http://packages.medibuntu.org/ maverick free non-free
deb-src http://packages.medibuntu.org/ maverick free non-free

#opera
# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F9A2F76A9D1A0061
deb http://deb.opera.com/opera/ lenny non-free

#google
# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A040830F7FAC5991
deb http://dl.google.com/linux/deb/ stable non-free main

#Skype
deb http://download.skype.com/linux/repos/debian/ stable non-free

#Back in Time -
deb http://ppa.launchpad.net/bit-team/stable/ubuntu maverick main
deb-src http://ppa.launchpad.net/bit-team/stable/ubuntu maverick main

#Dropbox
deb http://linux.dropbox.com/ubuntu maverick main
deb-src http://linux.dropbox.com/ubuntu maverick main

# Elementary Desktop
deb http://ppa.launchpad.net/elementaryart/ppa/ubuntu maverick main restricted multiverse universe
deb-src http://ppa.launchpad.net/elementaryart/ppa/ubuntu maverick main restricted multiverse universe

deb http://ppa.launchpad.net/elementaryart/elementarydesktop/ubuntu maverick main restricted multiverse universe
deb-src http://ppa.launchpad.net/elementaryart/elementarydesktop/ubuntu maverick main restricted multiverse universe

# Statistical Analysis Packages
deb http://cran.stat.ucla.edu/bin/linux/ubuntu maverick main

</pre></p>
<h4>Attributions</h4>
<pre>Image by <a href="http://xkcd.com/149/">XKCD</a></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/delivorias.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/delivorias.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/delivorias.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/delivorias.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/delivorias.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/delivorias.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/delivorias.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/delivorias.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/delivorias.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/delivorias.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/delivorias.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/delivorias.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/delivorias.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/delivorias.wordpress.com/456/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=456&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://delivorias.me/2011/01/18/ubuntu-post-install-one-script-to-rule-them-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>54.802494 -3.172310</georss:point>
		<geo:lat>54.802494</geo:lat>
		<geo:long>-3.172310</geo:long>
		<media:content url="http://1.gravatar.com/avatar/fa33466c9c1e40ddd2d633b4b8b37891?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">cmd</media:title>
		</media:content>

		<media:content url="http://imgs.xkcd.com/comics/sandwich.png" medium="image">
			<media:title type="html">Sandwich</media:title>
		</media:content>
	</item>
		<item>
		<title>When the iMac is working its HDD to death</title>
		<link>http://delivorias.me/2011/01/12/when-the-imac-is-working-its-hdd-to-death/</link>
		<comments>http://delivorias.me/2011/01/12/when-the-imac-is-working-its-hdd-to-death/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 00:15:18 +0000</pubDate>
		<dc:creator>Christos Delivorias</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://delivorias.me/?p=451</guid>
		<description><![CDATA[After installing a few applications to the iMac, which is an understatement in itself!, I realised that the hard disk was becoming increasingly audible at certain intervals. At the time the machine felt sluggish and it really disrupted the quiet environment I&#8217;m used to as of yet. The OS&#8217;s Activity Monitor sure enough showed the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=451&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://delivorias.files.wordpress.com/2011/01/screen-shot-2011-01-11-at-23-59-30.png"><img class="aligncenter size-medium wp-image-453" title="Screen shot 2011-01-11 at 23.59.30" src="http://delivorias.files.wordpress.com/2011/01/screen-shot-2011-01-11-at-23-59-30.png?w=300&#038;h=89" alt="" width="300" height="89" /></a></p>
<p style="text-align:justify;">After installing a few applications to the iMac, which is an understatement in itself!, I realised that the hard disk was becoming increasingly audible at certain intervals. At the time the machine felt sluggish and it really disrupted the quiet environment I&#8217;m used to as of yet. The OS&#8217;s Activity Monitor sure enough showed the the high disk activity, but there was no obvious way to determine which was the offending process. After some digging around and some different combinations and a lot of piping I&#8217;ve narrowed down to the following command:</p>
<p><pre class="brush: bash;">alias debug=&quot;sudo fs_usage -w -f filesys &gt; ./fs_usage.log; egrep -e read fs_usage.log | less ; egrep -e write fs_usage.log |less; rm -rf fs_usage.log&quot;</pre></p>
<p style="text-align:justify;">If you add this to your shell config file &#8211; in my case ~/.zshrc &#8211; then the debug command after requesting for the root password will collect some usage data and show sequentially the Reads and Writes that were requested until you broke the debugging( i.e. press C-c).</p>
<p style="text-align:justify;">The last column to the right will contain the name of the process that requested the action. Once you go over the output &#8211; keep pressing Space to go to the next page &#8211; the most commonly appearing process will most likely be the one increasing the I/O of the HDD. In my case it was the anti-virus being triggered every time I was performing a Spotlight search. Quitting Kasperky&#8217;s antivirus from he menu bar seems to have brought back the normal use and quietness.</p>
<p style="text-align:justify;">If the offending process is not easily identified with a web search then close down all critical applications with data you don&#8217;t want to lose &#8211; you do have a backup policy right? <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  &#8211; and start terminating one process at a time:</p>
<p><pre class="brush: bash;">sudo kill -9 &lt;PID&gt;;</pre></p>
<p>Right now the Sophos antivirus seems to be much better. Any one have prior experience regarding antivirus software for macs?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/delivorias.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/delivorias.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/delivorias.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/delivorias.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/delivorias.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/delivorias.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/delivorias.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/delivorias.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/delivorias.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/delivorias.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/delivorias.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/delivorias.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/delivorias.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/delivorias.wordpress.com/451/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=451&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://delivorias.me/2011/01/12/when-the-imac-is-working-its-hdd-to-death/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>55.958832 -3.215253</georss:point>
		<geo:lat>55.958832</geo:lat>
		<geo:long>-3.215253</geo:long>
		<media:content url="http://1.gravatar.com/avatar/fa33466c9c1e40ddd2d633b4b8b37891?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">cmd</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2011/01/screen-shot-2011-01-11-at-23-59-30.png?w=300" medium="image">
			<media:title type="html">Screen shot 2011-01-11 at 23.59.30</media:title>
		</media:content>
	</item>
		<item>
		<title>Switching to an iMac</title>
		<link>http://delivorias.me/2011/01/05/switching-to-an-imac/</link>
		<comments>http://delivorias.me/2011/01/05/switching-to-an-imac/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 11:58:49 +0000</pubDate>
		<dc:creator>Christos Delivorias</dc:creator>
				<category><![CDATA[imac]]></category>

		<guid isPermaLink="false">http://delivorias.me/?p=443</guid>
		<description><![CDATA[I&#8217;ve recently switched from a Linux laptop to an iMac. The reason for this decision was very simple. I was tired of spending most of my time, fixing and endlessly customizing Linux. Don&#8217;t get me wrong though! I loved my time with Linux. I&#8217;ve learned quite a lot of stuff &#8220;playing&#8221; around with it. After [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=443&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><img class="aligncenter" title="Switch" src="http://techhaze.com/wp-content/uploads/2010/01/e8o55l1.png" alt="" width="504" height="219" /></p>
<p>I&#8217;ve recently switched from a Linux laptop to an iMac. The reason for this decision was very simple. I was tired of spending most of my time, fixing and endlessly customizing Linux. Don&#8217;t get me wrong though! I loved my time with Linux. I&#8217;ve learned quite a lot of stuff &#8220;playing&#8221; around with it. After a point however, it just isn&#8217;t worth my time to spend hours into making Linux work/perform the way I want it to. And then do it all over again when you try to upgrade to a new distro. I ended up doing a fresh install every time and having a script to re-install all the programs I needed. That with a separate /home/ partition provided an easier and safer, believe it or not, solution to an upgrade of Ubuntu. After a point I realized I was spending more time fixing or changing Linux to facilitate me in what I wanted to do, rather than doing the things I needed to be doing.</p>
<p>I needed a machine that literally got out of my way and let me work efficiently and easily. The most appropriate solution was the new iMac. The actual tactile interface is like something I&#8217;ve never worked with before. That&#8217;s a 27&#8243; monitor that doesn&#8217;t make a &#8216;peep&#8217;  when it&#8217;s working. And I mean both fan noise and the HDD harassment Windows is performing when doing memory paging. That is a sound I only hear now when I fire up the Parallels version of Windows 7.</p>
<p>I still use the Office 2010 platform. I think it&#8217;s one of the most professional tools out there for office work. It&#8217;s not strange that Apple has &#8220;allowed&#8221; this platform to be run natively on Macs. I also use some simulation software that are only available on the windows platform. The Parallels VMs are great at providing a seamless integration of Windows into the OSX and also to have an option to work with Ubuntu when I need it. MacPorts is surprisingly useful for installing CRAN packages in R. On another note, I had to see OSX put itself to sleep to fully appreciate how Sleep should work and how flawed the attempts of Windows and Linux are when trying to do the same thing.</p>
<p>I&#8217;ll be returning to this subject in regards with certain productivity apps I&#8217;ve found useful up to now. Feel free to share yours as well.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/delivorias.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/delivorias.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/delivorias.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/delivorias.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/delivorias.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/delivorias.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/delivorias.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/delivorias.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/delivorias.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/delivorias.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/delivorias.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/delivorias.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/delivorias.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/delivorias.wordpress.com/443/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=443&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://delivorias.me/2011/01/05/switching-to-an-imac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>55.958832 -3.215253</georss:point>
		<geo:lat>55.958832</geo:lat>
		<geo:long>-3.215253</geo:long>
		<media:content url="http://1.gravatar.com/avatar/fa33466c9c1e40ddd2d633b4b8b37891?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">cmd</media:title>
		</media:content>

		<media:content url="http://techhaze.com/wp-content/uploads/2010/01/e8o55l1.png" medium="image">
			<media:title type="html">Switch</media:title>
		</media:content>
	</item>
		<item>
		<title>Επικόλληση στο GNU Screen</title>
		<link>http://delivorias.me/2010/08/31/%ce%b5%cf%80%ce%b9%ce%ba%cf%8c%ce%bb%ce%bb%ce%b7%cf%83%ce%b7-%cf%83%cf%84%ce%bf-gnu-screen/</link>
		<comments>http://delivorias.me/2010/08/31/%ce%b5%cf%80%ce%b9%ce%ba%cf%8c%ce%bb%ce%bb%ce%b7%cf%83%ce%b7-%cf%83%cf%84%ce%bf-gnu-screen/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 09:08:58 +0000</pubDate>
		<dc:creator>Christos Delivorias</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Screen]]></category>

		<guid isPermaLink="false">http://delivorias.me/?p=408</guid>
		<description><![CDATA[Στο γραφείο χρειάζεται να δουλεύω μεταξύ ενός Linux desktop και ενός Windows XP laptop. Η συγκεκριμένη διαμόρφωση έχει τα θετικά της έχει και τα αρνητικά της. Δεν μπορώ να μήν παραδεχτώ ότι το Microsoft Office είναι ένα προϊόν στοχευμένο στο εταιρικό περιβάλλον και ενώ το OpenOffice είναι υπεραρκετό για το σπίτι, στο γραφείο είναι υποχρεωτικό [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=408&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Στο γραφείο χρειάζεται να δουλεύω μεταξύ ενός Linux desktop και ενός Windows XP laptop. Η συγκεκριμένη διαμόρφωση έχει τα θετικά της έχει και τα αρνητικά της. Δεν μπορώ να μήν παραδεχτώ ότι το Microsoft Office είναι ένα προϊόν στοχευμένο στο εταιρικό περιβάλλον και ενώ το OpenOffice είναι υπεραρκετό για το σπίτι, στο γραφείο είναι υποχρεωτικό να δουλεύεις με Enterprise Grade λογισμικό. Για πολλούς λόγους ισχύει αυτό που δεν θα ήθελα να αναφέρω τώρα. Δεν είναι αυτός ο σκοπός της καταχώρησης. Το RedHat distro που έχουμε είναι fully supported ως Enterprise Linux.</p>
<p style="text-align:justify;">Αυτό που ήθελα να προσφέρω, σε όποιον/α ενδιαφέρεται, είναι ένας τρόπος να αξιοποιείτε η ταυτόχρονη χρήση του GNU Screen από πολλαπλούς χρήστες. Είχα αναφερθεί στο Screen και σε <a href="http://delivorias.me/2010/03/13/%ce%b5%ce%b9%cf%83%ce%b1%ce%b3%cf%89%ce%b3%ce%ae-%cf%83%cf%84%ce%bf-gnuscreen/" target="_blank">παλαιότερη ανάρτηση</a>. Για να μετακινούμαι από Linux σε Windows χρησιμοποιώ οθόνες με διπλή είσοδο σήματος. Με αυτό τον τρόπο το linux desktop παρέχει σήμα σε DVI, σε δύο οθόνες, και το Windows laptop σήμα σε VGA και πάλι σε δύο οθόνες. Με αυτό τον τρόπο πατώντας ένα κουμπί στην οθόνη, αλλάζω την οπτική μεταξύ τους. Σε συνδιασμό και με το <a href="http://synergy2.sourceforge.net/" target="_blank">synergy2</a>, δεν χρειάζεται να έχω πολλαπλά πληκτρολόγια και ποντίκια. Περισσότερα για το synergy2 σε μελλοντική καταχώρηση αν σας ενδιαφέρει. Απλά ρωτήστε στα σχόλια.</p>
<p style="text-align:justify;">Υπάρχουν όμως φορές που δεν χρειάζομαι ολόκληρο τον X server να τρέχει GDM. Χρειάζομαι απλά μια οθόνη με τερματικό. Κάτι τέτοιο είναι πολύ απλό. Το <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank">putty</a> είναι ένα πολύ ελαφρύ και εύχρηστο εργαλείο για να συμπληρώσει την έλλειψη SSH &amp; SCP στα Windows. Υποστηρίζει και public key cryptography σε περίπτωση οπυ θέλετε να συνδέεστε χωρίς συνθηματικό στον απομακρυσμένο υπολογιστή. Επικίνδυνο, αλλά βολικό ορισμένες φορες πίσω από προστατευμένα δίκτυα. Μπορώ συνεπώς σχετικά εύκολα να συνδέομαι στο Linux box.</p>
<p style="text-align:justify;"><span id="more-408"></span></p>
<p style="text-align:justify;">Αυτό που χρειαζόμουν είναι ένα τρόπο να διατηρώ ένα socket του Screen ανάμεσα στους δύο υπολογιστές. Αν εν τέλη χρειαζόμουν να αλλάξω την οθόνη στο μηχάνημα του RedHat, ήθελα να διατηρώ όλες τις εντολές και το history του ότι είχα κάνει μέσω putty.</p>
<p style="text-align:justify;">Ο τρόπος να γίνει αυτό είναι με την δυνατότητα του Screen να διαχειρίζετε πολλαπλούς χρήστες. Στην συγκεκριμένη περίπτωση και οι δύο χρήστες είμαι εγώ. Ότι πληκτρολογώ στο putty στα Windows εκείνη τη στιγμή εμφανίζεται στο linux.</p>
<p style="text-align:justify;">Για να γίνει αυτό θα πρέπει να γίνει επικόλληση στην υπάρχουσα επικολλημένη (attached screen). Αυτό που ήθελα ήταν ένας τρόπος να επιταχύνω αυτή τη διαδικασία μέσω ενός script. Το παρακάτω script κάνει ακριβώς αυτό. Τοποθετήστε το κάπου στο path και κάθε φορά που το εκτελείτε αφότου συνδεθείτε μέσω putty, θα μπορείτε να επικολλήστε στην πρώτη υπάρχουσα οθόνη του Screen.</p>
<p style="text-align:justify;">Αυτό που καταφέρνει το παρακάτω είναι να παίρνει μία λίστα όλων των υπάρχοντων οθόνων (Γραμμή 2) και να την αποθηκεύει σε ένα προσωρινό αρχείο. Η πρώτη περίπτωση μέσα σε αυτή την λίστα που αναφέρει μία οθόνη ώς επικολλημένη &#8220;(Attached)&#8221; αποθηκεύεται (Γραμμή 3) και το προσωρινό αρχείο διαγράφεται (Γραμμή 4). Από εκεί και πέρα αν υπάρχει διαθέσιμη επκολλημένη οθόνη (Γρ. 5) τότε επικολλούμαστε σε αυτήν (Γρ. 7), αλλιώς εκκινούμε μία νέα οθόνη (Γρ. 9)</p>
<p style="text-align:justify;"><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;"> </span></p>
<p><pre class="brush: bash;">&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;#!/bin/bash
s=$(screen -list &gt; /tmp/awk)
screen=$(awk '$2 == &quot;(Attached)&quot; { print $1 }' /tmp/awk)
r=$(rm -rf /tmp/awk)
if [ -n $screen ]
then
run=&quot;screen -x $screen&quot;
else
run=&quot;screen -R&quot;
fi
$run

</pre></p>
<p>Ελπίζω να το βρίσκετε τόσο χρήσιμο όσο και εγώ.</p>
<p>Χρίστος.</p>
<br /> Tagged: <a href='http://delivorias.me/tag/linux/'>Linux</a>, <a href='http://delivorias.me/tag/screen/'>Screen</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/delivorias.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/delivorias.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/delivorias.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/delivorias.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/delivorias.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/delivorias.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/delivorias.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/delivorias.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/delivorias.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/delivorias.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/delivorias.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/delivorias.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/delivorias.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/delivorias.wordpress.com/408/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=408&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://delivorias.me/2010/08/31/%ce%b5%cf%80%ce%b9%ce%ba%cf%8c%ce%bb%ce%bb%ce%b7%cf%83%ce%b7-%cf%83%cf%84%ce%bf-gnu-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>55.958832 -3.215253</georss:point>
		<geo:lat>55.958832</geo:lat>
		<geo:long>-3.215253</geo:long>
		<media:content url="http://1.gravatar.com/avatar/fa33466c9c1e40ddd2d633b4b8b37891?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">cmd</media:title>
		</media:content>
	</item>
		<item>
		<title>Γρήγορη εύρεση κατανομής δίσκου σε Linux partition</title>
		<link>http://delivorias.me/2010/07/12/%ce%b3%cf%81%ce%ae%ce%b3%ce%bf%cf%81%ce%b7-%ce%b5%cf%8d%cf%81%ce%b5%cf%83%ce%b7-%ce%ba%ce%b1%cf%84%ce%b1%ce%bd%ce%bf%ce%bc%ce%ae%cf%82-%ce%b4%ce%af%cf%83%ce%ba%ce%bf%cf%85-%cf%83%ce%b5-linux-partition/</link>
		<comments>http://delivorias.me/2010/07/12/%ce%b3%cf%81%ce%ae%ce%b3%ce%bf%cf%81%ce%b7-%ce%b5%cf%8d%cf%81%ce%b5%cf%83%ce%b7-%ce%ba%ce%b1%cf%84%ce%b1%ce%bd%ce%bf%ce%bc%ce%ae%cf%82-%ce%b4%ce%af%cf%83%ce%ba%ce%bf%cf%85-%cf%83%ce%b5-linux-partition/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 12:07:14 +0000</pubDate>
		<dc:creator>Christos Delivorias</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[greek]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://delivorias.me/?p=396</guid>
		<description><![CDATA[Πολλές φορές βρίσκω να χρειάζομαι ένα εργαλείο που να μου δείχνει πού συσσωρεύονται αρχεία και καταλαμβάνουν πολύ χώρο, με τρόπο που δίνει εύκολα να καταλάβω το μέγεθος των directories. Θα μπορούσα σίγουρα να κάνω μία εύρεση για μεγάλα αρχεία π.χ. αλλά κάτι τέτοιο δεν θα έβρισκε σημεία όπου πολλά μικρότερα αρχεία (π.χ. η cache των [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=396&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><img class="aligncenter" title="Untitled" src="http://delivorias.files.wordpress.com/2010/07/untitled.png?w=604&#038;h=211" alt="" width="604" height="211" /></p>
<p style="text-align:justify;">Πολλές φορές βρίσκω να χρειάζομαι ένα εργαλείο που να μου δείχνει πού συσσωρεύονται αρχεία και καταλαμβάνουν πολύ χώρο, με τρόπο που δίνει εύκολα να καταλάβω το μέγεθος των directories.</p>
<p>Θα μπορούσα σίγουρα να κάνω μία εύρεση για μεγάλα αρχεία π.χ.</p>
<p><pre class="brush: bash;">
RedHat/CentOS/Fedora

$ find . -type f -size +5000k -exec ls -lh {} \; | awk '{ print $9 &quot;: &quot; $5 }'

Debian/Ubuntu

$ find . -type f -size +10000k -exec ls -lh {} \; | awk '{ print $8 &quot;: &quot; $5 }'
</pre></p>
<p style="text-align:justify;">αλλά κάτι τέτοιο δεν θα έβρισκε σημεία όπου πολλά μικρότερα αρχεία (π.χ. η cache των browser ή τα log files) συνοστίζονται σε ένα directory.</p>
<p style="text-align:justify;">Μετά από κάποιο πειραματισμό μπόρεσα και μεταποίησα λίγο την συμπεριφορά της εντολής <strong>du </strong> με λίγη βοήθεια από την perl<strong>. </strong>Το παρακάτω είναι αποτέλεσμα αρκετής αναζήτησης στο ίντερνετ και δεν είναι μόνο δική μου δουλειά αλλά ενός συνόλου ανθρώπων, οι οποίοι είναι ανέφικτο να αναφερθούν όλοι εδώ.</p>
<p style="text-align:justify;">Η εντολή θα αναζητήσει το μέγεθος των αρχείων στο τρέχων directory, θα τα αναταξινομήσει σύμφωνα με τον αύξων αριθμό και μετά θα εμφανίσει το μέγεθος σε μορφή KB, MB &amp; GB ανάλογα με το μέγεθος.</p>
<p><pre class="brush: bash;">
alias duf='du -sk .[a-z]* * | sort -n | perl -ne '\''($s,$f)=split(m(\t)); for (qw( K M G)) {if($s&lt;1024) {printf(&quot;%.1f&quot;,$s);print &quot;$_\t$f&quot;;last};$s=$s/1024}'\'''
</pre></p>
<p>Προσθέτοντας το παραπάνω, σε ένα από τα αρχεία:</p>
<p><pre class="brush: bash;">
~/.zshrc || ~/.bashrc

</pre></p>
<p>θα μπορείτε να εκτελείται αυτή την εντολή με το alias <strong>duf </strong> στο τρέχον directory.</p>
<p>Αν σας βοήθησε το συγκεκριμένο, απλά προωθήστε το!</p>
<div><span style="color:#0000ee;"><br />
</span></div>
<br /> Tagged: <a href='http://delivorias.me/tag/bash/'>bash</a>, <a href='http://delivorias.me/tag/greek/'>greek</a>, <a href='http://delivorias.me/tag/linux/'>Linux</a>, <a href='http://delivorias.me/tag/scripting/'>scripting</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/delivorias.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/delivorias.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/delivorias.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/delivorias.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/delivorias.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/delivorias.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/delivorias.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/delivorias.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/delivorias.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/delivorias.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/delivorias.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/delivorias.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/delivorias.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/delivorias.wordpress.com/396/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=delivorias.me&amp;blog=361902&amp;post=396&amp;subd=delivorias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://delivorias.me/2010/07/12/%ce%b3%cf%81%ce%ae%ce%b3%ce%bf%cf%81%ce%b7-%ce%b5%cf%8d%cf%81%ce%b5%cf%83%ce%b7-%ce%ba%ce%b1%cf%84%ce%b1%ce%bd%ce%bf%ce%bc%ce%ae%cf%82-%ce%b4%ce%af%cf%83%ce%ba%ce%bf%cf%85-%cf%83%ce%b5-linux-partition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa33466c9c1e40ddd2d633b4b8b37891?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">cmd</media:title>
		</media:content>

		<media:content url="http://delivorias.files.wordpress.com/2010/07/untitled.png" medium="image">
			<media:title type="html">Untitled</media:title>
		</media:content>
	</item>
	</channel>
</rss>
