Tuesday, July 28, 2009

MAHARA : Site not available , Could not generate a new SSL key

MAHARA - MOODLE Integration

In Some cases, when you are integrating MAHARA with Moodle , the OpenSSL certificate Key is not displayed.
We came across this problem many times in a windows installation.The reason was the OpenSSL within the Apache folder is not configured in the MAHARA and Moodle.

They are more of configured to work on Linux than Windows.

The solution for the same is , using the OPENSSL methods we can override the existing methods by directly pointing to the openssl certificate file (openssl.cnf)

In Mahara,

Edit the File / api/xmlrpc/Lib.php

$config is a array which holds the path of the Openssl.cnf in the your exisiting setup

$config = array("config" => "C:\Apache\openssl.cnf");

// ensure we remove trailing slashes
$dn["commonName"] = preg_replace(':/$:', '', $dn["commonName"]);

//if (!$new_key = openssl_pkey_new()) {
if (!$new_key = openssl_pkey_new($config)) {
throw new ConfigException('Could not generate a new SSL key. Are '
. 'you sure that both openssl and the PHP module for openssl are '
. 'installed on this machine?');
}

//if (!$csr_rsc = openssl_csr_new($dn, $new_key, array('private_key_bits',2048))) {
if (!$csr_rsc = openssl_csr_new($dn, $new_key, $config)) {
// This behaviour has been observed once before, on an ubuntu hardy box.
// The php5-openssl package was installed but somehow openssl
// wasn't.
throw new ConfigException('Could not generate a new SSL key. Are '
. 'you sure that both openssl and the PHP module for openssl are '
. 'installed on this machine?');
}
//$selfSignedCert = openssl_csr_sign($csr_rsc, null, $new_key, 365 /*days*/);
$selfSignedCert = openssl_csr_sign($csr_rsc, null, $new_key, 365 /*days*/,$config);

unset($csr_rsc); // Free up the resource



The Same applies to Moodle.

Edit the File : /mnet/lib.php

$config = array("config" => "c:/apache/conf/openssl.cnf");
//$new_key = openssl_pkey_new();
$new_key = openssl_pkey_new($config);
//$csr_rsc = openssl_csr_new($dn, $new_key, array('private_key_bits',2048));
//$selfSignedCert = openssl_csr_sign($csr_rsc, null, $new_key, $days);
$csr_rsc = openssl_csr_new($dn, $new_key, $config);
$selfSignedCert = openssl_csr_sign($csr_rsc, null, $new_key, $days,$config);
unset($csr_rsc); // Free up the resource

Wednesday, July 8, 2009

The Groups in the Indian Stock Markets(BSE / NSE)

The scrips traded on BSE have been classified into various groups.

BSE has, for the guidance and benefit of the investors, classified the scrips in the Equity Segment into 'A', ‘B’,'T', ‘S', ‘TS' and 'Z' groups on certain qualitative and quantitative parameters.

Group A
It is the most tracked class of scripts consisting of about 200 scripts. Market capitalization is one key factor in deciding which scrip should be classified in Group A.
At present there are 216 companies in the A group.


Quote:
According to BSE circular dated February 5, 2008 the criterion to get listed in Group A is
1. Company must have been listed for minimum period of 3 months.
Exceptions:
* The Company can be directly listed in group 'A' provided the market capitalisation of a company being listed, based on its issue price, is higher than the average market capitalisation of 100th company in the existing group 'A' as per the ranking based on preceding 3 months data.
* Any company permitted to be traded in F&O segment from date of its listing shall be directly listed in group 'A'.
* Companies listed subsequent to any corporate action involving merger/ demerger/ capital restructuring etc.

2. Companies traded for minimum 98% of the trading days in past 3 months shall be considered eligible.

3. Companies with minimum non-promoter holding of 10% as per the shareholding pattern of most recent quarter shall be considered eligible. The criteria of minimum 10% non-promoter holding shall not be applicable to public sector undertakings (PSUs).

4. The weightage of 75% and 25% shall be given to ranking on three monthly average market capitalisation and traded turnover respectively to arrive at the final ranks.

5. The list derived, based on final rank shall be screened for compliance and investigation. Based on this screening, the list of top 200 companies shall constitute group 'A'.

6. The group re-classification shall be reviewed twice in a year i.e. February and August.

7. On inclusion of any new Company in group 'A' based on criteria 1(a) or 1(b) detailed above, the last company in the existing group 'A', based on its final rank calculated on data preceding three months shall be excluded.



Group G
G includes all governmental securities for retail investors

Group F
The "F" Group represents the Fixed Income Securities.

Group T
The "T" Group represents scrips which are settled on a trade-to-trade basis as a surveillance measure.

Group TS
The "TS" Group consists of scrips in the "BSE-Indonext" segment, which are settled on a trade-to- trade basis as a surveillance measure.

Group S

“The Exchange has introduced a new segment named “BSE Indonext” w.e.f. January 7, 2005. The “S” Group represents scripts forming part of the “BSE-Indonext” segment. “S” group consists of scripts from “B1” & “B2” group on BSE and companies exclusively listed on regional stock exchanges having capital of 3 crores to 30 crores. All trades in this segment are done through BOLT system under S group.”

Group B1 & B2:
All companies not included in group ‘A’, ‘S’ or ‘Z’ are clubbed under this category. B1 is ranked higher than B2.

B1 and B2 groups will be merged as a single Group B effective from March 2008.

Group G
Trading in Government Securities by the retail investors is done under the "G" group.

Group Z
The 'Z' group was introduced by BSE in July 1999 and includes companies which have failed to comply with its listing requirements and/or have failed to resolve investor complaints and/or have not made the required arrangements with both the depositories, viz., Central Depository Services (I) Ltd. (CDSL) and National Securities Depository Ltd. (NSDL) for dematerialization of their securities.

BSE also provides a facility to the market participants for on-line trading of odd-lot securities in physical form in 'A', 'B', 'T', 'S', 'TS' and 'Z' groups and in rights renunciations in all groups of scrips in the Equity Segment.

F&O expands to the Futures and Options segment, which indicates the way the stock price would move in the future and the traders bets on it.

Also I heard somewhere that T Group is also a bad group. Stocks in this group are settled in parts/settlements. For example, if you buy XYZ company shares, 100 numbers and sell it in same day, also actually you cannot sell unless u have shares in your account already, you have to give delivery and take delivery of it separately, it cannot be squared off in same day.


Data from link