I want to use javascript on my ongoing moodle development work. But the latest version of moodle 2.8 supporting to YUI library. Now there is no use of YUI because yahoo ceased that api due to transitioning (http://yahooeng.tumblr.com/post/96098168666/important-announcement-regarding-yui)
The soultion is that moodlers suggesting to install nodejs to use javascripts modules. So I mentioned steps which i installed on my windows 7 machine.

1. Download the latest nodejs executable file from https://nodejs.org/#download

















2. Once the installation done the files will be placed under the C://Program Files/nodesjs directory


3. Click on command prompt and test the nodejs verion to check the nodejs installed correctly.








4.  While doing nodejs installation it will also install npm.



5. To check the nodejs by script 
  Just write hello.js with the content console.log('Welcome to NodeJs!'); 
 Then from command prompt right the below command to execute it

 




6. Create a test file server.js and put this code in that file:
var http = require('http');
http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello World\n');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');






7. Open this address in your browser: http://127.0.0.1:1337/

ALTER TABLE account_regions RENAME s3_account_regions;

[root@achappan htdocs_8085]# find . -type f | wc -l
14626
[root@achappan htdocs_8085]#

Explanation:
find . -type f finds all files ( -type f ) in this ( . ) directory and in all sub directories, the filenames are then printed to standard out one per line.
This is then piped | into wc (word count) the -l option tells wc to only count lines of its input.
Together they count all your files.

 You can create a tar archive on two ways like below.
  • To create an archive of a directory and its contents:
    • tar -cvf name.tar /path/to/directory
  • To create an archive of certfain files:
    • tar -cvf name.tar /path/to/file1 /path/to/file2 /path/to/file3
[root@achappan mysql]# df -hk /var

Filesystem                                          1K-blocks         Used                    Available            Use%  Mounted on
/dev/mapper/VolGroup00-LogVol00         271169800         141653824           115519128             56%        /

1. List down all the installed Mysql RPM's

[root@achappan mysql]# rpm -qa | grep MySQL
MySQL-server-5.5.*-1.rhel5
MySQL-client-5.5.*-1.rhel5
perl-DBD-MySQL-3.0007-2.el5
[root@achappan mysql]#

2. Remove MySQL-server and MySQL-client from the list

[root@achappan mysql]# rpm -e MySQL-server-5.5.*-1.rhel5
[root@achappan mysql]# rpm -e MySQL-client-5.5.*-1.rhel5

3.  Verify the uninstalled rpms are removed from the list or not.

[root@achappan mysql]# rpm -qa | grep MySQL
perl-DBD-MySQL-3.0007-2.el5
[root@achappan mysql]#

4.  Find the list of mysql directories from system

[root@achappan mysql]# find / -name mysql

/etc/rc.d/init.d/mysql
/etc/logrotate.d/mysql
/usr/bin/mysql
/usr/lib/mysql
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/DBD/mysql
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBD/mysql
/usr/share/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/var/lock/subsys/mysql
/var/run/sudo/mysql

 5. Rename or Delete the highlighted mysql directories from the list.

 6. Go to RPMs directory which you are downloaded latest rpms from mysql site.

[root@achappan mysql rpm]# ls -l
total 612100
-rw-r--r-- 1 root root  313067520 Apr 13 15:14 MySQL-5.6.24-1.rhel5.i386.rpm-bundle.tar
-rw-r--r-- 1 7155 wheel  22883979 Mar 26 16:27 MySQL-client-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel   4136019 Mar 26 16:27 MySQL-devel-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel 113129185 Mar 26 16:27 MySQL-embedded-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel  89185903 Mar 26 16:28 MySQL-server-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel   2371167 Mar 26 16:29 MySQL-shared-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel   5466510 Mar 26 16:29 MySQL-shared-compat-5.6.24-1.rhel5.i386.rpm
-rw-r--r-- 1 7155 wheel  75885537 Mar 26 16:29 MySQL-test-5.6.24-1.rhel5.i386.rpm
[root@achappan mysql rpm]#

7. Install MySQL-server and MySQL-client Rpms

[root@achappan mysql rpm]# rpm -i MySQL-server-5.6.24-1.rhel5.i386.rpm

After the MySQL Server  installation it will provide the Mysql root password in mysql_secret file under the root dir (/root/.mysql_secret)

Then install MySQL Client. You probably always want to install this package.
 [root@achappan mysql rpm]# rpm -i MySQL-client-5.6.24-1.rhel5.i386.rpm

8. Get MySQL Random generated root password

[root@achappan mysql rpm]# cat /root/.mysql_secret
# The random password set for the root user at Mon Apr 13 21:01:17 2015 (local time): mO4rRAW7Xr6Xdcy6

9. Start the mysql

[root@achappan mysql rpm]# /etc/init.d/mysql start

MySQL running (32751)                                      [  OK  ]
[root@achappan mysql rpm]#

10. Change the mysql password for your convenient.

[root@achappan mysql]# mysql -u e3user -p
Enter password: ******

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 724
Server version: 5.6.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
mysql> show databases;
+----------------------------------------+
| Database                               |
+----------------------------------------+
| information_schema                     |
| mysql                                  |
| performance_schema                     |
| test                                   |
+----------------------------------------+
4 rows in set (0.02 sec)
mysql> use  mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('e3_user');
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
<?php

if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT']))
{
   echo "Browser Not supported";
    exit;
}

?>
In PHP, You can display the image in HTML email template in two ways,

1. Your organization restricted your application directory by authorization and you cant able to access outside. In this case you can embed a images in html template
2. If there is no restriction and free to access anywhere you can display your image by using absolute and relative path directly

Please find the sample code for the first option:

<?php

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->From="m.achappan@gmail.com";
$mail->FromName="My site's mailer";
$mail->Sender="m.achappan@gmail.com";

$address = "achappan.mahalingam@yahoo.co.in";
$mail->AddAddress($address, "Achappan Mahalingam");

$mail->Subject = "HTML Email template logo test";

$mail->IsHTML(true);

$mail->AddEmbeddedImage('email_logo.png', 'logoimg', 'email_logo.png');
$mail->Body = "<p><img src=\"cid:logoimg\" /></p>";

$mail->AltBody = "Sample html logo Image test!";

if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}
?>
To restart, start or stop MySQL server from the command line, type the following at the shell prompt…

/etc/init.d/mysqld start

/etc/init.d/mysqld stop 
    
/etc/init.d/mysqld restart


Some Linux flavours offer the service command too

service mysqld start 

service mysqld stop

service mysqld restart

Blog Archive

Total Pageviews

Popular Posts