Sunday, December 2, 2012

Moodle Email issue and Time syn issue

Recently I came a cross following issues in one of Moodle instance : - Forget password was not working - Forum posts are not going to learners emails - Though I open a Quiz at a particular time, it was not working as expected. For example, if I set a Quiz to be open at 14:00, it was not opening at 14:00. I could solve the first two problems in following way : 1. A email out going server need to be set. You can set through : Site Administration->Plugin->Message outs->Email. If you are running a mail instance in your Moodle server, then you do not need to set this. Otherwise, set SMTP host- Here you need to enter the out going email server. 2. Setup a cron (this is what I missed). Emails in Moodle have to triggered. Otherwise it would not work. Therefore you need to set up cron. You can find a detail description over here : http://docs.moodle.org/23/en/Cron For the second problem, go to Site administration->Location->Location setting. In my case, moodle instance was not getting the timezone setting from Linux OS. Therefore, here I had to manually set the timezone. Good luck

Monday, June 4, 2012

Web Hosting

I was trying get a hosting plan from a very famous hosting provider. I am trying to sign-up, but my go was not successful. And I was asked to communicate with a live chat. Then livechat guy got all the details from me, including the credit card, and registered the hosting plan. I was not very sure whether I can share my card information over chat. However since the chat was protected by http://www.thawte.com/ I just proceeded. It got the impression that its a preplanned setup. I think hosting provider does not have a proper system. Will check the credit card statement tomorrow!.. have anyone come a cross similar issue?

Thursday, August 25, 2011

Upgrade Fedora 10 packages

Recently I got to upgrade some packages of the my server which runs on Fedora 10. However I also got to know that Fedora 10 repo are not more maintained. Therefore I searched for some other repo and found a repo called remi. Using which I could upgrade my packages. Here are the steps that I followed :

rpm -Uvh http://rpms.famillecollet.com/remi-release-10.rpm
then I could update the php packages by executing following command :
yum --enablerepo=remi install php-pear php-pdo php-mysql php-pecl-memcache php-gd php-mbstring php-mcrypt php-xml

Rererence : http://www.if-not-true-then-false.com/2010/install-apache-php-on-fedora-centos-red-hat-rhel/

Monday, August 8, 2011

Control spamming through Horde webmail

There are ways that you can use to control spamming through Horde web mails :
Few of the configurations are as follow :

You need Horde 3.2/IMP 4.2 or later!

1. Turn on $conf['user']['verify_from_addr'] in Horde 3.2. This will
prevent a user from changing their from address without an email
confirmation - not a hard road block to a throwaway hotmail address,
but another hoop to jump through. Also useful for policing your legit
but perhaps less-than-technical users.

2. Turn on the sentmail logs in IMP 4.2. The driver and the amount of
time logs are kept are configured under "Other Settings" in IMP's
config (or $conf['sentmail']). Once you turn on the driver, there are
two permissions you can set through the Horde permissions API:

'imp:max_recipients' => "Maximum Number of Recipients per Message"
'imp:max_timelimit' => "Maximum Number of Recipients per Time Period"

The first one is a hard limit on the number of recipients for a single
message. The second one is limit on the number of messages that can be
sent in the time period configured in $conf['sentmail']. This is for
preventing someone from sending to exactly the max # of recipients
over and over again.



-------------
How to do this :

1:
do it in the horde config file

2 :
Administration -> Permissions -> then add sub permissions to IMP


Reference : http://lists.horde.org/archives/horde/Week-of-Mon-20080428/035200.html

Thursday, June 30, 2011

Generate a SSL certificate request for Multidomains

Recently I had a need to have a SSL certificate which should be used in multiple domains. When I search on that I found that it can be done using Unified Communications Certificates (UUC) :

This is how I generated a multidomain certificate request :

1. Open openssl.cnf
2. Make sure following line are there in that file :

[req]
req_extensions = v3_req

[v3_req]
subjectAltName = @alt_names

[alt_names]
DNS.1 = example.com
DNS.2 = hello.example.com
DNS.3 = testing.com


You should add your domains as given in under [alt_names]

3. Create a private key

4. generate your certificate requests by providing required information

Thats all! you are done!!!

Reference : http://playnice.ly/blog/2011/01/03/multi-domain-ucc-ssl-certificates-on-nginx-with-1-ip-address/



You can make sure by
openssl req -text -noout -in ssl.csr

Under the alternative section you can find your all the domains listed.

Wednesday, June 8, 2011

Want to visit IPv6 Only sites?

Internet Society announced IPv6 day on 8th June - http://www.worldipv6day.org/
As given in that website many gaints including Google, Yahoo, Facebook all are taking part in this IPv6 day.

In Sri Lanka also there are two IPv6 events (AFAIK) are happening.
1. www.isoc.lk
2.www.ipv6day.lk

What is the actual status in Sri Lanka?...

AFAIK,

None of the ISPs are providing IPv6 address for their end users. Still the ISPs are setting up their core and the servers with IPv6. www.isoc.lk shows some stats about present IPv6 allocations and their IPv6 web sites. Therefore the Internet Infrastructure in Sri Lanka (Except few Universities) is not ready for IPv6 (AFAIK)

.LK is already IPv6 ready. It has been assigning IPv6 address (AAAA records) to domain names.


How we can see the IPv6 only websites? like ipv6.google.com

There are several ways you can see the IPv6 only sites...

In Windows OS (7, Vista, XP with SP)

If you have a public IPv4 address, then when connect to Internet you will automatically get an IPv6 address via Microsoft's terado tunneling. Therefore you should be able to access IPv6 only sites without any issues. For example, if you connect via ADSL, then since you normally get a public IP, you can visit IPv6 only sites

In Linux

Since you do not have any tunnel which is automatically implemented you should establish a tunnel your self. Then you will get an IPv6 address. Thereafter you can visit IPv6 only sites. However you should have a publically reachable IPv4 address inorder to make the tunneling. I read that Teredo tunneling works even over NAT, I could not find a free Teredo tunneling broker.
- There are several tunnel brokers out there who provide free IP6to4 tunneling. I have tried with Hurricane (http://goodsarves.blogspot.com/2011/06/ipv6-over-ipv4-tunneling-ipv6to4.html) on Linux. It was working fine.

***If you are accessing Internet using broadband modem like HSPA you can not access the IPv6 sites. Because normally you get a NATed private IP address. Therefore you can not make tunnels.

***That is why even Google and Facebook have assigned both A and AAAA records for www.google.com and www.facebook.com. If they assigned only IPv6 address only 1 Million users of facebook can access out of 500 million users.

Thursday, June 2, 2011

IPv6 over IPv4 tunneling - IPv6to4

All were talking about IPv6 day and all the gaints were participating in IPv6 Day. Therefore I also want to feel the IPv6.

I created a tunnel with Hurricane and got an IPv6 address. However inorder to get this working we need to establish a tunnel to one of the Hurricane's Server.
My OS is Fedora 10 and I did following steps to enable IPv6 and IPv6to4 Tunnelling in my PC.

(If you also want to do, just execute following 4 lines in your Terminal as super user.

echo "NETWORKING_IPV6=yes" >> /etc/sysconfig/network
echo "IPV6_DEFAULTDEV=tun6to4">> /etc/sysconfig/network
echo "IPV6INIT=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "IPV6TO4INIT=yes">> /etc/sysconfig/network-scripts/ifcfg-eth0

In addition to that I created following script :

/etc/sysconfig/network-scripts/ifcfg-sit1

and added following content,

OOTPROTO="none"
DEVICE="sit1"
IPV6INIT=yes
IPV6TUNNELIPV4=xx.xx.xx.xx
IPV6TUNNELIPV4LOCAL=yy.yy.yy.yy
IPV6ADDR="2001:xxx:x:xxx::x/64"
ONBOOT=yes

After this the tunnel was established and everything was working fine.

References :
http://fedoraproject.org/wiki/IPv6Guide
http://unix.stackexchange.com/questions/7720/how-do-i-set-up-an-ipv6-tunnel-in-fedora

Wednesday, May 25, 2011

Enable Tamil and Sinhala input methods

Here how I enabled Tamil (Renganathan IM) and Sinhala (Wijesekara) on Ubuntu 11.

Step 1 : As a root, do :

apt-get install ibus im-switch ibus-m17n m17n-db m17n-contrib ttf-tamil-fonts language-pack-ta-base ttf-sinhala-lklug language-pack-si-base


Step 2 : Just run from your user account (Not as root) :
rm -f ~/.xinput.d/* ; im-switch -z all_ALL -s ibus

Thereafter restart the session (Just logoff and login)

Thereafter do "ibus-setup" and configure your prefered input setup. In addition to that you can configure where it should appear in your screen.

Enjoy!

Reference : http://sinhala.sourceforge.net/

Monday, May 2, 2011

Postfix with MySQL Backend

Here I am trying to describe how I configured Postfix with MySQL backend. Here I have given only the important parameter, however you can find tune this in various ways.

1.

Configure your Postfix with MySQL support.

I used following command - make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql' 'AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lz -lm'

Before do this, please make sure that you have installed all the MySQL components, including mysql-devel.

2.

Then do the make

3.

DO the make install. At the end of this phase you will be prompt with many questions, answer them appropriate.

4.

Then start configure your Postfix, normally you can find the configuration in main.cf

The important settings (though there are several settings) you need to add are :

data_directory = /var/lib/postfix
mail_owner = postfix
- make sure that you have created the user postfix
myhostname = mail.yy.xx.lk
mydomain = XX,cc.lk
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
relayhost = 192.NN.N.N
home_mailbox = Maildir/
- This is important, and this is where you say that you want to use MailDir, not Mailbox
virtual_gid_maps = static:506
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 100
virtual_transport = virtual
virtual_uid_maps = static:504
- You must create another user, may be vmail, who should have permission to write mails to maildir. After adding those user, you need to specify the uid and gid of that user here in uid_maps and gid_maps. Also make sure that you have given sufficient permission to the mailbox_base to the user that you have created.

After doing all these settings in the main.cf file, you need to create another two files that you have given in "virtual_mailbox_domains" and "virtual_mailbox_maps".

In my case etc/postfix/mysql_virtual_domains_maps.cf contains following parameters :

hosts = localhost
dbname = maildb
user = mailuser
password = xxxxxxx
table = mail_domains
select_field = mail_domain
where_field = mail_domain

This tells postfix that what are the domains should be handled by the postfix it self and what are should be routed to other MTAs.


/etc/postfix/mysql_virtual_mailbox_maps.cf contains :
hosts = localhost
dbname = maildb
user = mailuser
password = XXXX
table = mail_accounts
select_field = maildir
where_field = mail_user

This is used to select the MailDir name for the respective email account. For example if someone sends a mail to sarves@xyz.com, this will find and tells that where that message should go in the virtual_mailbox_base.

Hope this will work for you all as well.

Good luck

Reference :
http://hostingsoftware.net/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=56
http://www.postfix.org/INSTALL.html

Thursday, March 24, 2011

Moodle - Set default enrolable to no

When you create a course on Moodle, the course enrolable is always set to yes by default. Sometime this is problematic for you.
This is how you set course enrolable to no by default!

Open moodle/course/edit_form.php and find the line:

$mform->setDefault('enrollable', 1);

And change it to:

$mform->setDefault('enrollable', 0);