<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DU4CR30ycCp7ImA9WhRRFE4.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468</id><updated>2011-11-28T05:22:46.398+05:30</updated><category term="images" /><category term="statistical analysis tools" /><category term="Data encryption" /><category term="Vista boot loader" /><category term="data analysis" /><category term="statistical tools" /><category term="Linux" /><category term="iSCSI backup" /><category term="remove invalid email" /><category term="free clipart" /><category term="mother nature" /><category term="humanity" /><category term="nature" /><category term="Moodle" /><category term="Ubuntu" /><category term="dual booting" /><category term="statistics" /><category term="Windows" /><category term="Bouncing email" /><category term="kind" /><category term="System Backup" /><category term="life" /><title>.:ATTALAYA.::.අට්ටාලය:.</title><subtitle type="html">sum of my thoughts and experience</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://attalaya.blogspot.com/" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/attalaya" /><feedburner:info uri="attalaya" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CUUFQng4cSp7ImA9WxFXF0Q.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468.post-2515766384222627055</id><published>2010-05-20T12:43:00.007+05:30</published><updated>2010-05-25T18:43:33.639+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-25T18:43:33.639+05:30</app:edited><title>Split an Array Gradually</title><content type="html">Simple code snippet to devide and print an array of size 2 to the power x gradually.The code divides array and print elements in equal granularity at each stage. However, it will not repeat printed elements twice. Test it and find out.
&lt;br /&gt;&lt;br /&gt;
&lt;textarea cols="90" readonly="readonly" rows="40" style="overflow:scroll"&gt;
/*
# Copyright (C) 2008 Kenneth Manjula Thilakarathna mail: kenneth.tux@gmail.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#    This product includes software developed by the &lt;organization&gt;.
# 4. Neither the name of the &lt;organization&gt; nor the
#    names of its contributors may be used to endorse or promote products
#    derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY &lt;COPYRIGHT HOLDER&gt; ''AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL &lt;COPYRIGHT HOLDER&gt; BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Simple code snippet to devide and print an array of size 2 to the power x gradually.
 * The code divides array and print elements in equal granularity at each stage.
 * However, it will not repeat printed elements twise. Test it and find out.
 ************************************************************************************/
#include &lt;stdio.h&gt;

int main(){

 // Declaration and initialization of variables 
  int i,j,k,l,a,interval;
  printf("Insert a value for array size: ");
  scanf("%d", &amp;i);
  // Check if you entered a valid number and if so continue
  if(i&gt;1 &amp;&amp; ((i &amp; (i-1))==0)){
    // array initialization 
    int sample_array[i-1];
    for (l=0;l&amp;lt;i;l++)
      sample_array[l]=l+1;


    // Here goes the algo ..
    printf("Sending %d and %d\n", sample_array[0], sample_array[i-1]);

    for(j=2;j&lt;=i;){
      interval = i/j;
      j = j*2;
      printf("Sending ");
      k=1;
      if(interval == 1)a = 2;else a = 0;
      for(a;a&amp;lt;i;){
        if(a!=0 &amp;&amp; (k%2)==0)
          printf(" %d",sample_array[a-1]);
        k = k +1;
        a = a+interval;
      }
      printf("\n");
    }
    // algo ends
  }else
    printf("Number %d is not a power of two :D\n", i);
return 0;
}
&lt;/textarea&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1593749168785549468-2515766384222627055?l=attalaya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0irCHo-oNJvIR6s_BhH3Wb9Nkag/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0irCHo-oNJvIR6s_BhH3Wb9Nkag/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0irCHo-oNJvIR6s_BhH3Wb9Nkag/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0irCHo-oNJvIR6s_BhH3Wb9Nkag/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/attalaya/~4/qk86CdRsoo0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/2515766384222627055/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://attalaya.blogspot.com/2010/05/split-array-gradually.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/2515766384222627055?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/2515766384222627055?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/attalaya/~3/qk86CdRsoo0/split-array-gradually.html" title="Split an Array Gradually" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://attalaya.blogspot.com/2010/05/split-array-gradually.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQGSXo5fSp7ImA9WxFXF0Q.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468.post-3270924261857159217</id><published>2010-05-11T21:29:00.016+05:30</published><updated>2010-05-25T18:45:28.425+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-25T18:45:28.425+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="remove invalid email" /><category scheme="http://www.blogger.com/atom/ns#" term="Moodle" /><category scheme="http://www.blogger.com/atom/ns#" term="Bouncing email" /><title>Moodle Email Delete from Users</title><content type="html">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
The main intention of creating this moodle hack is to get rid of bouncing mails. When you install this in the steps described below, you will be able to easily delete bouncing email addresses from using the moodle admin interface itself. Please, test the script before using it. Hope it is useful.
&lt;br /&gt;
1. step: Copy these two scripts to the directory moodle_wwwroot/admin/. Change the permissions appropriately.&lt;br /&gt;
chown apache:apache del_gen_email*&lt;br /&gt; 
chmod 644 del_gen_email*&lt;br /&gt;
&lt;textarea cols="90" readonly="readonly" rows="40" style="overflow:scroll"&gt;
&amp;lt;?php 

/*
# Copyright (C) 2008 Kenneth Manjula Thilakarathna mail: kenneth.tux@gmail.com
#   
#   This program is free software: you may copy, redistribute and/or modify it  
#   under the terms of the GNU General Public License as published by the  
#   Free Software Foundation, either version 2 of the License, or (at your  
#   option) any later version.  
#   
#   This program is distributed in the hope that it will be useful, but  
#   WITHOUT ANY WARRANTY; without even the implied warranty of  
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  
#   General Public License for more details.  
#   
#   You should have received a copy of the GNU General Public License  
#   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
*/
// Hack script by Kenneth
// Deletes the moodle bouncing email content from all users COMPLETELY!!
// Then once they log in next time they will be prompted for updating their email address
// Thank you Yasiru for your idea
// BE VERY CAREFUL USING THIS!  

require_once $CFG-&gt;libdir.'/formslib.php';

class del_gen_email_form extends moodleform {

    function definition() {
        $mform    =&amp; $this-&gt;_form;
        $renderer =&amp; $mform-&gt;defaultRenderer();

        $mform-&gt;addElement('header', '', 'Enter Bouncing Email Address', '');

        $mform-&gt;addElement('text', 'del_email', get_string('email'));
        $mform-&gt;setType('del_email', PARAM_RAW);

        $this-&gt;add_action_buttons(true, get_string('ok'));
    }

}

?&gt;
&lt;/textarea&gt;

&lt;textarea cols="90" readonly="readonly" rows="40" style="overflow:scroll"&gt;
&amp;lt;?php

/*
# Copyright (C) 2008 Kenneth Manjula Thilakarathna mail: kenneth.tux@gmail.com
#   
#   This program is free software: you may copy, redistribute and/or modify it  
#   under the terms of the GNU General Public License as published by the  
#   Free Software Foundation, either version 2 of the License, or (at your  
#   option) any later version.  
#   
#   This program is distributed in the hope that it will be useful, but  
#   WITHOUT ANY WARRANTY; without even the implied warranty of  
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  
#   General Public License for more details.  
#   
#   You should have received a copy of the GNU General Public License  
#   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
*/
// Hack script by Kenneth
// Deletes the moodle bouncing email content from all users COMPLETELY!!
// Then once they log in next time they will be prompted for updating their email address
// Thank you Yasiru for your idea
// BE VERY CAREFUL USING THIS!  

  
    require_once('../config.php');
    require_once($CFG-&gt;libdir.'/adminlib.php');
    require_once('del_gen_email_form.php');

    admin_externalpage_setup('delgenemail');

    require_login();

    $reallysure = optional_param('reallysure', 0, PARAM_BOOL);
    $del_email_addr= optional_param('del_email', '', PARAM_RAW);
    if (empty($sesskey)){
    $sesskey= sesskey();
       }else{
        $sesskey= optional_param('sesskey');
       }

    require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));

    $mform = new del_gen_email_form();

    if ($mform-&gt;is_cancelled()){
       redirect($CFG-&gt;wwwroot);    

   }else if($data =  $mform-&gt;get_data()){

     if (!empty($data-&gt;del_email) or ($data-&gt;del_email)!= ''){

       if (empty($reallysure)) {

          admin_externalpage_print_header();
          print_heading('Delete Not Updated Email Addresses');
          $optionsyes = array('del_email'=&gt;$data-&gt;del_email, 'sesskey'=&gt;sesskey(), 'reallysure'=&gt;'yes');
          notice_yesno ('Are you REALLY REALLY completely sure you want to delete all site default email '.$data-&gt;del_email.' from all users?',
           'del_gen_email.php', 'del_gen_email.php', $optionsyes, NULL, 'post', 'get');
          admin_externalpage_print_footer();
          exit;

         } 
     }
   }else if($del_email_addr!='' and $sesskey == sesskey()){
          admin_externalpage_print_header();
          print_heading('Delete Not Updated Email Addresses');
        // OK Here we go
          print($del_email_addr);
          delete_gen_emails($del_email_addr,$CFG-&gt;dbhost,$CFG-&gt;dbuser, $CFG-&gt;dbpass, $CFG-&gt;dbname,$CFG-&gt;prefix); 
          print_box('All email fields having email address '.$del_email_addr.' have been deleted from database', 'generalbox boxwidthnormal boxaligncenter');
          print_continue($CFG-&gt;wwwroot.'/admin/del_gen_email.php');
          admin_externalpage_print_footer();
          exit;

   }else if ($sesskey != sesskey()){
     error('This script was called wrongly');
   }

   function delete_gen_emails($due_del_email,$dbhost,$dbuser,$dbpass,$dbname,$tblprefix){
    
    // test connection
    if (!mysql_connect($dbhost, $dbuser, $dbpass)) {
        die ("Connection to server failed.");
    }
   
    // connect to database
    if (!mysql_select_db($dbname)) {
        die ("Database not found.");
    }
    //make sure all users who are having bouncing email addresses will not have a email address anymore
    $query_del_email= 'UPDATE '.$tblprefix.'user SET email="" where email="'.$due_del_email.'"';
    $result = mysql_query($query_del_email);
    
   //close database connection
    mysql_close();
}

  // Display form
admin_externalpage_print_header();
print_heading('Delete Not Updated Email Addresses');
$mform-&gt;display();
print_footer();

?&gt;
&lt;/textarea&gt;

2. step: There is a php file named users.php at the location moodle_wwwroot/admin/settings/ directory. Edit the file and put the following line in the section  "stuff under the "accounts" subcategory". Note: it is around code line number 80. This is to bring the menu item in the interface Users-&gt;Accounts-&gt;Delete General Email 
&lt;br /&gt;&lt;br /&gt;
 $ADMIN-&gt;add('accounts', new admin_externalpage('delgenemail', 'delete general email', "$CFG-&gt;wwwroot/admin/del_gen_email.php", 'moodle/user:update')); 
&lt;br /&gt;&lt;br /&gt;
Hope it helps :D
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1593749168785549468-3270924261857159217?l=attalaya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1hpJNZB2QV62W-Zx6O_iVBpeTow/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1hpJNZB2QV62W-Zx6O_iVBpeTow/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1hpJNZB2QV62W-Zx6O_iVBpeTow/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1hpJNZB2QV62W-Zx6O_iVBpeTow/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/attalaya/~4/Sa8x7vK7abY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/3270924261857159217/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://attalaya.blogspot.com/2010/05/moodle-email-delete-from-users.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/3270924261857159217?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/3270924261857159217?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/attalaya/~3/Sa8x7vK7abY/moodle-email-delete-from-users.html" title="Moodle Email Delete from Users" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://attalaya.blogspot.com/2010/05/moodle-email-delete-from-users.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIBR307fSp7ImA9WxFXGUk.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468.post-208416783004460100</id><published>2010-05-05T00:49:00.015+05:30</published><updated>2010-05-27T13:35:56.305+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-27T13:35:56.305+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Moodle" /><category scheme="http://www.blogger.com/atom/ns#" term="iSCSI backup" /><category scheme="http://www.blogger.com/atom/ns#" term="System Backup" /><title>Moodle Backup Script</title><content type="html">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
The main intention of creating this backup script is to back up moodle. However, the script is generalized in a way that, once it is configure, users can use it in any GNU/Linux server to backup data and sqldump databases. Hope this is helpful. Note: the script is originally posted by &lt;a href="http://nmlaxaman.blogspot.com/2008/12/rsync-advanced-backup-script-for.html"&gt;Mr. N. M. Laxaman&lt;/a&gt; and I have done some improvements to work it with iSCSI and reporting features.
&lt;br /&gt;
To get things to work.
&lt;br /&gt;
1. Install ssmtp and configure it as a smart host -- &lt;a href="http://www.linux.com/archive/feature/132006"&gt; Simple How to &lt;/a&gt;
&lt;br /&gt;
2. Install and configure iscsi with your iscsi server -- &lt;a href="http://insanelabs.com/linux/debian-open-iscsi-use-iscsi-initiator-to-connect-to-a-san"&gt; Simple How to &lt;/a&gt;. Make sure that you test iscsi properly mounts intended devices.
&lt;br /&gt;
3. Configure the script for your requirements - only edit configuration section
&lt;br /&gt;
4. Make it executable and put it in /etc/cron.&lt;daily,hourly, ...etc&gt; directory as per your requirement
&lt;br /&gt;


&lt;textarea cols="90" readonly="readonly" rows="40" style="overflow:scroll"&gt;
#!/bin/bash
# Moodle system backup script Version: 0.1.1
#  
# Copyright (C) 2008 Nayanajit Mahendra Laxaman mail: nmlaxaman@gmail.com
#   
#   This program is free software: you may copy, redistribute and/or modify it  
#   under the terms of the GNU General Public License as published by the  
#   Free Software Foundation, either version 2 of the License, or (at your  
#   option) any later version.  
#   
#   This program is distributed in the hope that it will be useful, but  
#   WITHOUT ANY WARRANTY; without even the implied warranty of  
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  
#   General Public License for more details.  
#   
#   You should have received a copy of the GNU General Public License  
#   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.  
#   
#  This file incorporates work covered by the following copyright and  
#  permission notice:  
#   
#   Copyright (c) 2010, Kenneth Manjula Thilakarathna &lt;kenneth.tux@gmail.com&gt;  
#   
#      Permission to use, copy, modify, and/or distribute this software  
#      for any purpose with or without fee is hereby granted, provided  
#      that the above copyright notice and this permission notice appear  
#      in all copies.  
#   
#      THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL  
#      WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED  
#      WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE  
#      AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR  
#      CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS  
#      OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,  
#      NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN  
#      CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  
#  

#     +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#     Note: This script requires working ssmtp application installed
#     +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

DAILY=true
WEEKLY=true
MONTHLY=true
YEARLY=true
SEMESTERLY=true

#Set the number of backups to keep in each level
DAYS_TO_KEEP=60
WEEKS_TO_KEEP=26
MONTHS_TO_KEEP=24
YEARS_TO_KEEP=5
SEMESTERS_TO_KEEP=10
DELETE_OLD=true

#Relative backup directories for each level
DAILY_BAK=daily
WEEKLY_BAK=weekly
MONTHLY_BAK=monthly
YEARLY_BAK=yearly
SEMESTER_BAK=semesterly

END_SEMESTER_ONE=31-07   # dd-mm
END_SEMESTER_TWO=31-01  # dd-mm

# Server fqdn
WHICH_SERVER='yourserver.com'

# Enable/Disable backup types
MYSQLDUMP_BACKUP=true

# MySQL Configuration
DATABASES=( db_one db_two )
DB_USER=dbuser
DB_PASS=dbpass

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# There MUST be a backup destination directory coresponding to each source 
# directory
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#Source(s) of backup directory
BACKUP_SOURCES=( /www/lms/ /www/moodledata/ /mysql/db_pg/ )

#Coresponding destination(s) of backup sources
BACK_DIR_LIST=( moodle_web moodle_data moodle_db )

#Mount points and alternative backup locations
ISCSI_MOUNT_POINT=/backup/iscsi-backup/
ALT_BACKUP_DEST=/backup/alternatestorage/

#Weekly backup day (0 - SUN, 1 - MON, ...., 6 - SAT)
BACKUP_DAY=5 # Friday morning

#iSCSI device
BACKUP_DEV=/dev/sda2

# mail address which you wish to receive alerts
MAIL=xxx@yourmail.com

# tmp mail file
TMP_MAIL=/tmp/srvalertmail

# mail address which you wish to send mail from the server
MAIL_FROM=xxx@university.com

# daemon name of iscsi service ...
SERVICE='iscsid'

# End of configuration section 
# -------------------------------------------------------------------- #

MOUNT_STATUS=true

function msg_sender(){
echo "To: $MAIL" &gt; $TMP_MAIL
echo "From: $MAIL_FROM" &gt;&gt; $TMP_MAIL
echo "Subject: Server Alert" &gt;&gt; $TMP_MAIL
echo " " &gt;&gt; $TMP_MAIL
echo "$1" &gt;&gt; $TMP_MAIL
if [ $# -eq 2 ]; then
 echo " " &gt;&gt; $TMP_MAIL
 cat $2 &gt;&gt; $TMP_MAIL
fi
ssmtp $MAIL &lt; $TMP_MAIL
rm $TMP_MAIL
}

if [ ${#BACKUP_SOURCES[*]} != ${#BACK_DIR_LIST[*]} ]; then
 msg_sender "Configuration Error: Check Source and Destination directory lists. Backup is not taken. System Exited"
 exit 0
fi

#Check if iscsi is running. if not backup alternate location and send message
function mount_iscsi(){
#mount iscsi device and if error backup alternate location and send message
[[ -d $ISCSI_MOUNT_POINT ]] || mkdir -p  $ISCSI_MOUNT_POINT
# check if it is already mounted
cat /etc/mtab | grep $BACKUP_DEV &gt;/dev/null 
 if [ "$?" -eq "0" ]; then
   msg_sender "iSCSI unmount may have failed in previous atempt in $WHICH_SERVER server ..." 
# BUG Here ... correct it
 elif [ `mount $BACKUP_DEV $ISCSI_MOUNT_POINT` ] ; then
   [[ -d $ALT_BACKUP_DEST ]] || mkdir -p $ALT_BACKUP_DEST
   ISCSI_MOUNT_POINT=$ALT_BACKUP_DEST
   MOUNT_STATUS=false
   msg_sender "iSCSI mount failed for device $BACKUP_DEV on mount point $ISCSI_MOUNT_POINT in $WHICH_SERVER server ..."
 fi
}

if ps ax | grep -v grep | grep iscsid &gt; /dev/null; then
mount_iscsi
else
 for i in {1..1}; do
  /etc/init.d/$SERVICE start
  sleep 10
 done
 if ps ax | grep -v grep | grep iscsid &gt; /dev/null; then
  msg_sender "One atempt made successfully to start the iSCSI service in $WHICH_SERVER server ... I do not know how it stopped ..."
  mount_iscsi
 else
  [[ -d $ALT_BACKUP_DEST ]] || mkdir -p $ALT_BACKUP_DEST
  ISCSI_MOUNT_POINT=$ALT_BACKUP_DEST
  MOUNT_STATUS=false
  msg_sender "One atempts made to start the iscsid service in $WHICH_SERVER server. iSCSI service is not running ..."
 fi
fi

YEAR=`date +%Y`
DAY_OF_WEEK=`date +%u`
TOMORROW_DATE=`date --date="next day" +%d`;
TOMORROW_MONTH=`date --date="next day" +%m`;
YESTERDAY=`date --date="yesterday" +%d-%m-%Y`;
END_SEMESTER_I=$END_SEMESTER_ONE-`date +%Y`
END_SEMESTER_II=$END_SEMESTER_TWO-`date +%Y`


END_OF_WEEK=false
END_OF_MONTH=false
END_OF_YEAR=false

cd $ISCSI_MOUNT_POINT

# Using ISO week numbers
[[ $DAY_OF_WEEK == $BACKUP_DAY ]] &amp;&amp; END_OF_WEEK=true;
[[ $TOMORROW_DATE == 01 ]] &amp;&amp; END_OF_MONTH=true;
[[ $TOMORROW_DATE == 01 ]] &amp;&amp; [[ $TOMORROW_MONTH == 01 ]] &amp;&amp; END_OF_YEAR=true;

if $DAILY; then 
 [[ -d $DAILY_BAK ]] || mkdir $DAILY_BAK 
fi
if $WEEKLY; then
 [[ -d $WEEKLY_BAK ]] || mkdir $WEEKLY_BAK
fi
if $MONTHLY; then
 [[ -d $MONTHLY_BAK ]] || mkdir $MONTHLY_BAK
fi
if $YEARLY; then
 [[ -d $YEARLY_BAK ]] || mkdir $YEARLY_BAK
fi
if $SEMESTERLY; then
 [[ -d $SEMESTER_BAK ]] || mkdir $SEMESTER_BAK
fi

TODAY_BACKUP=`date +%d-%m-%Y`;

function backup(){
# Getting directory backups
RET_VAL=0
echo "" &gt; /tmp/status_mail
echo "Daily backup report for $WHICH_SERVER server." &gt;&gt; /tmp/status_mail
if [ ! -d $1 ]; then
 for i in ${BACK_DIR_LIST[@]}
 do
  mkdir -p $TODAY_BACKUP/$i
 done
else
 if [ -d $TODAY_BACKUP ]; then
  echo "$TODAY_BACKUP tries to run twise in $WHICH_SERVER server... ???" &gt;&gt; /tmp/status_mail
 else
  cp -al $1 $TODAY_BACKUP
  if [ "$?" != 0 ]; then
   RET_VAL=1
   echo " There is an error when trying to copy backup to new directory !!!" &gt;&gt; /tmp/status_mail
  fi
 fi
fi
COUNT=0
for j in ${BACKUP_SOURCES[@]}
do
 if [ ${#BACK_DIR_LIST[*]} -gt $COUNT ]; then
  rsync -a --delete $j $TODAY_BACKUP/${BACK_DIR_LIST[$COUNT]}
  if [ "$?" != 0 ]; then
   RET_VAL=1
   echo "There is an rsync error when processing $j into $TODAY_BACKUP !!!" &gt;&gt; /tmp/status_mail
  fi
  COUNT=`expr $COUNT + 1`
 fi
done

# Getting database dump backups
if $MYSQLDUMP_BACKUP; then
 for k in ${DATABASES[@]}
 do
  if [ `rm $TODAY_BACKUP/mysqldump-$k-$1.gz` ]; then
  echo "Yesterday mysqldump deletion failed for $WHICH_SERVER server... This may be the initial mysql dump" &gt;&gt; /tmp/status_mail
  fi
  if [ `mysqldump -u $DB_USER --password=$DB_PASS $k |gzip &gt; $TODAY_BACKUP/mysqldump-$k-$TODAY_BACKUP.gz` ]; then
  RET_VAL=1
  echo  "$TODAY_BACKUP mysqldump failed for $WHICH_SERVER server..." &gt;&gt; /tmp/status_mail
  fi
 done
fi

# Deleting old backups
if $DELETE_OLD; then
 if [ $(ls . | wc -l) -gt $3 ]; then
  rm -fr $( ls -t . | tail -1 )
  if [ "$?" != 0 ]; then
   echo "Old backup remove failed ..." &gt;&gt; /tmp/status_mail
  fi
# expr $( ls . | wc -l ) \&gt; $2 &amp;&amp; rm -fr $( ls -t . | tail -1 )
 fi
# Reporting 
 if [ $RET_VAL == 1 ]; then
  echo "WARNING: Backup failed ... " &gt;&gt; /tmp/status_mail
  msg_sender "" /tmp/status_mail
 else
  echo "Backup Successfull ... " &gt;&gt; /tmp/status_mail
  msg_sender "" /tmp/status_mail
 fi
fi
}

# LAST_WEEK calculation
function last_week(){
TODAY=`date`
THIS_WEEK=`date -d "$TODAY" +%U`
DATE=1
WEEK=`date -d "$YEAR-1-$DATE" +%U`

while [ "$WEEK" != 01 ]
 do
  DATE=`expr $DATE + 1`
  WEEK=`date -d "$YEAR-1-$DATE" +%U`
 done

FIRST_DATE_OF_FIRST_WEEK=`date --date "$YEAR-01-$DATE"`
THE_DAY_OF_FIRST_DATE_OF_FIRST_WEEK=`date -d "$FIRST_DATE_OF_FIRST_WEEK" +%u`

if [ $BACKUP_DAY == $THE_DAY_OF_FIRST_DATE_OF_FIRST_WEEK ]; then
 FIRST_BACKUP_DATE= $FIRST_DATE_OF_FIRST_WEEK
elif [ $BACKUP_DAY &gt; $THE_DAY_OF_FIRST_DATE_OF_FIRST_WEEK ]; then
 DIFFERENCE=` expr $BACKUP_DAY - $THE_DAY_OF_FIRST_DATE_OF_FIRST_WEEK`
 FIRST_BACKUP_DATE=`date -d "$FIRST_DATE_OF_FIRST_WEEK $DIFFERENCE days"`
elif [ $BACKUP_DAY &lt; $THE_DAY_OF_FIRST_DATE_OF_FIRST_WEEK ]; then
 DIFFERENCE=` expr $BACKUP_DAY + 7 - $THE_DAY_OF_FIRST_DATE_OF_FIRST_WEEK`
 FIRST_BACKUP_DATE=`date -d "$FIRST_DATE_OF_FIRST_WEEK $DIFFERENCE days"`
fi

LAST_WEEK_BACKUP_DATE=`date -d "$FIRST_BACKUP_DATE $((7*(($THIS_WEEK - 1)))) days"`
LAST_WEEK_BACKUP=`date -d "$LAST_WEEK_BACKUP_DATE" +%d-%m-%Y`
}


if $YEARLY &amp;&amp; $END_OF_YEAR; then
cd $YEARLY_BAK
LASTYEAR_BACKUP=`date +%d-%m-$((YEAR-1))`
[[ -d $LASTYEAR_BACKUP ]] || msg_sender "$LASTYEAR_BACKUP yearly backup is not there in $WHICH_SERVER server..."
backup $LASTYEAR_BACKUP $YEARS_TO_KEEP
cd ..
fi

if [ $SEMESTERLY ] &amp;&amp; [ $END_SEMESTER_I == $TODAY_BACKUP ] || [ $END_SEMESTER_II == $TODAY_BACKUP ]; then
cd $SEMESTER_BAK
if [ $TODAY_BACKUP == $END_SEMESTER_I ]; then
 [[ -d $END_SEMESTER_TWO-`expr $YEAR - 1` ]] || msg_sender "$END_SEMESTER_TWO-`expr $YEAR - 1` semester backup is not there in $WHICH_SERVER server..."
 LAST_SEMESTER=$END_SEMESTER_II
elif [ $TODAY_BACKUP == $END_SEMESTER_II ]; then
 [[ -d $END_SEMESTER_I ]] || msg_sender "$END_SEMESTER_I semester backup is not there in $WHICH_SERVER server..."
 LAST_SEMESTER=$END_SEMESTER_I
fi
backup $LAST_SEMESTER $SEMESTERS_TO_KEEP
cd ..
fi

if $MONTHLY &amp;&amp; $END_OF_MONTH; then
cd $MONTHLY_BAK
LASTMONTH_BACKUP=`date -d "$(date +%Y-%m-1) -1 day" +%d-%m-%Y`
[[ -d $LASTMONTH_BACKUP ]] || msg_sender "$LASTMONTH_BACKUP monthly backup is not there in $WHICH_SERVER server..."
backup $LASTMONTH_BACKUP $MONTHS_TO_KEEP
cd ..
fi

if $WEEKLY &amp;&amp; $END_OF_WEEK; then
cd $WEEKLY_BAK
LAST_WEEK_BACKUP= 
last_week
[[ -d $LAST_WEEK_BACKUP ]] || msg_sender "$LAST_WEEK_BACKUP weekly backup is not there in $WHICH_SERVER server..."
backup $LAST_WEEK_BACKUP $WEEKS_TO_KEEP
cd ..
echo " weekly disk usage report for $WHICH_SERVER " &gt; /tmp/week_mail
df -h &gt;&gt; /tmp/week_mail
msg_sender " " /tmp/week_mail 
rm /tmp/week_mail
fi

if $DAILY; then
cd $DAILY_BAK
YESTERDAY_BACKUP=$YESTERDAY;
[[ -d $YESTERDAY_BACKUP ]] || msg_sender "$YESTERDAY_BACKUP daily backup is not there in $WHICH_SERVER server..."
backup $YESTERDAY_BACKUP $DAYS_TO_KEEP
cd ..
fi

if $MOUNT_STATUS; then
 cd /
 if [ `umount $BACKUP_DEV` ]; then
  msg_sender " $BACKUP_DEV unmount failed on $TODAY_BACKUP ??? "
 fi
fi

exit 0
&lt;/textarea&gt;

&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1593749168785549468-208416783004460100?l=attalaya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BJHhvAipTVkdn37BfipbVG-GQhE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BJHhvAipTVkdn37BfipbVG-GQhE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BJHhvAipTVkdn37BfipbVG-GQhE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BJHhvAipTVkdn37BfipbVG-GQhE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/attalaya/~4/vrjFRny8tnI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/208416783004460100/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://attalaya.blogspot.com/2010/05/backup-script.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/208416783004460100?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/208416783004460100?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/attalaya/~3/vrjFRny8tnI/backup-script.html" title="Moodle Backup Script" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://attalaya.blogspot.com/2010/05/backup-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ANR344eyp7ImA9WxJbEEo.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468.post-761810358525971518</id><published>2009-07-20T12:01:00.003+05:30</published><updated>2009-07-20T12:06:36.033+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-20T12:06:36.033+05:30</app:edited><title>VirtualBox Configuration</title><content type="html">It is very well explained in Ubuntu community help site&lt;br /&gt;&lt;a href="https://help.ubuntu.com/community/VirtualBox"&gt;https://help.ubuntu.com/community/VirtualBox&lt;/a&gt;&lt;br /&gt;Note that when configuring networking the hosts may not be able to ping each other but network applications works perfectly&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1593749168785549468-761810358525971518?l=attalaya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lD3c94Lp-vGohvLr4tjRT6e9cIM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lD3c94Lp-vGohvLr4tjRT6e9cIM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lD3c94Lp-vGohvLr4tjRT6e9cIM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lD3c94Lp-vGohvLr4tjRT6e9cIM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/attalaya/~4/CdHkpvqXleU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/761810358525971518/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://attalaya.blogspot.com/2009/07/virtualbox-configuration.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/761810358525971518?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/761810358525971518?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/attalaya/~3/CdHkpvqXleU/virtualbox-configuration.html" title="VirtualBox Configuration" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://attalaya.blogspot.com/2009/07/virtualbox-configuration.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIMQHo4cSp7ImA9WxJUGU8.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468.post-7483342748662190205</id><published>2009-07-18T20:11:00.003+05:30</published><updated>2009-07-18T20:19:41.439+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-18T20:19:41.439+05:30</app:edited><title>Installing ATI Radeon HD2600 propriatory driver on Debian/Lenny</title><content type="html">Download the installer from http://support.amd.com/us/gpudownload/Pages/index.aspx ...&lt;br /&gt;&lt;br /&gt;$mkdir fglrx&lt;br /&gt;$cp ati-driver-installer-9-6-x86.x86_64.run fglrx/&lt;br /&gt;$cd fglrx&lt;br /&gt;$chmod +x ati-driver-installer-9-6-x86.x86_64.run&lt;br /&gt;$./ati-driver-installer-9-6-x86.x86_64.run --buildpkg Debian/lenny&lt;br /&gt;$ su&lt;br /&gt;#dpkg -i *.deb&lt;br /&gt;&lt;br /&gt;Reboot the system for single user mode&lt;br /&gt;#apt-get install build-essential linux-headers-$(uname -r) module-assistant&lt;br /&gt;#m-a prepare&lt;br /&gt;#m-a a-i fglrx&lt;br /&gt;#modprobe -v fglrx&lt;br /&gt;&lt;br /&gt;If this is the first installation &lt;br /&gt;#dpkg-reconfigure xserver-xorg&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1593749168785549468-7483342748662190205?l=attalaya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zRhkuxZ2NXmnTbrZJjQzlMtu9qk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zRhkuxZ2NXmnTbrZJjQzlMtu9qk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zRhkuxZ2NXmnTbrZJjQzlMtu9qk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zRhkuxZ2NXmnTbrZJjQzlMtu9qk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/attalaya/~4/auDNv9cYhsk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/7483342748662190205/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://attalaya.blogspot.com/2009/07/installing-ati-radeon-hd2600.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/7483342748662190205?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/7483342748662190205?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/attalaya/~3/auDNv9cYhsk/installing-ati-radeon-hd2600.html" title="Installing ATI Radeon HD2600 propriatory driver on Debian/Lenny" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://attalaya.blogspot.com/2009/07/installing-ati-radeon-hd2600.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MFSX4zcSp7ImA9WxJUEUk.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468.post-3810492527791152813</id><published>2009-07-09T18:24:00.006+05:30</published><updated>2009-07-09T18:46:58.089+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-09T18:46:58.089+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="statistics" /><category scheme="http://www.blogger.com/atom/ns#" term="statistical tools" /><category scheme="http://www.blogger.com/atom/ns#" term="data analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="statistical analysis tools" /><title>Statistical Data Collection and Analysis Tools for Linux</title><content type="html">I was searching for tools which I could use to analyse statistical data for my research work and found three popular tools. I won't talk about the most famous SPSS here as it is not for free&lt;br /&gt;1. R - http://www.r-project.org/&lt;br /&gt;2. PSPP - http://www.gnu.org/software/pspp/&lt;br /&gt;3. SOFA - Statistics Open For All - http://www.sofastatistics.com/home.php&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 255, 255);"&gt;Installing R&lt;/span&gt;&lt;br /&gt;R is available in universe repositories. But if you want to get the latest version then you have to add a repository as follows.&lt;br /&gt;Add a repository to your /etc/apt/sources.list file&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;deb &lt;/span&gt;&lt;a style="font-family: courier new;" href="http://%3cmy.favorite.cran.mirror%3e/bin/linux/ubuntu"&gt;http://ftp.sunet.se/pub/lang/CRAN&lt;my.favorite.cran.mirror&gt;/bin/linux/ubuntu&lt;/my.favorite.cran.mirror&gt;&lt;/a&gt;&lt;span style="font-family:courier new;"&gt; jaunty/&lt;/span&gt;&lt;br /&gt;You can select a suitable mirror from the following list of mirrors&lt;br /&gt;http://cran.r-project.org/mirrors.html&lt;br /&gt;Then you have to update your package list&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo apt-get update&lt;/span&gt;&lt;br /&gt;Now you are ready to install R into your system&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo apt-get install r-base&lt;/span&gt;&lt;br /&gt;Now it is time to install GUI for r-base called R Commander&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo R&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;install.packages("Rcmdr", dependencies=TRUE)&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;When you want to update your R then it is simple as this&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&gt;update.packages(lib.loc = "/usr/local/lib/R/site-library")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 255, 255);"&gt;Installing PSPP&lt;/span&gt;&lt;br /&gt;PSPP is also available in Ubuntu repositories.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;sudo apt-get install pspp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 255, 255);"&gt;Installing SOFA&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;wget http://www.vislab.uq.edu.au/debuntu/uqvislab-pubkey.asc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo apt-key add uqvislab-pubkey.asc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo apt-get update&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;wget&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; http://www.vislab.uq.edu.au/debuntu/uqvislab-pubkey.asc -O - | sudo apt-key add -&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo wget http://www.vislab.uq.edu.au/debuntu/sources.list.d/jaunty.list -O /etc/apt/sources.list.d/uqvislab.list&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo apt-get update&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo wget http://www.vislab.uq.edu.au/debuntu/sources.list.d/jaunty.list -O /etc/apt/sources.list.d/uqvislab.list&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo apt-get install python-webkitwx&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Download SOFA from http://www.sofastatistics.com/downloads.php&lt;br /&gt;Double click on the downloaded file and install&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1593749168785549468-3810492527791152813?l=attalaya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NP6CuBfDr7oUGzBBMaY12VaY-sQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NP6CuBfDr7oUGzBBMaY12VaY-sQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NP6CuBfDr7oUGzBBMaY12VaY-sQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NP6CuBfDr7oUGzBBMaY12VaY-sQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/attalaya/~4/sTPCtGW2ZRo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/3810492527791152813/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://attalaya.blogspot.com/2009/07/statistical-data-collection-and.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/3810492527791152813?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/3810492527791152813?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/attalaya/~3/sTPCtGW2ZRo/statistical-data-collection-and.html" title="Statistical Data Collection and Analysis Tools for Linux" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://attalaya.blogspot.com/2009/07/statistical-data-collection-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYMSHczfyp7ImA9WxVWFUU.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468.post-4864307806601061667</id><published>2009-02-25T22:43:00.002+05:30</published><updated>2009-02-25T22:46:29.987+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-25T22:46:29.987+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="nature" /><category scheme="http://www.blogger.com/atom/ns#" term="life" /><category scheme="http://www.blogger.com/atom/ns#" term="humanity" /><category scheme="http://www.blogger.com/atom/ns#" term="kind" /><category scheme="http://www.blogger.com/atom/ns#" term="mother nature" /><title>Mother Nature</title><content type="html">I feel that it is worth of sharing this experience with you.  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Today, I needed to get wheel barrow to bring some wood. As the case in most houses, my wheel barrow  was also filled with some junk. I picked out one peace of the stuff at a time to unload the wheel barrow and I was in a hurry. Suddenly a mouse jumped off from it an ran away. Then I heard some noises from under the stuff loaded in the wheel barrow. I continued the cleaning and I found 5 mouse kids who are not even had their eyelids open. I was really worried about what I have done and I picked them and placed them in a box with the garbage that the mouse had make in the same place where the wheel barrow was. I was really worried about that mother who left her children will not come back as I cleaned the things up.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;After some time we heard some noise from the place we left the mouse kiddies. Oh, mom has come to pick her babies and she is hanging around. After few hours we checked for little mouse kiddies and found that mother mouse has taken her children away from that place.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;See how wonderful. But why some of the women are not gifted by such a gift which gives them the courage and feeling to protect their children. Also it is worth to remember that life cannot be valued regardless of being  a human or other living being.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1593749168785549468-4864307806601061667?l=attalaya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5bECwDrT8-bAivN9Z3OoaUNrrWI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5bECwDrT8-bAivN9Z3OoaUNrrWI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5bECwDrT8-bAivN9Z3OoaUNrrWI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5bECwDrT8-bAivN9Z3OoaUNrrWI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/attalaya/~4/K0fR_HCxzlg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/4864307806601061667/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://attalaya.blogspot.com/2009/02/mother-nature.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/4864307806601061667?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/4864307806601061667?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/attalaya/~3/K0fR_HCxzlg/mother-nature.html" title="Mother Nature" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://attalaya.blogspot.com/2009/02/mother-nature.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcHQns7fip7ImA9WxFbFEU.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468.post-6636166266543053717</id><published>2009-02-10T22:39:00.009+05:30</published><updated>2010-07-07T11:57:13.506+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-07T11:57:13.506+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Vista boot loader" /><category scheme="http://www.blogger.com/atom/ns#" term="dual booting" /><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows" /><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu" /><title>Dual booting using Windows Vista boot loader</title><content type="html">I wanted to dual boot my laptop with Windows Vista and Ubuntu GNU/Linux. I used Windows Vista boot manager to boot my GNU/Linux system. I had to do this because, if I would have installed &lt;span style=";font-family:courier;font-size:10;"  &gt;grub&lt;/span&gt; boot loader of Ubuntu system in Master Boot Record then I loose F11 option to recover Windows Vista system (Which I may have to do very frequently). So I decided to use Windows Vista boot loader to boot my Ubuntu GNU/Linux system. I installed Ubuntu boot loader in &lt;span style=";font-family:courier;font-size:10;"  &gt;/boot&lt;/span&gt; mounted device. Make sure you don't reboot your system when asked to do so. If you forgot to not to reboot, don't worry, see bellow. Then get a console and execute following command as root user (replace device files with appropriate). The device should be your /boot partition&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;dd if=/dev/sda5 of=/dev/sdb1/boot.lnx bs=512 count=1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I plugged my pen drive and directly copied the file into it. Then unmount pen drive from the system and rebooted the system into Windows Vista. Get a command line interface by right clicking on the application icon from the menu bar and choosing "Run as Administrator". Then execute following commands ...&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /create {ntldr} /d "GNU/LInux Ubuntu"&lt;/span&gt;&lt;br /&gt;&lt;em&gt;This will create a legacy boot loader entry&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /set {ntldr} device boot&lt;/span&gt;&lt;br /&gt;&lt;em&gt;This will declare it as it contains a bootable system&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /set {ntldr} path /Windows/system32/boot.lnx&lt;/span&gt;&lt;br /&gt;&lt;em&gt;This will set the path of the bootable image. Note that it only worked for me when I copied the &lt;span style=";font-family:courier;font-size:10;"  &gt;boot.lnx&lt;/span&gt; file into /Windows/system32/&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /displayorder {ntldr} /addfirst&lt;/span&gt;&lt;br /&gt;&lt;em&gt;This will set this boot option to appear at first line&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /default {ntldr}&lt;/span&gt;&lt;br /&gt;&lt;em&gt;This will make Ubuntu system as default booted system&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;OK if you have successfully created the entry reboot and see it work ...&lt;br /&gt;&lt;br /&gt;If you already have a Windows Xp also installed in your machine then creating an ntldr will not be allowed as it may have been already created. Then you can use one of the following options. I recommend the second option.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;1&lt;sup&gt;st&lt;/sup&gt; Option&lt;/u&gt;&lt;br /&gt;Open a command line same as above and you have to have the boot.lnx file with you.&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /copy {ntldr} /d "GNU/Linux Ubuntu"&lt;/span&gt;&lt;br /&gt;&lt;em&gt;This will copy a legacy boot loader entry to new one and give you an ID for that for further configurations. and the ID would be something like &lt;/em&gt;{81ed7925-47ee-11db-bd26-cbb4e160eb27}&lt;em&gt; I will refer to it as .:ID:. hereafter&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /set .:ID:. device boot&lt;/span&gt;&lt;br /&gt;&lt;em&gt;This will declare it as it contains a bootable system&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /set .:ID:. path /Windows/system32/boot.lnx&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /displayorder .:ID:. /addfirst&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /default .:ID:.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;2&lt;sup&gt;nd&lt;/sup&gt; Option&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /create /d "GNU/Linux Ubuntu" /application BOOTSECTOR&lt;/span&gt;&lt;br /&gt;&lt;em&gt;This will create a location to hold a bootsector application and give you an ID for that for further configurations. I will refer to it as .:ID:. hereafter&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /set .:ID:. device boot&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /set .:ID:. path \boot.lnx&lt;/span&gt;&lt;br /&gt;&lt;em&gt;Note that you can copy your &lt;span style=";font-family:courier new;font-size:10;"  &gt;boot.lnx&lt;/span&gt; boot image into C:/ and use above command to set the path for it.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /displayorder .:ID:. /addfirst&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;bcdedit.exe /default .:ID:.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;OK now reboot your system and see it works ....&lt;br /&gt;Oh let's say that you unfortunately rebooted Ubuntu after installing it and then installed Vista which result Ubuntu partitions inaccessible. Don't worry. Then you need to boot your system using a Ubuntu Live CD. Then get a gnome terminal ... execute the following commands..&lt;br /&gt;Find your linux installed "/" partition and mount it.&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;sudo mount /dev/sda6 /media/disk&lt;/span&gt;&lt;br /&gt;If your &lt;span style=";font-family:courier;font-size:10;"  &gt;/boot&lt;/span&gt; partition is separated from root partition then you have to mount it also ...&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;sudo mount /dev/sda5 /media/disk/boot&lt;/span&gt;&lt;br /&gt;Then you have to change your root ... using the following command ...&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;sudo chroot /media/disk&lt;/span&gt;&lt;br /&gt;Mount following partitions which are essential to run a system ...&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;sudo mount /proc&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:courier;font-size:10;"  &gt;sudo mount /sys&lt;/span&gt;&lt;br /&gt;Now you should be able to run above commands as you are in the installed system ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1593749168785549468-6636166266543053717?l=attalaya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vADays7jIMSElC1zH93BWoSnBDY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vADays7jIMSElC1zH93BWoSnBDY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vADays7jIMSElC1zH93BWoSnBDY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vADays7jIMSElC1zH93BWoSnBDY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/attalaya/~4/UOLz-yHQOAg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/6636166266543053717/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://attalaya.blogspot.com/2009/02/i-wanted-to-dual-boot-my-laptop-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/6636166266543053717?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/6636166266543053717?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/attalaya/~3/UOLz-yHQOAg/i-wanted-to-dual-boot-my-laptop-with.html" title="Dual booting using Windows Vista boot loader" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://attalaya.blogspot.com/2009/02/i-wanted-to-dual-boot-my-laptop-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQARXg9fyp7ImA9WxVXEkU.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468.post-483229696134859170</id><published>2009-02-10T20:47:00.003+05:30</published><updated>2009-02-10T23:05:44.667+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-10T23:05:44.667+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="images" /><category scheme="http://www.blogger.com/atom/ns#" term="free clipart" /><title>Openclipart Gallary for cliparts</title><content type="html">&lt;p&gt;I hope you know about &lt;a href="http://www.inkscape.org/"&gt;Inkscape&lt;/a&gt; and &lt;a href="http://www.openclipart.org/"&gt;Openclipart.org&lt;/a&gt;. It now has a very good collection of clip arts which may benefit you in your day to day activities. You can found my small collection of open clip arts at Openclipart.org &lt;a href="http://openclipart.org/media/people/thilakarathna"&gt;here&lt;/a&gt;. It is also a very good way to contribute to open community. enjoy :-D .&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1593749168785549468-483229696134859170?l=attalaya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AhNtQgmq6b44Sf0rRijzYz1OIKM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AhNtQgmq6b44Sf0rRijzYz1OIKM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AhNtQgmq6b44Sf0rRijzYz1OIKM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AhNtQgmq6b44Sf0rRijzYz1OIKM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/attalaya/~4/WbazonyZ2WI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/483229696134859170/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://attalaya.blogspot.com/2009/02/openclipart-gallary-for-cliparts-i-hope.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/483229696134859170?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/483229696134859170?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/attalaya/~3/WbazonyZ2WI/openclipart-gallary-for-cliparts-i-hope.html" title="Openclipart Gallary for cliparts" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://attalaya.blogspot.com/2009/02/openclipart-gallary-for-cliparts-i-hope.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQMQHc7eCp7ImA9WxVXEkU.&quot;"><id>tag:blogger.com,1999:blog-1593749168785549468.post-2167284482148624564</id><published>2009-01-17T23:05:00.001+05:30</published><updated>2009-02-10T23:06:21.900+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-10T23:06:21.900+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Data encryption" /><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu" /><title>Encrypted USB with Ubuntu 8.10 Installed</title><content type="html">&lt;span style="font-family:lucida grande;"&gt;I got my first own pen drive 2 days before. I wanted a portable GNU/Linux OS in it to use in the places that I can't have a GNU/Linux box. At the same time I wanted it to be secured. I choose LUKS to get the thing done. Would like to share my experience with you. Hope you find it useful.&lt;br /&gt;OK let's get started ...&lt;br /&gt;First of all boot you Laptop or Desktop with Ubuntu 8.10 Live CD. Then plug in the pen drive which you want to install GNU/Linux (backup all the data before starting this, otherwise you will loss your data forever). Use &lt;span style="font-family:courier;"&gt;dmesg&lt;/span&gt; to find the device file of your pen drive.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;dmesg&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;In my case it was &lt;span style="font-family:courier;"&gt; /dev/sdb &lt;/span&gt;&lt;br /&gt;Now it is time to fill your pen drive with some random data. You can use either&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;dd if=/dev/urandom of=/dev/sdb&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;or&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;shred -n 1 -v /dev/sdb&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Use &lt;span style="font-family:courier;"&gt;fdisk&lt;/span&gt; to create a new partition table. If you want to use this pen drive in Windows systems, then you will have to create your first most partition in FAT. If you create it elsewhere then Windows will not give a drive letter for that partition and hence it will be not accessible though Windows systems. In my pen drive I have the following partition table&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;    Name          Part Type       FS Type                Size (MB)&lt;br /&gt; ------------------------------------------------------------------------------&lt;br /&gt;   sdb1             Primary          FAT                 2836.52&lt;br /&gt;   sdb2             Primary          Linux                541.81&lt;br /&gt;   sdb5             Logical          Linux ext2           111.55&lt;br /&gt;   sdb6             Logical          Linux               4310.55&lt;br /&gt;   sdb7             Logical          Linux                326.68&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span&gt;Once you finish partitioning you need to create file systems on each partition. Before doing this required encrypted partitions should make encrypted using LUKS. In Ubuntu GNU/Linux there is an application called &lt;span style="font-family:courier;"&gt;cryptsetup&lt;/span&gt; which will give necessary tools to do this. Therefore install&lt;span style="font-family:courier;"&gt;cryptsetup&lt;/span&gt;application into your Live system.&lt;br /&gt;&lt;span style="font-family:courier;"&gt;apt-get install cryptsetup&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Load necessary kernel modules to use &lt;span style="font-family:courier;"&gt;cryptsetup&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;modprobe dm-crypt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Now let's create encrypted partitions.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;cryptsetup -y --cipher aes-cbc-essiv:sha256 --key-size 256 luksFormat /dev/sdb2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;On execution of the above command you will be prompted for a pass phrase. That pass phrase will be use to create necessary encryption keys to encrypt the partition. You may use different keys for different partitions.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;cryptsetup -y --cipher aes-cbc-essiv:sha256 --key-size 256 luksFormat /dev/sdb6&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;After making partitions encrypted you should decrypt and mount those partitions to use them. The following command is used to open and mount LUKS encrypted partition.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;cryptsetup luksOpen /dev/sdb2 enc_data&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;enc_data&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt; is the location where encrypted &lt;/span&gt;&lt;span style="font-family:courier;"&gt;/dev/sdb2&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt; should be mounted. You don't have to create mount points specifically. &lt;/span&gt;&lt;span style="font-family:courier;"&gt;cryptsetup&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt; will do it for you. Newly created mount point can be located at &lt;span style="font-family:courier;"&gt;/dev/mapper/ &lt;/span&gt;directory. Make sure you remember the corresponding pass phrase for encrypted partitions.&lt;br /&gt;&lt;span style="font-family:courier;"&gt;cryptsetup luksOpen /dev/sdb6 enc_root&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Now create file systems in partitions using following commands.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;mkfs.vfat /dev/sdb1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;mkfs.ext3 /dev/mapper/enc_data&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;mkfs.ext2 /dev/sdb5&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;mkfs.ext3 /dev/mapper/enc_root&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Now your pen drive is ready for installing Ubuntu GNU/Linux. Click on System -&amp;gt; Administration -&amp;gt; Install to begin Ubuntu installation. In the installation process make sure you partition disks manually. Below pictures show how I have allocated partitions for my installation. As you can see in the image, you should not format devices &lt;span style="font-family:courier;font-size:12px;"&gt;/dev/sdb6&lt;/span&gt; and &lt;span style="font-family:courier;font-size:12px;"&gt;/dev/sdb7&lt;/span&gt;. Instead you should format decrypted devices of those which are located in &lt;span style="font-family:courier;font-size:12px;"&gt;/dev/mapper/&lt;/span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_-zj5vbHGmEc/SXzOb0gP4sI/AAAAAAAAAAM/E8Z6LVqKPTc/s1600-h/Screenshot-Install.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 267px; height: 320px;" src="http://1.bp.blogspot.com/_-zj5vbHGmEc/SXzOb0gP4sI/AAAAAAAAAAM/E8Z6LVqKPTc/s320/Screenshot-Install.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5295334239226553026" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;At the final stage of your installation process you should give the installation location of &lt;span style="font-family:courier;font-size:12px;"&gt;grub&lt;/span&gt; as &lt;span style="font-family:courier;font-size:12px;"&gt;/dev/sdb&lt;/span&gt; by going into the advanced options.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;After successful installation of Ubuntu GNU/Linux system you will be prompted to restart your machine. As we have some more things to do, you should chose to continue with the live CD system.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Making a swap partition to use with your newly installed system is bit different from others. If we create it using the above method then you will have to enter the password at the boot time for decrypting swap partition as well. It is embarrassing to enter too many passwords just to boot your system. So we will use a derived key from &lt;span style="font-family:courier;font-size:12px;"&gt;enc_root&lt;/span&gt; partition to decrypt our swap partition at boot time. It means that once root partition is decrypted the system will decrypt your swap partition seamlessly.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;/lib/cryptsetup/scripts/decrypt_derived enc_root   | cryptsetup luksFormat /dev/sdb7 --key-file -&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Let's decrypt the partition.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;/lib/cryptsetup/scripts/decrypt_derived enc_root   | cryptsetup luksOpen /dev/sdb7 enc_swap --key-file -&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Make it a swap partition.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;mkswap /dev/mapper/enc_swap&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Now we should make our installed system capable of decrypting our root partition. To do that first we have to &lt;span style="font-family:courier;font-size:12px;"&gt;chroot&lt;/span&gt; to the installed system. Use following commands to change your root.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;mkdir /tmp/tmp/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;mount /dev/mapper/enc_root /tmp/tmp/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;mount /dev/sdb5 /tmp/tmp/boot&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;chroot /tmp/tmp/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;mount -t proc proc /proc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;mount -t sysfs sys /sys&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Install required packages into the newly installed system.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;apt-get update&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;apt-get install cryptsetup&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Now we have to update initramfs with installed new modules. Edit&lt;span style="font-family:courier;font-size:12px;"&gt; /etc/initramfs-tools/modules&lt;/span&gt; and append following modules line by line.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;aes-i586&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;sha256&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;dm-crypt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Edit&lt;span style="font-family:courier;font-size:12px;"&gt; /etc/crypttab&lt;/span&gt; file and add following lines.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;enc_root /dev/sdb6 none luks,retry=1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;enc_swap /dev/sdb7 enc_root luks,keyscript=/lib/cryptsetup/scripts/decrypt_derived,retry=1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Edit&lt;span style="font-family:courier;font-size:12px;"&gt; /etc/fstab&lt;/span&gt; and replace encrypted partitions UUID with it's real device name. My&lt;span style="font-family:courier;font-size:12px;"&gt; /etc/fstab&lt;/span&gt; file looks like this.&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;# /etc/fstab: static file system information.&lt;br /&gt;#&lt;br /&gt;# &amp;lt;file system&amp;gt; &amp;lt;mount point&amp;gt;   &amp;lt;type&amp;gt;  &amp;lt;options&amp;gt;               &amp;lt;dump&amp;gt;  &amp;lt;pass&amp;gt;&lt;br /&gt;proc               /proc         proc    defaults                 0       0&lt;br /&gt;# my root partition&lt;br /&gt;/dev/mapper/enc_root /          ext3  relatime,errors=remount-ro  0        1&lt;br /&gt;# my /boot partition /dev/sdb5&lt;br /&gt;UUID=71500825-460e-4945-8634-04912c7b2999 /boot  ext2   relatime  0        2&lt;br /&gt;# my swap partition&lt;br /&gt;/dev/mapper/enc_swap swap       swap       sw                     0        0&lt;br /&gt;/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0        0&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Regenerate initram file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:12px;"&gt;update-initramfs -k all -c&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Now reboot the system and boot the system with using your pen drive. :-D&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1593749168785549468-2167284482148624564?l=attalaya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/D6QIi9FEjxPEwSaNvyuO30i8vT8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/D6QIi9FEjxPEwSaNvyuO30i8vT8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/D6QIi9FEjxPEwSaNvyuO30i8vT8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/D6QIi9FEjxPEwSaNvyuO30i8vT8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/attalaya/~4/AUtFW8qFYrI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://attalaya.blogspot.com/feeds/2167284482148624564/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://attalaya.blogspot.com/2009/01/encrypted-os-encrypted-usb.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/2167284482148624564?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1593749168785549468/posts/default/2167284482148624564?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/attalaya/~3/AUtFW8qFYrI/encrypted-os-encrypted-usb.html" title="Encrypted USB with Ubuntu 8.10 Installed" /><author><name>Kenneth Thilakarathna</name><uri>http://www.blogger.com/profile/17491632972101734893</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_-zj5vbHGmEc/S-WitIp7CiI/AAAAAAAAANo/ppxvOVQp9Sc/S220/pro.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_-zj5vbHGmEc/SXzOb0gP4sI/AAAAAAAAAAM/E8Z6LVqKPTc/s72-c/Screenshot-Install.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://attalaya.blogspot.com/2009/01/encrypted-os-encrypted-usb.html</feedburner:origLink></entry></feed>

