Thursday, May 20, 2010

Split an Array Gradually

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.

Tuesday, May 11, 2010

Moodle Email Delete from Users

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.
1. step: Copy these two scripts to the directory moodle_wwwroot/admin/. Change the permissions appropriately.
chown apache:apache del_gen_email*
chmod 644 del_gen_email*
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->Accounts->Delete General Email

$ADMIN->add('accounts', new admin_externalpage('delgenemail', 'delete general email', "$CFG->wwwroot/admin/del_gen_email.php", 'moodle/user:update'));

Hope it helps :D

Wednesday, May 5, 2010

Moodle Backup Script

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 Mr. N. M. Laxaman and I have done some improvements to work it with iSCSI and reporting features.
To get things to work.
1. Install ssmtp and configure it as a smart host -- Simple How to
2. Install and configure iscsi with your iscsi server -- Simple How to . Make sure that you test iscsi properly mounts intended devices.
3. Configure the script for your requirements - only edit configuration section
4. Make it executable and put it in /etc/cron. directory as per your requirement

Monday, July 20, 2009

VirtualBox Configuration

It is very well explained in Ubuntu community help site
https://help.ubuntu.com/community/VirtualBox
Note that when configuring networking the hosts may not be able to ping each other but network applications works perfectly

Saturday, July 18, 2009

Installing ATI Radeon HD2600 propriatory driver on Debian/Lenny

Download the installer from http://support.amd.com/us/gpudownload/Pages/index.aspx ...

$mkdir fglrx
$cp ati-driver-installer-9-6-x86.x86_64.run fglrx/
$cd fglrx
$chmod +x ati-driver-installer-9-6-x86.x86_64.run
$./ati-driver-installer-9-6-x86.x86_64.run --buildpkg Debian/lenny
$ su
#dpkg -i *.deb

Reboot the system for single user mode
#apt-get install build-essential linux-headers-$(uname -r) module-assistant
#m-a prepare
#m-a a-i fglrx
#modprobe -v fglrx

If this is the first installation
#dpkg-reconfigure xserver-xorg