Saturday, 27 June 2015

Moodle : Incorrect access detected, this server may be accessed only through x address

Often when you install moodle within site directory and when you want to access directly you will see error.


Following amendment can be done to get rid off this error

Change the following file: /home/xxxxxx/public_html/moodle/lib/setuplib.php
Change -  setuplib.php
Redirect ($CFG->wwwroot, get_string('wwwrootmismatch', 'error', $CFG->wwwroot), 3);
for
Redirect ($CFG->wwwroot, get_string('wwwrootmismatch', 'error', $CFG->wwwroot), 0);

Now when you access the link, Moodle redirects immediately to the www.<your registered domain> without the warning message.

Another solution is to make changes in .htaccess file

***************************************************************
suphp_configpath /home/myroot/public_html/php.ini
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^www.domainname.com [nc]
rewriterule ^(.*)$ http://domainname.com/$1 [r=301,nc]
 i.e. replace the myhost.com  with your domain name
***************************************************************
The main advantage of this solution, you won't have to update the moodle code every time you update to a new version.

Hope this will solve the issue.

Thursday, 25 June 2015

Some Useful Oracle Tips

Here are some of useful oracle tips that is of common use. Hope you will enjoy this article.

1. You can login to SQL by also typing  scott/tiger together means username/password together need not specify in separate text boxes.
2. Someuseful commands to remind when going to start your oracle engine startup ,shutdown immediate,   shutdown, startup nomount
3. Use command  sqlplus/nolog in anywhere in your command prompt directly to get SQL>
       Like  c:\>sqlplus/nolog you will get SQL>
4. For connected as sys user use command SQL:> conn /as sysdba need not enter semicolon. No error if that is there.
5. For showing the user use show user; command.
6. For creating a new user use command create user user1 identified by password
7. Now connect as  general user use conn as username/password
8. Connect holds create session previleges. So when you log in as a new user it will show error.
9. To remove that give permission of create session to your newly created user.
10. Command is grant create session to username.
11. Now you can login as conn as username/password
12. After connected as general user you have to give resource permission 
13. grant resource to username. That will help to user to create table and other permission


14. Please note down that all the permission can be given as sysdba only so for everytime you have to login as sysdba by using command conn /as sysdba

Ubuntu 14.04 brightness control issue with Intel card

Recently noticed an issue in Dell laptop,It was pre installed with ubuntu 12ish version. Once this was upgraded to ubuntu 14.04 LTS version I noticed there is issue with backlight display and it was not working. Below soultion worked for me hence thought to be useful for others and I am posting here... Steps


[1] Check /usr/share/X11/xorg.conf.d directory and find out if you see file named as “20-intel.conf”


oyeweb@oyeweb-Latitude-3540:~$ ls -ltr /usr/share/X11/xorg.conf.d
total 36
-rw-r--r-- 1 root root 842 Feb 5 2014 50-wacom.conf
-rw-r--r-- 1 root root 364 Feb 5 2014 11-evdev-trackpoint.conf
-rw-r--r-- 1 root root 590 Feb 5 2014 11-evdev-quirks.conf
-rw-r--r-- 1 root root 115 Feb 5 2014 50-vmmouse.conf
-rw-r--r-- 1 root root 590 Apr 10 2014 51-synaptics-quirks.conf
-rw-r--r-- 1 root root 1757 Apr 10 2014 50-synaptics.conf
-rw-r--r-- 1 root root 1867 Dec 10 23:47 10-quirks.conf
-rw-r--r-- 1 root root 1099 Dec 10 23:47 10-evdev.conf


[2] If you don't see “20-intel.conf” upi will have to create a file for the same. You can do this as a super user hence follow the command

sudo touch /usr/share/X11/xorg.conf.d/20-intel.conf
[3] Now please edit the file by using vi or any other command
sudo vi /usr/share/X11/xorg.conf.d/20-intel.conf
you will have to add following things into your file
Section
"Device"

    
   Identifier  "card0"

    
   Driver      "intel"

    
   Option      "Backlight"  "intel_backlight"

    
   BusID       "PCI:0:2:0"

EndSection
Please save by using :wq! and restart your laptop/pc. 
I have not remembered if restarts is required but anyhow this solution will work.
Please comment if you see further issues. We will be happy to help.