<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-36526186</id><updated>2012-01-24T20:43:53.071-08:00</updated><category term='Python'/><category term='Xen'/><category term='Fedora'/><category term='Arch'/><category term='Statistics'/><category term='VirtualBox'/><category term='CentOS'/><category term='webcam'/><category term='Zend Framework'/><category term='Mint'/><category term='ssh'/><category term='skype'/><category term='ffmpeg'/><category term='bash'/><category term='vnc'/><category term='Octave'/><category term='PHP'/><category term='Drupal'/><category term='xampp'/><category term='SPSS'/><category term='ALSA'/><category term='MATLAB'/><category term='sound'/><category term='git'/><category term='Linux'/><category term='samba'/><category term='imagemagick'/><category term='Ubuntu'/><category term='framework'/><category term='JavaScript'/><category term='Excel'/><category term='CakePHP'/><title type='text'>Short IT recipes</title><subtitle type='html'>i.e. some stuff and junk about Python, Perl, Matlab, Ruby, Mac X, Linux, Solaris, ...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default?start-index=101&amp;max-results=100'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>245</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-36526186.post-3352189613781023144</id><published>2012-01-21T00:24:00.000-08:00</published><updated>2012-01-21T00:25:10.573-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webcam'/><category scheme='http://www.blogger.com/atom/ns#' term='Mint'/><category scheme='http://www.blogger.com/atom/ns#' term='skype'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Linux Mint 11 (32 bit): Logitech C210 webcam and skype</title><content type='html'>Logitech C210 works without any issues in &lt;a href="http://projects.gnome.org/cheese/"&gt;cheese&lt;/a&gt;.&lt;br /&gt;However to make it work in skype I needed to execute skype beta 2.2.0.35 through the following command&lt;code&gt;LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so /usr/bin/skype&lt;/code&gt;If this does not work, than u can try to use:&lt;code&gt;LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so /usr/bin/skype&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If u don't already libv4l installed, than u can install it as follows: &lt;code&gt;sudo apt-get install libv4l-0&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3352189613781023144?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3352189613781023144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2012/01/linux-mint-11-32-bit-logitech-c210.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3352189613781023144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3352189613781023144'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2012/01/linux-mint-11-32-bit-logitech-c210.html' title='Linux Mint 11 (32 bit): Logitech C210 webcam and skype'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-9112401197862380932</id><published>2011-09-18T23:30:00.000-07:00</published><updated>2011-09-18T23:30:02.714-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ffmpeg'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>ffmpeg: Convert mp4 to mov</title><content type='html'>To convert mp4 movie into mov movie the following command can be used:&lt;code&gt;ffmpeg -i input_file.mp4 -acodec copy -vcodec copy -f mov output_file.mov&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-9112401197862380932?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/9112401197862380932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/09/ffmpeg-convert-mp4-to-mov.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9112401197862380932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9112401197862380932'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/09/ffmpeg-convert-mp4-to-mov.html' title='ffmpeg: Convert mp4 to mov'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-5368906282648449039</id><published>2011-08-18T21:20:00.000-07:00</published><updated>2011-08-18T21:20:42.652-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='samba'/><title type='text'>CentOS 5: Mount samba share in read-write mode</title><content type='html'>To mount a windows share on centos with read-write mode, I used the following command as a root&lt;br /&gt;&lt;code&gt;/sbin/mount.cifs //ip_address/windows_sharename/ /home/w/my_folder_on_centos/ -o rw,user=windows_username,password=windows_password,uid=linux_username&lt;/code&gt;I noticed, that without &lt;i&gt;uid=linux_username&lt;/i&gt;, the command will mount the share in read-only mode.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-5368906282648449039?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/5368906282648449039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/08/centos-5-mount-samba-share-in-read.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5368906282648449039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5368906282648449039'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/08/centos-5-mount-samba-share-in-read.html' title='CentOS 5: Mount samba share in read-write mode'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1375454955137991530</id><published>2011-07-26T04:36:00.001-07:00</published><updated>2011-07-26T04:38:35.571-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='git'/><title type='text'>Git: change commit editor to vim</title><content type='html'>This command can be used:&lt;code&gt;git config --global core.editor "vim"&lt;/code&gt;or one can setup environment variable GIT_EDITOR:&lt;code&gt;export GIT_EDITOR="vim"&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1375454955137991530?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1375454955137991530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/07/git-change-commit-editor-to-vim.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1375454955137991530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1375454955137991530'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/07/git-change-commit-editor-to-vim.html' title='Git: change commit editor to vim'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-5879983249686904</id><published>2011-06-26T05:33:00.001-07:00</published><updated>2011-06-26T05:33:56.781-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='git'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Git: last commit date</title><content type='html'>To obtain date and time of the last commit in a current branch one can use &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-show.html"&gt;git log&lt;/a&gt; command: &lt;code&gt;git log -1 --format="%cd"&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-5879983249686904?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/5879983249686904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/06/git-last-commit-date.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5879983249686904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5879983249686904'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/06/git-last-commit-date.html' title='Git: last commit date'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8944807469302983685</id><published>2011-05-03T18:39:00.000-07:00</published><updated>2011-05-03T18:41:28.456-07:00</updated><title type='text'>IELTS preparation: useful vocabulary</title><content type='html'>Recently, I was preparing myself for &lt;a href="http://www.ielts.org/default.aspx"&gt;IELTS&lt;/a&gt; (International English Language Testing System) test (general module). As part of this preparation I composed &lt;a href="https://docs.google.com/document/pub?id=1jacsRr2soRxcc84W8IYLNdQaqr4Vlpsxz2xIENFni-E"&gt;a list&lt;/a&gt; of useful words and expressions for this test. The list also contains words that spelling was difficult for me to remember.&lt;br /&gt;&lt;br /&gt;If you are curious, my overall IELTS score was 8.0 with the lowest band of 7.0. Hope that &lt;a href="https://docs.google.com/document/pub?id=1jacsRr2soRxcc84W8IYLNdQaqr4Vlpsxz2xIENFni-E"&gt;the list&lt;/a&gt; will be useful to you also.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8944807469302983685?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8944807469302983685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/05/ielts-preparation-useful-vocabulary.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8944807469302983685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8944807469302983685'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/05/ielts-preparation-useful-vocabulary.html' title='IELTS preparation: useful vocabulary'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8884686081525530694</id><published>2011-04-30T23:28:00.000-07:00</published><updated>2011-04-30T23:33:43.099-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ubuntu 11.04 (Natty Narwhal): Use 'normal' GNOME instead of Unity</title><content type='html'>Ubuntu 11.04 uses Unit as its default desktop environment. However, it is very easy to switch back to 'normal/traditional' GNOME desktop environment. Just select 'Ubuntu classic' option in your login window:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-78xX5VAI7dM/Tbz9Q46V0gI/AAAAAAAAAvo/nmqtKl7MsAE/s1600/Screenshot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="296" src="http://3.bp.blogspot.com/-78xX5VAI7dM/Tbz9Q46V0gI/AAAAAAAAAvo/nmqtKl7MsAE/s400/Screenshot.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8884686081525530694?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8884686081525530694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/04/ubuntu-1104-natty-narwhal-use-normal.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8884686081525530694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8884686081525530694'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/04/ubuntu-1104-natty-narwhal-use-normal.html' title='Ubuntu 11.04 (Natty Narwhal): Use &apos;normal&apos; GNOME instead of Unity'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-78xX5VAI7dM/Tbz9Q46V0gI/AAAAAAAAAvo/nmqtKl7MsAE/s72-c/Screenshot.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7508633921331057148</id><published>2011-04-30T02:27:00.000-07:00</published><updated>2011-04-30T21:22:11.107-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ubuntu 11.04 (Natty Narwhal): How to remove chat and mail icons (indicators) from system tray</title><content type='html'>Just &lt;a href="http://shortrecipes.blogspot.com/2010/04/ubuntu-1004-how-to-remove-chat-and-mail.html"&gt;like for Ubuntu 10.04&lt;/a&gt;, the two following icons (notifiers):&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-8M-5Um-N47U/TbvqU5G58RI/AAAAAAAAAvg/GkbHmyjukmI/s1600/ubuntu1104.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://2.bp.blogspot.com/-8M-5Um-N47U/TbvqU5G58RI/AAAAAAAAAvg/GkbHmyjukmI/s400/ubuntu1104.png" width="348" /&gt;&lt;/a&gt;&lt;/div&gt;can be removed by removing two packages: &lt;b&gt;indicator-me and indicator-messages&lt;/b&gt;:&lt;code&gt;sudo apt-get remove indicator-me indicator-messages&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7508633921331057148?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7508633921331057148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/04/ubuntu-1104-natty-narwhal-how-to-remove.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7508633921331057148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7508633921331057148'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/04/ubuntu-1104-natty-narwhal-how-to-remove.html' title='Ubuntu 11.04 (Natty Narwhal): How to remove chat and mail icons (indicators) from system tray'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-8M-5Um-N47U/TbvqU5G58RI/AAAAAAAAAvg/GkbHmyjukmI/s72-c/ubuntu1104.png' height='72' width='72'/><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6740118166003678140</id><published>2011-03-30T20:03:00.001-07:00</published><updated>2011-03-30T20:05:26.772-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='imagemagick'/><title type='text'>ImageMagick: Make thumbs of images</title><content type='html'>For example to make jpg thumbs of all tiff images in a current director one can use:&lt;code&gt;for f in *.tiff; do bname=`basename $f .tiff` ;  convert -resize 256x256 $f ./thumbs/$bname.jpg; done&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6740118166003678140?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6740118166003678140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/03/imagemagick-make-thumbs-of-images.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6740118166003678140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6740118166003678140'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/03/imagemagick-make-thumbs-of-images.html' title='ImageMagick: Make thumbs of images'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6048265906824050400</id><published>2011-03-17T00:50:00.000-07:00</published><updated>2011-03-17T00:51:22.206-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='imagemagick'/><title type='text'>ImageMagick: Flatten and convert an image to grayscale</title><content type='html'>In short, to flatten and convert to grayscale all images in current director one can use: &lt;code&gt;mogrify -flatten -type Grayscale *&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6048265906824050400?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6048265906824050400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/03/imagemagick-flatten-and-convert-image.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6048265906824050400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6048265906824050400'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/03/imagemagick-flatten-and-convert-image.html' title='ImageMagick: Flatten and convert an image to grayscale'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-2971715709713829915</id><published>2011-03-08T21:26:00.000-08:00</published><updated>2011-03-08T21:37:28.768-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Zend Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>An example file upload progress monitoring in Zend Framework 1.11</title><content type='html'>An example web application demonstrating usage of &lt;a href="http://framework.zend.com/manual/en/zend.progressbar.introduction.html"&gt;Zend_ProgressBar&lt;/a&gt;&amp;nbsp;and &lt;a href="http://t.wits.sg/jquery-progress-bar/"&gt;jquery progressbar&lt;/a&gt;&amp;nbsp;for&amp;nbsp;monitoring progress of file uploads in Zend Framework 1.11.3.&lt;br /&gt;&lt;br /&gt;Since file uploads are done to the folder APPLICATION_PATH/uploads, the application&amp;nbsp;tries to create this folder if it does not exists. For this reason APPLICATION_PATH&amp;nbsp;should be writable, or uploads folder created manually with necessary rights. The application also requires '&lt;a href="http://pecl.php.net/package/uploadprogress/"&gt;uploadprogress&lt;/a&gt;' PECL package&amp;nbsp;since it uses 'uploadprogress_get_info' function for getting the information about&amp;nbsp;upload progress.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh4.googleusercontent.com/-s9tsMi4E6-E/TXcNhrMOEnI/AAAAAAAAAu4/F1BbijUFO3o/s1600/Screenshot-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="190" src="https://lh4.googleusercontent.com/-s9tsMi4E6-E/TXcNhrMOEnI/AAAAAAAAAu4/F1BbijUFO3o/s400/Screenshot-3.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh5.googleusercontent.com/-ynkb5A_unvU/TXcSES3YMoI/AAAAAAAAAvA/y1p2t36nyWc/s1600/Screenshot-5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="193" src="https://lh5.googleusercontent.com/-ynkb5A_unvU/TXcSES3YMoI/AAAAAAAAAvA/y1p2t36nyWc/s400/Screenshot-5.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The &lt;b&gt;source code&lt;/b&gt; is at &lt;a href="https://github.com/marcinwol/zfupload"&gt;GitHub&lt;/a&gt;. Most action happens in &lt;a href="https://github.com/marcinwol/zfupload/blob/master/application/controllers/IndexController.php"&gt;indexController.php&lt;/a&gt;&amp;nbsp;and &lt;a href="https://github.com/marcinwol/zfupload/blob/master/application/views/scripts/index/index.phtml"&gt;index.phtml&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-2971715709713829915?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/2971715709713829915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/03/example-file-upload-progress-monitoring.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/2971715709713829915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/2971715709713829915'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/03/example-file-upload-progress-monitoring.html' title='An example file upload progress monitoring in Zend Framework 1.11'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh4.googleusercontent.com/-s9tsMi4E6-E/TXcNhrMOEnI/AAAAAAAAAu4/F1BbijUFO3o/s72-c/Screenshot-3.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-441624056961581185</id><published>2011-02-27T17:54:00.000-08:00</published><updated>2011-10-04T06:01:43.032-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Zend Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>An example of OpenID, Facebook and Twitter authentication in Zend Framework 1.11</title><content type='html'>This is an example Zend Framework 1.11.3 application that uses OpenID (Google,&lt;br /&gt;Yahoo, MyOpenId, AOL, OpenId) as well as Facebook Connect and Twitter Oauth for&lt;br /&gt;authentication&amp;nbsp;of users.&lt;br /&gt;&lt;br /&gt;During authentication, information about a user (e.g.&amp;nbsp;an email or a country) is fetched from the authentication provider.&lt;br /&gt;&lt;br /&gt;Zend Framework 1.11 does not have a very good support for&amp;nbsp;OpenID, not&amp;nbsp;mentioning&amp;nbsp;Facebook Connect and Twitter Oauth. Thus, to make it all work the following elements were used:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/openid-selector/"&gt;openid-selector&lt;/a&gt;&lt;/li&gt;&lt;li&gt;My_Auth_Adapter_Facebook by &lt;a href="http://www.krotscheck.net/2010/08/21/zend_auth_adapter_facebook.html"&gt;Michael Krotscheck&lt;/a&gt;&lt;/li&gt;&lt;li&gt;My_Auth_Adapter_Oauth and My_Auth_Adapter_Oauth_Twitter by &lt;a href="http://www.jasonawesome.com/2010/11/24/authenticating-to-twitter-with-zend_auth/"&gt;Jason Austin&lt;/a&gt;&lt;/li&gt;&lt;li&gt;My_OpenId_Extension_AttributeExchange by &lt;a href="http://framework.zend.com/issues/browse/ZF-7328"&gt;Chris Bisnett&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://framework.zend.com/issues/browse/ZF-6905"&gt;Patched&lt;/a&gt; Zend_OpenId_Custumer&lt;/li&gt;&lt;/ul&gt;In some cases slight modifications to the above elements were made.&lt;br /&gt;&lt;br /&gt;The &lt;b&gt;demo&lt;/b&gt; of this application is &lt;a href="http://born2die.linuxpl.info/mwol/zfopenid/public/"&gt;here&lt;/a&gt;&amp;nbsp;, while the &lt;b&gt;source code&lt;/b&gt; is at &lt;a href="https://github.com/marcinwol/zfopenid"&gt;GitHub&lt;/a&gt;. The user authentication is performed in a loginAction in &lt;a href="https://github.com/marcinwol/zfopenid/blob/master/application/controllers/UserController.php"&gt;UserController.php&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Hopefully, this example application will be useful to others as it was for me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-441624056961581185?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/441624056961581185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/02/example-of-openid-facebook-and-twitter.html#comment-form' title='26 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/441624056961581185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/441624056961581185'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/02/example-of-openid-facebook-and-twitter.html' title='An example of OpenID, Facebook and Twitter authentication in Zend Framework 1.11'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>26</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4416797481599532259</id><published>2011-02-06T04:02:00.000-08:00</published><updated>2011-02-06T04:04:52.812-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Drupal'/><title type='text'>Drupal 7: Add last update date to the footer of the page</title><content type='html'>I needed to add a date of last modification of the website made in Drupal 7. I did it by enable core module &lt;a href="http://drupal.org/documentation/modules/php"&gt;PHP Filter&lt;/a&gt; and creating a block located a footer block region. The body of the block was as follows:&lt;code&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;// get date of most most recent change to a node&lt;br /&gt;$result = db_query('SELECT title, changed FROM {node} WHERE status=1 ORDER BY changed DESC LIMIT 1');&lt;br /&gt;$node = $result-&amp;gt;fetchObject();&lt;br /&gt;$date = date('d-M-Y g:i a', $node-&amp;gt;changed);&lt;br /&gt;echo "Last update: $date";&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/TU6N4kzemmI/AAAAAAAAAuo/VZ7SNEuAMAw/s1600/Drupal7_Block_with_PHP.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="296" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/TU6N4kzemmI/AAAAAAAAAuo/VZ7SNEuAMAw/s400/Drupal7_Block_with_PHP.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4416797481599532259?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4416797481599532259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/02/drupal-7-add-last-update-date-to-footer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4416797481599532259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4416797481599532259'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/02/drupal-7-add-last-update-date-to-footer.html' title='Drupal 7: Add last update date to the footer of the page'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qvZ1h1bgBRo/TU6N4kzemmI/AAAAAAAAAuo/VZ7SNEuAMAw/s72-c/Drupal7_Block_with_PHP.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4858823335336743020</id><published>2011-01-22T21:49:00.000-08:00</published><updated>2011-02-04T20:34:18.494-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Pear run-tests: Setting --cgi option to test file uploads using phpt</title><content type='html'>In PHP, file uploads can be tested using phpt files as explained &lt;a href="http://qafoo.com/blog/013_testing_file_uploads_with_php.html"&gt;here&lt;/a&gt;. However, when I wanted to execute phpt test with --POST_RAW-- or --POST-- sections, pear run-tests was giving an error that: &lt;code&gt;--cgi option needed for this test, type 'pear help run-tests'&lt;/code&gt; My phpt file was as follows:&lt;script src="https://gist.github.com/791856.js?file=example-upload.phpt"&gt;&lt;/script&gt; The layout of phpt files is explained &lt;a href="http://qa.php.net/phpt_details.php"&gt;here&lt;/a&gt;. To overcome this problem I installed php5-cgi package for ubuntu&lt;code&gt;sudo apt-get install php5-cgi&lt;/code&gt;This allowed for correct execution of the test&lt;code&gt;pear run-tests --cgi=/usr/lib/cgi-bin/php5 example-upload.phpt&lt;br /&gt;Running 1 tests&lt;br /&gt;PASS Example test emulating a file upload[example-upload.phpt]&lt;br /&gt;TOTAL TIME: 00:00&lt;br /&gt;1 PASSED TESTS&lt;br /&gt;0 SKIPPED TESTS&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4858823335336743020?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4858823335336743020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/01/ear-run-tests-seting-cgi-option-for-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4858823335336743020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4858823335336743020'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/01/ear-run-tests-seting-cgi-option-for-to.html' title='Pear run-tests: Setting --cgi option to test file uploads using phpt'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1391740457974030191</id><published>2011-01-02T08:34:00.000-08:00</published><updated>2011-01-03T03:42:14.770-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mint'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ubuntu 10.10: Change grub menu timeout</title><content type='html'>Default grub menu timeout is 10 seconds. To change it just edit the grub file&lt;code&gt;sudo vim /etc/default/grub&lt;/code&gt; and change GRUB_TIMEOUT value from 10 to e.g. 2. Then update grub&lt;code&gt;sudo update-grub&lt;/code&gt;After the restart the time before boot your default operating system be 2 seconds.&lt;br /&gt;&lt;br /&gt;Alternatively, one can install GUI grub editor called StartUp-Manager &lt;code&gt;sudo apt-get install startupmanager&lt;/code&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/TSG1LO-X1lI/AAAAAAAAAuc/1D2TWgWoLMo/s1600/StartUp-Manager.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="332" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/TSG1LO-X1lI/AAAAAAAAAuc/1D2TWgWoLMo/s400/StartUp-Manager.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1391740457974030191?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1391740457974030191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2011/01/ubuntu-1010-change-grub-menu-timeout.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1391740457974030191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1391740457974030191'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2011/01/ubuntu-1010-change-grub-menu-timeout.html' title='Ubuntu 10.10: Change grub menu timeout'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/TSG1LO-X1lI/AAAAAAAAAuc/1D2TWgWoLMo/s72-c/StartUp-Manager.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3621973222480072684</id><published>2010-12-13T04:10:00.000-08:00</published><updated>2010-12-14T21:48:16.198-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ALSA'/><category scheme='http://www.blogger.com/atom/ns#' term='sound'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ubuntu 10.10: static and noise sound with HDA Intel SigmaTel STAC9221 A1</title><content type='html'>I have just installed Ubuntu 10.04 and I found that my sound card was not working. There was a lot of&amp;nbsp;breaks,&amp;nbsp;noise&amp;nbsp;and&amp;nbsp;freezes&amp;nbsp;when I was playing any audio file.&lt;br /&gt;&lt;br /&gt;This is what I have: &lt;code&gt;aplay -l&lt;br /&gt;**** List of PLAYBACK Hardware Devices ****&lt;br /&gt;card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]&lt;br /&gt;Subdevices: 0/1&lt;br /&gt;Subdevice #0: subdevice #0&lt;br /&gt;card 0: Intel [HDA Intel], device 1: STAC92xx Digital [STAC92xx Digital]&lt;br /&gt;Subdevices: 1/1&lt;br /&gt;Subdevice #0: subdevice #0&lt;br /&gt;&lt;/code&gt;&lt;code&gt;cat /proc/asound/version&lt;br /&gt;Advanced Linux Sound Architecture Driver Version 1.0.23.&lt;/code&gt;&lt;code&gt;cat /proc/asound/card0/codec#* | grep Codec&lt;br /&gt;Codec: SigmaTel STAC9221 A1&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I overcame this problem simply by adding the following line:&lt;code&gt;options snd-hda-intel model=ref&lt;/code&gt; into the file &lt;i&gt;/etc/modprobe.d/alsa-base.conf&lt;/i&gt;:&lt;code&gt;sudo gedit /etc/modprobe.d/alsa-base.conf&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/TQYNHjL7B_I/AAAAAAAAAuU/R7eSDKcOfu4/s1600/alsa-base.conf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/TQYNHjL7B_I/AAAAAAAAAuU/R7eSDKcOfu4/s400/alsa-base.conf.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3621973222480072684?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3621973222480072684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/12/ubuntu-1004-static-and-noise-sound-with.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3621973222480072684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3621973222480072684'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/12/ubuntu-1004-static-and-noise-sound-with.html' title='Ubuntu 10.10: static and noise sound with HDA Intel SigmaTel STAC9221 A1'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qvZ1h1bgBRo/TQYNHjL7B_I/AAAAAAAAAuU/R7eSDKcOfu4/s72-c/alsa-base.conf.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3558576854128173708</id><published>2010-06-21T02:39:00.000-07:00</published><updated>2010-06-21T02:41:23.011-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><title type='text'>"Remote desktop session has ended" error when connecting to a guest on VirtualBox</title><content type='html'>I had a problem connecting from Windows using build-in Remote Desktop Connection program to a a guest on a headless VirtualBox server. I found that the reason wast that I did not checked "Allow me to save credentials" option in a Remote Desktop Connection.  &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/TB8yxLrV79I/AAAAAAAAAtw/do8jRIbZdDo/s1600/rdp_client_windows.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/TB8yxLrV79I/AAAAAAAAAtw/do8jRIbZdDo/s400/rdp_client_windows.png" width="357" /&gt;&lt;/a&gt;&lt;/div&gt;With this option, the client will ask for username/password before connecting to the VirtualBox. Thus it seems, that VirtualBox requires user credentials at the very beginning of the session. Without this option, connections will fail.&lt;br /&gt;&lt;br /&gt;I was using VirtualBox 3.2.4 in a headless mode running on a CentOS 5.5 x86_64.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3558576854128173708?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3558576854128173708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/06/remote-desktop-session-has-ended-error.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3558576854128173708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3558576854128173708'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/06/remote-desktop-session-has-ended-error.html' title='&quot;Remote desktop session has ended&quot; error when connecting to a guest on VirtualBox'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/TB8yxLrV79I/AAAAAAAAAtw/do8jRIbZdDo/s72-c/rdp_client_windows.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8733379326130976994</id><published>2010-05-29T00:53:00.000-07:00</published><updated>2010-05-29T00:55:42.468-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vnc'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><title type='text'>Example of SSH tunneling</title><content type='html'>Example:&lt;br /&gt;&lt;code&gt;ssh  -N  -L 5904:127.0.0.1:5901 username@remoteserver&lt;/code&gt;The above command forwards everything on localhost port 5904 to the port 5901 on &lt;i&gt;remoteserver&lt;/i&gt;. This is what I use to connect to a VNC service on port 5901 on a remoteserver at my job from my home computer. Thus, at home, after establishing the above tunnel I can use a vncviewer as follows:&lt;code&gt;vncviewer :4&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8733379326130976994?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8733379326130976994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/05/example-of-ssh-tunneling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8733379326130976994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8733379326130976994'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/05/example-of-ssh-tunneling.html' title='Example of SSH tunneling'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4390226028050578513</id><published>2010-05-14T23:04:00.000-07:00</published><updated>2010-05-19T20:22:52.080-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><title type='text'>VirtualBox: start and stop a guest in a headless mode</title><content type='html'>Lets assume that we have a guest VirtualBox machine called "xp". To start it in a headless mode we can use &lt;code&gt;VBoxHeadless --startvm "xp"&lt;/code&gt;To stop it we can use &lt;code&gt;VBoxManage controlvm "xp" savestate&lt;/code&gt;Since it is in a headless state we have to access it using a RDP viewer, e.g. rdesktop command in Linux:&lt;code&gt;desktop -u username -p password -a 16 serverIP&lt;/code&gt;Of course, before we can use it in this way, we have to enable remote destkop for the "xp" machine and define authentication method. In my case, I used External method, since it uses the linux user account under which my VirtualBox is running.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/S-460RAAUfI/AAAAAAAAAto/5t_hIBm_h18/s1600/VirtualBox_RDP.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="161" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/S-460RAAUfI/AAAAAAAAAto/5t_hIBm_h18/s400/VirtualBox_RDP.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4390226028050578513?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4390226028050578513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/05/virtualbox-start-and-stop-guest.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4390226028050578513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4390226028050578513'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/05/virtualbox-start-and-stop-guest.html' title='VirtualBox: start and stop a guest in a headless mode'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/S-460RAAUfI/AAAAAAAAAto/5t_hIBm_h18/s72-c/VirtualBox_RDP.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3563757516996678000</id><published>2010-04-25T07:39:00.000-07:00</published><updated>2010-04-25T07:40:44.106-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>bash: send a command to a screen session</title><content type='html'>"&lt;a href="http://www.gnu.org/software/screen/screen.html"&gt;Screen&lt;/a&gt; is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells." It is a very useful tool, that I often use, as it allows me to run "multiple terminals in one" even when I log out from the system. &lt;br /&gt;&lt;br /&gt;So how to send command to screen session from other terminal. In other words how to remote-control a screen session from within a script. &lt;a href="http://www.jerri.de/blog/archives/2006/05/02/scripting_screen_for_fun_and_profit/"&gt;This&lt;/a&gt; post is useful for this. &lt;br /&gt;&lt;br /&gt;In particular, I wanted to execute matlab scripts in screen windows. To do this I used the following:&lt;br /&gt;1. Create screen session&lt;code&gt;screen -S matlab&lt;/code&gt;2. Create few windows in the screen session using &lt;i&gt;Ctr-a c&lt;/i&gt; &lt;br /&gt;3. Send matlab command to each as follows&lt;code&gt;for ((i=0;i&amp;lt;$NO_WINDOWS;i+=1)); do&lt;br /&gt;echo $i&lt;br /&gt;sleep 2 &lt;br /&gt;screen  -S matlab -p $i -X exec matlab -nodesktop -r "bashCalculations('part',$i+1)"&lt;br /&gt;done&lt;/code&gt;where bashCalculations is my matlab script bashCalculations.m that takes part argument. So,, each screen window executes different &lt;i&gt;part&lt;/i&gt; of my script.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3563757516996678000?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3563757516996678000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/04/bash-send-command-to-screen-session.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3563757516996678000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3563757516996678000'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/04/bash-send-command-to-screen-session.html' title='bash: send a command to a screen session'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-9045223455306797766</id><published>2010-04-24T20:45:00.000-07:00</published><updated>2011-04-30T03:56:35.590-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ubuntu 10.04: How to remove chat and mail icons (indicators) from system tray</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/S9O1C9uP02I/AAAAAAAAAtQ/9YlOcfCZzxA/s1600/blackeubuntulogo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/S9O1C9uP02I/AAAAAAAAAtQ/9YlOcfCZzxA/s320/blackeubuntulogo.png" /&gt;&lt;/a&gt;The 10.04 LTS release of Ubuntu seems to be very, very good. However, for some strange reason, creators of this release made some strange decisions about Ubuntu's look-and-feel. One of the things that&amp;nbsp;annoyed&amp;nbsp;me was the assumption that every Ubuntu user, uses&amp;nbsp;Twitter, Facebook or other social network. Thus, they incorporated the tools for using social networking sites into the distibution. They did it by adding chat and status icons/notifiers into Gnome system try. However, what they did not do, was the ability to easily remove them. For example, when you remove&amp;nbsp;massage&amp;nbsp;notifier (mail icon) using "Remove From Panel" option, the volume control icon also disappears.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/S9O99-iot9I/AAAAAAAAAtY/etDzphrmOT8/s1600/ubuntu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="194" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/S9O99-iot9I/AAAAAAAAAtY/etDzphrmOT8/s400/ubuntu.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;Thus you need to remove these icons some other way, which in this case, is to remove two packages: indicator-me and indicator-messages:&lt;code&gt;sudo apt-get remove indicator-me indicator-messages&lt;/code&gt;After that just log-out and log-into the gnome session and the icons should be gone:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/S9O_lvPv9XI/AAAAAAAAAtg/R2OZNzUEAlk/s1600/Screenshot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/S9O_lvPv9XI/AAAAAAAAAtg/R2OZNzUEAlk/s320/Screenshot-1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;EDIT&lt;/b&gt;&lt;br /&gt;It also &lt;a href="http://shortrecipes.blogspot.com/2011/04/ubuntu-1104-natty-narwhal-how-to-remove.html"&gt;should work for Ubuntu 11.04 (Natty Narwhal)&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-9045223455306797766?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/9045223455306797766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/04/ubuntu-1004-how-to-remove-chat-and-mail.html#comment-form' title='43 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9045223455306797766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9045223455306797766'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/04/ubuntu-1004-how-to-remove-chat-and-mail.html' title='Ubuntu 10.04: How to remove chat and mail icons (indicators) from system tray'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/S9O1C9uP02I/AAAAAAAAAtQ/9YlOcfCZzxA/s72-c/blackeubuntulogo.png' height='72' width='72'/><thr:total>43</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7845999117881534198</id><published>2010-03-08T00:53:00.000-08:00</published><updated>2010-03-08T00:55:37.308-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><title type='text'>Matlab: Convert numerical array to cell with string representation of numbers</title><content type='html'>Short Matlab script that takes an array (i.e. vector) of numbers and returns cell with fileds that are string representation of the numbers in the array.&lt;script src="http://gist.github.com/324998.js?file=numarray2cellstring.m"&gt;&lt;/script&gt;For example: &lt;code&gt;&amp;gt;&amp;gt; a=[1 2 3.24 -43 4.56];&lt;br /&gt;&amp;gt;&amp;gt; numarray2cellstring(a)&lt;br /&gt;&lt;br /&gt;ans = &lt;br /&gt;&lt;br /&gt;'1'    '2'    '3.24'    '-43'    '4.56'&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7845999117881534198?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7845999117881534198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/03/matlab-convert-numerical-array-to-cell.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7845999117881534198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7845999117881534198'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/03/matlab-convert-numerical-array-to-cell.html' title='Matlab: Convert numerical array to cell with string representation of numbers'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-9153083526396410642</id><published>2010-03-03T03:52:00.001-08:00</published><updated>2010-03-03T03:52:39.190-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='imagemagick'/><title type='text'>imagemagick: crop all images</title><content type='html'>Example:&lt;code&gt;convert rose: -crop 40x30+10+10  +repage  repage.gif&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-9153083526396410642?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/9153083526396410642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/03/imagemagick-crop-all-images.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9153083526396410642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9153083526396410642'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/03/imagemagick-crop-all-images.html' title='imagemagick: crop all images'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4319254299007765321</id><published>2010-02-26T07:33:00.000-08:00</published><updated>2010-02-26T07:33:36.115-08:00</updated><title type='text'>Change font and font size in Fluxbox</title><content type='html'>In Fluxbox 1.1 a font and a font size can be changed by editing a &lt;i&gt;overlay&lt;/i&gt; file, usually located in ~/.fluxbox/. So just add the following lines to this file and restart fluxbox&lt;code&gt;menu.title.font: sans-12:bold&lt;br /&gt;menu.frame.font: sans-12:bold&lt;br /&gt;toolbar.clock.font: sans-10:bold&lt;br /&gt;toolbar.workspace.font: sans-12:bold&lt;br /&gt;*font: sans-12&lt;/code&gt;Of course you have to select the font you like or the size.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4319254299007765321?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4319254299007765321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/change-font-and-font-size-in-fluxbox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4319254299007765321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4319254299007765321'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/change-font-and-font-size-in-fluxbox.html' title='Change font and font size in Fluxbox'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3259460589402426372</id><published>2010-02-25T20:38:00.000-08:00</published><updated>2010-02-25T21:49:48.204-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>bash: split string to array</title><content type='html'>There are few possible ways of splitting a string with delimiter-separated values to an array  in Bash. Here I present five of them. &lt;br /&gt;&lt;h3&gt;1. Using &lt;i&gt;tr&lt;/i&gt; command&lt;/h3&gt;&lt;script src="http://gist.github.com/315449.js?file=string2array1.sh"&gt;&lt;/script&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;code&gt;&amp;gt; [123]&lt;br /&gt;&amp;gt; [456]&lt;br /&gt;&amp;gt; [567]&lt;br /&gt;&amp;gt; [5]&lt;br /&gt;&amp;gt; [343]&lt;/code&gt;This method will produce incorrect array due to space in "567 5", but it works fine if there are no spaces in the $STR variable.&lt;br /&gt;&lt;h3&gt;2. Using &lt;i&gt;IFS&lt;/i&gt; (Internal Field Separator) variable&lt;/h3&gt;&lt;script src="http://gist.github.com/315451.js?file=string2array2.sh"&gt;&lt;/script&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;code&gt;&amp;gt; [123]&lt;br /&gt;&amp;gt; [456]&lt;br /&gt;&amp;gt; [567 5]&lt;br /&gt;&amp;gt; [343]&lt;/code&gt;This method works fine even if there are spaces.&lt;br /&gt;&lt;h3&gt;3. Using &lt;i&gt;read&lt;/i&gt; command&lt;/h3&gt;&lt;script src="http://gist.github.com/315454.js?file=string2array3.sh"&gt;&lt;/script&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;code&gt;&amp;gt; [123]&lt;br /&gt;&amp;gt; [456]&lt;br /&gt;&amp;gt; [567 5]&lt;br /&gt;&amp;gt; [343]&lt;/code&gt; This method also works fine even though there are spaces in the $STR variable.&lt;br /&gt;&lt;h3&gt;4. Using &lt;i&gt;sed&lt;/i&gt; command&lt;/h3&gt;&lt;script src="http://gist.github.com/315455.js?file=string2array3.sh"&gt;&lt;/script&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;code&gt;&amp;gt; [123]&lt;br /&gt;&amp;gt; [456]&lt;br /&gt;&amp;gt; [567]&lt;br /&gt;&amp;gt; [5]&lt;br /&gt;&amp;gt; [343]&lt;/code&gt;This method will also produce incorrect array due to space in "567 5", but it works fine if there are no spaces in the $STR variable.&lt;br /&gt;&lt;h3&gt;5. Using &lt;i&gt;set&lt;/i&gt; command&lt;/h3&gt;&lt;script src="http://gist.github.com/315461.js?file=string2array5.sh"&gt;&lt;/script&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;code&gt;&amp;gt; [123]&lt;br /&gt;&amp;gt; [456]&lt;br /&gt;&amp;gt; [567 5]&lt;br /&gt;&amp;gt; [343]&lt;/code&gt; This method also works fine.&lt;br /&gt;&lt;h3&gt;References&lt;/h3&gt;This post was mainly inspired by &lt;a href="http://stackoverflow.com/questions/918886/split-string-based-on-delimiter-in-bash"&gt;this StackOverflow question&lt;/a&gt; and my need to perform string 2 array conversions in bash.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3259460589402426372?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3259460589402426372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/bash-split-string-to-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3259460589402426372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3259460589402426372'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/bash-split-string-to-array.html' title='bash: split string to array'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7816183277872595723</id><published>2010-02-24T07:48:00.000-08:00</published><updated>2010-02-24T08:04:23.244-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>bash: read a specific line or/and a column from a file</title><content type='html'>If we have column-row wise txt files, we can use &lt;i&gt;awk&lt;/i&gt; and &lt;i&gt;sed&lt;/i&gt; programs to read the rows and columns of such files. &lt;br /&gt;&lt;h3&gt;Read specific line&lt;/h3&gt;To read a specific line from a txt file, the following commands can be used&lt;code&gt;awk  'NR==12' file.txt&lt;/code&gt; &lt;code&gt;sed -n '12p' file.txt&lt;/code&gt; In both cases, line 12 will be returned.&lt;br /&gt;&lt;h3&gt;Read specific column&lt;/h3&gt;&lt;code&gt; awk '{print $1, $2}' file&lt;/code&gt; The code will return first and second columns from file.txt&lt;br /&gt;&lt;h3&gt;Read specific column and line&lt;/h3&gt;Additionally, using awk we can get a specific column(s) in of a given line as follows&lt;code&gt;awk  'NR==12 {print $1, $2}' file.txt&lt;/code&gt;The Code will return first and second columns form a line no. 12.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7816183277872595723?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7816183277872595723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/bash-read-one-line-of-given-number-from.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7816183277872595723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7816183277872595723'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/bash-read-one-line-of-given-number-from.html' title='bash: read a specific line or/and a column from a file'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3653007926083734318</id><published>2010-02-21T05:10:00.000-08:00</published><updated>2010-02-21T05:25:54.944-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xampp'/><title type='text'>xampp: Compiling mod_bw.c and getting the error about undefined symbol: apr_atomic_cas</title><content type='html'>When I was compiling mod_bw.c 0.7 (&lt;i&gt;apxs -i -a -c mod_bw.c&lt;/i&gt;) for xampp 1.7.1 on Ubuntu 9.10 and restarting lampp I was getting the following error:&lt;code&gt;httpd: Syntax error on line 129 of /opt/lampp/etc/httpd.conf: Cannot load /opt/lampp/modules/mod_bw.so into server: /opt/lampp/modules/mod_bw.so: undefined symbol: apr_atomic_cas&lt;/code&gt;The solution was to edit the mod_bw.c and comment out or remove the following lines:&lt;code&gt;#if (APR_MAJOR_VERSION &lt; 1)    #define apr_atomic_inc32 apr_atomic_inc    #define apr_atomic_dec32 apr_atomic_dec    #define apr_atomic_add32 apr_atomic_add    #define apr_atomic_cas32 apr_atomic_cas    #define apr_atomic_set32 apr_atomic_set#endif&lt;/code&gt;and to recompile the file.&lt;br /&gt;&lt;br /&gt;Unfortunately, there was no difference in the file upload speed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3653007926083734318?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3653007926083734318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/xampp-compiling-modbwc-and-getting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3653007926083734318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3653007926083734318'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/xampp-compiling-modbwc-and-getting.html' title='xampp: Compiling mod_bw.c and getting the error about undefined symbol: apr_atomic_cas'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7380957706537850517</id><published>2010-02-20T00:23:00.000-08:00</published><updated>2010-02-20T00:24:26.495-08:00</updated><title type='text'>ImageMagick: add text to many images</title><content type='html'>Lets assume that we have 800x600 pixels images and we want to add an authors name to the lower right corner. We can do this using the following command (the command overwrites the original files!)&lt;br /&gt;&lt;code&gt;mogrify   -fill white  -pointsize 16  -annotate +685+590 'Authors Name' *.JPG&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7380957706537850517?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7380957706537850517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/imagemagick-add-text-to-many-images.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7380957706537850517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7380957706537850517'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/imagemagick-add-text-to-many-images.html' title='ImageMagick: add text to many images'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1635085371418566900</id><published>2010-02-18T20:25:00.000-08:00</published><updated>2010-02-18T20:25:51.625-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='imagemagick'/><title type='text'>ImageMagick: split one image to smaller images</title><content type='html'>Lets assume that we have a 1024x1024 pixel image called test.tif and that we want to split this image into 64x64 non-overlapping images called test001.tif, test002.tif, test003.tiff,.... &lt;br /&gt;We can do this using this command from &lt;br /&gt;&lt;code&gt;convert -crop 64x64 +repage  test.tif test%02d.tif&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1635085371418566900?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1635085371418566900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/imagemagick-split-one-image-to-smaller.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1635085371418566900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1635085371418566900'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/imagemagick-split-one-image-to-smaller.html' title='ImageMagick: split one image to smaller images'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-9132553405005918726</id><published>2010-02-10T20:15:00.000-08:00</published><updated>2010-02-10T20:15:51.981-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>VirtualBox: Autostart guest in Windows XP host</title><content type='html'>Some time ago I was asked to quickly setup a temporary LAMP server. Since, the time was an issue and it was supposed to be only a short-term solution I decided to take a PC box with Windows XP, install a VirtualBox, and setup an Ubuntu server 8.04 LST as a guest operating system.&lt;br /&gt;&lt;br /&gt;Unfortunately, it was over a 1.5 year ago and what was a short-term solution become now &lt;i&gt;de-facto&lt;/i&gt; a long term one. However, recently we had some power shortages in our building, and the problem appeared with this PC box, i.e. after it went down due to power shortage it did not start VirtualBox automatically when being turned on. Thus, I was asked to make it start automatically, in such a way that after turning the PC on, everything VirtualBox and ubuntu-server start automatically. I did it in to steps:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Setup autologin in Windows XP.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To do this I followed instructions from &lt;a href="How to turn on automatic logon in Windows XP"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Make VirtualBox start automatically. &lt;/b&gt;&lt;br /&gt;To do this I wrote very simple Windows batch script called &lt;i&gt;startVB.bat&lt;/i&gt; that contained the following two lines:&lt;code&gt;cd "C:\Program Files\Sun\xVM VirtualBox" &lt;br /&gt;vboxmanage startvm "ubuntu-server"&lt;/code&gt;where "ubuntu-server" is the name of virtual machine to be started. The script was located in Startup folder &lt;i&gt;C:\Documents and Settings\MY_USER_NAME\Start Menu\Programs\Startup&lt;/i&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-9132553405005918726?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/9132553405005918726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/virtualbox-autostart-guest-in-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9132553405005918726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9132553405005918726'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/virtualbox-autostart-guest-in-windows.html' title='VirtualBox: Autostart guest in Windows XP host'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7032427250704465006</id><published>2010-02-05T03:24:00.000-08:00</published><updated>2010-02-05T05:08:01.501-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Anonymous Internet browsing using Ubuntu 9.10, Tor and Firefox</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.torproject.org/images/top-left.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.torproject.org/images/top-left.png" /&gt;&lt;/a&gt;&lt;/div&gt;"&lt;a href="http://www.torproject.org/"&gt;Tor&lt;/a&gt; protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world: it prevents somebody watching your Internet connection from learning what sites you visit, and it prevents the sites you visit from learning your physical location. Tor works with many of your existing applications, including web browsers, instant messaging clients, remote login, and other applications based on the TCP protocol." [taken from Tor &lt;a href="http://www.torproject.org/"&gt;website&lt;/a&gt;] &lt;br /&gt;&lt;br /&gt;Basically we need to install three things:&lt;br /&gt;&lt;ol&gt;&lt;li&gt; &lt;a href="http://www.pps.jussieu.fr/%7Ejch/software/polipo/"&gt;Polipo&lt;/a&gt; -  a proxy server, &lt;a href="http://www.torproject.org/"&gt;&lt;br /&gt;&lt;/a&gt;&lt;a href="http://en.wikipedia.org/wiki/Onion_routing"&gt;&lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://www.torproject.org/"&gt;Tor&lt;/a&gt;, the &lt;a href="http://en.wikipedia.org/wiki/Onion_routing"&gt;onion router&lt;/a&gt;, and&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/2275"&gt;Torbutton&lt;/a&gt; -a Firefox add-on&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/2275"&gt;&lt;/a&gt;. &lt;/li&gt;&lt;/ol&gt;Bellow are steps to install these three things.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Install &lt;a href="http://www.pps.jussieu.fr/%7Ejch/software/polipo/"&gt;Polipo&lt;/a&gt;, a caching web proxy&lt;/b&gt;&lt;br /&gt;&lt;code&gt;sudo apt-get install polipo&lt;/code&gt;&lt;b&gt;Setup polipo&lt;/b&gt;&lt;br /&gt;Manually open /etc/polipo/config and copy-paste config details &lt;a href="https://svn.torproject.org/svn/torbrowser/trunk/build-scripts/config/polipo.conf"&gt;here&lt;/a&gt; or &lt;code&gt;sudo sh -c "wget 'https://svn.torproject.org/svn/torbrowser/trunk/build-scripts/config/polipo.conf' -O /etc/polipo/config"&lt;/code&gt;After this restart polipo &lt;code&gt;sudo /etc/init.d/polipo restart&lt;/code&gt;&lt;b&gt; Add Tor repository&lt;/b&gt;&lt;br /&gt;&lt;code&gt;sudo sh -c "echo 'deb http://deb.torproject.org/torproject.org karmic main' &amp;gt;&amp;gt; /etc/apt/sources.list"&lt;/code&gt;&lt;b&gt; Add Tor repository GPG key&lt;/b&gt;&lt;code&gt;gpg --keyserver keys.gnupg.net --recv 886DDD89&lt;br /&gt;gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -&lt;br /&gt;&lt;/code&gt;&lt;b&gt;Update repositories and install Tor&lt;/b&gt;&lt;code&gt;sudo apt-get update&lt;br /&gt;sudo apt-get install tor&lt;br /&gt;&lt;/code&gt;&lt;b&gt;Install &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/2275"&gt;Torbutton&lt;/a&gt; (an add-on to firefox)&lt;/b&gt; &lt;br /&gt;Just go to website of &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/2275"&gt;Torbutton&lt;/a&gt; and install it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Check if you are anonymous&lt;/b&gt;&lt;br /&gt;Enable tor in Firefox using the Torbutton, and go to &lt;a href="https://check.torproject.org/"&gt;Are you using Tor?&lt;/a&gt;If everything is OK you should see the following:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/S2wPqqafI4I/AAAAAAAAAsk/dht0QtU5KRM/s1600-h/tor_OK.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="285" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/S2wPqqafI4I/AAAAAAAAAsk/dht0QtU5KRM/s400/tor_OK.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;Additionally, you can install &lt;a href="http://www.torproject.org/vidalia/"&gt;vidalia&lt;/a&gt;, a GUI for Tor&lt;/b&gt;&lt;code&gt;sudo apt-get install vidalia&lt;/code&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/S2wRDYR5kgI/AAAAAAAAAss/qNdghjOuqoI/s1600-h/vidalia_CP.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/S2wRDYR5kgI/AAAAAAAAAss/qNdghjOuqoI/s320/vidalia_CP.png" /&gt;&lt;/a&gt;&lt;/div&gt;Now, using vidalia you can create a new identity (i.e. a new IP) whenever you want:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/S2wR9q0KuOI/AAAAAAAAAs8/Z4xC_zM4fRI/s1600-h/IP2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="87" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/S2wR9q0KuOI/AAAAAAAAAs8/Z4xC_zM4fRI/s400/IP2.png" width="400" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/S2wR-qytSZI/AAAAAAAAAtE/VciELBrxTz8/s1600-h/IP3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="80" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/S2wR-qytSZI/AAAAAAAAAtE/VciELBrxTz8/s400/IP3.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/S2wR8nrWm3I/AAAAAAAAAs0/JGhEqF8sjsE/s1600-h/IP1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="90" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/S2wR8nrWm3I/AAAAAAAAAs0/JGhEqF8sjsE/s400/IP1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7032427250704465006?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7032427250704465006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/anonymous-browsing-internet-using.html#comment-form' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7032427250704465006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7032427250704465006'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/anonymous-browsing-internet-using.html' title='Anonymous Internet browsing using Ubuntu 9.10, Tor and Firefox'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/S2wPqqafI4I/AAAAAAAAAsk/dht0QtU5KRM/s72-c/tor_OK.png' height='72' width='72'/><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8002630444048646225</id><published>2010-02-01T04:01:00.000-08:00</published><updated>2010-02-04T18:58:03.411-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>Javascript Prototype: En example of periodical event broadcaster with ajax</title><content type='html'>The class below executes script.php every 60 seconds. After successful execution, it throws an event "jobs:updated" with JSON data returned from script.php.&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/295451.js?file=gistfile1.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8002630444048646225?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8002630444048646225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/javascript-prototype-en-example-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8002630444048646225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8002630444048646225'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/02/javascript-prototype-en-example-of.html' title='Javascript Prototype: En example of periodical event broadcaster with ajax'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3421410367118964151</id><published>2010-01-09T23:44:00.000-08:00</published><updated>2010-01-12T18:50:07.334-08:00</updated><title type='text'>Linux + VirtualBox with Windows  – [my] ideal combination for web development</title><content type='html'>Currently, for the development purposes I use Ubuntu 9.10 and most web applications developed need be tested on IEs 6,7,8. The problem is that I need different versions of IEs to test my xhtml/css/JavaScript. Altough, my PC is a dual boot (Ubuntu and XP)  I don't want constantly dual boot between Windows and Linux, as this is quite distracting and annoying. The solution that works best for me is to have &lt;a href="http://finalbuilds.edskes.net/iecollection.htm"&gt;Internet Explorer Collection&lt;/a&gt; installed in Windows XP that runs  (in Seamless Mode)  on  VirtualBox.  Thanks to this, I can do all the coding and testing without the need to leave Ubuntu.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/S0mFGgm7E3I/AAAAAAAAAr8/RxZxw15VZog/s1600-h/Ubuntu_with_VirtualBox_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/S0mFGgm7E3I/AAAAAAAAAr8/RxZxw15VZog/s400/Ubuntu_with_VirtualBox_1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/S0mFIvQKOKI/AAAAAAAAAsE/PKbd5d8-vCU/s1600-h/Ubuntu_with_VirtualBox_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/S0mFIvQKOKI/AAAAAAAAAsE/PKbd5d8-vCU/s400/Ubuntu_with_VirtualBox_2.png" /&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/S0mFKEfoLiI/AAAAAAAAAsM/LBuBxEUCK_c/s1600-h/Ubuntu_with_VirtualBox_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/S0mFKEfoLiI/AAAAAAAAAsM/LBuBxEUCK_c/s400/Ubuntu_with_VirtualBox_3.png" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/S0mFMrGrkCI/AAAAAAAAAsU/KbkPB84a2-Y/s1600-h/Ubuntu_with_VirtualBox_4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/S0mFMrGrkCI/AAAAAAAAAsU/KbkPB84a2-Y/s400/Ubuntu_with_VirtualBox_4.png" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/S0mFN0dKV4I/AAAAAAAAAsc/UxfuH6jBd70/s1600-h/Ubuntu_with_VirtualBox_5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/S0mFN0dKV4I/AAAAAAAAAsc/UxfuH6jBd70/s400/Ubuntu_with_VirtualBox_5.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3421410367118964151?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3421410367118964151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2010/01/linux-virtualbox-with-windows-ideal.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3421410367118964151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3421410367118964151'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2010/01/linux-virtualbox-with-windows-ideal.html' title='Linux + VirtualBox with Windows  – [my] ideal combination for web development'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qvZ1h1bgBRo/S0mFGgm7E3I/AAAAAAAAAr8/RxZxw15VZog/s72-c/Ubuntu_with_VirtualBox_1.png' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6893849214634768112</id><published>2009-12-20T23:59:00.001-08:00</published><updated>2009-12-21T00:20:31.431-08:00</updated><title type='text'>SyntaxHighlighter 2.1 test ob blogger</title><content type='html'>&lt;pre class="brush: js"&gt;/**&lt;br /&gt;     * SyntaxHighlighter&lt;br /&gt;     */&lt;br /&gt;    function foo()&lt;br /&gt;    {&lt;br /&gt;        // it works!&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;SyntaxHighlighter 2.1 failure! Maybe next time I'll find out how to make it work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6893849214634768112?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6893849214634768112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/syntaxhighlighter-20-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6893849214634768112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6893849214634768112'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/syntaxhighlighter-20-test.html' title='SyntaxHighlighter 2.1 test ob blogger'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4164911041247948288</id><published>2009-12-07T03:31:00.000-08:00</published><updated>2009-12-07T03:41:51.756-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>Easy installation of Microsoft Office 2007  in Fedora 12 using Wine</title><content type='html'>As far as I'm concerned, the only thing that forces me to use Windows or Mac from time to time is lack of Microsoft Office World, Excel and PowerPoint 2007 in Linux. In the web you can find info how to install it using wine in Ubuntu, but I could not find much about Fedora, especially Fedora 12. Here I present my experience of installing Office 2007 in Fedora 12. I must admit though, the what I'm going to write is based on my memory, so please feel free to comment if I skipped or made some mistakes.&lt;br /&gt;&lt;br /&gt;First thing that we need to do is to install wine (in fedora 12 it is wine-1.1.32-1) &lt;code&gt;sudo yum install wine&lt;/code&gt;Now we can install Microsoft Office 2007 from CD. I used Microsoft Office 2007 Enterprise and I install only Word, Excel and PowerPoint and some default common office tools. For the installation I did not had to do any tweaking of wine, or did not had to use &lt;a href="http://wiki.winehq.org/winetricks"&gt;winetricks&lt;/a&gt; to download any additional dlls! &lt;br /&gt;&lt;br /&gt;After the installation, I could start Word and Excel, but not PowerPoint. Also Equation editor in Word did not work, since the windows with default equation formulas were empty!&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SxzkiqOBvbI/AAAAAAAAAro/9z3dR9aO854/s1600-h/Screenshot-31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SxzkiqOBvbI/AAAAAAAAAro/9z3dR9aO854/s400/Screenshot-31.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;To fix it, it was necessary to go to Libraries in winecfg and in "New override for library" select usp10 and then set it to native as seen below:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SxzlSHFGqLI/AAAAAAAAArw/mSBnpMmGYb0/s1600-h/Screenshot-6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SxzlSHFGqLI/AAAAAAAAArw/mSBnpMmGYb0/s400/Screenshot-6.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;This was enough to make equations work and also enough to start PowerPoint, though I'm not sure of the former.&lt;br /&gt;&lt;br /&gt;I also tried to install Microsoft Office 2007 Service Pack 2, but without success. To install this service packed I tried installing some stuff from winetricks, changing some dlls from build in to native, but nothing seemed to work. &lt;br /&gt;&lt;br /&gt;In concussion, to install and run Microsoft World 2007, Excel 2007 and PowerPoint 2007 nothing special was necessary. Just install wine from repositories, and set usp10 library  to native in winecfg window. However, as I said at the beginning I'm writing this from my memory and I hope I did not skip something. Nevertheless, I think this post might be useful to other Linux users.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4164911041247948288?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4164911041247948288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/easy-installation-of-microsoft-office.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4164911041247948288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4164911041247948288'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/easy-installation-of-microsoft-office.html' title='Easy installation of Microsoft Office 2007  in Fedora 12 using Wine'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/SxzkiqOBvbI/AAAAAAAAAro/9z3dR9aO854/s72-c/Screenshot-31.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3030380987090698409</id><published>2009-12-06T17:15:00.000-08:00</published><updated>2009-12-06T17:37:12.893-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='xampp'/><title type='text'>Installing xdebug in xampp (lampp) on fedora 12</title><content type='html'>&lt;blockquote&gt;&lt;a href="http://xdebug.org/"&gt;xdebug&lt;/a&gt; is a PHP extension for powerful debugging. It supports stack and function traces, profiling information and memory allocation and script execution analysis.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;By default &lt;a href="http://www.apachefriends.org/en/xampp-linux.html"&gt;xampp&lt;/a&gt;-linux-1.7.1 does not come with this extension. Therefore, it is necessary to install it. &lt;br /&gt;&lt;br /&gt;First, assuming that there is already xampp-linux-1.7.1 installed in /opt/lampp it is necessary to download &lt;a href="http://www.apachefriends.org/en/xampp-linux.html"&gt;xampp&lt;/a&gt; development package. In my case it was xampp-linux-devel-1.7.1.tar.gz and unpack it &lt;code&gt;&lt;br /&gt;su &lt;br /&gt;tar xvfz xampp-linux-devel-1.7.1.tar.gz -C /opt&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Second, install autoconf package (as a root) &lt;code&gt;yum install autoconf&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Thrid, xdebug can be installed (as a root)&lt;code&gt;/opt/lampp/bin/pecl install xdebug&lt;/code&gt;If compilation was successful you should get &lt;code&gt;Build process completed successfully&lt;br /&gt;Installing '/opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so'&lt;br /&gt;install ok: channel://pecl.php.net/xdebug-2.0.5&lt;br /&gt;configuration option "php_ini" is not set to php.ini location&lt;br /&gt;You should add "extension=xdebug.so" to php.ini&lt;/code&gt;Finally, localization of xdebug.so should be added to php.ini. In my case, xdebug.so was in &lt;i&gt;opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/&lt;/i&gt;. This extension should be added using "zend_extension" and not "extension", therefore, &lt;b&gt;you should ignore the prompt about adding "extension=xdebug.so"&lt;/b&gt; to php.ini. Hance, add the following line to /opt/lampp/etc/php.ini restart your lampp server&lt;br /&gt;&lt;code&gt;zend_extension="/opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"&lt;/code&gt; &lt;br /&gt;If everything went wine, using phpinfo() you should get:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SxxaYUpjyYI/AAAAAAAAArg/STm7KshyUcs/s1600-h/Screenshot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SxxaYUpjyYI/AAAAAAAAArg/STm7KshyUcs/s400/Screenshot.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3030380987090698409?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3030380987090698409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/installing-xdebug-in-xampp-lampp-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3030380987090698409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3030380987090698409'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/installing-xdebug-in-xampp-lampp-on.html' title='Installing xdebug in xampp (lampp) on fedora 12'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/SxxaYUpjyYI/AAAAAAAAArg/STm7KshyUcs/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4096099193665678276</id><published>2009-12-06T15:55:00.000-08:00</published><updated>2009-12-21T20:45:39.213-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Zend Framework'/><title type='text'>Testing Basic HTTP Authentication using PHPUnit in Zend Framework</title><content type='html'>In Zend Framework, there are few ways of restricting access to the protected areas of an application. The simplest and the fastest to implement is &lt;a href="http://en.wikipedia.org/wiki/Basic_access_authentication"&gt;Basic HTTP Authentication&lt;/a&gt;. However, it must be remembered that it is not the most secure way, as it is using base64 coding that can be easily broken.&lt;br /&gt;&lt;br /&gt;Although &lt;a href="http://framework.zend.com/manual/en/zend.auth.html"&gt;Zend_Auth&lt;/a&gt; reference guide shows how to implement Basic HTTP Authentication, it does not show how to test it using PHPUnit. Therefore, in this post, a simple example of a Zend project,  along with the associated PHPUnit test case is presented. The full source code of the project is available for download. The project's name is httpautheg.&lt;br /&gt;&lt;br /&gt;So, lets assume that we want to restrict access to the actions called  protectedAction and editAction in IndexController. We also want a simple action helper, called HTTPAuth that will do the authentication. Finally, we want a test case for IndexController that will perform the tests of  incorrect and correct  authentications, so that we do not have to worry that during further work on the project we will break something without noticing it. &lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The directory tree of the httpautheg project&lt;/h3&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SxxEZA0Yr0I/AAAAAAAAAqw/Yu4_lPPn7vw/s1600-h/project_dir.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SxxEZA0Yr0I/AAAAAAAAAqw/Yu4_lPPn7vw/s400/project_dir.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;HTTPAuth action helper&lt;/h3&gt;The helper has only one function called &lt;i&gt;doBasicHTTPAuth&lt;/i&gt; that does the authentication, and returns false or true if authentication failed or succeeded, respectively.&lt;br /&gt;&lt;code&gt;&amp;lt;?php&lt;br /&gt;class My_Controller_Action_Helper_HTTPAuth extends Zend_Controller_Action_Helper_Abstract {&lt;br /&gt;//put your code here&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Perform Basic HTTP authentication&lt;br /&gt;*&lt;br /&gt;* @return boolean authentication successful or not&lt;br /&gt;*/&lt;br /&gt;public function &lt;b&gt;doBasicHTTPAuth&lt;/b&gt;() {&lt;br /&gt;&lt;br /&gt;$path = APPLICATION_PATH .'/configs/passwdBasic.txt';&lt;br /&gt;$resolver = new Zend_Auth_Adapter_Http_Resolver_File($path);&lt;br /&gt;$config = array(&lt;br /&gt;'accept_schemes' =&amp;gt; 'basic',&lt;br /&gt;'realm'          =&amp;gt; 'Admin Area',&lt;br /&gt;'digest_domains' =&amp;gt; '/index',&lt;br /&gt;'nonce_timeout'  =&amp;gt; 3600,&lt;br /&gt;);&lt;br /&gt;$adapter = new Zend_Auth_Adapter_Http($config);        &lt;br /&gt;$adapter-&amp;gt;setBasicResolver($resolver);&lt;br /&gt;&lt;br /&gt;$request = $this-&amp;gt;getRequest();&lt;br /&gt;$response = $this-&amp;gt;getResponse();        &lt;br /&gt;$adapter-&amp;gt;setRequest($request);&lt;br /&gt;$adapter-&amp;gt;setResponse($response);&lt;br /&gt;&lt;br /&gt;$result = $adapter-&amp;gt;authenticate();&lt;br /&gt;&lt;br /&gt;if (!$result-&amp;gt;isValid()) {&lt;br /&gt;// Bad userame/password, or canceled password prompt&lt;br /&gt;return false;&lt;br /&gt;} else {&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;IndexController.php&lt;/h3&gt;In the &lt;i&gt;preDispatch()&lt;/i&gt; function, public actions that do not require authentication are specified. For all other actions in the controller, basic HTTP Authentication using the above helper. For this example 'index' and 'failedauth' actions are public, while actions named 'protected' and 'edit' require authentication.&lt;br /&gt;&lt;code&gt;&amp;lt;?php&lt;br /&gt;class IndexController extends Zend_Controller_Action {&lt;br /&gt;public function init() {&lt;br /&gt;/* Initialize action controller here */&lt;br /&gt;}&lt;br /&gt;public function &lt;b&gt;preDispatch()&lt;/b&gt; {&lt;br /&gt;//any action not in this array will require Auth&lt;br /&gt;$publicActions = array('index','failedauth');&lt;br /&gt;$action = $this-&amp;gt;getRequest()-&amp;gt;getActionName();&lt;br /&gt;&lt;br /&gt;if (!in_array($action, $publicActions)) {&lt;br /&gt;//if requested action is non public one,&lt;br /&gt;//then do authenticated&lt;br /&gt;if ($this-&amp;gt;_helper-&amp;gt;_HTTPAuth-&amp;gt;doBasicHTTPAuth() == false) {&lt;br /&gt;$this-&amp;gt;_forward('failedauth');&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function  &lt;b&gt;indexAction() &lt;/b&gt; {&lt;br /&gt;// public action&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;public function  &lt;b&gt;protectedAction() &lt;/b&gt; {&lt;br /&gt;// protected action&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;public function  &lt;b&gt;editAction() &lt;/b&gt; {&lt;br /&gt;// protected action&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function  &lt;b&gt;failedauthAction() &lt;/b&gt; {&lt;br /&gt;//public action&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;PHPUnit test case IndexControllerTest.php&lt;/h3&gt;Testing of failed authentication is quite easy. The trick is with testing correct  authentication, since we have to sent a correct HTTP header to the server. In our case, the username is 'admin' and the password is 'admin12', so before we dispatch the request for a protectedAction, we need to set a header as follows:&lt;code&gt;$this-&amp;gt;request-&amp;gt;setHeader('Authorization','Basic YWRtaW46YWRtaW4xMg==');&lt;/code&gt;where “YWRtaW46YWRtaW4xMg==” is a result of base64_encode("admin:admin12") function.&lt;br /&gt;The full code of the IndexControllerTest.php is &lt;code&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;class IndexControllerTest extends ControllerTestCase {&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Check if we go to index controller&lt;br /&gt;*/&lt;br /&gt;public function  &lt;b&gt;testIndexController() &lt;/b&gt; {&lt;br /&gt;$this-&amp;gt;dispatch('/');&lt;br /&gt;$this-&amp;gt;assertController('index');&lt;br /&gt;$this-&amp;gt;assertAction('index');&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Prived an array with protected actions&lt;br /&gt;*&lt;br /&gt;* @return array&lt;br /&gt;*/&lt;br /&gt;public function  &lt;b&gt;getProtectedActions() &lt;/b&gt; {&lt;br /&gt;return array(&lt;br /&gt;array('/index/protected'),&lt;br /&gt;array('/index/edit'),&lt;br /&gt;&lt;br /&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Going to /index/protected should result in Www-Authenticate header&lt;br /&gt;* and since we do not send header with correct passwors and user&lt;br /&gt;* we should be forwarded to failedauth action and see 'Failed authentification'&lt;br /&gt;*&lt;br /&gt;* @dataProvider getProtectedActions&lt;br /&gt;*/&lt;br /&gt;public function  &lt;b&gt;testAccessWithoutAuth($action='/index/protected') &lt;/b&gt; {&lt;br /&gt;&lt;br /&gt;$this-&amp;gt;dispatch($action);&lt;br /&gt;&lt;br /&gt;$this-&amp;gt;assertHeader('Www-Authenticate');&lt;br /&gt;$this-&amp;gt;assertAction('failedauth');&lt;br /&gt;$this-&amp;gt;assertQueryContentContains('h1', 'Failed Authentication');&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Going to /index/index, but this time we send a header&lt;br /&gt;* with some inccorect password:username, codded as base64_encode.&lt;br /&gt;* Since username and password are inccorect we should get 'Www-Authenticate'&lt;br /&gt;*  header.&lt;br /&gt;*&lt;br /&gt;* @dataProvider getProtectedActions&lt;br /&gt;*&lt;br /&gt;*/&lt;br /&gt;public function  &lt;b&gt;testAccessWithInccorectAuthCredentials($action='/index/protected') &lt;/b&gt; {&lt;br /&gt;&lt;br /&gt;//send header with inccorect user and password, e.g.&lt;br /&gt;//YWRtaW46d3JvbnRwYXNzd29yZA== is equal to base64_encode("admin:wrontpassword")&lt;br /&gt;$this-&amp;gt;request-&amp;gt;setHeader('Authorization','Basic YWRtaW46d3JvbnRwYXNzd29yZA==');&lt;br /&gt;&lt;br /&gt;$this-&amp;gt;dispatch($action);&lt;br /&gt;$this-&amp;gt;assertHeader('Www-Authenticate');&lt;br /&gt;$this-&amp;gt;assertNotQueryContentContains('h1', 'Successful Authentication');&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Going to /index/index, but this time we send a header&lt;br /&gt;* with  CORRECT password:username, codded as base64_encode.&lt;br /&gt;* Since username and password are ccorect we should not get 'Www-Authenticate'&lt;br /&gt;*  header and be able to see protected content.&lt;br /&gt;*&lt;br /&gt;*   @dataProvider getProtectedActions&lt;br /&gt;*/&lt;br /&gt;public function  &lt;b&gt;testAccessWithCorrectAuthCredentials($action='/index/protected') &lt;/b&gt; {&lt;br /&gt;&lt;br /&gt;//send header with correct user and password i.e.&lt;br /&gt;//YWRtaW46YWRtaW4xMg== is equal to base64_encode("admin:admin12")&lt;br /&gt;$this-&amp;gt;request-&amp;gt;setHeader('Authorization','Basic YWRtaW46YWRtaW4xMg==');&lt;br /&gt;&lt;br /&gt;$this-&amp;gt;dispatch($action);&lt;br /&gt;$this-&amp;gt;assertNotHeader('Www-Authenticate');&lt;br /&gt;$this-&amp;gt;assertQueryContentContains('h1', 'Successful Authentication');&lt;br /&gt;&lt;br /&gt;if ($action == '/index/protected') {&lt;br /&gt;$this-&amp;gt;assertQueryContentContains('h2', 'Protected action');&lt;br /&gt;} elseif ($action == '/index/edit') {&lt;br /&gt;$this-&amp;gt;assertQueryContentContains('h2', 'Edit action');&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/code&gt;&lt;h3&gt;Some example screenshots&lt;/h3&gt;After clicking “Go to protected action” we are ask for credentials:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SxxEkdzcXPI/AAAAAAAAAq4/jFTovPH0aSI/s1600-h/Screenshot1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SxxEkdzcXPI/AAAAAAAAAq4/jFTovPH0aSI/s400/Screenshot1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Failed  Authentication:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SxxEnhRHrUI/AAAAAAAAArA/eh4mvSEN0tI/s1600-h/Screenshot1_failed.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SxxEnhRHrUI/AAAAAAAAArA/eh4mvSEN0tI/s400/Screenshot1_failed.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Successful access to protected action: &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SxxErXqxCNI/AAAAAAAAArI/MEszOrS6Ktc/s1600-h/Screenshot1_success.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SxxErXqxCNI/AAAAAAAAArI/MEszOrS6Ktc/s400/Screenshot1_success.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Execution of PHPUnit&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SxxEvjXTPjI/AAAAAAAAArQ/voukrQHvNtU/s1600-h/Screenshot_phpunit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SxxEvjXTPjI/AAAAAAAAArQ/voukrQHvNtU/s400/Screenshot_phpunit.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;Download the project (&lt;a style="font-size:14px" href="http://sites.google.com/site/someexamplestuffsite/files-1/httpautheg.tar.bz2"&gt;httpautheg.tar.bz2&lt;/a&gt;)&lt;/h3&gt;The project was done using ZendFramework-1.9.3PL1. For simplicity, the archive file contains the Zend library. Therefore, just download the archive, unpack it, change file rights if necessary and it should work. Assuming that the project directory is in your root path in the localhost, than it can be executed with url: http://localhost/httpautheg/public/. If xampp is used, it must be remembered that PHPUnit version that comes with xampp is too old and it must be upgraded to execute PHPUnit tests. To execute PHPUnits, a phpunit command  must be used in a terminal - not a web browser.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Testing Digest HTTP Authentication&lt;/h3&gt;Testing Digest HTTP Authentication can be done in a similar way. The difference would be in setting a correct header when requesting for protected action. More details on  Digest HTTP Authentication header is here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4096099193665678276?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4096099193665678276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/testing-basic-http-authentication-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4096099193665678276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4096099193665678276'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/testing-basic-http-authentication-using.html' title='Testing Basic HTTP Authentication using PHPUnit in Zend Framework'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/SxxEZA0Yr0I/AAAAAAAAAqw/Yu4_lPPn7vw/s72-c/project_dir.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-5274142679496182352</id><published>2009-12-04T01:53:00.000-08:00</published><updated>2009-12-04T01:55:22.491-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><title type='text'>Installing Abaqus 6.9 on CentOS 5.3</title><content type='html'>In the past post I was installing &lt;a href="http://shortrecipes.blogspot.com/2009/04/centoos-problem-to-install-abacus-68.html"&gt;Abaqus 6.9 on CentOS 5.2&lt;/a&gt;. However, the CentOS was upgraded to 5.3 and I needed to also install newer version of Abaqus, i.e. Abaqus 6.9. So, how did it go?&lt;br /&gt;&lt;br /&gt;Just like before, the first problem was: &lt;b&gt;Unable to determine Linux Distribution&lt;/b&gt;. But this time it was neccessery to put "Red Hat Enterprise Linux Server release 5.0 (Tikanga)" into /etc/redhat-release. To change this file root permissions are required.&lt;br /&gt;&lt;br /&gt;After that there were no more problems with the installation or the execution of abaqus 6.9.&lt;br /&gt;&lt;br /&gt;After the installation was finished I just original content (i.e. "CentOS release 5.3 (Final)") of /etc/redhat-release back.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-5274142679496182352?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/5274142679496182352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/installing-abaqus-69-on-centos-53.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5274142679496182352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5274142679496182352'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/installing-abaqus-69-on-centos-53.html' title='Installing Abaqus 6.9 on CentOS 5.3'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-9193485348366405909</id><published>2009-12-03T18:41:00.000-08:00</published><updated>2009-12-06T15:51:06.577-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Zend Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>PHP: Generation of MD5 hash for HTTP digest access authentication</title><content type='html'>&lt;blockquote&gt;&lt;a href="http://en.wikipedia.org/wiki/Digest_access_authentication#Example_with_explanation"&gt;HTTP Digest access authentication&lt;/a&gt; is one of the agreed methods a web server can use to negotiate credentials with a web user (using the HTTP protocol). Digest authentication is intended to supersede unencrypted use of the Basic access authentication, allowing user identity to be established securely without having to send a password in plaintext over the network. Digest authentication is basically an application of MD5 cryptographic hashing with usage of nonce values to prevent cryptanalysis.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;For example, lets assume that we want to allow a user called "adminuser" access a realm called "Admin Realm" with a password "secretpassword". Using php command the MD5 hash for this can be generated using:&lt;code&gt;php -r 'echo MD5("adminuser:Admin Realm:secretpassword")."\n";'&lt;/code&gt;This gives the following MD5 hash:&lt;code&gt;3228e0b5f8ae5ffb249d16125baffe63&lt;/code&gt;Therefore, for example when using &lt;a href="http://www.framework.zend.com/manual/en/zend.auth.adapter.http.html#zend.auth.adapter.http.basic_usage"&gt;Zend_Auth&lt;/a&gt; in Zend Framework, a file e.g. 'files/passwd.txt' with the username,realm and password that has to go into a resolver Zend_Auth_Adapter_Http_Resolver_File can contain&lt;code&gt;adminuser:Admin Realm:3228e0b5f8ae5ffb249d16125baffe63&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;In case of basic authentication, in 'files/passwd.txt' we would have password in a plain text&lt;code&gt;adminuser:Admin Realm:secretpassword&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-9193485348366405909?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/9193485348366405909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/php-generation-of-md5-hash-for-http.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9193485348366405909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9193485348366405909'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/12/php-generation-of-md5-hash-for-http.html' title='PHP: Generation of MD5 hash for HTTP digest access authentication'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6830434903066218885</id><published>2009-11-26T21:26:00.001-08:00</published><updated>2009-11-26T21:30:15.812-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Zend Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Zend Framework: Returning pdf file from an action controller</title><content type='html'>Lets assume that we have an action called getpdfAction in a Zend Controller. When we execute the action in a browser (e.g. http:://www.oursite.com/somezfcontroller/getpdf), the Zend Application by default will render view associated with the action and if necessary layout. However, when we want to have a pdf file returned or any other file from the action this behaviour is not needed. So, before we read a pdf for returning, we have to disable view script and layout rendering. This can be done as in the example getpdfAction function below:&lt;code&gt;public function getpdfAction() {&lt;br /&gt;&lt;br /&gt;//Disable rendering of view script and layout&lt;br /&gt;&lt;b&gt;$this-&amp;gt;_helper-&amp;gt;viewRenderer-&amp;gt;setNoRender();&lt;br /&gt;$this-&amp;gt;_helper-&amp;gt;layout-&amp;gt;disableLayout();&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;// We'll be outputting a PDF&lt;br /&gt;header('Content-type: application/pdf');&lt;br /&gt;&lt;br /&gt;// It will be called downloaded.pdf&lt;br /&gt;header('Content-Disposition: attachment; filename="downloaded.pdf"');&lt;br /&gt;&lt;br /&gt;// The PDF source is in original.pdf&lt;br /&gt;readfile('some_pdf_file.pdf');&lt;br /&gt;}&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6830434903066218885?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6830434903066218885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/zend-framework-returning-pdf-file-from.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6830434903066218885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6830434903066218885'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/zend-framework-returning-pdf-file-from.html' title='Zend Framework: Returning pdf file from an action controller'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4399908051713752709</id><published>2009-11-26T00:06:00.000-08:00</published><updated>2009-11-26T00:06:02.314-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='Statistics'/><title type='text'>Paired t-test</title><content type='html'>I always forget what P value must be to reject or not to reject null hypothesis in paired  &lt;a href="http://en.wikipedia.org/wiki/Student%27s_t-test#Significance"&gt;t-test&lt;/a&gt;. So lets explain by the example.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;b&gt;H0&lt;/b&gt; - null hypothesis - there is no&lt;br /&gt;significant difference&lt;br /&gt;between method A and B&lt;br /&gt;&lt;b&gt;H1&lt;/b&gt; - alternative hypothesis - there is difference&lt;br /&gt;(two tail test)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;For example [with 5% (a=0.05) level of significance ]:&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/Ri1etsXdB2I/AAAAAAAAACU/vROwBMNXG-k/s1600-h/t.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5056802095703590754" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/Ri1etsXdB2I/AAAAAAAAACU/vROwBMNXG-k/s400/t.png" style="cursor: pointer; display: block; margin: 0px auto 10px; text-align: center;" /&gt;&lt;/a&gt;&lt;br /&gt;Based on the above results I can say that: since P=0.009103483 and this is lover than a=0.05 &lt;b&gt;(P&amp;lt;0.05)&lt;/b&gt;, I can claim that:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;I'm 95% (a=0.05) sure that there &lt;u&gt;is&lt;/u&gt; significant&lt;br /&gt;difference between A and B, because &lt;b&gt;(P&amp;lt;0.05)&lt;/b&gt;.&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;On the other hand, we can have:&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Ri1ho8XdB3I/AAAAAAAAACc/qf12rcVKa60/s1600-h/t2.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5056805312634095474" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Ri1ho8XdB3I/AAAAAAAAACc/qf12rcVKa60/s400/t2.png" style="cursor: pointer; display: block; margin: 0px auto 10px; text-align: center;" /&gt;&lt;/a&gt;&lt;br /&gt;In this case P=0.649507752, hence I can claim that:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;I'm 95% (a=0.05) sure that there &lt;u&gt;is no&lt;/u&gt; significant&lt;br /&gt;difference between A and B, because &lt;b&gt;(P&amp;gt;0.05)&lt;/b&gt;.&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Above paired t-test was performed in Excel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4399908051713752709?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4399908051713752709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2007/04/paired-t-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4399908051713752709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4399908051713752709'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2007/04/paired-t-test.html' title='Paired t-test'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/Ri1etsXdB2I/AAAAAAAAACU/vROwBMNXG-k/s72-c/t.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4309298798025091549</id><published>2009-11-18T00:38:00.000-08:00</published><updated>2009-11-23T02:10:39.673-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Octave'/><title type='text'>Octave is getting faster!</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.gnu.org/software/octave/images/sombrero.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="111" src="http://www.gnu.org/software/octave/images/sombrero.jpg" width="200" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://www.gnu.org/software/octave/"&gt;GNU Octave&lt;/a&gt; "is a high-level language, primarily intended for numerical computations.  It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language. "&lt;br /&gt;&lt;br /&gt;In numerical calculations speed is very important. I remember that Octave 2.x, although very useful, used to be slow. What about now when there is Octave 3.2? To answer to this question I decided to compare the time performance of this new Octave release with the performances of versions 3.0 and 2.9 using custom made &lt;a href="http://shortrecipes.blogspot.com/2009/11/performance-benchmark-for-matlab-and.html"&gt;benchmark script&lt;/a&gt;. The tests were run on Intel Mac OS X 10.4.11 (Intel Core Duo 2GHz, 2GB RAM).&lt;br /&gt;&lt;br /&gt;&amp;nbsp;The results of 21 small tests for matrix and I/O operations are below or can be downloaded from &lt;a href="http://sites.google.com/site/someexamplestuffsite/files-1/results_octave.gnumeric?attredirects=0&amp;amp;d=1"&gt;here&lt;/a&gt; (gnumeric file):&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SweL_ixUm0I/AAAAAAAAApo/-GEtVdMBh18/s1600/Screenshot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SweL_ixUm0I/AAAAAAAAApo/-GEtVdMBh18/s400/Screenshot-1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;The bar plot of normalized geometric mean of the 21 tests is as follows (lower is better):&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SweL-b-0WTI/AAAAAAAAApg/ORokMAzssqA/s1600/Screenshot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SweL-b-0WTI/AAAAAAAAApg/ORokMAzssqA/s400/Screenshot.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The graph shows that Octave 3.2 is a bit faster than the two previous versions! Additionally, since the time values used &lt;a href="http://shortrecipes.blogspot.com/2009/11/performance-benchmark-for-matlab-and.html"&gt;were normalized against&lt;/a&gt; times obtained using MATLAB 7.4.0.287 (R2007a) on Intel Mac OS X 10.4.11 (Intel Core Duo 2GHz, 2GB RAM), it can be seen that Octave 3.2 is faster than the MATLAB R2007a. However, based on the data in the table it can be seen that the lowest performance of the Octave, as compared to Matlab is, &lt;i&gt;for&lt;/i&gt; loop (row 13 in the table). The Octave 3.2 was nearly 700 times slower than the Matlab in execution of nested &lt;i&gt;for&lt;/i&gt; loops! At the same time Matlab was about 1000 times slower than Octave 3.2 (but not Octave 2.9 and 3.0) in creation of sparse matrices (row 14 in the table)!!!&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Should we be very excited about this! Probably not very much, since my analysis has a number of limitations. The main one is that the question whether Octave 3.2 is faster than the older versions should be answered using some real statistical approach e.g.  Mann-Whiten U tests  or Ordinary least products (OLP) regression analysis, influence of outliners (row 13 and 14) should be investigated etc. There is also a question whether the differences in the performance obtained are statistically significant, or whether Octave 3.2 is statistically significantly faster/slower that Matlab?&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Nonetheless, I think that the results obtained clearly show a trend of increased performance for Octave.&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I'm also planning to repeat the above tests for Octave 3.2, but this time with inclusion of image processing functions such as: image creation, rotation, resize, image saving etc. I could not do this for is post, because there were problems compiling image package for Octave 2.9 and 3.0 on my Mac.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4309298798025091549?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4309298798025091549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/octave-is-getting-faster.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4309298798025091549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4309298798025091549'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/octave-is-getting-faster.html' title='Octave is getting faster!'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/SweL_ixUm0I/AAAAAAAAApo/-GEtVdMBh18/s72-c/Screenshot-1.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4129431328351058936</id><published>2009-11-11T20:55:00.000-08:00</published><updated>2009-11-18T00:34:37.495-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mint'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Linux Mint: Positive first impression</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SvuUIuoYKJI/AAAAAAAAAoY/_AU24Ik9teM/s1600-h/LML.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SvuUIuoYKJI/AAAAAAAAAoY/_AU24Ik9teM/s200/LML.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;Today, my Arch Linux died on a PC at work. Since I had not time to play with it, I decided to install something new. First I wanted to install Ubuntu 9.10, but usually after the installation of Ubuntu I have to spent time installing audio/video codes, flash player etc. I've heard that in &lt;a href="http://www.linuxmint.com/"&gt;Linux Mint&lt;/a&gt; all this stuff is pre-installed. I've also heard positive comments about this Ubuntu-base distro, so today I decided to give it a try. &lt;br /&gt;&lt;br /&gt;I downloaded Mint 7 Gloria, made backup of my home folder form Arch and I did a fresh installation on my dual-screen PC.&lt;br /&gt;&lt;br /&gt;In short: installation was very smooth and quite fast. After the installation, I could play my video and audio files, DVDs without any tweaking or installing any packages. The one thing that required installation was nvidia driver, but there were no problems with it. As a gnome user, the only thing that I found strange was the mintMenu at the bottom panel, no top panel and very dark default Mint theme. So I had to manually adjust these things. It just took few minutes. &lt;br /&gt;&lt;br /&gt;Some screens:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SvuU58uoUfI/AAAAAAAAApQ/iqgHiY46mRY/s1600-h/DSC00070.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SvuU58uoUfI/AAAAAAAAApQ/iqgHiY46mRY/s400/DSC00070.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SvuU6199JRI/AAAAAAAAApY/oZXVsKhE2zs/s1600-h/DSC00071.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SvuU6199JRI/AAAAAAAAApY/oZXVsKhE2zs/s400/DSC00071.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SvuU46iRDDI/AAAAAAAAApI/TR0BtkFDirA/s1600-h/DSC00069.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SvuU46iRDDI/AAAAAAAAApI/TR0BtkFDirA/s400/DSC00069.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SvuU3zL6rBI/AAAAAAAAApA/ZpsxjKBs74A/s1600-h/DSC00068.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SvuU3zL6rBI/AAAAAAAAApA/ZpsxjKBs74A/s400/DSC00068.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In conclusion, my first impression of Linux Mint is very positive. Now I look forward to Mint 8!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4129431328351058936?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4129431328351058936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/linux-mint-first-impression.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4129431328351058936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4129431328351058936'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/linux-mint-first-impression.html' title='Linux Mint: Positive first impression'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/SvuUIuoYKJI/AAAAAAAAAoY/_AU24Ik9teM/s72-c/LML.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-311433223198084805</id><published>2009-11-09T01:47:00.000-08:00</published><updated>2010-02-05T06:32:15.543-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><category scheme='http://www.blogger.com/atom/ns#' term='Statistics'/><title type='text'>Effect size of matched and unmatched data in Maltab</title><content type='html'>"In statistics, an effect size is a measure of the strength of the relationship between two variables in a statistical population, or a sample-based estimate of that quantity" from &lt;a href="http://en.wikipedia.org/wiki/Effect_size"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;The script below calculates effect size for matched (paired) and unmatched (unpaired) data as described in [1].&lt;br /&gt;&lt;script src="http://gist.github.com/295825.js"&gt;&lt;/script&gt;&lt;br /&gt;So, if C and E sets are matched than effect size d is 1.265. If C and E sets are unmatched than effect size d is also 1.265. The two sizes are equal for this example only.&lt;br /&gt;&lt;h3&gt;References&lt;/h3&gt;[1] Dunlop, W. P., Cortina, J. M., Vaslow, J. B., &amp;amp; Burke, M. J. (1996).&lt;br /&gt;Meta-analysis of experiments with matched groups or repeated measures designs. Psychological Methods, 1, 170-177.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-311433223198084805?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/311433223198084805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/effect-size-of-matched-and-unmatched.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/311433223198084805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/311433223198084805'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/effect-size-of-matched-and-unmatched.html' title='Effect size of matched and unmatched data in Maltab'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7729267220503526088</id><published>2009-11-07T00:13:00.000-08:00</published><updated>2009-11-08T18:38:31.066-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><category scheme='http://www.blogger.com/atom/ns#' term='Octave'/><title type='text'>Useful Matlab / Octave script to make default function arguments easier</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.gnu.org/software/octave/images/sombrero.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="111" src="http://www.gnu.org/software/octave/images/sombrero.jpg" width="200" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;The lack of an easy way of making default function arguments in MATLAB (I have R2007a) was annoying me for a long time. Octave (current version 3.2), which is an open source equivalent of MATLAB is much better in terms of handling default function arguments. &lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;What I mean, can be explained best by simple example.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;So, lets define a very simple m file, called &lt;i&gt;testDefaultArguments.m&lt;/i&gt; with the following function. &lt;br /&gt;&lt;code&gt;function testDefaultArguments(a=1,b=2)&lt;br /&gt;fprintf(1,'a=%d, b=%d\n',a,b);&lt;/code&gt;We see that we have a function called &lt;i&gt;testDefaultArguments&lt;/i&gt; with two arguments a and b, and we assign default values to them, i.e. 1 and 2, respectively. Such syntax seems to be helpful, because you can execute &lt;i&gt;testDefaultArguments&lt;/i&gt; function as follows:&lt;code&gt;octave-3.2.3:40&amp;gt; testDefaultArguments()&lt;br /&gt;a=1, b=2&lt;br /&gt;octave-3.2.3:41&amp;gt; testDefaultArguments(3)&lt;br /&gt;a=3, b=2&lt;br /&gt;octave-3.2.3:42&amp;gt; testDefaultArguments(a=43)&lt;br /&gt;a=43, b=2&lt;br /&gt;octave-3.2.3:43&amp;gt; testDefaultArguments(a=43,5)&lt;br /&gt;a=43, b=5&lt;br /&gt;octave-3.2.3:44&amp;gt; testDefaultArguments(a=43,b=55)&lt;br /&gt;a=43, b=55&lt;br /&gt;&lt;/code&gt;So everything seems good, but what if you want to assign only value to b, and not to a?Lets try&lt;code&gt;octave-3.2.3:47&amp;gt; testDefaultArguments(b=55)&lt;br /&gt;a=55, b=2 %&lt;b&gt;!!! a is 55 and not b !!! This is strange&lt;/b&gt;&lt;/code&gt;So, this is not only strange, but can easily leads to bugs in one's code.&lt;br /&gt;&lt;br /&gt;So this was Octave. &lt;b&gt;What about MATLAB&lt;/b&gt;? The anwser is: Error! The function &lt;i&gt;testDefaultArguments&lt;/i&gt; can't be executed in Matlab (at least in R2007a and R2008a) due to syntax errors! &lt;br /&gt;&lt;br /&gt;So, to help myself with making default function arguments in &lt;b&gt;both MATLAB and Octave&lt;/b&gt; I made &lt;a href="http://sites.google.com/site/someexamplestuffsite/files-1/getfunargs.m?attredirects=0&amp;amp;d=1"&gt;getfunargs.m&lt;/a&gt; script, which makes working with default function arguments little easier (To be honest, this function is a modification of &lt;a href="http://read.pudn.com/downloads64/sourcecode/math/227004/em/em/getargs.m__.htm"&gt;getargs.m&lt;/a&gt; script). I'm not going to explain how it works, instead I'm just going to show how it can be used. &lt;br /&gt;&lt;br /&gt;Lets  define function called &lt;i&gt;testDefaultArguments2&lt;/i&gt; which uses getfunargs:&lt;code&gt;function testDefaultArguments2(varargin)&lt;br /&gt;&lt;br /&gt;defaults = struct(...&lt;br /&gt;'a',1,...&lt;br /&gt;'b',2 ...&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;args = getfunargs(defaults, varargin);&lt;br /&gt;&lt;br /&gt;fprintf(1,'a=%d, b=%d\n',args.a,args.b);&lt;/code&gt;Now, the &lt;i&gt;testDefaultArguments2&lt;/i&gt; can be executed both in MATLAB and Octave as follows:&lt;code&gt;octave-3.2.3:52&amp;gt; testDefaultArguments2()&lt;br /&gt;a=1, b=2&lt;br /&gt;octave-3.2.3:53&amp;gt; testDefaultArguments2('a',3)&lt;br /&gt;a=3, b=2&lt;br /&gt;octave-3.2.3:54&amp;gt; testDefaultArguments2('b',5)&lt;br /&gt;a=1, b=5&lt;br /&gt;octave-3.2.3:55&amp;gt; testDefaultArguments2('b',5,'a',2)&lt;br /&gt;a=2, b=5&lt;/code&gt; It can bee seen now, that the default arguments work as expected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7729267220503526088?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7729267220503526088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/useful-matlab-octave-script-to-make.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7729267220503526088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7729267220503526088'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/useful-matlab-octave-script-to-make.html' title='Useful Matlab / Octave script to make default function arguments easier'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7584263642182222070</id><published>2009-11-05T00:50:00.000-08:00</published><updated>2009-11-06T23:37:31.217-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Octave'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Install Octave 3.2 with Image Processing package on Arch Linux</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.gnu.org/software/octave/images/sombrero.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="111" src="http://www.gnu.org/software/octave/images/sombrero.jpg" width="200" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://www.gnu.org/software/octave/"&gt;Octave&lt;/a&gt; is a great tool for programming mathematics. However, when I wanted to install it and its &lt;a href="http://octave.sourceforge.net/image/index.html"&gt;Image processing package&lt;/a&gt; on Arch Linux I got a problem: missing lgfortranbegin library.&lt;br /&gt;&lt;br /&gt;To begin with I installed Octave using pacman as a root or sudo user (I prefer sudo)&lt;code&gt;sudo pacman -Sy; pacman -S octave&lt;/code&gt; There was no problems with this. &lt;br /&gt;Now, to install &lt;a href="http://octave.sourceforge.net/image/index.html"&gt;Image processing&lt;/a&gt; package it is necessary to do as follows: &lt;br /&gt;&lt;blockquote&gt;To install a package, download the package file, and install it from the Octave prompt by typing pkg install package_file_name.tar.gz&lt;br /&gt;where package_file_name.tar.gz is the name of the file you downloaded.&lt;br /&gt;&lt;/blockquote&gt;In my case the package_file_name.tar.gz was image-1.0.10.tar.gz and it can be downloaded form &lt;a href="http://octave.sourceforge.net/image/index.html"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So, when I tried to install it I got the following error&lt;code&gt;octave:1&amp;gt; pkg install image-1.0.10.tar.gz&lt;br /&gt;warning: creating installation directory /usr/share/octave/packages&lt;br /&gt;&lt;b&gt;/usr/bin/ld: cannot find -lgfortranbegin&lt;/b&gt;&lt;br /&gt;collect2: ld returned 1 exit status&lt;br /&gt;make: *** [__spatial_filtering__.oct] Error 1&lt;br /&gt;'make' returned the following error: make: Entering directory `/tmp/oct-9oWZxI/image-1.0.10/src'&lt;br /&gt;mkoctfile __spatial_filtering__.cc&lt;br /&gt;make: Leaving directory `/tmp/oct-9oWZxI/image-1.0.10/src'&lt;br /&gt;error: called from `pkg&amp;gt;configure_make' in file /usr/share/octave/3.2.3/m/pkg/pkg.m near line 1253, column 2&lt;br /&gt;error: called from:&lt;br /&gt;error:   /usr/share/octave/3.2.3/m/pkg/pkg.m at line 714, column 5&lt;br /&gt;error:   /usr/share/octave/3.2.3/m/pkg/pkg.m at line 287, column 7&lt;/code&gt; As it can be seen &lt;i&gt;lgfortranbegin&lt;/i&gt; is missing. The library belongs to fortran compiler and in Arch Linux it can be installed simply by &lt;code&gt;sudo pacman -S gcc-fortran&lt;/code&gt;To make sure that the library was installed I performed a search and I found it&lt;code&gt;[marcin@arch ~]$ sudo find / -name "*fortranbegin*"&lt;br /&gt;/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/libgfortranbegin.a&lt;/code&gt;After this there was no problems. I installed Image package as previously described and I checked if I got functions that I needed (e.g. imrotate, imresize) by: &lt;code&gt;octave:1&amp;gt; pkg install image-1.0.10.tar.gz&lt;br /&gt;octave:2&amp;gt; imr&amp;lt;tabulator&amp;gt;&lt;br /&gt;imread            imresize          imrotate_Fourier  &lt;br /&gt;imremap           imrotate          &lt;br /&gt;octave:2&amp;gt; &lt;/code&gt; The installation was almost finished. I needed one more package, i.e. gnuplot to be able to display figures&lt;code&gt;sudo pacman -S gnuplot&lt;/code&gt;Finally, I did some simple test to create an image, make a rotated version of it and display both of them&lt;code&gt;octave:8&amp;gt; I=randn(256);&lt;br /&gt;octave:9&amp;gt; I2=imrotate(I,30);&lt;br /&gt;octave:10&amp;gt; figure,imshow(I);&lt;br /&gt;octave:11&amp;gt; figure,imshow(I2);&lt;/code&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SvKTsuZ4HFI/AAAAAAAAAoQ/FHFOKT8QTOs/s1600-h/octave_imrotate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SvKTsuZ4HFI/AAAAAAAAAoQ/FHFOKT8QTOs/s400/octave_imrotate.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;Conclusion&lt;/h3&gt;So in conclusion, to install octave along with Image package I needed to have gcc-fortran and gnuplot installed first:&lt;code&gt;sudo pacman -S gcc-fortran gnuplot octave&lt;/code&gt;Then follow general instruction on how to install Octave packages from &lt;a href="http://octave.sourceforge.net/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7584263642182222070?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7584263642182222070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/install-octave-32-with-image-processing.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7584263642182222070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7584263642182222070'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/install-octave-32-with-image-processing.html' title='Install Octave 3.2 with Image Processing package on Arch Linux'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/SvKTsuZ4HFI/AAAAAAAAAoQ/FHFOKT8QTOs/s72-c/octave_imrotate.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-5388768184001188809</id><published>2009-11-04T21:31:00.000-08:00</published><updated>2009-11-26T00:02:58.928-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><category scheme='http://www.blogger.com/atom/ns#' term='Octave'/><title type='text'>Performance benchmark script for MATLAB and Octave</title><content type='html'>The benchmark script evaluates MATLAB and Octave not only in execution times for matrix manipulation, but also for integration, 2D interpolation, solving nonlinear equation,  reading/writing files, plot creating and saving, image manipulation (e.g. rotation, filtering, erosion). &lt;br /&gt;&lt;br /&gt;The execution times of each test (27 tests for now) are normalized against times obtained using MATLAB 7.4.0.287 (R2007a) on Intel Mac OS X 10.4.11 (Intel Core Duo&lt;br /&gt;2GHz, 2GB RAM).&lt;br /&gt;&lt;br /&gt;As a results the script generates txt file with the time values (normalized and not normalized) obtained for each test.  &lt;br /&gt;&lt;br /&gt;The evaluate overall performance of MATLAB/Octave geometric and arithmetic means of the individual time values obtained are used. &lt;br /&gt;&lt;br /&gt;The header &lt;br /&gt;&lt;code&gt;function res = mybench(varargin)&lt;br /&gt;% res = mybench('noOfRepeats', 3,...&lt;br /&gt;%                     'normalize',true,...&lt;br /&gt;%                     'onlyTests',[],...&lt;br /&gt;%                     'imagep',true)&lt;br /&gt;%&lt;br /&gt;% Benchmark script for MATLAB and Octave.&lt;br /&gt;% Tested on Matlab 2009a and Octave 3.2.2 for Windows.&lt;br /&gt;%&lt;br /&gt;% Execution time of basic matrix manipulation function is tested along with&lt;br /&gt;% integration, solving nonlinear equation, image processing functions ( if&lt;br /&gt;% available), saving/loading matrices to a file system, for loop,&lt;br /&gt;% binary operation,etc. In total 27&lt;br /&gt;% tests are performed (less if image processing functions not available).&lt;br /&gt;%&lt;br /&gt;% All results are normalized against the results obtained&lt;br /&gt;% using MATLAB 7.4.0.287 (R2007a) on Intel Mac OS X 10.4.11 (Intel Core Duo&lt;br /&gt;% 2GHz, 2GB RAM)&lt;br /&gt;%&lt;br /&gt;% At the end, arithmetic and geometric means of the times obtained are&lt;br /&gt;% calculated. All results obtained are stored in a txt file named&lt;br /&gt;% results_&lt;matlab octave="" version=""&gt;.txt.&lt;br /&gt;%&lt;br /&gt;% INPUT&lt;br /&gt;%  noOfRepeats - int - number of times each test is executed (default 3)&lt;br /&gt;%  normalize - boolean - normalize results (default true).&lt;br /&gt;%  onlyTests - int vector - do only tests given (default [], i.e. do all tests)&lt;br /&gt;%  imagep - boolean - do or not image processing testing&lt;br /&gt;%&lt;br /&gt;% OUTPUT&lt;br /&gt;% res - struct -   normalized geometric mean .&lt;br /&gt;%&lt;br /&gt;% EXAMPLES&lt;br /&gt;% res = mybench(); %perform all tests with default settings.&lt;br /&gt;% res = mybench('noOfRepeats',10); %perform all tests 10 times.&lt;br /&gt;% res = mybench('onlyTests',[1,5,8]); %perform only tests 1,5 and 8.&lt;br /&gt;% res = mybench('noOfRepeats', 1,'normalize',false); % repeat 1 time&lt;br /&gt;%                                               %each tests and do not&lt;br /&gt;%                                               %normalize results.&lt;br /&gt;%&lt;br /&gt;% Site: http:\\shortrecipes.blogspot.com&lt;br /&gt;% Date: Nov 2009&lt;br /&gt;&lt;/matlab&gt;&lt;/code&gt;&lt;br /&gt;The full code is &lt;a href="http://sites.google.com/site/someexamplestuffsite/files-1/mybench.m?attredirects=0&amp;amp;d=1"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Example output from the script is as follows:&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sw40TYaGOKI/AAAAAAAAAp4/HvHL9NDyRT4/s1600/Octave_3.2_benchmark.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sw40TYaGOKI/AAAAAAAAAp4/HvHL9NDyRT4/s640/Octave_3.2_benchmark.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sw42KE-jOSI/AAAAAAAAAqA/MFZ4WHx2C8A/s1600/Picture+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sw42KE-jOSI/AAAAAAAAAqA/MFZ4WHx2C8A/s640/Picture+2.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-5388768184001188809?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/5388768184001188809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/performance-benchmark-for-matlab-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5388768184001188809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5388768184001188809'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/11/performance-benchmark-for-matlab-and.html' title='Performance benchmark script for MATLAB and Octave'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sw40TYaGOKI/AAAAAAAAAp4/HvHL9NDyRT4/s72-c/Octave_3.2_benchmark.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1145405872228235293</id><published>2009-10-30T23:35:00.000-07:00</published><updated>2009-11-26T17:38:20.600-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><category scheme='http://www.blogger.com/atom/ns#' term='Octave'/><title type='text'>Comparing two methods of measurement in Matalb or Octave</title><content type='html'>How to compare two methods that measure the same variable? How to check if one method produces results constantly higher than the other method and if the difference is significant? How to determine whether new method, can replace the old one? The anwser to these question lies in the analysis of bias between the two method of measurement [1]. Below is a Matlab implementation of  Ordinary least products (OLP) regression analysis [1] that can be used to anwser to these questions. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;function res = mgr(X,Y,varargin)&lt;br /&gt;% res = mgr(X,Y)&lt;br /&gt;% Mean Geometric Regression (i.e. Ordinary least products (OLP) regression)&lt;br /&gt;%&lt;br /&gt;% Used to evaluate two measurement methods in terms of fixed and&lt;br /&gt;% proportional bias as described in [1].&lt;br /&gt;%&lt;br /&gt;% INPUT&lt;br /&gt;% X - vector of values calculated by the first method.&lt;br /&gt;% Y - vector of values calculated by the second method.&lt;br /&gt;% boolean - plot or not scattergram of the values&lt;br /&gt;% string - label of x axis of scattergram&lt;br /&gt;% string - label of y axis of scattergram&lt;br /&gt;%&lt;br /&gt;%&lt;br /&gt;% EXAMPLE from [1]:&lt;br /&gt;%&lt;br /&gt;% M1=[132 138 144 146 148 152 158 130 162 168 172 174 180 180 188 194 194 200 200 204 210 210 216 220 220];&lt;br /&gt;% M2=[130 134 132 140 150 144 150 122 160 150 160 178 168 174 186 172 182 178 196 188 180 196 210 190 202];&lt;br /&gt;%&lt;br /&gt;% res=mgr(M1,M2)&lt;br /&gt;%res =&lt;br /&gt;%&lt;br /&gt;% a: 13.9506&lt;br /&gt;% b: 0.8611&lt;br /&gt;% a_CI95: [-6.9476 32.3364]&lt;br /&gt;% b_CI95: [0.7576 0.9788]&lt;br /&gt;%&lt;br /&gt;% res=mgr(M1,M2,true); % produces scattergram&lt;br /&gt;% res=mgr(M1,M2,true,'SBP(M1)','SBP(M2)'); % produces scattergram with x and y axis&lt;br /&gt;% % labels of 'SBP(M1)' and 'SBP(M2)'&lt;br /&gt;%&lt;br /&gt;% NOTE:&lt;br /&gt;% The above calculated values of a and b agree with the values in [1]&lt;br /&gt;% Values of CI95 are marginally different, becouse, as expalined in [1],&lt;br /&gt;% they are calculated using approximate formulas.&lt;br /&gt;%&lt;br /&gt;%REFERENCE:&lt;br /&gt;%[1] J Ludbrook, Comparing methods of measurement, Clinical and&lt;br /&gt;% Experimental Pharmacology and Physiology, 1997:24,193-203&lt;br /&gt;%&lt;br /&gt;%&lt;br /&gt;%&lt;/code&gt;Full code of the above script is &lt;a href="http://sites.google.com/site/someexamplestuffsite/files-1/mgr.m?attredirects=0&amp;amp;d=1"&gt;here&lt;/a&gt;.&lt;br /&gt;Script was tested on Matlab 2007a and in Octave 3.2. En example of the scattergram that is generated by the script is below. This scattergram is the same as an example given in [1].&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SuvadIdkDQI/AAAAAAAAAoI/L4fIMi8B0fk/s1600-h/Scattergram.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SuvadIdkDQI/AAAAAAAAAoI/L4fIMi8B0fk/s320/Scattergram.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;References&lt;/h3&gt;[1] J Ludbrook, Comparing methods of measurement, Clinical and Experimental Pharmacology and Physiology, 1997:24,193-203.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1145405872228235293?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1145405872228235293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/comparing-to-methods-of-measurement-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1145405872228235293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1145405872228235293'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/comparing-to-methods-of-measurement-in.html' title='Comparing two methods of measurement in Matalb or Octave'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/SuvadIdkDQI/AAAAAAAAAoI/L4fIMi8B0fk/s72-c/Scattergram.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7723031212349891520</id><published>2009-10-23T01:29:00.000-07:00</published><updated>2009-11-03T02:31:06.016-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ten clicks to install Ubuntu 9.04</title><content type='html'>&lt;div&gt;&lt;/div&gt;&lt;h3&gt;Update: My honest mistake: It should be Ubuntu 9.10, not 9.04. Thanks Tom!&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Click 1&lt;/h3&gt;Click Enter for English language.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SuFo4cC_fII/AAAAAAAAAmM/CC0wgkcJv8o/s1600-h/click1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SuFo4cC_fII/AAAAAAAAAmM/CC0wgkcJv8o/s320/click1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;Clicks 2 and 3&lt;/h3&gt;Go to Install Ubuntu and Click Enter.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuFpGU4wkpI/AAAAAAAAAmU/0exsHB4eOwc/s1600-h/click2-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuFpGU4wkpI/AAAAAAAAAmU/0exsHB4eOwc/s320/click2-3.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;Click 4&lt;/h3&gt;Forward.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SuFpzaxt45I/AAAAAAAAAmc/HBD_uXFPWg4/s1600-h/click4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SuFpzaxt45I/AAAAAAAAAmc/HBD_uXFPWg4/s320/click4.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;Click5&lt;/h3&gt;Forward.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SuFqF5cJL2I/AAAAAAAAAmk/J7_RuUNf7Hk/s1600-h/click5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SuFqF5cJL2I/AAAAAAAAAmk/J7_RuUNf7Hk/s320/click5.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;Click 6&lt;/h3&gt;Forward&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuFqQZYIE4I/AAAAAAAAAms/0_EOPt8Azo0/s1600-h/click6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuFqQZYIE4I/AAAAAAAAAms/0_EOPt8Azo0/s320/click6.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;Click 7&lt;/h3&gt;Forward&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SuFqWYefZzI/AAAAAAAAAm0/ES6U6YhivnM/s1600-h/click7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SuFqWYefZzI/AAAAAAAAAm0/ES6U6YhivnM/s320/click7.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Click 8&lt;/h3&gt;Forward (Typing username and password were not counted).&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuFqcyDCOBI/AAAAAAAAAm8/DI2x9p9ry90/s1600-h/click8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuFqcyDCOBI/AAAAAAAAAm8/DI2x9p9ry90/s320/click8.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;Click 9&lt;/h3&gt;Install&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuFqq9uSwOI/AAAAAAAAAnE/ygjnco3sedI/s1600-h/click9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuFqq9uSwOI/AAAAAAAAAnE/ygjnco3sedI/s320/click9.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;Waiting for installation to complete&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SuFrBc8mY_I/AAAAAAAAAnM/mq_U9Uh8IVQ/s1600-h/click9-after.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SuFrBc8mY_I/AAAAAAAAAnM/mq_U9Uh8IVQ/s320/click9-after.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;Click 10&lt;/h3&gt;Restart Now and Ubuntu installation is finished.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SuFrEVmyF4I/AAAAAAAAAnU/LV6RQXBj50w/s1600-h/click10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SuFrEVmyF4I/AAAAAAAAAnU/LV6RQXBj50w/s320/click10.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;So 10 clicks is enough to install Ubuntu &lt;strike&gt;9.04&lt;/strike&gt; 9.10. Is it much or not? You can compare it with the number of clicks in other systems [Image taken from &lt;a href="http://www.tuxradar.com/content/benchmarked-ubuntu-vs-vista-vs-windows-7"&gt;Benchmarked: Ubuntu vs Vista vs Windows 7&lt;/a&gt;]:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.tuxradar.com/files/ubuntu_vs_7-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="242" src="http://www.tuxradar.com/files/ubuntu_vs_7-2.png" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7723031212349891520?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7723031212349891520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/ten-clicks-to-install-ubuntu-904.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7723031212349891520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7723031212349891520'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/ten-clicks-to-install-ubuntu-904.html' title='Ten clicks to install Ubuntu 9.04'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/SuFo4cC_fII/AAAAAAAAAmM/CC0wgkcJv8o/s72-c/click1.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1408060369864888637</id><published>2009-10-19T03:34:00.000-07:00</published><updated>2009-10-22T21:30:08.086-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='imagemagick'/><title type='text'>How ImageMagick can save you time</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuExRGjhlqI/AAAAAAAAAmE/_341GP_TeG0/s1600-h/ImageMagick.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuExRGjhlqI/AAAAAAAAAmE/_341GP_TeG0/s320/ImageMagick.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://www.imagemagick.org/"&gt;ImageMagick&lt;/a&gt; is a great tool! Many times it has saved me from programming. Here is just one example of many applications of the ImageMagick that can save one's time. &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Recently, I was asked to check whether a set of images (few hundreds of them) contains one particular image. So, basically &lt;b&gt;I was given and image (called testImage.tiff), and I needed to check whether this image belongs to a set a few hundreds of images&lt;/b&gt;. En example of the images from the set is below:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuEq6ztK1dI/AAAAAAAAAlk/Iye3j-CH4AQ/s1600-h/images.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuEq6ztK1dI/AAAAAAAAAlk/Iye3j-CH4AQ/s320/images.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;So how to anwser this? You can do manual (i.e. visual comparison), you can also write some simple script in Python with PIL. All would take some time. But why to do this, if you can just write one &lt;i&gt;for&lt;/i&gt; loop in bash with &lt;a href="http://www.imagemagick.org/script/compare.php"&gt;&lt;i&gt;compare&lt;/i&gt;&lt;/a&gt; command from ImageMagick?&lt;br /&gt;&lt;br /&gt;So first thing I did is to create the following folders:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SuEq59xEaiI/AAAAAAAAAlc/KYVpguzB39s/s1600-h/folders.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SuEq59xEaiI/AAAAAAAAAlc/KYVpguzB39s/s320/folders.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;The input folder contains all images from the set, the output folder will be where the results of my search will be stored, and the testImage.tiff is my test image. &lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;So thanks to ImageMagick's, the only thing I had to do is to execute its &lt;i&gt;compare&lt;/i&gt; command on all images from the set (i.e. input folder).&amp;nbsp; In other words, I compared, in a loop, an image from the set with the testImage.tiff and the results of the comparison went to output folder. Below is the bash &lt;i&gt;for&lt;/i&gt; loop that was executed inside the input folder.&lt;br /&gt;&lt;/div&gt;&lt;code&gt;for f in *.tiff ; do    &lt;br /&gt;compare $f ../testImage.tiff ../output/$f ;&lt;br /&gt;done&lt;/code&gt;After loop finished, I could go to output folder, and quickly find out whether testImage.tiff is in the set:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SuEq75DLS2I/AAAAAAAAAls/tcaVy0gGL9Q/s1600-h/results.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SuEq75DLS2I/AAAAAAAAAls/tcaVy0gGL9Q/s320/results.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;As can be seen in the above picture, the testImage.tiff belongs this this set.&lt;br /&gt;&lt;br /&gt;One limitation of this procedure is that I had to manually go through the output folder. But because all not matching images are in red, it was very quick to find, the one image that was not red. (if any). Additionally, if the testImage.tiff and images from the set were of different size or type additional code would be necessary.&lt;br /&gt;&lt;br /&gt;So thanks to the ImageMagick, I could do the job in just a few minutes.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1408060369864888637?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1408060369864888637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/imagemagickl-compare-all-image-files.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1408060369864888637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1408060369864888637'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/imagemagickl-compare-all-image-files.html' title='How ImageMagick can save you time'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qvZ1h1bgBRo/SuExRGjhlqI/AAAAAAAAAmE/_341GP_TeG0/s72-c/ImageMagick.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1856481646863713138</id><published>2009-10-18T20:36:00.000-07:00</published><updated>2010-02-10T00:53:31.883-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Zend Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><category scheme='http://www.blogger.com/atom/ns#' term='xampp'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>xampp /  lampp: upgrade PHPUnit in lampp  1.7.1</title><content type='html'>The default PHPUnit that ships with lampp 1.7.1 is not suited for use with Zend Framework 1.9. The reason is that the PHPUnit version in lampp is to low. So it is necessary to upgrade it using pear. However, before it can be done, pear version that comes with lampp 1.7.1 needs to be also upgraded. The pear executable is in /opt/lampp/bin so I went to this folder.&lt;br /&gt;&lt;br /&gt;First PHPUnit channel must be added &lt;code&gt;sudo ./pear channel-discover pear.phpunit.de&lt;br /&gt;Adding Channel "pear.phpunit.de" succeeded&lt;br /&gt;Discovery of channel "pear.phpunit.de" succeeded&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then pear chanels can be updated &lt;code&gt;sudo ./pear update-channels&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then we can try to install PHPUnit:&lt;code&gt;sudo ./pear install phpunit/PHPUnit&lt;br /&gt;phpunit/PHPUnit requires PEAR Installer (version &gt;= 1.8.1), installed version is 1.7.1&lt;br /&gt;phpunit/PHPUnit requires package "pear/Image_GraphViz" (version &gt;= 1.2.1), installed version is 1.1.0&lt;br /&gt;phpunit/PHPUnit can optionally use PHP extension "xdebug" (version &gt;= 2.0.5)&lt;br /&gt;No valid packages found&lt;br /&gt;install failed&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To upgrade pear I used &lt;code&gt;sudo ./pear upgrade PEAR&lt;/code&gt; To check if upgrade was successful I used &lt;code&gt;./pear -V&lt;br /&gt;PEAR Version: 1.9.0&lt;br /&gt;PHP Version: 5.2.9&lt;br /&gt;Zend Engine Version: 2.2.0&lt;br /&gt;Running on: Linux arch 2.6.31-ARCH #1 SMP PREEMPT Tue Oct 13 13:36:23 CEST 2009 i686&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Before PHPUnit can be upgraded, pear/Image_GraphViz package must be upgraded first. So &lt;code&gt;sudo ./pear upgrade pear/Image_GraphViz&lt;br /&gt;downloading Image_GraphViz-1.2.1.tgz ...&lt;br /&gt;Starting to download Image_GraphViz-1.2.1.tgz (4,872 bytes)&lt;br /&gt;.....done: 4,872 bytes&lt;br /&gt;upgrade ok: channel://pear.php.net/Image_GraphViz-1.2.1&lt;/code&gt;&lt;br /&gt;and install PHPUnit &lt;code&gt;./pear install -a phpunit/PHPUnit&lt;br /&gt;phpunit/PHPUnit can optionally use PHP extension "xdebug" (version &gt;= 2.0.5)&lt;br /&gt;downloading PHPUnit-3.4.1.tgz ...&lt;br /&gt;Starting to download PHPUnit-3.4.1.tgz (326,659 bytes)&lt;br /&gt;...................................................................done: 326,659 bytes&lt;br /&gt;install ok: channel://pear.phpunit.de/PHPUnit-3.4.1&lt;/code&gt;&lt;br /&gt;After this, when I could use PHPUnit with Zend Framework as described in a tutorial &lt;a href="http://maff.ailoo.net/2009/04/set-up-a-zend-framework-application-using-zend_application-including-phpunit-setup/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1856481646863713138?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1856481646863713138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/xampp-lampp-upgrade-phpunit-in-lampp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1856481646863713138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1856481646863713138'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/xampp-lampp-upgrade-phpunit-in-lampp.html' title='xampp /  lampp: upgrade PHPUnit in lampp  1.7.1'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-34763991626327233</id><published>2009-10-15T01:11:00.000-07:00</published><updated>2009-10-22T01:08:05.593-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SPSS'/><title type='text'>SPSS: create random binary variable</title><content type='html'>To create a random binary variable called e.g. new_var one can use the following code:&lt;code&gt;COMPUTE new_var=RND(RV.UNIFORM(0,1)). &lt;br /&gt;EXECUTE.&lt;/code&gt;or &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/StbZraEGFUI/AAAAAAAAAkY/7818kuCf57w/s1600-h/spss_random_variable.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 104px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/StbZraEGFUI/AAAAAAAAAkY/7818kuCf57w/s400/spss_random_variable.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5392736943576847682" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-34763991626327233?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/34763991626327233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/spss-create-random-binary-variable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/34763991626327233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/34763991626327233'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/spss-create-random-binary-variable.html' title='SPSS: create random binary variable'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StbZraEGFUI/AAAAAAAAAkY/7818kuCf57w/s72-c/spss_random_variable.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-247855975688464116</id><published>2009-10-07T03:09:00.001-07:00</published><updated>2009-10-22T02:22:45.660-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Zend Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><category scheme='http://www.blogger.com/atom/ns#' term='xampp'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Xampp: SQLSTATE[HY000] [2002] Invalid argument</title><content type='html'>I'm currently developing a web application using Zend Framework 1.9.x. For this purpose I used Xampp for linux (i.e. lampp 1.7.2). Most of the time I was using arch linux with xampp 1.7.2 and there was no problem. Then I changed my os to Ubuntu 9.04 and I installed the same xampp 1.7.2. Interestingly, when I wanted to run my application under Ubuntu I got an error&lt;code&gt;Message: SQLSTATE[HY000] [2002] Invalid argument&lt;/code&gt;After googling  I found that the reason was that in my php.ini (i.e. for xampp it is /opt/lampp/etc/php.ini) the variable pdo_mysql.default_socket was not set:&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SsxqWvRFBpI/AAAAAAAAAjQ/IOM36kPdoTA/s1600-h/pdo_mysql.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 60px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SsxqWvRFBpI/AAAAAAAAAjQ/IOM36kPdoTA/s400/pdo_mysql.png" alt="" id="BLOGGER_PHOTO_ID_5389799792933406354" border="0" /&gt;&lt;/a&gt; Therefore I set it to /opt/lampp/var/mysql/mysql.sock&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Ssxqvvpv33I/AAAAAAAAAjY/C9qeMi34L5c/s1600-h/Screenshot2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 52px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Ssxqvvpv33I/AAAAAAAAAjY/C9qeMi34L5c/s400/Screenshot2.png" alt="" id="BLOGGER_PHOTO_ID_5389800222533607282" border="0" /&gt;&lt;/a&gt;Of course, I also had to restart Xampp&lt;code&gt;sudo /opt/lampp/lampp restart&lt;/code&gt;It is interesting why Xampp 1.7.2 worked under Arch Linux, but it did not work under Ubuntu 9.04?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-247855975688464116?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/247855975688464116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/php-53-sqlstatehy000-2002-invalid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/247855975688464116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/247855975688464116'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/php-53-sqlstatehy000-2002-invalid.html' title='Xampp: SQLSTATE[HY000] [2002] Invalid argument'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/SsxqWvRFBpI/AAAAAAAAAjQ/IOM36kPdoTA/s72-c/pdo_mysql.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6753680865638006285</id><published>2009-10-02T23:40:00.000-07:00</published><updated>2009-10-02T23:43:48.244-07:00</updated><title type='text'>Gnome desktop icons disappear</title><content type='html'>I have gnome 2.26.3 and sometimes all my icons on the desktop disappear. I found that in Gnome, program called &lt;span style="font-style: italic;"&gt;nautilus&lt;/span&gt; manages it. So for my case it was enough to restart/start it&lt;code&gt;nautilus --no-default-window &amp;&lt;/code&gt;Nautilus is the same program that you use for browsing folders under Gnome.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6753680865638006285?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6753680865638006285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/gnome-desktop-icons-disappear.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6753680865638006285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6753680865638006285'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/10/gnome-desktop-icons-disappear.html' title='Gnome desktop icons disappear'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8949092971487022687</id><published>2009-09-27T02:00:00.000-07:00</published><updated>2009-12-01T22:00:44.984-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Zend Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>TOP PHP frameworks in terms of number of books published on a given framework</title><content type='html'>&lt;div style="text-align: justify;"&gt;To begin with, I would like to say that I'm not new to PHP 4 and 5, but I would not call myself an expert. The reason is that for a few years now, PHP and web applications are things that I do only in my spare time.   I also haven't used all the PHP frameworks, nor I'm the expert in any of them. I'm basically looking for a framework that is worth looking into  and which would save me a time, as I don't want to spend much time on weekends coding e.g. only user authorization or registration form validation. So far, I did some  small jobs using Prado, CakePHP and now I'm starting to learn Zend Framework. I also heard lots of good about CodeIgniter and Symfony. Since, I couldn't learn all of them, I just wanted to find some way of determining which of them seems to be the most popular. I decided to check &lt;span style="font-weight: bold;"&gt;how many books on a given framework are available in amazon.com&lt;/span&gt;?&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;I chose this criterion because for a person that wants to learn a framework, examples along with explanation can be valuable. Apart from official tutorials, quick start guides and reference manuals, that are available on the websites of the frameworks, books can provide good introduction along with example applications. Additionally, a number of books, also shows to some extend, how popular a given framework is. I would imaging that not many authors would write books about unpopular frameworks. Off course, there are many other possible criteria that can be used to rank or compare PHP frameworks, such as documentation, community support, performance, fast availability of updates etc., but I think that the number of books somehow translates to the the popularity of a framework.&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;Method of comparison&lt;/h3&gt;&lt;div style="text-align: justify;"&gt;I went to amazon.com and &lt;span&gt;I performed advanced searches for books on a  given framework written in English and published after 2007&lt;/span&gt;. A year 2007 was chosen because  books older than two years may contain highly outdated information. A framework name was a keyword. Than,  the number of books found was counted.&lt;br /&gt;&lt;br /&gt;En example of a search criteria used is given below:&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/StR-yNaBNLI/AAAAAAAAAkQ/nfnKfVHTiuY/s1600-h/example_amazon_book_search.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 281px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/StR-yNaBNLI/AAAAAAAAAkQ/nfnKfVHTiuY/s400/example_amazon_book_search.png" alt="" id="BLOGGER_PHOTO_ID_5392074054926677170" border="0" /&gt;&lt;/a&gt;&lt;h3&gt;Results&lt;/h3&gt;The results are as follows:&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://framework.zend.com/"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 135px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/StRlV1htmcI/AAAAAAAAAjg/iJpsbU3RRH8/s400/zend-framework.jpg" alt="" id="BLOGGER_PHOTO_ID_5392046079689464258" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Zend Framework - 10 books (&lt;a href="http://www.amazon.com/gp/search/ref=sr_adv_b/?search-alias=stripbooks&amp;amp;unfiltered=1&amp;amp;field-keywords=&amp;amp;field-author=&amp;amp;field-title=zend+framework&amp;amp;field-isbn=&amp;amp;field-publisher=&amp;amp;node=&amp;amp;url=&amp;amp;field-feature_browse-bin=&amp;amp;field-binding_browse-bin=&amp;amp;field-subject=&amp;amp;field-language=English&amp;amp;field-dateop=After&amp;amp;field-datemod=&amp;amp;field-dateyear=2007&amp;amp;sort=relevancerank&amp;amp;Adv-Srch-Books-Submit.x=26&amp;amp;Adv-Srch-Books-Submit.y=18"&gt;see the books&lt;/a&gt;)&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.symfony-project.org/"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 271px; height: 115px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/StRmnWUilyI/AAAAAAAAAj4/DR3LYk-Dod8/s400/symfony-logo.png" alt="" id="BLOGGER_PHOTO_ID_5392047480061990690" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Symfony - 9 books (&lt;a href="http://www.amazon.com/gp/search/ref=sr_adv_b/?search-alias=stripbooks&amp;amp;unfiltered=1&amp;amp;field-keywords=&amp;amp;field-author=&amp;amp;field-title=Symfony&amp;amp;field-isbn=&amp;amp;field-publisher=&amp;amp;node=&amp;amp;url=&amp;amp;field-feature_browse-bin=&amp;amp;field-binding_browse-bin=&amp;amp;field-subject=&amp;amp;field-language=English&amp;amp;field-dateop=After&amp;amp;field-datemod=&amp;amp;field-dateyear=2007&amp;amp;sort=relevancerank&amp;amp;Adv-Srch-Books-Submit.x=0&amp;amp;Adv-Srch-Books-Submit.y=0"&gt;see the books&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://cakephp.org/"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 198px; height: 160px;" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/StRlkyEb3xI/AAAAAAAAAjo/aO4gvwtOVEI/s400/cakephp.jpg" alt="" id="BLOGGER_PHOTO_ID_5392046336459398930" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;CakePHP - 3 books (&lt;a href="http://www.amazon.com/gp/search/ref=sr_adv_b/?search-alias=stripbooks&amp;amp;unfiltered=1&amp;amp;field-keywords=&amp;amp;field-author=&amp;amp;field-title=cakephp&amp;amp;field-isbn=&amp;amp;field-publisher=&amp;amp;node=&amp;amp;url=&amp;amp;field-feature_browse-bin=&amp;amp;field-binding_browse-bin=&amp;amp;field-subject=&amp;amp;field-language=English&amp;amp;field-dateop=After&amp;amp;field-datemod=&amp;amp;field-dateyear=2007&amp;amp;sort=relevancerank&amp;amp;Adv-Srch-Books-Submit.x=16&amp;amp;Adv-Srch-Books-Submit.y=11"&gt;see the books&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://codeigniter.com/"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 137px; height: 189px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/StRmNejmu9I/AAAAAAAAAjw/nLPSfscrV3w/s400/codeigniter.png" alt="" id="BLOGGER_PHOTO_ID_5392047035596061650" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;CodeIgniter - 2 book (&lt;a href="http://www.amazon.com/gp/search/ref=sr_adv_b/?search-alias=stripbooks&amp;amp;unfiltered=1&amp;amp;field-keywords=&amp;amp;field-author=&amp;amp;field-title=CodeIgniter&amp;amp;field-isbn=&amp;amp;field-publisher=&amp;amp;node=&amp;amp;url=&amp;amp;field-feature_browse-bin=&amp;amp;field-binding_browse-bin=&amp;amp;field-subject=&amp;amp;field-language=English&amp;amp;field-dateop=After&amp;amp;field-datemod=&amp;amp;field-dateyear=2007&amp;amp;sort=relevancerank&amp;amp;Adv-Srch-Books-Submit.x=42&amp;amp;Adv-Srch-Books-Submit.y=5"&gt;see the books&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.pradosoft.com/"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 135px; height: 55px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/StRm6wz2EHI/AAAAAAAAAkA/afcdtpGxZ2I/s400/prado.png" alt="" id="BLOGGER_PHOTO_ID_5392047813590126706" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Prado - 0 books (&lt;a href="http://www.amazon.com/gp/search/ref=sr_adv_b/?search-alias=stripbooks&amp;amp;unfiltered=1&amp;amp;field-keywords=&amp;amp;field-author=&amp;amp;field-title=prado&amp;amp;field-isbn=&amp;amp;field-publisher=&amp;amp;node=&amp;amp;url=&amp;amp;field-feature_browse-bin=&amp;amp;field-binding_browse-bin=&amp;amp;field-subject=&amp;amp;field-language=English&amp;amp;field-dateop=After&amp;amp;field-datemod=&amp;amp;field-dateyear=2007&amp;amp;sort=relevancerank&amp;amp;Adv-Srch-Books-Submit.x=0&amp;amp;Adv-Srch-Books-Submit.y=0"&gt;see the books&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;My personal opinion&lt;/h3&gt;&lt;div style="text-align: justify;"&gt;From my perspective, the experience that I had with Prado (I used v. 3.1.4) was the worst one, although it's concept was interesting.  I found it difficult to learn and use, because the documentation was sparse, there were not many tutorials, and even if  I was wiling to invest some money and buy a book about it, I could not find any books about it.&lt;br /&gt;&lt;br /&gt;After Prado I tried CakePHP (I was using v. 1.2). I found it very good, easy to learn and fast to use, as long as  I adhered to all the naming conventions. Especially, I liked the ORM (Object-Relational Mapping) which was very useful and saved me a lot of time. The problem I had with it, was that it uses PHP 4, which already has been discontinued. Off course, sooner or later CakePHP will move to PHP 5, but I  wanted to use a PHP 5.  I think it would be better to use something in PHP 5, rather than something that is developed in a version of language that is already not supported. Off course, CakePHP runs smoothly on PHP 5. It is only CakePHP's core that does not use features of PHP 5. Additionally, I wanted to have more freedom when programming, and CakePHP does not allow for much of it  due to it's "convention over configuration paradigm". But this is a price that you pay in CakePHP.&lt;br /&gt;&lt;br /&gt;At the moment I'm learning Zend Framework v1.9 which is build using PHP 5. For now,  I can say that it is definitely more difficult to learn at the beginning. The biggest issue that I had at the beginning, and still have but to a lesser extend, is a bootstrap class, which is difficult to understand. It really took me a long time to begin to understand how to use it at the simplest level. However, what I like is, that Zend Framework is less rigid than CakePHP, it uses PHP 5, and it has a vast number of tools (e.g. for working with PDF files or captcha) that CakePHP does not have.&lt;br /&gt;&lt;br /&gt;I don't have experience with Symfony and CodeIgniter, so I cannot say anything apart from what I read in the Internet. CodeIgniter is considered to be faster than CakePHP and just like CakePHP, it is written for PHP 4, whereas Symfony is for PHP 5 only.&lt;br /&gt;&lt;br /&gt;In conclusion, it seems that when you look only at the number of books on a given framework, Zend Framework is the winner with eight books. At the moment, I'm trying to get to know it, hopping that it will not be a waste of time. It must be remembered though, that there are many other criteria that can be used to compare PHP frameworks. However the final decision which framework to choose, if any, should be based on the specific needs of a project that we want to developed.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8949092971487022687?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8949092971487022687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/09/top-php-frameworks-in-terms-of-number.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8949092971487022687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8949092971487022687'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/09/top-php-frameworks-in-terms-of-number.html' title='TOP PHP frameworks in terms of number of books published on a given framework'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StR-yNaBNLI/AAAAAAAAAkQ/nfnKfVHTiuY/s72-c/example_amazon_book_search.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4731188555963429451</id><published>2009-09-15T16:40:00.001-07:00</published><updated>2009-10-22T00:49:46.588-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='imagemagick'/><title type='text'>imagemagick: resize all image files in a current folder</title><content type='html'>Example:&lt;code&gt;mogrify -resize 60% *.JPG&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4731188555963429451?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4731188555963429451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/09/imagemagick-resize-all-image-files-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4731188555963429451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4731188555963429451'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/09/imagemagick-resize-all-image-files-in.html' title='imagemagick: resize all image files in a current folder'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4640227004754713148</id><published>2009-09-01T17:51:00.000-07:00</published><updated>2009-12-09T17:07:37.220-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Arch linux: RGB to CMYK</title><content type='html'>To convert RGB files to CMYK files (for printing) one can install &lt;a href="http://cue.yellowmagic.info/softwares/separate.html"&gt;Separate+&lt;/a&gt; Gimp plugin. &lt;br /&gt;&lt;br /&gt;My gimp version was 2.6.6. I downloaded Separate+ plugin sources (now version 0.54)  and unpacked them. Than I installed littleCMS library &lt;code&gt;sudo pacman -S lcms&lt;/code&gt;. After that I compiled the Separate+ plugin and installed it: &lt;code&gt;make&lt;br /&gt;sudo make install&lt;/code&gt; I also needed Adobe ICC Profiles that can be found &lt;a href="http://www.adobe.com/support/downloads/detail.jsp?ftpID=4075"&gt;here&lt;/a&gt; (does not meter that they are for Windows). I unpacked the downloaded archive and I copied the contents of RGB and CMYK folders to usr/share/color/icc/ folder. That's it!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/Sp3DfcnkolI/AAAAAAAAAh4/DC4sQHAN3SA/s1600-h/Screenshot.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 303px; height: 400px;" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/Sp3DfcnkolI/AAAAAAAAAh4/DC4sQHAN3SA/s400/Screenshot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5376668475175772754" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4640227004754713148?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4640227004754713148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/09/arch-linux-rgb-to-cmyk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4640227004754713148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4640227004754713148'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/09/arch-linux-rgb-to-cmyk.html' title='Arch linux: RGB to CMYK'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qvZ1h1bgBRo/Sp3DfcnkolI/AAAAAAAAAh4/DC4sQHAN3SA/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8795153772276114771</id><published>2009-07-28T03:16:00.000-07:00</published><updated>2009-07-28T03:22:17.834-07:00</updated><title type='text'>Firefox: images don't load but work everywhere else</title><content type='html'>I had problem with one of my sites. When testing on firefox, some banners did not load. My site was sponsored so I had sponsors banners on my front page. The banners were located on the localhost i.e. &lt;code&gt;&amp;lt;img alt="toyto logo" src="./images/sponsors/toyota.gif" /&amp;gt;&lt;br /&gt;&amp;lt;img alt="honda logo" src="./images/sponsors/honda.gif" /&amp;gt;&lt;/code&gt;Of course everything was fine in IE, Opera an Safari. &lt;br /&gt;&lt;br /&gt;I found that my AdBlock Plus was blocking my banners because the following default filter in AdBlock Plus &lt;code&gt;/[/^a-ik-z\d=+](get|web)?_?spons?(or(ed|s))?_?(links?(auto)?)?(pots?)?(\W|_|$)(?!.*sigalert)/&lt;/code&gt;The solution was to rename sponsors folder on my server to something else. I choose to rename it to friends. It worked.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8795153772276114771?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8795153772276114771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/firefox-images-dont-load-but-work.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8795153772276114771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8795153772276114771'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/firefox-images-dont-load-but-work.html' title='Firefox: images don&apos;t load but work everywhere else'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-2152790470902401545</id><published>2009-07-22T00:52:00.000-07:00</published><updated>2009-10-22T00:56:09.308-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>bash: check size of all folders in a given directory</title><content type='html'>&lt;h4&gt;To list all folders in a given path &lt;/h4&gt; this can be used&lt;code&gt;for f in ./* ; do if [ -d "$f" ]; then echo $f  ; fi done;&lt;/code&gt;&lt;h4&gt;To list sizes of all folders in a given path &lt;/h4&gt;To check the size of all folders in the current directory the above can be modified to use du -sh "$f" command: &lt;code&gt;  for f in * ; do if [ -d "$f" ]; then du -sh "$f"  ; fi done;&lt;/code&gt;The command goes in a loop on every file in a current dir and if a given file is a directory, than the size is calculated.  &lt;h4&gt;To sort by folder size&lt;/h4&gt;&lt;code&gt; for f in * ; do if [ -d "$f" ]; then du -s "$f"  ; fi done | sort -n&lt;/code&gt;Note that in du command there is no -h option!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-2152790470902401545?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/2152790470902401545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/bash-check-size-of-all-folders-in-given.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/2152790470902401545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/2152790470902401545'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/bash-check-size-of-all-folders-in-given.html' title='bash: check size of all folders in a given directory'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8752452305304192055</id><published>2009-07-20T20:26:00.000-07:00</published><updated>2009-07-20T20:32:00.414-07:00</updated><title type='text'>Using rsync to transfer files and directories from server</title><content type='html'>&lt;h4&gt;A file from a server to the local computer&lt;/h4&gt;&lt;code&gt; rsync -v -e ssh W@server:~/some_file.tar.gz ~/local_dir&lt;/code&gt;&lt;h4&gt;A directory from a server to the local computer&lt;/h4&gt;&lt;code&gt; rsync -r -v -e ssh W@server:~/some_directory ~/local_dir&lt;/code&gt; Other info is &lt;a href="http://www.cyberciti.biz/tips/linux-use-rsync-transfer-mirror-files-directories.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8752452305304192055?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8752452305304192055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/using-rsync-to-transfer-files-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8752452305304192055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8752452305304192055'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/using-rsync-to-transfer-files-and.html' title='Using rsync to transfer files and directories from server'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3051212381292225533</id><published>2009-07-09T03:23:00.000-07:00</published><updated>2009-10-27T21:56:15.151-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>VirtualBox on CentOS 5.3: port forwarding</title><content type='html'>I have &lt;a href="http://shortrecipes.blogspot.com/2009/07/install-virtualbox-on-centos-5.html"&gt;installed&lt;/a&gt; VirtualBox 2.2.4 on a CentOS 5.3. As a guest OS I installed Ubuntu, and on that Ubuntu I made a LAMP server. So, what I wanted was to &lt;b&gt;redirect all html requrest on port 80 of CentOS (host) to port 80 of Ubuntu (guest)&lt;/b&gt;. This is similar problem to the previously described on &lt;a href="http://shortrecipes.blogspot.com/2009/01/virtualbox-port-forwarding.html"&gt;Windows XP host&lt;/a&gt;. The difference is that this time my host was CentOS 5.3, and &lt;b&gt;VirtualBox was running as a normal user&lt;/b&gt;, not as a root.&lt;br /&gt;&lt;br /&gt;The first thing to do was to make VirtualBox to forward the ports. I did it by executing the following commands, as a normal user under which VirtulBox was running. &lt;code&gt;VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/Protocol" TCP&lt;br /&gt;VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/GuestPort" 80&lt;br /&gt;VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/HostPort" 80&lt;/code&gt; where "ubuntu-server" is the name of Ubuntu guest.&lt;br /&gt;&lt;br /&gt;Than I wanted to start it in a headless mode&lt;code&gt;VBoxHeadless -s ubuntu-server &lt;/code&gt; but I was getting the following error:&lt;code&gt;Error: failed to start machine. Error message: NAT#0: configuration error: failed to set up redirection of 80 to 10.0.2.15:80. Probably a conflict with existing services or other rules (VERR_NAT_REDIR_SETUP).&lt;br /&gt;Unknown error creating VM (VERR_NAT_REDIR_SETUP)&lt;/code&gt;This error is due to the fact that in Linux systems &lt;b&gt;only root can bind to ports below 1024&lt;/b&gt;, and not a normal user!. There are two possible solutions. First is to run VirtualBox as a root, the second is to redirect port 80 to port 8080 in the CentOS and the make VirtualBox to get connection from port 8080 of CentOS. I choose the second option. Therefore, I did as follows:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;code&gt;VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/Protocol" TCP&lt;br /&gt;VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/GuestPort" 80&lt;br /&gt;VBoxManage setextradata "ubuntu-server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/HostPort" &lt;b&gt;8080&lt;/b&gt;&lt;/code&gt; The above makes VirtualBox to redirect trafic from 8080 of CentOS to 80 of guest ubuntu-server. Than as a root I used &lt;a href="http://en.wikipedia.org/wiki/Iptables"&gt;iptables&lt;/a&gt; to redirect port 80 to 8080 in CentOS &lt;code&gt;iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080&lt;/code&gt;To check if iptables command was succesfull I used &lt;span style="font-style: italic;"&gt;iptables -t nat -L&lt;/span&gt; command&lt;code&gt;iptables -t nat -L&lt;br /&gt;Chain PREROUTING (policy ACCEPT)&lt;br /&gt;target     prot opt source               destination       &lt;br /&gt;REDIRECT   tcp  --  anywhere             anywhere            tcp dpt:http redir ports 8080&lt;br /&gt;&lt;br /&gt;Chain POSTROUTING (policy ACCEPT)&lt;br /&gt;target     prot opt source               destination       &lt;br /&gt;&lt;br /&gt;Chain OUTPUT (policy ACCEPT)&lt;br /&gt;target     prot opt source               destination  &lt;/code&gt;If OK save your iptables settings using&lt;code&gt;sudo /etc/init.d/iptables save&lt;/code&gt;Hope it will be useful. I also used VirtualBox 2.2, rather then VirtualBox 3.0, but I think the procedure will be similar.&lt;br /&gt;&lt;br /&gt;The schematic illustration of what I did is below:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SufOERGupjI/AAAAAAAAAoA/uaUUqOYkSWI/s1600-h/VirtualBox_Centos.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SufOERGupjI/AAAAAAAAAoA/uaUUqOYkSWI/s400/VirtualBox_Centos.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3051212381292225533?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3051212381292225533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/virtualbox-on-centos-53.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3051212381292225533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3051212381292225533'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/virtualbox-on-centos-53.html' title='VirtualBox on CentOS 5.3: port forwarding'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qvZ1h1bgBRo/SufOERGupjI/AAAAAAAAAoA/uaUUqOYkSWI/s72-c/VirtualBox_Centos.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-5816683389714454521</id><published>2009-07-08T03:48:00.000-07:00</published><updated>2009-10-22T01:12:16.376-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><title type='text'>Install VirtualBox on CentOS 5</title><content type='html'>Go to the conclusions if you have no time for BS. If you have time the details of my installation of VirtualBox 2.2.4 on CentOS 5.3 are below.&lt;br /&gt;&lt;br /&gt;1. I downloaded VirtuaBox rpm form &lt;a href="http://www.virtualbox.org/wiki/Downloads"&gt;virtualbox.org&lt;/a&gt;. In my case I downloaded VirtualBox-2.2.4_47978_rhel5-1.i386.rpm&lt;br /&gt;&lt;br /&gt;2. Installed the rpm as a root&lt;code&gt;su root -c "rpm -ivh VirtualBox-2.2.4_47978_rhel5-1.i386.rpm"&lt;br /&gt;&lt;/code&gt; But I got the error&lt;code&gt;error: Failed dependencies:&lt;br /&gt;  libSDL-1.2.so.0 is needed by VirtualBox-2.2.4_47978_rhel5-1.i386&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;3. So I installed SDL &lt;code&gt;su root -c "yum install SDL"&lt;/code&gt; and I tried again &lt;code&gt;su root -c "rpm -ivh VirtualBox-2.2.4_47978_rhel5-1.i386.rpm"&lt;/code&gt; and the installation failed &lt;code&gt;Preparing...                ########################################### [100%]&lt;br /&gt;1:VirtualBox             ########################################### [100%]&lt;br /&gt;&lt;br /&gt;Creating group 'vboxusers'. VM users must be member of that group!&lt;br /&gt;&lt;br /&gt;No precompiled module for this kernel found -- trying to build one. Messages&lt;br /&gt;emitted during module compilation will be logged to /var/log/vbox-install.log.&lt;br /&gt;&lt;br /&gt;Compilation of the kernel module FAILED! VirtualBox will not start until this&lt;br /&gt;problem is fixed. Please consult /var/log/vbox-install.log to find out why the&lt;br /&gt;kernel module does not compile. Most probably the kernel sources are not found.&lt;br /&gt;Install them and execute&lt;br /&gt;&lt;br /&gt;/etc/init.d/vboxdrv setup&lt;br /&gt;&lt;br /&gt;as root.&lt;/code&gt; The reason is that kernel-headers and kernel-develop packages were missing, so I installed them &lt;code&gt;su root -c "yum install kernel-headers kernel-devel"&lt;/code&gt; Be sure that the install packages correspond to your kernel version! You can check this as follows: &lt;code&gt;[W@localhost ~]$ uname -a&lt;br /&gt;Linux localhost.localdomain 2.6.18-128.1.16.el5 #1 SMP Tue Jun 30 06:10:28 EDT 2009 i686 i686 i386 GNU/Linux&lt;br /&gt;[W@localhost ~]$ rpm -q kernel-headers kernel-devel&lt;br /&gt;kernel-headers-2.6.18-128.1.16.el5&lt;br /&gt;kernel-devel-2.6.18-128.1.16.el5&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;4. I removed failed installation of VirtualBox &lt;code&gt;su root -c "rpm -e VirtualBox-2.2.4_47978_rhel5-1.i386"&lt;/code&gt; and I tried again to install it. Again I got the same error. But this time the reason was that I did not have gcc installed. So I installed it &lt;code&gt;su root -c "yum install gcc"&lt;/code&gt;, removed failed installation of VirtualBox and tried again to install it: &lt;code&gt;[W@localhost ~]$ su root -c "rpm -ivh VirtualBox-2.2.4_47978_rhel5-1.i386.rpm"&lt;br /&gt;Password:&lt;br /&gt;Preparing...                ########################################### [100%]&lt;br /&gt;1:VirtualBox             ########################################### [100%]&lt;br /&gt;&lt;br /&gt;Creating group 'vboxusers'. VM users must be member of that group!&lt;br /&gt;&lt;br /&gt;No precompiled module for this kernel found -- trying to build one. Messages&lt;br /&gt;emitted during module compilation will be logged to /var/log/vbox-install.log.&lt;br /&gt;&lt;br /&gt;Success!&lt;br /&gt;&lt;/code&gt; This time it worked!!&lt;h3&gt;Concussion&lt;/h3&gt; First, download VirtualBox from &lt;a href="http://www.virtualbox.org/wiki/Downloads"&gt;virtualbox.org&lt;/a&gt;. Second, install four missing packages (at least I did not have these packages installed, they are on CentOS CDs/DVD, you can use pirut or yum to install them)  &lt;code&gt;su root -c "yum install SDL kernel-devel kernel-headers gcc"&lt;/code&gt; Third, install VirtualBox &lt;code&gt;su root -c "rpm -e VirtualBox-2.2.4_47978_rhel5-1.i386"&lt;/code&gt; Fourth, add yourself to the vboxusers group &lt;code&gt;su root -c "/usr/sbin/usermod -a -G vboxusers yourusername"&lt;/code&gt;Finally, start VirtualBox:&lt;code&gt;[W@localhost ~]$ VirtualBox &lt;/code&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SlXZNArapKI/AAAAAAAAAhs/ncOJyfM0xOg/s1600-h/VirtualBox_on_CentOS.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 291px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SlXZNArapKI/AAAAAAAAAhs/ncOJyfM0xOg/s400/VirtualBox_on_CentOS.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5356426149370700962" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-5816683389714454521?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/5816683389714454521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/install-virtualbox-on-centos-5.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5816683389714454521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5816683389714454521'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/install-virtualbox-on-centos-5.html' title='Install VirtualBox on CentOS 5'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/SlXZNArapKI/AAAAAAAAAhs/ncOJyfM0xOg/s72-c/VirtualBox_on_CentOS.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-5673754999587998937</id><published>2009-07-06T21:30:00.000-07:00</published><updated>2009-10-22T00:59:28.611-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><title type='text'>Update of CentOS 5.2 to CentOS 5.3</title><content type='html'>There was no problems with the update. I just followed the &lt;a href="http://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.3"&gt;instructions&lt;/a&gt;. Most importantly, after the update to CentOS 5.3, applications previously installed in CentOS 5.2 worked (i.e. Ansys 11SP1, Matlab 2008b, Mathematica 7, Abaqus 6.8).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-5673754999587998937?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/5673754999587998937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/update-of-centos-52-to-centos-53.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5673754999587998937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5673754999587998937'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/update-of-centos-52-to-centos-53.html' title='Update of CentOS 5.2 to CentOS 5.3'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1751959476093681030</id><published>2009-07-01T00:23:00.000-07:00</published><updated>2009-10-22T01:09:29.657-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>ssh -X Error: Can't open display:</title><content type='html'>The error occurred when I was accessing a server (Arch linux) from a desktop (Mac X) using ssh -X username@serverip. In other words I wanted to X forward some apps from server to my desktop. First thing to do, I checked whether $DISPLAY variable on the server was set&lt;code&gt;echo $DISPLAY&lt;/code&gt;It was not. Then I checked the setting of my ssh daemon (sshd) on the server in /etc/ssh/sshd_config. I found that option X11Forwarding was not set, so I set it to&lt;code&gt;X11Forwarding yes&lt;/code&gt; and I restarted the sshd. After this I logged in to the server again using ssh -X and this time &lt;code&gt;echo $DISPLAY&lt;br /&gt;localhost:11.0&lt;/code&gt; Now X forwarding was working! It appears that $DISPLAY does not have to point to my desktop.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1751959476093681030?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1751959476093681030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/ssh-x-error-cant-open-display.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1751959476093681030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1751959476093681030'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/07/ssh-x-error-cant-open-display.html' title='ssh -X Error: Can&apos;t open display:'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3966654090378832120</id><published>2009-06-30T01:42:00.000-07:00</published><updated>2009-10-22T01:09:29.657-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>wine: remove Wine gnome menu</title><content type='html'>In my system (Arch Linux) after removing wine (sudo pacman -R wine), the Wine gnome menu was still in the Gnome Menus. To remove it, I had to delete it manualy from my .local folder:&lt;code&gt;rm -rvf ~/.local/share/applications/wine&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3966654090378832120?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3966654090378832120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/06/wine-remove-wine-gnome-menu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3966654090378832120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3966654090378832120'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/06/wine-remove-wine-gnome-menu.html' title='wine: remove Wine gnome menu'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6207468081054915482</id><published>2009-06-18T00:08:00.000-07:00</published><updated>2009-12-10T01:42:15.983-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>python: numbers starting with zero are octagonal</title><content type='html'>I was debugging my script and I found that a number that starts from zero is different that the number without zero. This is because these numbers are octal literals. For example &lt;code&gt;In [1]: a=23&lt;br /&gt;In [2]: b=023&lt;br /&gt;In [3]: a==b&lt;br /&gt;Out[3]: False&lt;br /&gt;In [4]: print a,b&lt;br /&gt;23 19&lt;/code&gt;It appears that when a number starts from zero it is treated as an &lt;a href="http://en.wikipedia.org/wiki/Octagonal_number"&gt;octagonal&lt;/a&gt; number rather than &lt;a href="http://en.wikipedia.org/wiki/Decimal_number"&gt;decimal&lt;/a&gt; number. Good to know, as it is easy to make mistake.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6207468081054915482?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6207468081054915482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/06/python-numbers-starting-with-zero-are.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6207468081054915482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6207468081054915482'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/06/python-numbers-starting-with-zero-are.html' title='python: numbers starting with zero are octagonal'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6031742058082705388</id><published>2009-06-17T00:50:00.000-07:00</published><updated>2009-10-22T00:57:52.947-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>CentoOS: problem to install Abacus 6.8</title><content type='html'>&lt;div style="text-align: justify;"&gt;When I was installing Abacus 6.8 on CentOS 5.2 x86_64 I run into three problems. The first one was that installation script did not recognize my Linux distribution (i.e. CentOS 5.2), the second was that that after successful installation, I could not start freshly installed abacus because of missing one library, and the last problem was that the GUI would not start. Below more details on these problems are given, along with my solutions to them.&lt;br /&gt;&lt;/div&gt;&lt;h4&gt;1. Unable to determine Linux Distribution&lt;/h4&gt;&lt;div style="text-align: justify;"&gt;When a user (or a root) wants to install Abacus 6.8 on CentOS 5.2, at the beginning of installation process the error appears: "Unable to determine Linux Distribution". In another words, CentOS is not supported and the user should use Red Hat Enterprise or SuSE. The full list of the supported distributions is in the contents of the error and the error itself is shown below:&lt;/div&gt;&lt;code&gt;Checking system requirements for installation.  This will&lt;br /&gt;take just a moment...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;***ERROR:  One or more system tests have failed the minimum installation&lt;br /&gt;requirements. The installation procedure will not continue.&lt;br /&gt;Hit &lt;enter&gt; to view the output from this system check.&lt;br /&gt;&lt;br /&gt;Checking for GNU Lib C version 2.3.2 or newer.&lt;br /&gt;Pass - Found GNU Lib C Version 2.5.&lt;br /&gt;WARNING: Problem parsing /etc/redhat-release to determine version of Red Hat.&lt;br /&gt;&lt;br /&gt;Running system configuration checks for Linux/x86-64.&lt;br /&gt;Please wait until all the needed information has been gathered...&lt;br /&gt;&lt;br /&gt;System requirement status is:&lt;br /&gt;&lt;br /&gt;Requirement:          SuSE 9.3, 10.0, 10.1 or 10.2, SuSE Enterprise Linux 9.0&lt;br /&gt;        or 10.0, SuSE Enterprise Desktop 10, Red Hat Enterprise&lt;br /&gt;        3.0, 4.0 or 5.0, or Fedora Core 6.0&lt;br /&gt;Products:             All Abaqus Products&lt;br /&gt;Status:               Fail - Unable to determine Linux Distribution.&lt;br /&gt;&lt;br /&gt;Requirement:          GNU Lib C 2.3.2 or greater&lt;br /&gt;Products:             All Abaqus Products&lt;br /&gt;Status:               Pass - Found GNU Lib C 2.5, which was installed with&lt;br /&gt;        glibc-2.5-24.rpm.&lt;br /&gt;&lt;br /&gt;Not all requirement checks succeeded.&lt;/enter&gt;&lt;/code&gt;The solution to this problem is quite easy. After going through some installation scripts, I found that, they relay on the file /etc/redhat-release. This file can be found in RHEL and CentOS. Therefore, instalation script checks the contents of this file, and if it does not find something familiar e.g. Red Hat Enterprise Linux AS 5, the error occurs and the installation stops. In CentOS 5.2. the contents of this file is just one line:&lt;code&gt;[W@localhost ~]$ cat /etc/redhat-release&lt;br /&gt;CentOS release 5.2 (Final)&lt;/code&gt;Therefore, what can be done is to change this file temporary, just for the purpose of the installation of Abacus. I just add  "Red Hat Enterprise Linux AS 5" as a second line /etc/redhat-release and the installation script should worked.&lt;br /&gt;The installation went good, no more problems. The other two problems occurred after successful installation, when I wanted to start Abaqus. &lt;h4&gt;Error while loading shared libraries: libstdc++.so.5&lt;/h4&gt;I installed Abaqus in /opt/abaqus68. During the first attempt to start Abaqus CAE or Viewer I got the error that there are was no libstdc++.so.5 library:&lt;code&gt;[W@localhost ~]$ /opt/abaqus68/Commands/abq682 cae&lt;br /&gt;/opt/abaqus68/6.8-2/exec/ABQcaeK.exe: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory&lt;br /&gt;Abaqus Error: Abaqus/CAE Kernel exited with an error.&lt;/code&gt;This problem was easily solved, because CentOS 5.2 DVD comes with this library. So, I just installed it using pirut. To be specific I installed the following rpm: compat-ibstdc++-33-3.2.3-61.x86_64&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/Se6iwI5EmxI/AAAAAAAAAf8/yWvJyIvIlDI/s1600-h/libstdc.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 31px;" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/Se6iwI5EmxI/AAAAAAAAAf8/yWvJyIvIlDI/s400/libstdc.png" alt="" id="BLOGGER_PHOTO_ID_5327374357130156818" border="0" /&gt;&lt;/a&gt;&lt;h4&gt;Insufficient system resource available.&lt;/h4&gt;After installing the missing library, the finall error was "ValueError: Insufficient system resource available."&lt;code&gt;[W@localhost ~]$ /opt/abaqus68/Commands/abq682 cea&lt;br /&gt;Abaqus License Manager checked out the following license(s):&lt;br /&gt;"cae" version 6.8 from abaqus.some.example.com&lt;br /&gt;&lt;6&gt;.&lt;br /&gt;ValueError: Insufficient system resource available.&lt;br /&gt;&lt;br /&gt;Abaqus Error: Abaqus/CAE Kernel exited with an error.&lt;br /&gt;Abaqus Error: Abaqus/Viewer exited with an error&lt;/code&gt;This problem has something to do with X11 server and graphics &lt;a href="http://simulia.custhelp.com/cgi-bin/abaqus.cfg/php/enduser/std_adp.php?p_faqid=1249&amp;amp;p_created=1057610402"&gt;hardware acceleration&lt;/a&gt;. My server does not have 3D graphic card, so no chance for hardware acceleration. The solution was to disable it by starting abaqus with and option -mesa:&lt;code&gt;/opt/abaqus68/Commands/abq682 cae -mesa&lt;/code&gt;or&lt;code&gt;/opt/abaqus68/Commands/abq682 viewer -mesa&lt;/code&gt;Finnaly, after some time spent on installing and starting Abaqus I and other users could use it:&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Se6lOFAvLlI/AAAAAAAAAgM/hB-Yem-tDXE/s1600-h/abaqus_on_centos.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 240px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Se6lOFAvLlI/AAAAAAAAAgM/hB-Yem-tDXE/s400/abaqus_on_centos.png" alt="" id="BLOGGER_PHOTO_ID_5327377070507896402" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6031742058082705388?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6031742058082705388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/centoos-problem-to-install-abacus-68.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6031742058082705388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6031742058082705388'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/centoos-problem-to-install-abacus-68.html' title='CentoOS: problem to install Abacus 6.8'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qvZ1h1bgBRo/Se6iwI5EmxI/AAAAAAAAAf8/yWvJyIvIlDI/s72-c/libstdc.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4871367697251704060</id><published>2009-06-15T16:43:00.000-07:00</published><updated>2009-10-22T00:58:43.678-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Kyoto subway</title><content type='html'>Recently I visited Kyoto (Japan) for business. Before the visit I was looking for some info about how to use subway, if there are English signs and is it easy to use for a foreigner (yes, &lt;span style="font-weight: bold;"&gt;its very easy&lt;/span&gt;!). I could not found much info about this, so when I was in Kyoto I decided to take some pictures of Kyoto subway station next to my hotel.&lt;br /&gt;&lt;br /&gt;I was using everyday &lt;a href="http://en.wikipedia.org/wiki/Karasuma_Line"&gt;Karasuma Line&lt;/a&gt; to get from my hotel (i.e. &lt;a href="http://www.gimmond.co.jp/kyoto/english/e_index.html"&gt;Gimmond hotel&lt;/a&gt; - it have no complains about this hotel) to my destination. The Gimmond hotel is  just next to station K08 (i.e. Karasuma Oike). So I took some pictures from this station:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SrAo14fmrUI/AAAAAAAAAiY/0wI2vbq8Gvc/s1600-h/kyoto_subway_tickets.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SrAo14fmrUI/AAAAAAAAAiY/0wI2vbq8Gvc/s400/kyoto_subway_tickets.JPG" alt="" id="BLOGGER_PHOTO_ID_5381846460870864194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SrAo1hCHuuI/AAAAAAAAAiQ/0a9YOTxUKVU/s1600-h/kyoto_subway.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SrAo1hCHuuI/AAAAAAAAAiQ/0a9YOTxUKVU/s400/kyoto_subway.JPG" alt="" id="BLOGGER_PHOTO_ID_5381846454573185762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SrAo1Lb_23I/AAAAAAAAAiI/YqTx4GxJOiE/s1600-h/kyoto_subway_time_schedule.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SrAo1Lb_23I/AAAAAAAAAiI/YqTx4GxJOiE/s400/kyoto_subway_time_schedule.JPG" alt="" id="BLOGGER_PHOTO_ID_5381846448776141682" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Kyoto subway map&lt;/h3&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SrAslCK8VzI/AAAAAAAAAjA/yD-Lq7azb4M/s1600-h/kyoto-subway-map-1.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 358px; height: 400px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SrAslCK8VzI/AAAAAAAAAjA/yD-Lq7azb4M/s400/kyoto-subway-map-1.gif" alt="" id="BLOGGER_PHOTO_ID_5381850569457293106" border="0" /&gt;&lt;/a&gt;This map is taken from &lt;a href="http://www.city.kyoto.jp/koho/eng/access/transport.html"&gt;this website&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Buying tickets&lt;/h3&gt;&lt;br /&gt;To my surprise using tickets wending machines, buying tickets and using subway was very easy. So I was basically traveling from station K08 to station K01 (the cost was 280 yen) and from K08 to K11 (i.e. main Kyoto station, cost 210 yen).  So to use the subway we off course need to buy tickets. This is done using tickets vending machines available on each station:&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SrAprXIhvRI/AAAAAAAAAig/6g8wTjNyrWw/s1600-h/kyoto_subway_tickets.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SrAprXIhvRI/AAAAAAAAAig/6g8wTjNyrWw/s400/kyoto_subway_tickets.JPG" alt="" id="BLOGGER_PHOTO_ID_5381847379628637458" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;To buy tickets  it: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. First check how expensive tickets you have to buy for your destination. You do this buy analysis subway map board above the wending machines (see above picture).&lt;br /&gt;&lt;br /&gt;2. Put required amount of money to the wending machine. You can put more. For example if you want to go from K08 to K01 it costs 280 yen. You can put 500 yen coin or a 1000 yen bill into the wending machine or more. The machine will return you the change.&lt;br /&gt;&lt;br /&gt;3. Once you put some money into the machine, the machine shows you the available tickets for this price: &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SrAq_3GztuI/AAAAAAAAAio/pIviIGHcpf0/s1600-h/kyoto_subway_ticket_machine01.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SrAq_3GztuI/AAAAAAAAAio/pIviIGHcpf0/s400/kyoto_subway_ticket_machine01.JPG" alt="" id="BLOGGER_PHOTO_ID_5381848831320372962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;4. You select thicket that you want and you collect the ticket and change if necessary:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SrArPfN48zI/AAAAAAAAAiw/asA3IJQWRh4/s1600-h/kyoto_subway_ticket_machine03.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SrArPfN48zI/AAAAAAAAAiw/asA3IJQWRh4/s400/kyoto_subway_ticket_machine03.JPG" alt="" id="BLOGGER_PHOTO_ID_5381849099785532210" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;5. When you have tickets you go to subway gates and use it there to "tag in". At your destination you use it again to "tag off". Or just follow the crowd:-) It's worth noticing that at the destination station when you "tag off" your tickets is automatically taken by the gate, so you loose it. If you want to keep it and have a recite, because for example you want a refund from your  company for the tickets, you should not "tag off" using gates. Instead go to a booth next to the gates, there will be a subway stuff person and ask him for a &lt;span style="font-weight: bold;"&gt;recite&lt;/span&gt;. He will give you a red, rectangular stump on your ticket (see below):&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SrAsaLr86ZI/AAAAAAAAAi4/zo5IKhgyX6w/s1600-h/kyoto_subway_tickets_gates01.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SrAsaLr86ZI/AAAAAAAAAi4/zo5IKhgyX6w/s400/kyoto_subway_tickets_gates01.JPG" alt="" id="BLOGGER_PHOTO_ID_5381850383033100690" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SrAvu1O9YyI/AAAAAAAAAjI/sAhk3sLnGCo/s1600-h/ticket.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 259px; height: 131px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SrAvu1O9YyI/AAAAAAAAAjI/sAhk3sLnGCo/s400/ticket.jpg" alt="" id="BLOGGER_PHOTO_ID_5381854036318053154" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Basically there are no problems using the subway in Kyoto. There are plenty of English signs next to Japanese ones, so everyone that knows a little bit of English should be fine. The only challenge at the very beginning might be buying tickets, but I hope that my post will help with this.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Some other sites in English about Kyoto public transport&lt;/h3&gt;http://www.city.kyoto.jp/koho/eng/access/transport.html&lt;br /&gt;http://www.japanvisitor.com/index.php?cID=424&amp;amp;pID=1730&lt;br /&gt;http://urbanrail.fotopic.net/c1174303.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4871367697251704060?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4871367697251704060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/09/kyoto-subway.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4871367697251704060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4871367697251704060'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/09/kyoto-subway.html' title='Kyoto subway'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/SrAo14fmrUI/AAAAAAAAAiY/0wI2vbq8Gvc/s72-c/kyoto_subway_tickets.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7514728643804258356</id><published>2009-06-14T23:11:00.000-07:00</published><updated>2009-10-22T01:09:29.657-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Mathematica: xset:  bad font path element (#23)</title><content type='html'>I have Mathematica 7.0 installed on a Linux server with CentOS 5.2. I'm using my PC (now Arch Linux) to x forwad (ssh -Y login@server) mathematica  from the server to my PC. Unfortunately I was getting error &lt;code&gt;xset:  bad font path element (#23), possible causes are:&lt;br /&gt; Directory does not exist or has wrong permissions&lt;br /&gt; Directory missing fonts.dir&lt;br /&gt; Incorrect font server address or syntax&lt;br /&gt;&lt;/code&gt;After 20-30 seconds I was getting the following window: &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SjXpFKSuAeI/AAAAAAAAAhk/rRh_ixKmK5o/s1600-h/Screenshot-Serious+Startup+Error.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 231px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SjXpFKSuAeI/AAAAAAAAAhk/rRh_ixKmK5o/s400/Screenshot-Serious+Startup+Error.png" alt="" id="BLOGGER_PHOTO_ID_5347436407443816930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;This is a common problem and the solution is &lt;a href="http://documents.wolfram.com/mathematica/GettingStarted/SystemAdministrationGuide/UnixLinuxAdministration/Fonts.html"&gt;here&lt;/a&gt;. For clarity I write what I did:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;From Mathematica's CD I unpacked /Unix/Files/Fonts/contents.tar.gz  into my home directory in my Arch Linux PC. After unpacking the font path was: /home/W/SystemFiles/Fonts/Type1&lt;/li&gt;&lt;li&gt;I added this path to my font path: &lt;code&gt;&lt;span class="MR"&gt;xset fp+ &lt;/span&gt;/home/W/SystemFiles/Fonts/Type1&lt;span class="MR"&gt;; xset fp rehash&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;I chacked if the new path was included: &lt;code&gt;xset q&lt;/code&gt; &lt;/li&gt;&lt;li&gt;I logged into the serwer using ssh -Y login@server and started mathematica and it worked! &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7514728643804258356?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7514728643804258356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/06/mathematica-xset-bad-font-path-element.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7514728643804258356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7514728643804258356'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/06/mathematica-xset-bad-font-path-element.html' title='Mathematica: xset:  bad font path element (#23)'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/SjXpFKSuAeI/AAAAAAAAAhk/rRh_ixKmK5o/s72-c/Screenshot-Serious+Startup+Error.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1074610736981104040</id><published>2009-06-13T00:35:00.000-07:00</published><updated>2009-10-22T00:50:01.464-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='imagemagick'/><title type='text'>imagemagick: change color image to gray</title><content type='html'>&lt;code&gt;convert -type Grayscale old.tiff new.tiff&lt;/code&gt;or to overiate original image&lt;code&gt;mogrify -type Grayscale old.tiff&lt;/code&gt; or to convert all images in a current folder:&lt;code&gt;for f in *.tiff; do mogrify -type Grayscale $f ;done&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1074610736981104040?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1074610736981104040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/06/imagemagick-change-color-image-to-gray.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1074610736981104040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1074610736981104040'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/06/imagemagick-change-color-image-to-gray.html' title='imagemagick: change color image to gray'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-2739259085043912686</id><published>2009-06-02T06:17:00.000-07:00</published><updated>2009-10-22T02:26:37.870-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><category scheme='http://www.blogger.com/atom/ns#' term='SPSS'/><category scheme='http://www.blogger.com/atom/ns#' term='Statistics'/><title type='text'>Paired t-test assumption of normality</title><content type='html'>&lt;div style="text-align: justify;"&gt;It is important to remember that paired&lt;a href="http://en.wikipedia.org/wiki/Student%27s_t-test#Dependent_t-test_for_paired_samples"&gt; t-test&lt;/a&gt; is valid if the differences of pairs of variables are normally distributed. It appears that the variables itself do not need to be normally distributed, as paired t-test only operates on the differences. This observation is based on [Bland2000, p. 161 and 260].&lt;br /&gt;&lt;br /&gt;Normality of a sample can be evaluated using &lt;a href="http://en.wikipedia.org/wiki/Q-Q_plot"&gt;Q-Q plots&lt;/a&gt; [Bland2000, ch. 7.5]. However, the problem with these plots is that they are not objective, i.e. for one person a sample is normally distributed, for other person the same sample may be only approximately normally distributed while for the third person it is not normally distributed. For that reason quantitative methods are better. One of such methods is &lt;a href="http://en.wikipedia.org/wiki/Shapiro-Wilk"&gt;Shapiro-Wilk test&lt;/a&gt;. The other method is &lt;a href="http://en.wikipedia.org/wiki/Kolmogorov-Smirnov"&gt;Kolmogorov-Smirnov&lt;/a&gt; test. For small samples (i.e. 50) Shapiro-Wilk is generally more accurate [Marques2003 p.157].&lt;br /&gt;&lt;br /&gt;If sample was found to be non Normal, &lt;span class="definedword"&gt;&lt;a href="http://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test"&gt;Wilcoxon signed-rank test&lt;/a&gt; (called also Wilcoxon matched pairs test) can be used [&lt;/span&gt;Bland2000, ch.12.3&lt;span class="definedword"&gt;]. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;All the above tests can be performed easily in SPSS.&lt;br /&gt;&lt;br /&gt;References&lt;br /&gt;Bland, Martin. &lt;a href="http://books.google.com.au/books?id=YQQAHQAACAAJ&amp;amp;dq=An+Introduction+to+Medical+Statistics&amp;amp;ei=qiclSvCRJp-OkAS39cyiBw"&gt;An Introduction to Medical Statistics 3th&lt;/a&gt; ed, Oxford University Press, 2000&lt;br /&gt;J. P. Marques de Sá &lt;a href="http://books.google.com.au/books?id=jkhxTVFEd0sC"&gt;Applied statistics: using SPSS, STATISTICA, and MATLAB&lt;/a&gt;, Springer, 2003&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-2739259085043912686?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/2739259085043912686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/06/paired-t-test-assumption-of-normality.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/2739259085043912686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/2739259085043912686'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/06/paired-t-test-assumption-of-normality.html' title='Paired t-test assumption of normality'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-417965987055074999</id><published>2009-05-27T02:09:00.000-07:00</published><updated>2009-05-27T02:11:25.868-07:00</updated><title type='text'>Setting new nice value for a user's processes</title><content type='html'>To set a new nice value for all processes of a user the renice command can be used. For example to set a nice to 10:&lt;code&gt;sudo renice 10 -u username&lt;/code&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-417965987055074999?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/417965987055074999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/setting-new-nice-value-for-users.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/417965987055074999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/417965987055074999'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/setting-new-nice-value-for-users.html' title='Setting new nice value for a user&apos;s processes'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4686814640980000961</id><published>2009-05-26T18:45:00.000-07:00</published><updated>2009-10-22T00:59:28.612-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><title type='text'>Matlab: generate unique ID number</title><content type='html'>To generate a unique ID number for e.g. a temporary file or seed for random number generator current date/time in milliseconds can be used. I matlab the only command that gives time in milliseconds is &lt;a style="font-style: italic;" href="http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/datestr.html&amp;amp;http://www.google.com.au/search?q=matlab+datestr"&gt;datestr&lt;/a&gt; with FFF input e.g.&lt;code&gt; datestr(now,'MMSSFFF')&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;5139451&lt;br /&gt;datestr(now,'MMSSFFF')&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;5140057&lt;br /&gt;&lt;br /&gt;UID=datestr(now,'MMSSFFF')&lt;br /&gt;&lt;br /&gt;UID =&lt;br /&gt;&lt;br /&gt;5214981&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Unfortunatly other commands such as &lt;span style="font-style: italic;"&gt;cputime&lt;/span&gt; or &lt;span style="font-style: italic;"&gt;now&lt;/span&gt; don't return time in milliseconds, which is not so good.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4686814640980000961?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4686814640980000961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/matlab-generate-unique-id-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4686814640980000961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4686814640980000961'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/matlab-generate-unique-id-number.html' title='Matlab: generate unique ID number'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7849121868717740253</id><published>2009-05-24T23:12:00.000-07:00</published><updated>2009-10-22T00:57:34.286-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><title type='text'>CentOS 5: Set a background wallpaper for fluxbox.</title><content type='html'>To set a background wallpaper for fluxbox in CentOS 5.2  the following command can be used:&lt;br /&gt;&lt;code&gt;fbsetbg -f /usr/share/backgrounds/images/c5-center-2048x1536.jpg &lt;/code&gt;or &lt;code&gt;fbsetbg -f /usr/share/backgrounds/images/default.jpg &lt;/code&gt; The above commands in my case was executed in xterm in running fluxbox. The CentOS's wallpapers are in usr/share/backgrounds/.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sho4derym0I/AAAAAAAAAhc/ztEvtN-sN90/s1600-h/centos_fluxbox_wallpaper.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sho4derym0I/AAAAAAAAAhc/ztEvtN-sN90/s400/centos_fluxbox_wallpaper.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5339642387305241410" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7849121868717740253?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7849121868717740253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/centos-5-set-background-wallpaper-for.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7849121868717740253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7849121868717740253'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/centos-5-set-background-wallpaper-for.html' title='CentOS 5: Set a background wallpaper for fluxbox.'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sho4derym0I/AAAAAAAAAhc/ztEvtN-sN90/s72-c/centos_fluxbox_wallpaper.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8068846519780750239</id><published>2009-05-22T22:36:00.000-07:00</published><updated>2009-10-22T00:58:12.661-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>python: simple start with simplejson</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/JSON"&gt;JSON&lt;/a&gt; (i.e. JavaScript Object Notation) is a popular way of exchanging data in a string format. It can also be used to provide setup parameters for a program. The second option I used to show very basic JSON usage in python with &lt;a href="http://pypi.python.org/pypi/simplejson/"&gt;simplejson&lt;/a&gt; package. Lets assume that we have a txt file called data.json with the following JSON code:&lt;code&gt;{&lt;br /&gt;       "Name": "W",&lt;br /&gt;       "Job": "Programmer",&lt;br /&gt;       "Movies": ["Star Wars", "Star Trek", "Terminator"],&lt;br /&gt;       "Address" : {&lt;br /&gt;               "Street": "Some Streat",&lt;br /&gt;               "House": 3,&lt;br /&gt;               "City": "Some City"&lt;br /&gt;       }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;The above JSON code can be read into python object using load function as follows&lt;code&gt;In [7]: import simplejson as json&lt;br /&gt;In [8]: f=open("data.json")&lt;br /&gt;In [9]: data=json.load(f)&lt;br /&gt;In [10]: f.close()&lt;br /&gt;In [11]: data&lt;br /&gt;Out[11]:&lt;br /&gt;{'Address': {'House': 3, 'Street': 'Some Streat', 'City': 'Some City'},&lt;br /&gt;'Job': 'Programmer',&lt;br /&gt;'Movies': ['Star Wars', 'Star Trek', 'Terminator'],&lt;br /&gt;'Name': 'W'}&lt;br /&gt;In [12]: print data['Address']['House']&lt;br /&gt;3&lt;br /&gt;In [13]:&lt;br /&gt;&lt;/code&gt;That's it:-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8068846519780750239?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8068846519780750239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/python-simple-start-with-simplejson.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8068846519780750239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8068846519780750239'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/python-simple-start-with-simplejson.html' title='python: simple start with simplejson'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-5579409723415302567</id><published>2009-05-20T18:14:00.000-07:00</published><updated>2009-10-22T01:09:29.658-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Arch Linux: "Create archive" in gnome context menu</title><content type='html'>"Create archive" option in context menu is provided by &lt;a href="http://projects.gnome.org/nautilus/screenshots.html"&gt;Nautilus&lt;/a&gt; extenssion called file-roller. To install it in Arch linux it is enough to write (if sudo was installed previusly) &lt;code&gt;sudo pacman -S file-roller&lt;/code&gt; With this extension files and folders can be archived, and archve files can be extracted &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/ShSr_uz5e8I/AAAAAAAAAhM/H7dpFcW6SKE/s1600-h/file-roller.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 307px; height: 400px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/ShSr_uz5e8I/AAAAAAAAAhM/H7dpFcW6SKE/s400/file-roller.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5338080569726696386" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/ShSsYjC35LI/AAAAAAAAAhU/L355ksjnnJg/s1600-h/file-roller_.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 366px; height: 396px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/ShSsYjC35LI/AAAAAAAAAhU/L355ksjnnJg/s400/file-roller_.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5338080996065010866" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-5579409723415302567?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/5579409723415302567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/arch-linux-create-archive-in-gnome.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5579409723415302567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5579409723415302567'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/arch-linux-create-archive-in-gnome.html' title='Arch Linux: &quot;Create archive&quot; in gnome context menu'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/ShSr_uz5e8I/AAAAAAAAAhM/H7dpFcW6SKE/s72-c/file-roller.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4810535352953906465</id><published>2009-05-14T21:19:00.000-07:00</published><updated>2009-10-22T01:09:07.886-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ubuntu 9.04 CD</title><content type='html'>I got my version of Ubuntu 9.04 on a CD from Canonical. These are the photos.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SgztpJjoHUI/AAAAAAAAAg8/miieZYoD4sA/s1600-h/DSC00051.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SgztpJjoHUI/AAAAAAAAAg8/miieZYoD4sA/s400/DSC00051.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5335900949722963266" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SgzttXSONPI/AAAAAAAAAhE/mTB00B6aCNQ/s1600-h/DSC00053.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SgzttXSONPI/AAAAAAAAAhE/mTB00B6aCNQ/s400/DSC00053.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5335901022127535346" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4810535352953906465?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4810535352953906465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/ubuntu-904-cd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4810535352953906465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4810535352953906465'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/ubuntu-904-cd.html' title='Ubuntu 9.04 CD'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/SgztpJjoHUI/AAAAAAAAAg8/miieZYoD4sA/s72-c/DSC00051.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8949447963542443561</id><published>2009-05-04T20:25:00.000-07:00</published><updated>2009-10-22T01:09:29.658-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Matlab 2008b: Execute matlab from python in CentOS 5.2</title><content type='html'>I have Matlab 2008b running on CentOS 5.2 server. I wanted to be able to execute Matlab commands from python. After a search I found &lt;a href="http://mlabwrap.sourceforge.net/"&gt;mlabwrap&lt;/a&gt; 1.0.1. I decided to install it. On CentOS 5.2 I have python 2.4.3. I also installed numpy 1.0.4 from &lt;a href="http://download.fedora.redhat.com/pub/epel/5/x86_64/repoview/numpy.html"&gt;epel&lt;/a&gt; repository. numpy is required to install mlabwrap. To install mlabwrap I fallowed the &lt;a href="http://mlabwrap.sourceforge.net/#Installation"&gt;instructions&lt;/a&gt;.   Fortunately, I had no problems with the installation.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sf-0aQI5CiI/AAAAAAAAAgs/C0NZNmcYZVw/s1600-h/matlab_python.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 315px; height: 400px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sf-0aQI5CiI/AAAAAAAAAgs/C0NZNmcYZVw/s400/matlab_python.png" alt="" id="BLOGGER_PHOTO_ID_5332178846931814946" border="0" /&gt;&lt;/a&gt;Note: the appearance of the windows in the image is from Mac X because I X forward them from CentOS server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8949447963542443561?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8949447963542443561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/mmatlab-2008b-execute-matlab-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8949447963542443561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8949447963542443561'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/mmatlab-2008b-execute-matlab-from.html' title='Matlab 2008b: Execute matlab from python in CentOS 5.2'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/Sf-0aQI5CiI/AAAAAAAAAgs/C0NZNmcYZVw/s72-c/matlab_python.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1105109643809075166</id><published>2009-05-03T22:24:00.000-07:00</published><updated>2009-10-22T01:09:29.659-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Arch Linux: dual monitor</title><content type='html'>I use gnome 2.26.1 + compiz-fusion on my Archlinux box. I wanted to add a second monitor to it. I have nVidia GeFore FX 5200 card and the following drivers&lt;code&gt;[W@localhost ~]$ pacman -Q | grep nvidia&lt;br /&gt;nvidia-173xx 173.14.18-2&lt;br /&gt;nvidia-173xx-utils 173.14.18-1&lt;/code&gt;I connected one monitor through &lt;a href="http://en.wikipedia.org/wiki/Digital_Visual_Interface"&gt;DVI&lt;/a&gt; cable and the second by the &lt;a href="http://en.wikipedia.org/wiki/Video_Graphics_Array"&gt;VGA&lt;/a&gt; cable. I had no problems setting dual screen using nvidia-settings program (it comes with the above drivers). Below are my settings:&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sf59VLveZHI/AAAAAAAAAgc/C4JFqILSUjs/s1600-h/Screenshot-NVIDIA+X+Server+Settings.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 385px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sf59VLveZHI/AAAAAAAAAgc/C4JFqILSUjs/s400/Screenshot-NVIDIA+X+Server+Settings.png" alt="" id="BLOGGER_PHOTO_ID_5331836811735884914" border="0" /&gt;&lt;/a&gt;I also attach a photo of my compiz 3D cube on dual monitor screen. &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sf59uvwMqnI/AAAAAAAAAgk/aY7iJIKLOdc/s1600-h/DSC00047.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 234px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sf59uvwMqnI/AAAAAAAAAgk/aY7iJIKLOdc/s400/DSC00047.JPG" alt="" id="BLOGGER_PHOTO_ID_5331837250899323506" border="0" /&gt;&lt;/a&gt;Later I change the monitors to have two, the same one. &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SgK6hwhxfRI/AAAAAAAAAg0/zoduNTE8gVE/s1600-h/DSC00048.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 223px;" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/SgK6hwhxfRI/AAAAAAAAAg0/zoduNTE8gVE/s400/DSC00048.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5333029997885095186" /&gt;&lt;/a&gt; It can be noticed, that each monitor "is" on a different site of the 3D cube:-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1105109643809075166?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1105109643809075166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/archlinux-dual-monitor.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1105109643809075166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1105109643809075166'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/05/archlinux-dual-monitor.html' title='Arch Linux: dual monitor'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sf59VLveZHI/AAAAAAAAAgc/C4JFqILSUjs/s72-c/Screenshot-NVIDIA+X+Server+Settings.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-5047445817264322820</id><published>2009-04-30T00:00:00.000-07:00</published><updated>2009-10-22T00:57:34.287-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><title type='text'>limits.conf:  virtual memory limit</title><content type='html'>I was setting some limits on CentOS 5.2 with 24GB of RAM. I wanted to set a limit to virtual memory for a process of group of users to be no more than 4GB. Normally, you a user can do this for its own bash session using&lt;code&gt;ulimit -v 4000000&lt;/code&gt;I wanted to do the same thing but to as a root (i.e. admin of a server) to a group of users. Such limits can normally be set in /etc/security/limits.conf. There are many limits&lt;code&gt;#        - core - limits the core file size (KB)&lt;br /&gt;#        - data - max data size (KB)&lt;br /&gt;#        - fsize - maximum filesize (KB)&lt;br /&gt;#        - memlock - max locked-in-memory address space (KB)&lt;br /&gt;#        - nofile - max number of open files&lt;br /&gt;#        - rss - max resident set size (KB)&lt;br /&gt;#        - stack - max stack size (KB)&lt;br /&gt;#        - cpu - max CPU time (MIN)&lt;br /&gt;#        - nproc - max number of processes&lt;br /&gt;#        - as - address space limit&lt;br /&gt;#        - maxlogins - max number of logins for this user&lt;br /&gt;#        - maxsyslogins - max number of logins on the system&lt;br /&gt;#        - priority - the priority to run user process with&lt;br /&gt;#        - locks - max number of file locks the user can hold&lt;br /&gt;#        - sigpending - max number of pending signals&lt;br /&gt;#        - msgqueue - max memory used by POSIX message queues (bytes)&lt;br /&gt;#        - nice - max nice priority allowed to raise to&lt;br /&gt;#        - rtprio - max realtime priority&lt;br /&gt;&lt;/code&gt;However, I could not find anything for virtual memory, nor I could find any info about this in the Internet. Therefore, I used the try-and-see approach. Finally, I found that item "as" (i.e. address space limit (kb)) does this! Therefore I made a limit to a group &lt;code&gt;@somegroup               hard    as      4000000&lt;/code&gt;To check it, I logged in to a server using ssh as a user from the "somegroup" and executed&lt;code&gt;[test@w ~]$ ulimit -a | grep virtual&lt;br /&gt;virtual memory          (kbytes, -v) 4000000&lt;/code&gt;This is of course a limit per process of a user from this group, and not limit for a user of a group!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-5047445817264322820?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/5047445817264322820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/limitsconf-virtual-memory-limit.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5047445817264322820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5047445817264322820'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/limitsconf-virtual-memory-limit.html' title='limits.conf:  virtual memory limit'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6351557388672620106</id><published>2009-04-27T20:42:00.000-07:00</published><updated>2009-10-22T00:59:28.613-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><title type='text'>Matlab: mex error: expected expression before '/' token</title><content type='html'>Few days ago I installed Matlab 2008b on CentOS 5.2, and I wanted to move my programs from Matlab 2007a on Mac X to the  Matlab 2008b on CentOS 5.2. There were no problems with that, execpt my mex C files. When I wanted to compile my mex files  in the new Matlab I was getting literally hundreds of errors&lt;code&gt;my_c.c:653: error: expected expression before '/' token&lt;br /&gt;my_c.c:655: error: expected expression before '/' token&lt;br /&gt;my_c.c:686: error: expected expression before '/' token&lt;br /&gt;my_c.c:688: error: expected expression before '/' token&lt;br /&gt;my_c.c:688: error: expected expression before '/' token&lt;/code&gt;The reason was that in my C files I was using "//" for doing comments, rather than "/*   */". By default Matlab 2008b uses ansi standard (i.e. -ansi flag in gcc). The &lt;a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/gcc/c-dialect-options.html"&gt;-ansi flag&lt;/a&gt; represents ISO C90 (equivalent to flag -std=c89) standard. In this standard there are no "//" for comments. Therefore, I could change all comments in my C files, or compile my C files using  -std=c99 flag instead of -ansi flag. In c99 one can use "//" for comments. I choose the second option, and therefore I modified my &lt;a href="http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/mex.html&amp;amp;http://www.mathworks.com/cgi-bin/texis/webinator/search?pr=Whole_site&amp;amp;db=MSS&amp;amp;prox=page&amp;amp;rorder=750&amp;amp;rprox=750&amp;amp;rdfreq=500&amp;amp;rwfreq=500&amp;amp;rlead=250&amp;amp;sufs=0&amp;amp;order=r&amp;amp;whole=Whole_site&amp;amp;entire_flag=1&amp;amp;is_summary_on=1&amp;amp;ResultCount=10&amp;amp;query=mexopts&amp;amp;submit=Search"&gt;mexopts.sh&lt;/a&gt; file.This file contains default options and flags to be used when executing mex command in matlab (i.e. compiling C files). In my case this this was in my home directory, i.e. ~/.matlab/R2008b/mexopts.sh. So I opened this file and edit parts for my computer. I had CentOS5.2 x64 bits, so I edited part &lt;code&gt;#----------------------------------------------------------------------------&lt;br /&gt;         ;;&lt;br /&gt;     glnxa64)&lt;br /&gt;#----------------------------------------------------------------------------&lt;br /&gt;&lt;/code&gt;Specifically, I changed &lt;code&gt;CC='gcc'&lt;br /&gt;CFLAGS=" -ansi -D_GNU_SOURCE"&lt;/code&gt;to&lt;code&gt;CC='gcc'&lt;br /&gt;CFLAGS=' -std=c99'&lt;br /&gt;CFLAGS=" $CFLAGS -D_GNU_SOURCE"&lt;/code&gt;With this change I had no more errors regarding "//" comments.&lt;h4&gt;Tip&lt;/h4&gt;To determine which options in mexopts.sh your mex compiler is using, one can just make an error or typo in some options and check if mex will crash or not.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6351557388672620106?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6351557388672620106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/matlab2008b-mex-error-expected.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6351557388672620106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6351557388672620106'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/matlab2008b-mex-error-expected.html' title='Matlab: mex error: expected expression before &apos;/&apos; token'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1517008880864421142</id><published>2009-04-23T20:08:00.000-07:00</published><updated>2009-10-22T01:12:16.376-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>VirtualBox: 3D acceleration for Ubuntu</title><content type='html'>I have just installed VirtualBox 2.2 on Mac X 10.4. I also installed latest Ubuntu 9.04 as a guest in the VB. To my surprise, 3D acceleration works! I can enjoy compiz effects (3D cubes or wobbling windows) in VirtualBox. &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SfEuXHQIbcI/AAAAAAAAAgU/pmfsqhT5QSU/s1600-h/ubuntu_VB.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SfEuXHQIbcI/AAAAAAAAAgU/pmfsqhT5QSU/s400/ubuntu_VB.png" alt="" id="BLOGGER_PHOTO_ID_5328090808774585794" border="0" /&gt;&lt;/a&gt; There were absolutely no problems to make it work!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1517008880864421142?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1517008880864421142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/virtualbox-3d-acceleration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1517008880864421142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1517008880864421142'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/virtualbox-3d-acceleration.html' title='VirtualBox: 3D acceleration for Ubuntu'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/SfEuXHQIbcI/AAAAAAAAAgU/pmfsqhT5QSU/s72-c/ubuntu_VB.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3572934569626541012</id><published>2009-04-16T22:12:00.000-07:00</published><updated>2009-10-22T01:09:29.659-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>TYPO3: Enable realURL</title><content type='html'>&lt;div style="text-align: justify;"&gt;By default typo3 uses URLs such as this: &lt;span style="font-weight: bold;"&gt;index.php?id=45&lt;/span&gt;. This is not very useful, it does not look good and is not "search engine friendly". Therefore it would be nice to have&lt;code&gt;http://www.mysite.com/&lt;span style="font-weight: bold;"&gt;contact/&lt;/span&gt;&lt;/code&gt;instead of &lt;code&gt;http://www.mysite.com/&lt;span style="font-weight: bold;"&gt;index.php?id=45&lt;/span&gt;&lt;/code&gt;In typo3, to do this you need to have &lt;a href="http://typo3.org/documentation/document-library/extension-manuals/realurl/1.1.3/view/toc/0/"&gt;RealURL&lt;/a&gt; extension installed. &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SegcaqiVzbI/AAAAAAAAAf0/8WNzwK5ExEM/s1600-h/realURL_ext.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 117px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SegcaqiVzbI/AAAAAAAAAf0/8WNzwK5ExEM/s400/realURL_ext.png" alt="" id="BLOGGER_PHOTO_ID_5325537803786112434" border="0" /&gt;&lt;/a&gt;As I remember I had no problems installing it, or maybe it is installed by default, I'm not sure. Anyway, although installation of RealURL was easy, it was not so easy to make it work. I was creating some simple site using typo3, and I needed the most simple way to translate my address (e.g. from /index.php?id=45 to /contact/). The &lt;a href="http://typo3.org/documentation/document-library/extension-manuals/realurl/1.1.3/view/toc/0/"&gt;manual&lt;/a&gt; on the RealURL website is not so easy to understand, and it seems to be not updated (RealURL &lt;a href="http://wiki.typo3.org/index.php/EXT/realurl/manual"&gt;wiki&lt;/a&gt; seems to be better). For example in &lt;a href="http://typo3.org/documentation/document-library/extension-manuals/realurl/1.1.3/view/1/2/#id2860197"&gt;TypoScript configuration&lt;/a&gt; section the manual, it is said that we should set the following variable in TypoScript template record&lt;code&gt;config.baseURL = 1&lt;/code&gt;Unfortunately doing this results in an error: Unsupported TypoScript property was found in this template: "config.baseURL="1": &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SegUAMZj0eI/AAAAAAAAAfc/pveRKz2iD2g/s1600-h/realURL_error.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 269px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SegUAMZj0eI/AAAAAAAAAfc/pveRKz2iD2g/s400/realURL_error.png" alt="" id="BLOGGER_PHOTO_ID_5325528552926597602" border="0" /&gt;&lt;/a&gt;The current version of typo3, at the moment of writing this, was 4.2.2!. So it seams this manual was not updated for a while. To solve this, in my case I needed to set this variable to&lt;code&gt;config.baseURL = http://www.mysite.com/&lt;/code&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Threfore, it took me a while to make this simple translation work. So what I did?&lt;br /&gt;&lt;br /&gt;First, I made sure that mod_rewrite module was installed and working in my Apache (I had ubuntu-server 8.04 LTS and typo3 4.1.2). How exactly? There is plenty of information how to do this in the Internet, so I will not repeat it. Sorry:-).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Second, I enabled .htaccess in the root of your TYPO3-installation directory that comes with typo3 &lt;code&gt;mv _.htaccess .htaccess&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Third, I added &lt;code&gt;config.simulateStaticDocuments = 0&lt;br /&gt;config.baseURL = http://www.mysite.com/&lt;br /&gt;config.tx_realurl_enable = 1&lt;/code&gt;to in the TypoScript record. This record is in Template menu for root page of your site three, i.e. &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SegXnooWhJI/AAAAAAAAAfk/yr_YhZ07Fkw/s1600-h/realURL2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 176px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SegXnooWhJI/AAAAAAAAAfk/yr_YhZ07Fkw/s400/realURL2.png" alt="" id="BLOGGER_PHOTO_ID_5325532529054614674" border="0" /&gt;&lt;/a&gt;With this, if everything is ok, your realURL should already work! For me, it translated addresses from &lt;code&gt;http://www.mysite.com/&lt;span style="font-weight: bold;"&gt;index.php?id=45&lt;/span&gt;&lt;/code&gt;to&lt;code&gt;http://www.mysite.com/&lt;span style="font-weight: bold;"&gt;45&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Forth, the manual says that file  typo3conf/localconf.php should be edited for definition of translation rules. But for me it was enough to make aliases for each page to have e.g. "contact" instead of number 45:&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SegZcoSrZkI/AAAAAAAAAfs/9ozjedJd8K4/s1600-h/realURL_3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 81px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SegZcoSrZkI/AAAAAAAAAfs/9ozjedJd8K4/s400/realURL_3.png" alt="" id="BLOGGER_PHOTO_ID_5325534539008403010" border="0" /&gt;&lt;/a&gt;I did not have to edit localconf.php file. Thought, for more advanced translations probably you have to edit it.&lt;br /&gt;&lt;br /&gt;Because I'm not sure whether I modified .htaccess I attach it &lt;a href="http://sites.google.com/site/someexamplestuffsite/files-1/htaccess.txt?attredirects=0"&gt;here&lt;/a&gt;. localconf.php is also attached &lt;a href="http://sites.google.com/site/someexamplestuffsite/files-1/localconf.php.txt?attredirects=0"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3572934569626541012?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3572934569626541012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/typo3-enable-realurl.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3572934569626541012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3572934569626541012'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/typo3-enable-realurl.html' title='TYPO3: Enable realURL'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/SegcaqiVzbI/AAAAAAAAAf0/8WNzwK5ExEM/s72-c/realURL_ext.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-3606893625301483761</id><published>2009-04-16T22:06:00.000-07:00</published><updated>2009-10-22T01:09:29.660-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>CentOS: Tabulator completion for sudo in bash</title><content type='html'>To enable so-called tab-completion for sudo users, it is enough to add &lt;code&gt;complete -cf sudo&lt;br /&gt;&lt;/code&gt;to your local &lt;span style="font-style:italic;"&gt;.bashrc&lt;/span&gt; file. It also works for &lt;a href="http://wiki.archlinux.org/index.php/Sudo#Enabling_Tab-Completion_for_sudo_Users"&gt;Arch linux&lt;/a&gt;. En example is below:&lt;code&gt;[w@localhost ~]$ sudo vnc&lt;TAB&gt;&lt;br /&gt;vncconfig  vncpasswd  vncserver &lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-3606893625301483761?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/3606893625301483761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/centos-tabulator-completion-for-sudo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3606893625301483761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/3606893625301483761'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/centos-tabulator-completion-for-sudo.html' title='CentOS: Tabulator completion for sudo in bash'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-1762542081293329099</id><published>2009-04-16T01:49:00.000-07:00</published><updated>2009-10-22T00:57:52.948-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>SSH: Strange characters in Midnight Commander</title><content type='html'>If one tries to login into a linux box using SSH and gets  strange characters instead of lines in &lt;a href="http://en.wikipedia.org/wiki/Midnight_Commander"&gt;Midnight Commander&lt;/a&gt; (MC), one can try to set an environmental variable LC_ALL to C:&lt;code&gt;export LC_ALL=C&lt;/code&gt;For me, it transformed MC from this: &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/Sebx3722-YI/AAAAAAAAAfU/agz9ezNZBjk/s1600-h/mc1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 207px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/Sebx3722-YI/AAAAAAAAAfU/agz9ezNZBjk/s400/mc1.png" alt="" id="BLOGGER_PHOTO_ID_5325209552675076482" border="0" /&gt;&lt;/a&gt; to this: &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/Sebx3-6pVEI/AAAAAAAAAfM/m5I2blEvuOI/s1600-h/mc2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 210px;" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/Sebx3-6pVEI/AAAAAAAAAfM/m5I2blEvuOI/s400/mc2.png" alt="" id="BLOGGER_PHOTO_ID_5325209553496265794" border="0" /&gt;&lt;/a&gt;Although there are still some strange characters for scrolls, MC looks considerably better. &lt;br /&gt;&lt;br /&gt;The above command can be written in your local .bash_profile file, that you don't have to set it manually every time you login. &lt;br /&gt;&lt;br /&gt;Command &lt;span style="font-style:italic;"&gt;local&lt;/span&gt; can be used to check the state your local character encoding variables. For example &lt;code&gt;[w@localhost rpms]$ locale&lt;br /&gt;LANG=en_US.UTF-8&lt;br /&gt;LC_CTYPE="C"&lt;br /&gt;LC_NUMERIC="C"&lt;br /&gt;LC_TIME="C"&lt;br /&gt;LC_COLLATE="C"&lt;br /&gt;LC_MONETARY="C"&lt;br /&gt;LC_MESSAGES="C"&lt;br /&gt;LC_PAPER="C"&lt;br /&gt;LC_NAME="C"&lt;br /&gt;LC_ADDRESS="C"&lt;br /&gt;LC_TELEPHONE="C"&lt;br /&gt;LC_MEASUREMENT="C"&lt;br /&gt;LC_IDENTIFICATION="C"&lt;br /&gt;LC_ALL=C&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-1762542081293329099?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/1762542081293329099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/terminal-strange-characters-in-midnight.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1762542081293329099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/1762542081293329099'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/terminal-strange-characters-in-midnight.html' title='SSH: Strange characters in Midnight Commander'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/Sebx3722-YI/AAAAAAAAAfU/agz9ezNZBjk/s72-c/mc1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-5911916182903911015</id><published>2009-04-15T23:50:00.000-07:00</published><updated>2009-10-22T00:59:28.613-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><title type='text'>Gnome: Add menu item</title><content type='html'>To add a gnome application menu item or so-called "&lt;a href="http://library.gnome.org/admin/system-admin-guide/stable/menustructure-desktopentry.html.en"&gt;Desktop Entry&lt;/a&gt;" the following procedure can be used (I did it in CentOS5.2). Lets assume that we want to add menu item for Octave. First, as a root create file octave.desktop in /usr/share/applications/ with the following contents:&lt;code&gt;[Desktop Entry]&lt;br /&gt;Name=Octave 3&lt;br /&gt;Comment=Octave instead of Matlab&lt;br /&gt;Categories=Application;&lt;br /&gt;Exec=octave&lt;br /&gt;Terminal=true&lt;br /&gt;Type=Application&lt;br /&gt;Icon=octave.png&lt;br /&gt;Encoding=UTF-8&lt;br /&gt;StartupNotify=true&lt;/code&gt;octave.png icon can be created manually. Just find some octave logo imagee, convert it to png of size of 48x48 pixels and place it in folder /usr/share/pixmaps/. Of course it is not necessary, if icon does not exist gnome will not display any icon, only Name.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SebXOmpx74I/AAAAAAAAAfE/8kz1VwC_xzE/s1600-h/gnome_octave_icon.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 362px; height: 314px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/SebXOmpx74I/AAAAAAAAAfE/8kz1VwC_xzE/s400/gnome_octave_icon.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5325180255306116994" /&gt;&lt;/a&gt;The advantage of this procedure is that menu entry created will be available for every user, not only for root.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-5911916182903911015?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/5911916182903911015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/gnome-add-menu-item.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5911916182903911015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5911916182903911015'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/gnome-add-menu-item.html' title='Gnome: Add menu item'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qvZ1h1bgBRo/SebXOmpx74I/AAAAAAAAAfE/8kz1VwC_xzE/s72-c/gnome_octave_icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-2052458520748665594</id><published>2009-04-09T02:04:00.000-07:00</published><updated>2009-10-22T01:09:29.660-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Epiphany: Install Adobe Flash Player</title><content type='html'>&lt;div style="text-align: justify;"&gt;Just download the latest flash player from Adobe &lt;a href="http://get.adobe.com/flashplayer/"&gt;site&lt;/a&gt;. In my case it was: install_flash_player_10_linux.tar.gz. Unpack the file&lt;code&gt;tar xzvf install_flash_player_10_linux.tar.gz&lt;/code&gt;Copy  contents of install_flash_player_10_linux folder obtained (i.e. files  flashplayer-installer and  libflashplayer.so) into /usr/lib/epiphany/2.26/plugins. For me it work. I used Arch Linux. Similar procedure can be used for Firefox (plugins folder is  /usr/lib/firefox-3.0/plugins).&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-2052458520748665594?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/2052458520748665594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/epiphany-install-adobe-flash-player.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/2052458520748665594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/2052458520748665594'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/epiphany-install-adobe-flash-player.html' title='Epiphany: Install Adobe Flash Player'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6655532500517836529</id><published>2009-04-05T20:10:00.001-07:00</published><updated>2009-10-22T01:09:29.660-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Arch linux: changing gnome logo in Floating Feet screenserver to Arch logo</title><content type='html'>To change default Gnome Floating Feet screenserer from:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/Sdly1KpqVaI/AAAAAAAAAe8/6OWqCH2_eLU/s1600-h/foot-screen.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 219px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/Sdly1KpqVaI/AAAAAAAAAe8/6OWqCH2_eLU/s400/foot-screen.png" alt="" id="BLOGGER_PHOTO_ID_5321410692432680354" border="0" /&gt;&lt;/a&gt;to this:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qvZ1h1bgBRo/Sdly1J-pehI/AAAAAAAAAe0/uBwZxXxIPpY/s1600-h/arch-screen.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 220px;" src="http://1.bp.blogspot.com/_qvZ1h1bgBRo/Sdly1J-pehI/AAAAAAAAAe0/uBwZxXxIPpY/s400/arch-screen.png" alt="" id="BLOGGER_PHOTO_ID_5321410692252269074" border="0" /&gt;&lt;/a&gt; the following procedure can be used.&lt;br /&gt;First, install archlinux-artwork &lt;code&gt;pacman -S archlinux-artwork&lt;/code&gt;This will install wallpapers, logs and icons of Arch in /usr/share/archlinux. Than edit file footlogo-floaters.desktop&lt;br /&gt;in /usr/share/applications/screensavers: &lt;code&gt;vi /usr/share/applications/screensavers/footlogo-floaters.desktop&lt;/code&gt; and change the following line &lt;code&gt;Exec=floaters /usr/share/pixmaps/gnome-logo-white.svg&lt;/code&gt;to two lines:&lt;code&gt;#Exec=floaters /usr/share/pixmaps/gnome-logo-white.svg&lt;br /&gt;Exec=floaters /usr/share/archlinux/logos/archlinux-vert-light.svg&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6655532500517836529?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6655532500517836529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/arch-linux-changing-gnome-logo-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6655532500517836529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6655532500517836529'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/arch-linux-changing-gnome-logo-in.html' title='Arch linux: changing gnome logo in Floating Feet screenserver to Arch logo'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/Sdly1KpqVaI/AAAAAAAAAe8/6OWqCH2_eLU/s72-c/foot-screen.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6706624099438391589</id><published>2009-04-04T22:46:00.000-07:00</published><updated>2009-10-22T01:09:29.660-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Arch linux: Install adobe flash plugin for firefox 3</title><content type='html'>To enable flash support in firefox 3.0, the following procedure can be used: First, as a root install flashplugin:&lt;code&gt;pacman -S flashplugin&lt;/code&gt;This command will install flash plugin in /usr/lib/mozilla. Second, to make it work in firefox, just copy plugins folder from /usr/lib/mozilla into /usr/lib/firefox-3.0. In my case plugins folder in /usr/lib/firefox-3.0 did not exist until I had coppied it there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6706624099438391589?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6706624099438391589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/arch-linux-install-adobe-flash-plugin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6706624099438391589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6706624099438391589'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/04/arch-linux-install-adobe-flash-plugin.html' title='Arch linux: Install adobe flash plugin for firefox 3'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-7551643412355856327</id><published>2009-03-26T02:10:00.000-07:00</published><updated>2009-10-22T01:12:16.376-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>Arch linux: very first impression</title><content type='html'>&lt;div style="text-align: justify;"&gt;Usually I don't write any reviews or any opinions on linux distros. However, I have to make an exception. The reason is that I have just install &lt;a href="http://www.archlinux.org/"&gt;Arch linux&lt;/a&gt;! Arch linux is &lt;strong&gt;&lt;/strong&gt; &lt;blockquote&gt;a lightweight and flexible Linux® distribution that tries to Keep It Simple.&lt;/blockquote&gt;First on virtual box though, just to see what all the fuss is about. What I see is that this distro is quite interesting, it was easy to install. It was easy to set up fluxbox, and some other programs that I need (e.g. python-numpy, python-scipy, matplotlib). Currently I’m using CentOS on my HPC (high performance computing) server, and ubuntu 8.10 on desktop. In few weeks Ubuntu 9.04 released and I strongly think that I may move to Arch on desktop! Not 100% sure now, but I keep testing arch on virtualbox. Definitely, the first impression is positive! If I'll have some further info about this, I will update this post.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SdhHWujGhMI/AAAAAAAAAes/8612F8B0Zz8/s1600-h/archlinux-icon-tango-64.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/SdhHWujGhMI/AAAAAAAAAes/8612F8B0Zz8/s400/archlinux-icon-tango-64.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5321081415516193986" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-7551643412355856327?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/7551643412355856327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/arch-linux-very-first-impression.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7551643412355856327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/7551643412355856327'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/arch-linux-very-first-impression.html' title='Arch linux: very first impression'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/SdhHWujGhMI/AAAAAAAAAes/8612F8B0Zz8/s72-c/archlinux-icon-tango-64.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-4103327322486934791</id><published>2009-03-18T01:10:00.000-07:00</published><updated>2009-10-22T01:09:29.661-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch'/><title type='text'>ubuntu-server 8.10: problem with vncsever</title><content type='html'>To install vncserver on ubuntu-server 8.10 one can use the following&lt;code&gt;sudo apt-get install tightvncserver fluxbox xterm&lt;/code&gt;or&lt;code&gt;sudo apt-get install vnc4server fluxbox xterm&lt;/code&gt; where fluxbox is the name of window manager that we want. I like fluxbox, but there are others such as twm ot ctwm. xterm is terminal console. I used the first command.&lt;br /&gt;&lt;br /&gt;After installation, each user can run its own vncserver to connect to. To start it, please run vncserver as a normal user (not root). When you run it for the first time vncserver will ask you for your password.&lt;br /&gt;&lt;br /&gt;However, there is a problem with vncserver in this version of ubuntu. The problem is that file rgb.txt is missing, and as results vnc cannot display colors correctly. The errors in vncserver log file in ~/.vnc folder are be:&lt;code&gt;Couldn't open RGB_DB '/usr/X11R6/lib/X11/rgb'&lt;br /&gt;xsetroot:  unknown color "grey"&lt;/code&gt; To be specific, in my case, when I starter xterm, it was just showing black "patch" and not a command prompt.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/ScCsqytszRI/AAAAAAAAAek/XL7eC5iF3oo/s1600-h/vnc1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 306px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/ScCsqytszRI/AAAAAAAAAek/XL7eC5iF3oo/s400/vnc1.png" alt="" id="BLOGGER_PHOTO_ID_5314437411465121042" border="0" /&gt;&lt;/a&gt;When searching for this rgb.txt file one finds it in /usr/share/X11/rgb.txt. However, this is a broken link:&lt;code&gt;ls -l /usr/share/X11/rgb.txt&lt;br /&gt;lrwxrwxrwx 1 root root 16 2009-03-17 10:09 /usr/share/X11/rgb.txt -&gt; /etc/X11/rgb.txt&lt;/code&gt;File /etc/X11/rgb.txt does not exists. The solution is to  manual upload the file to /etc/X11/ and to make it readable. The file can be found performing a search in google. With this file, the colors can be displayed correctly and finally xterm in vnc was displaying what it should be displaying, i.e. command prompt.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qvZ1h1bgBRo/ScCsqzC-vdI/AAAAAAAAAec/A1J3Bexx0YA/s1600-h/vnc2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_qvZ1h1bgBRo/ScCsqzC-vdI/AAAAAAAAAec/A1J3Bexx0YA/s400/vnc2.png" alt="" id="BLOGGER_PHOTO_ID_5314437411554377170" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-4103327322486934791?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/4103327322486934791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/ubuntu-server-810-problem-with-vncsever.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4103327322486934791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/4103327322486934791'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/ubuntu-server-810-problem-with-vncsever.html' title='ubuntu-server 8.10: problem with vncsever'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/ScCsqytszRI/AAAAAAAAAek/XL7eC5iF3oo/s72-c/vnc1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-2404392261563541641</id><published>2009-03-16T16:53:00.000-07:00</published><updated>2009-10-22T00:58:12.662-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>LS-DYNA parallel: SMP vs MPP</title><content type='html'>&lt;blockquote&gt;LS-DYNA, is an part of ANSYS software and it is a general purpose transient dynamic finite element program capable of simulating complex real world problems.&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;For large models, you can use the &lt;span style="font-weight: bold;"&gt;shared memory parallel processing&lt;/span&gt; (SMP) or the &lt;span style="font-weight: bold;"&gt;massively parallel processing&lt;/span&gt; (MPP) capabilities of ANSYS LS-DYNA to shorten the elapsed time necessary to run an analysis.&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;The &lt;span style="font-weight: bold;"&gt;shared memory parallel&lt;/span&gt; processing capabilities allow you to distribute model-solving power over multiple processors on the same machine.&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;The &lt;span style="font-weight: bold;"&gt;massively parallel processing&lt;/span&gt; (MPP) capabilities of ANSYS LS-DYNA allow you to run the LS-DYNA solver over a cluster of machines or use multiple processors on a single machine.&lt;/blockquote&gt;&lt;h4 style="text-align: center;"&gt;My question is which one is faster and how faster?&lt;/h4&gt;To answer to this question, I performed LS-DYNA simulation of an official LS-DYNA example &lt;a href="http://www.dynaexamples.com/Examplesmanual/Misc/Airbag/Download/"&gt;airbag.deploy.k&lt;/a&gt;, once with SMP and once with MPP for different number of CPUs. To use LS-DYNA SMP I used the following example command:&lt;code&gt;ls971.e110 pr=aa_r_dy ncpu=%d i=airbag.deploy.k&lt;/code&gt; where pr=aa_r_dy is my license, and %d is the number of CPUs to be used for solving the airbag problem. For LS-DYNA MPP I used:&lt;code&gt;lsdyna110 -dis -np %d pr=aa_r_dy i=.airbag.deploy.k&lt;/code&gt; where %d is the number of CPUs to be used.&lt;br /&gt;&lt;br /&gt;The above commands were used in a short Python script (it is &lt;a href="http://sites.google.com/site/someexamplestuffsite/files-1/testlsdyna.py?attredirects=0"&gt;here&lt;/a&gt;) that executes them with different values of %d, calculates execution times, and generates file with the time results. The times obtained were plotted against number of CPUs used:&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sb7ui_OH4mI/AAAAAAAAAeU/rQMCD4t6x18/s1600-h/LS-DYNA_parallel.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 298px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sb7ui_OH4mI/AAAAAAAAAeU/rQMCD4t6x18/s400/LS-DYNA_parallel.png" alt="" id="BLOGGER_PHOTO_ID_5313946895197397602" border="0" /&gt;&lt;/a&gt;The tests were executed on a single server with 4 Intel Xeon processors and 24GB RAM. Each processor had 6 cores. The operating system (CentOS 5.2) sees this as 24 CPUs.&lt;h3&gt;Conclusions&lt;/h3&gt; It can be seen for the graph, that solving LS-DYNA problems using MPP is faster than using SMP. However, the execution time does not reduce linearly with the number of CPUs. One reason may be that airbag.deploy.k is not well suited for solving using large number of CPUs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-2404392261563541641?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/2404392261563541641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/ls-dyna-parallel-smp-vs-mpp.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/2404392261563541641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/2404392261563541641'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/ls-dyna-parallel-smp-vs-mpp.html' title='LS-DYNA parallel: SMP vs MPP'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sb7ui_OH4mI/AAAAAAAAAeU/rQMCD4t6x18/s72-c/LS-DYNA_parallel.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-633756023733133818</id><published>2009-03-11T01:11:00.000-07:00</published><updated>2009-10-22T00:58:43.679-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Linux: Error while loading shared libraries</title><content type='html'>Just indicate the folder containing the library:&lt;code&gt;export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/folder/with/lirbary&lt;/code&gt; To check what libraries are used by a given program, one can use ldd:&lt;code&gt;ldd ./ls971_mpphpmpi.e110 &lt;br /&gt;        libmpio.so.1 =&gt; not found&lt;br /&gt;        libmpi.so.1 =&gt; not found&lt;br /&gt;        libdl.so.2 =&gt; /lib64/libdl.so.2 (0x0000003874a00000)&lt;br /&gt;        libm.so.6 =&gt; /lib64/libm.so.6 (0x0000003874600000)&lt;br /&gt;        libstdc++.so.6 =&gt; /usr/lib64/libstdc++.so.6 (0x0000003885800000)&lt;br /&gt;        libgcc_s.so.1 =&gt; /lib64/libgcc_s.so.1 (0x0000003885400000)&lt;br /&gt;        libc.so.6 =&gt; /lib64/libc.so.6 (0x0000003874200000)&lt;br /&gt;        /lib64/ld-linux-x86-64.so.2 (0x0000003873200000)&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-633756023733133818?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/633756023733133818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/linux-error-while-loading-shared.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/633756023733133818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/633756023733133818'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/linux-error-while-loading-shared.html' title='Linux: Error while loading shared libraries'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-5418164253395848598</id><published>2009-03-10T21:04:00.000-07:00</published><updated>2009-10-22T01:12:59.963-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Xen'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Xen: performance of full virtualization vs. paravirtualization</title><content type='html'>I wanted to check what is the difference in performance between virtualization and paravirtualization using &lt;a href="http://en.wikipedia.org/wiki/Xen"&gt;Xen&lt;/a&gt;. Before going any further some basic info about paravirtualization and full virtualization is given.&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Under &lt;span style="font-style: italic;"&gt;paravirtualization&lt;/span&gt; the kernel of the guest operating system is modified specifically to run on the hypervisor [from &lt;a href="http://www.virtuatopia.com/index.php/An_Overview_of_Virtualization_Techniques#Paravirtualization"&gt;here&lt;/a&gt;], where &lt;i&gt;hypervisor&lt;/i&gt;  is a program that runs directly on the hardware of the host system in ring 0. The task of the hypervisor is to handle resource and memory allocation for the virtual machines in addition to providing interfaces for higher level administration and monitoring tools [from &lt;a href="http://www.virtuatopia.com/index.php/An_Overview_of_Virtualization_Techniques#Paravirtualization"&gt;here&lt;/a&gt;]. &lt;span style="font-style: italic;"&gt;Full virtualization &lt;/span&gt;provides support for unmodified guest operating systems. The term unmodified refers to operating system kernels which have not been altered to run on a hypervisor and therefore still execute privileged operations as though running in ring 0 of the CPU. In this scenario, the hypervisor provides CPU emulation to handle and modify privileged and protected CPU operations made by unmodified guest operating system kernels [from &lt;a href="http://www.virtuatopia.com/index.php/An_Overview_of_Virtualization_Techniques#Paravirtualization"&gt;here&lt;/a&gt;].&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To compare the performance of paravirtualized system with full virtualized syststem I created two virtual machines (two domU's). The first one was full virtualization with CentOS 5.2 x86_64, while the second one was paravirtualization with the same CentOS 5.2 x86_64. CentOS's were installed with identical sets of packages and configurations. The only difference between the two, was that one was installed using full virtualization, while the second was installed using paravirtualization. Both were installed with four virtual CPU's and 1GB of RAM. The host (dom0) was CentOS 5.2 x86_64 with 24 CPUs (4 physical Xeon CPUs, each with 6 cores)  and 24GB of RAM. It must be noted the my CPUs support hardware virtualization (Intel VT-x). &lt;span style="font-style: italic;"&gt;Hardware virtualization&lt;/span&gt; leverages virtualization features built into the latest generations of CPUs from both Intel and AMD [from &lt;a href="http://www.virtuatopia.com/index.php/An_Overview_of_Virtualization_Techniques#Paravirtualization"&gt;here&lt;/a&gt;]. Therefore, the following title of this post could be  better:  Xen: performance of hardware virtualization vs. paravirtualization. However, I basically refer to the fact that in paravirtualization the kernel of the guest (i.e. domU) is modified, while in full and hardware virtualizations the kernel of the guest is not modified.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sbi_qsXqWmI/AAAAAAAAAeE/fet6293X3iA/s1600-h/Centos_xen.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 251px;" src="http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sbi_qsXqWmI/AAAAAAAAAeE/fet6293X3iA/s400/Centos_xen.png" alt="" id="BLOGGER_PHOTO_ID_5312206500669315682" border="0" /&gt;&lt;/a&gt;To compare the performance the following benchmarks were used: &lt;a href="http://www.tux.org/%7Emayer/linux/bmark.html"&gt;nbench&lt;/a&gt;, &lt;a href="http://www.anime.net/%7Egoemon/benchmarks.html"&gt;bench&lt;/a&gt; and &lt;a href="http://www.xtremesystems.org/forums/showthread.php?p=2898899"&gt;primes 0.9&lt;/a&gt;. nbench and bench are single-threaded benchmarks, while primes is multi-threaded benchmark. Primes benchmark was executed with four CPUs and option #15 (i.e.  find all prime number less than 256,000,000). The tests on one virtual machine were performed while the other was not running.&lt;br /&gt;&lt;br /&gt;Some results are presented below. Full results are &lt;a href="http://sites.google.com/site/someexamplestuffsite/files-1/PV.txt?attredirects=0"&gt;here&lt;/a&gt; (PV) and &lt;a href="http://sites.google.com/site/someexamplestuffsite/files-1/FV.txt?attredirects=0"&gt;here&lt;/a&gt; (FV). &lt;span style="font-weight: bold;"&gt;Better results between the two virtualization method were marked using bold font&lt;/span&gt;. For complicity, results for dom0 are also given. Dom0 was the same CentOS 5.2 x86_64 as was used in virtual machines. However, there were differences in configuration, installed packages and services. In another words, dom0 was little more loaded than any domU. During the tests on dom0, virtual machines were shutdown. The full results for dom0 are &lt;a href="http://sites.google.com/site/someexamplestuffsite/files-1/dom0.txt?attredirects=0"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;nbench results&lt;/h3&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Index (higher is better)&lt;/td&gt;     &lt;td&gt;Full virtualization&lt;/td&gt;   &lt;td&gt;Paravirtualization&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;dom0&lt;br /&gt;&lt;/td&gt;  &lt;/tr&gt;   &lt;tr&gt;     &lt;td&gt;MEMORY INDEX&lt;/td&gt;     &lt;td&gt;18.892&lt;/td&gt;     &lt;td style="font-weight: bold;"&gt;18.991&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;21.046&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt;   &lt;tr&gt;  &lt;td&gt;INTEGER INDEX&lt;/td&gt;     &lt;td&gt;16.921&lt;/td&gt;     &lt;td style="font-weight: bold;"&gt;17.062&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;17.969&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;FLOATING-POINT INDEX&lt;/td&gt; &lt;td&gt;28.499&lt;/td&gt;  &lt;td style="font-weight: bold;"&gt;28.781&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;29.917&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Update 17/03/09: I tested fully virtualized ubuntu-server 8.10 using nbench and got: 19.037,18.017 and 28.756.&lt;br /&gt;&lt;h3&gt;Primes results&lt;/h3&gt;&lt;table border="1"&gt;   &lt;tbody&gt;&lt;tr&gt;  &lt;td&gt;Time [s] (lower is better)&lt;/td&gt;   &lt;td&gt;Full virtualization&lt;/td&gt;  &lt;td&gt;Paravirtualization&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;dom0*&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;     &lt;td&gt;Time&lt;/td&gt;     &lt;td&gt;116.423&lt;/td&gt;  &lt;td style="font-weight: bold;"&gt;112.432&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;104.67&lt;br /&gt;&lt;/td&gt;   &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;* - four CPUs were used.&lt;br /&gt;&lt;br /&gt;Update 17/03/09: I tested fully virtualized ubuntu-server 8.10 using primes, and got 113.297 s.&lt;br /&gt;&lt;h3&gt;bench results&lt;/h3&gt;&lt;table border="1"&gt;   &lt;tbody&gt;&lt;tr&gt;  &lt;td&gt;Index (higher is better)&lt;/td&gt;     &lt;td&gt;Full virtualization&lt;/td&gt;     &lt;td&gt;Paravirtualization&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;dom0&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;     &lt;td&gt;Arithmetic Test (type = double)&lt;/td&gt;     &lt;td&gt;409.6&lt;/td&gt;  &lt;td style="font-weight: bold;"&gt;411.6&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;461.3&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;   &lt;td&gt;Dhrystone 2 without register variables&lt;/td&gt;&lt;td&gt;484.4&lt;/td&gt;    &lt;td style="font-weight: bold;"&gt;489.8&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;539.2&lt;br /&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Process Creation Test [lps]&lt;/td&gt;    &lt;td&gt;614.0&lt;/td&gt;   &lt;td style="font-weight: bold;"&gt;3176.7&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;2855.6&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td&gt;Shell scripts (4 concurrent) [lpm]&lt;/td&gt;    &lt;td&gt;190.6&lt;/td&gt;   &lt;td style="font-weight: bold;"&gt;1250.0&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;1261.3&lt;br /&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;Conclusions&lt;/h3&gt;&lt;div style="text-align: justify;"&gt;Paravirtualization is marginally faster than full virtualization in my case. Therefore, from the results obtained it does not appear that paravirtualization exhibits much greater performance over  full virtualization. One reason for this may be the fact that my CPU's support hardware virtualization. However, my tests were not full. Things such as network bandwich, disk operations etc. were not tested. More tests is required.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-5418164253395848598?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/5418164253395848598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/xen-performance-of-full-virtualization.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5418164253395848598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/5418164253395848598'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/xen-performance-of-full-virtualization.html' title='Xen: performance of full virtualization vs. paravirtualization'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qvZ1h1bgBRo/Sbi_qsXqWmI/AAAAAAAAAeE/fet6293X3iA/s72-c/Centos_xen.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8576760593081418534</id><published>2009-03-10T00:37:00.000-07:00</published><updated>2009-10-22T01:12:59.963-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Xen'/><title type='text'>Xen: Error: Device creation failed for domain</title><content type='html'>On  CentOS 5.2 I had few paravirtualized domU's running. Everything went fine, but one day my Xen could not start any domU. The errors were:&lt;code&gt;xm create /etc/xen/testPV&lt;br /&gt;Using config file "/etc/xen/testPV ".&lt;br /&gt;Error: Device 0 (vif) could not be connected. Hotplug scripts not working.&lt;/code&gt;The above error was shown about 1-2 min after xm create command was issued. However, when I hit Ctrl+c during this time I got &lt;code&gt;xm create /etc/xen/testPV&lt;br /&gt;Using config file "/etc/xen/testPV".&lt;br /&gt;Error: Device creation failed for domain testPV&lt;/code&gt; I found that these erros were caused by the fact that udevd was not workig. To check if it is working I used&lt;code&gt;ps aux | grep udevd&lt;/code&gt;udevd is (from man) &lt;blockquote&gt;udevd allows the serialization of hotplug(8) events. The events generated by the kernel may arrive in random order in userspace, that makes it necessary to reorder them. udevd takes care of the kernel supplied sequence number and arranges the events for execution in the correct order. Missing sequences delay the execution of the following events until a timeout is reached.&lt;/blockquote&gt;  So I started it as a root using:&lt;code&gt;udevd --daemon&lt;/code&gt;Once it was working I could start my domU's with xm create command. So it appears that in my case udevd was not working. Most likely I killed it by accident.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8576760593081418534?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8576760593081418534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/xen-error-device-creation-failed-for.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8576760593081418534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8576760593081418534'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/xen-error-device-creation-failed-for.html' title='Xen: Error: Device creation failed for domain'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8198665245929172300</id><published>2009-03-08T22:31:00.000-07:00</published><updated>2009-10-22T00:57:52.950-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Linux: creating ramdisk</title><content type='html'>The following comes from &lt;a href="http://www.tuxradar.com/content/more-linux-tips-every-geek-should-know"&gt;tip #45&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Remember the old days of RAM disks? Well, Linux has them too! If you've never tried them, a RAM disk is a virtual filesystem that runs entirely from your PC's main memory, which means it's lightning fast to read and write anything you want.&lt;br /&gt;&lt;br /&gt;How much space you choose to allocate to your RAM disk is down to how much RAM you have and how much you plan to use it - if you have 1GB of RAM, you can easily spare 64MB for a ramdisk; if you have 2GB you can probably spare 256MB, and if you're lucky enough to have 4GB then you can easily stretch your RAM disk legs with 1GB.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Here's how to set up a 64MB disk - just change the 65536 for the size you want:&lt;code&gt;mkfs -t ext3 -q /dev/ram1 65536&lt;br /&gt;mkdir -p /ramdisk&lt;br /&gt;mount /dev/ram1 /ramdisk -o defaults,r,w&lt;/code&gt; or &lt;code&gt;mkdir /ramdisk&lt;br /&gt;mount none -t tmpfs -o size=256M /ramdisk&lt;/code&gt;That will allocate 256MB of space to your RAM disk. If you skip the "-o size=256M" part, half your RAM will be used by default.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8198665245929172300?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8198665245929172300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/lunux-creating-ramdisk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8198665245929172300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8198665245929172300'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/lunux-creating-ramdisk.html' title='Linux: creating ramdisk'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-9128437501576376509</id><published>2009-03-07T17:21:00.001-08:00</published><updated>2009-10-22T02:27:57.297-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><title type='text'>Excel: Convert text to number</title><content type='html'>To convert number written as text in excel, one can use value function: &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SbMdqOxcuPI/AAAAAAAAAd8/QJ2TF4HUraY/s1600-h/Picture+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 258px; height: 132px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SbMdqOxcuPI/AAAAAAAAAd8/QJ2TF4HUraY/s400/Picture+1.png" alt="" id="BLOGGER_PHOTO_ID_5310620996957157618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SbMdp1xBDII/AAAAAAAAAd0/O8HQxCRCOiw/s1600-h/Picture+2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 244px; height: 119px;" src="http://2.bp.blogspot.com/_qvZ1h1bgBRo/SbMdp1xBDII/AAAAAAAAAd0/O8HQxCRCOiw/s400/Picture+2.png" alt="" id="BLOGGER_PHOTO_ID_5310620990244457602" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-9128437501576376509?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/9128437501576376509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/excel-convert-text-to-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9128437501576376509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/9128437501576376509'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/excel-convert-text-to-number.html' title='Excel: Convert text to number'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qvZ1h1bgBRo/SbMdqOxcuPI/AAAAAAAAAd8/QJ2TF4HUraY/s72-c/Picture+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6862126483267480965</id><published>2009-03-06T17:33:00.000-08:00</published><updated>2009-10-22T00:57:52.950-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Missing libXm.so.3 in ANSYS 11 SP1 on RHEL4</title><content type='html'>&lt;div style="text-align: justify;"&gt;According to  ANSYS Version 11.0 Service Pack 1 - &lt;a href="http://www.ansys.com/services/ss-110-SP1-platform-support.pdf"&gt;Platform Support Table&lt;/a&gt;, ANSYS 11 SP1 for Intel Xeon EM64T/AMD Opteron  is fully supported  on Red Hat Enterprise Linux 4.0. One would expect that installing and running ANSYS on this OS would be painless. However, although installation along with setting licence went smooth, I had problems starting ANSYS. The error was:&lt;code&gt;/usr/ansys_inc/v110/ansys/bin/linem64t/ansys.e110: error while loading shared libraries: &lt;span style="font-weight: bold;"&gt;libXm.so.3&lt;/span&gt;: cannot open shared object file: No such file or directory&lt;/code&gt; Therefore, the first thing I did was to check if my RHEL4.5 comes with this library. To do this I did as a root:&lt;code&gt;find / -name "libXm.so.3"&lt;/code&gt;As a result I found this library in /usr/X11R6/lib/. This library belongs to openmotif package, however in my case I had 32bit version of this package. My RHEL4.5 and ANSYS were for x86_64 platform. The only thing I had to do, was to install 64bit version &lt;code&gt;rpm -ivh openmotif-2.2.3-10.1.el4.x86_64.rpm&lt;/code&gt; Openmotif package contains libraries of graphical user interface that is used in ANSYS.  This package can be found on RHEL4.5 installation CDs/DVD. Once the package was installed, libXm.so.3 was also located in /usr/X11R6/lib64/. This was enough to start ANSYS.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Very similar problems were found when the same ANSYS 11 SP1 was installed on CentOS5.2 on the same machine. So, in my case there was no apparent advantage in using RHEL4.5 over CentOS5.2. It appears that that similar problems occur whether I was using officially supported OS than not supported.&lt;br /&gt;&lt;br /&gt;One would expect that when ANSYS claims that something is supported it would work out of the box. Unfortunately, this is not the case. This was not the only problem with ANSYS. I also cannot start CFX launcher. I get en error &lt;code&gt;/var/tmp/anslaunch110.chris.12.sh: line 3: cfx5: command not found&lt;/code&gt; The same situation is in CentOS 5.2. However, since I do not need to use CFX I did not spend any time trying to make it work. If someone knows, how to fix it, I would be very grateful. It seems that some paths must be added to PATH environmental variable.&lt;br /&gt;&lt;br /&gt;Finally, I have to point out that ANSYS Version 11.0 Service Pack 1 - Platform Support Table says RHEL 4.0 not 4.5! So maybe if I was using over 4 years old OS, everything would work out of box.  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6862126483267480965?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6862126483267480965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/missing-libxmso3-in-ansys-11-sp1-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6862126483267480965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6862126483267480965'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/missing-libxmso3-in-ansys-11-sp1-on.html' title='Missing libXm.so.3 in ANSYS 11 SP1 on RHEL4'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-6145659200809356376</id><published>2009-03-04T17:53:00.000-08:00</published><updated>2009-03-04T18:01:10.642-08:00</updated><title type='text'>CentoOS: Long delay after password in ssh</title><content type='html'>&lt;div style="text-align: justify;"&gt;From some computers, when I wanted to connect to my server using ssh, I had to wait about 30s before I could login. I goggled this and I found  &lt;a href="http://www.webhostingtalk.com/showthread.php?t=586092"&gt;this&lt;/a&gt; and &lt;a href="http://macnewbie.wordpress.com/2006/08/30/slow-ssh-connections-on-mac-os-x/"&gt;this&lt;/a&gt;. I tried both solution and they work. In second solution I had to edit /etc/hosts on my server and add my computer that I use to connect to the server. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-6145659200809356376?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/6145659200809356376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/centoos-long-delay-after-password-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6145659200809356376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/6145659200809356376'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/centoos-long-delay-after-password-in.html' title='CentoOS: Long delay after password in ssh'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-36526186.post-8154620457011933471</id><published>2009-03-03T19:42:00.000-08:00</published><updated>2009-10-22T00:57:52.950-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>CentOS: ANSYS: error while loading shared libraries: libXm.so.3</title><content type='html'>After installing ANSYS 11 SP1 on CentoOS 5.2 x86_64 and trying to start some new job I got the error that libXm.so.3 is missing. Ansys does not come with it, so I installed it form CentOS5.2 dvd. To be specific, I installed the following package that contains this library:&lt;code&gt;openmotif22-2.2.3-18.x86_64.rpm&lt;/code&gt;Just after this I had another error: "cannot restore segment prot after reloc: Permission denied". This is due to SElinux. Therefore, I disabled SElinux in CentOS5.2 using Security Level and Firewall in Gnome System-&gt;Administration. No reboot was required.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/36526186-8154620457011933471?l=shortrecipes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shortrecipes.blogspot.com/feeds/8154620457011933471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/centos-ansys-error-while-loading-shared.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8154620457011933471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36526186/posts/default/8154620457011933471'/><link rel='alternate' type='text/html' href='http://shortrecipes.blogspot.com/2009/03/centos-ansys-error-while-loading-shared.html' title='CentOS: ANSYS: error while loading shared libraries: libXm.so.3'/><author><name>W</name><uri>http://www.blogger.com/profile/04578057696168658626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_qvZ1h1bgBRo/StwUrmTzefI/AAAAAAAAAkg/KLMEIkKAhxo/S220/me.png'/></author><thr:total>0</thr:total></entry></feed>
