Wednesday, December 3, 2008

Clone Drupal Site

If you're trying to close drupal site to a subdomain or subfolder, please aware to copy .htaccess and change the rewritebase

Also other important note to bypass the login.

to login when there is the problem however you can do the following
http://***.net/stage?q=user/login
Then when you login you will have to type in the following url
http://***.net/stage?q=admin/settings/clean-urls

Friday, October 10, 2008

Park Domain Error in Cpanel

If you're trying to Park A Domain which name server you didn't control, you have to go

Under WHM | Tweak Settings | DNS I had to enable "** Allow Creation of Parked/Addon Domains that resolve to other servers (i.e. domain transfers)".

Tuesday, September 9, 2008

Rebuild PHP with Ldap in cpanel

After you did the software apache update, you have to create a file here /var/cpanel/easy/apache/rawopts/all_php5 and put --with-ldap in it to make it install the ldap php module

Then rebuild the apache again.

Wednesday, August 20, 2008

Moodle latex and dvips

If you go to filter settings and found /usr/bin/latex and /usr/bin/dvips is not installed, do a yum install tetex-latex

Now if you also have a red X next to convert binary your path is incorrect or you need to install gostscript or ImageMagic I installed ImageMagic and if fixed the problem.
yum install ImageMagick (It's case sensitive)

Saturday, August 2, 2008

How to turn debug on during upgrade

If you're upgrading moodle and it just saying processing assignment and it's not going anywhere, it's worth a shot to debug the process.

Go to config.php and add $CFG->debug=1;
Then setting debug to true in the mod/assignment/db/upgrade.php

Friday, July 25, 2008

Error while opening bat or ini file

Looks like there is trojan on the system and this happen. If you don't want to reinstall the system, simply scan the trojan and here is how to fix the error.

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\batfile\shell\edit\command] = %SystemRoot%\System32\NOTEPAD.EXE %1"

Notice at the end, there is a single ". You need to remove that " and it should work like a charm.

PS: Above path is for the .bat. For .ini, you need to find inifile and so on.

Monday, July 21, 2008

In Cpanel, httpd can't start

If you use cpanel and happen httpd can't start with the error

root@s30 [~]# /etc/init.d/httpd start
[Tue Jul 1 04:21:41 2008] [info] mod_ssl:Compat: MAPPED 'SSLEnable' => 'SSLEngine on'
[Tue Jul 1 04:21:41 2008] [info] mod_ssl:Compat: MAPPED 'SSLLogFile
/usr/local/apache/domlogs/dis**********.org-ssl_data_log' => 'SSLLog
/usr/local/apache/domlogs/dis*******.org-ssl_data_log'
[Tue Jul 1 04:21:41 2008] [warn] NameVirtualHost 67.*.*.*:80 has no VirtualHosts
[Tue Jul 1 04:21:41 2008] [warn] NameVirtualHost 67.*.*.*:80 has no VirtualHosts
/etc/init.d/httpd: line 83: 5450 File size limit exceeded$HTTPD -DSSL
/etc/init.d/httpd start: httpd could not be started

Backup the file /usr/local/apache/domlogs/dis*****.org-ssl_data_log to other name and start the httpd. (Something to do with logrotate)

Sunday, July 20, 2008

5 Rules that differentiate Amateurs and Pros in investing

1. Always have cash handy on your portfolio, at least 10% of it. When there is a bear situation where the stocks are down, you can buy the stock at cheap price if and only if you have the money.

2. Pros are usually focus on the downside instead of the upside. Which means they look at the risk of their portfolio first, instead of thinking of the profit. Pros know this inevitability, so they buy companies with huge stock-repurchasing plans and healthy dividends, which protect their investments when that decline comes.

3. If you don’t know it, don’t buy it. Pros pass up investing in companies they don’t understand all the time because they’d rather hold on to their money.

4. There is such a thing as making too much money – might be a bit harder for amateurs to understand. But the bottom line is that making to much money is usually a sign that a portfolio is overexposed to one stock or sector. Think dot-com era, 1999-2000. Everyone was in tech. Everyone was making money hand-over-fist. Then everything collapsed. It never costs any money to take profits, so do it before it’s too late.

5. Earnings season produces the smallest profits and biggest losses of the year. Why? Because too many people – analysts and institutional investors – are making snap decisions based on the numbers. Investing during earnings season is too much of a gamble. And when you gamble, the house always wins.

Monday, July 7, 2008

How to fix the unaligned course in Moodle

After upgrading to 1.9, some of the text are aligned to the right.
To fix that, go to the current theme and open the css.
there's probably a .coursebox css entry somewhere in one of the styles.css files, probably styles_layout.css
and if there's a float entry for it, just delete

How to fix breadcrumb in moodle that say "Array"

Go to the current theme, and open header.html.
Find $navigation and remote the "" around it.

Monday, May 12, 2008

Moodle Profile Picture Missing

If you tried to upload photos for your profile and it doesn't appear, please check the GD on the system, whether it's installed. Then check the system paths on Server whether it includes the GD version.

Friday, May 9, 2008

Stuck in maintenance mode?

If you are stuck in Maintenance Mode – please read following:

Maintenance Mode

When one Enables the Maintenance Mode, it creates a file called maintenance.htm in the site files' directory. (moodledata/1)

The site is still in Maintenance Mode if that file exists

When one Disables the maintenance mode, the system deleted the file and moodle comes out of Maintenance Mode.

Monday, April 7, 2008

A little joke

Young and pretty lady wishes to marry a rich guy. Fantastic reply from a financial
person

A young and pretty lady posted this on a popular forum:

Title: What should I do to marry a rich guy?

I'm going to be honest of what I'm going to say here. I'm 25 this year.
I'm very pretty, have style and good taste. I wish to marry a guy with
$500k annual salary or above. You might say that I'm greedy, but an
annual salary of $1M is considered only as middle class in New
York. My requirement is not high. Is there anyone in this forum who has an
income of $500k annual salary? Are you all married? I wanted to ask: what
should I do to marry rich persons like you? Among those I've dated, the
richest is $250k annual income, and it seems that this is my upper limit. If
someone is going to move into high cost residential area on the west of New
York City Garden (?), $250k annual income is not enough.

I'm here humbly to ask a few questions:

1) Where do most rich bachelors hang out? (Please list down the names and
addresses of bars, restaurant, gym)

2) Which age group should I target?

3) Why most wives of the riches is only average-looking? I've met a few girls
who doesn't have looks and are not interesting, but they are able to marry
rich guys

4) How do you decide who can be your wife, and who can only be your
girlfriend? (my target now is to get married)

Ms. Pretty
---------------------------------------
---------------------------------------
-------------------
Here's a reply from a Wall Street Financial guy:

Dear Ms. Pretty,

I have read your post with great interest. Guess there are lots of girls
out there who have similar questions like yours. Please allow me to analyze
your situation as a professional investor. My annual income is more than
$500k, which meets your requirement, so I hope everyone believes that I'm not
wasting time here.

From the standpoint of a business person, it is a bad decision to marry
you. The answer is very simple, so let me explain. Put the details aside, what
you're trying to do is an exchange of "beauty" and "money": Person A provides
beauty, and Person B pays for it, fair and square. However, there's a deadly
problem here, your beauty will fade, but my money will not be gone without
any good reason. The fact is, my income might increase from year to year, but
you can't be prettier year after year. Hence from the viewpoint of economics,
I am an appreciation asset, and you are a depreciation asset. It's not just
normal depreciation, but exponential depreciation. If that is your only
asset, your value will be much worried 10 years later

By the terms we use in Wall Street, every trading has a position, dating
with you is also a "trading position". If the trade value dropped we will sell
it and it is not a good idea to keep it for long term same goes with the
marriage that you wanted. It might be cruel to say this, but in order to make
a wiser decision any assets with great depreciation value will be sold or
"leased". Anyone with over $500k annual income is not a fool; we would only
date you, but will not marry you. I would advice that you forget looking
for any clues to marry a rich guy. And by the way, you could make yourself to
become a rich person with $500k annual income. This has better chance than
finding a rich fool.

Hope this reply helps. If you are interested in "leasing" services, do
contact me

signed,

The Wall Street Guy

Thursday, February 28, 2008

How to resize quiz timer box

On a 1024x768 resolution, the quiz timer box sometimes block the questions. To resize the box, edit the moodle/mod/quiz/jstimer.php

Look for width on the first "table" and change 150px to 80px. That should fix the problem.

Monday, February 25, 2008

How to read mysql datetime format?

To read datetime from mysql format to a format that we understand, simply just add from_unixtime(fieldname) on your query.

For example: select from_unixtime(lastaccess) from mdl_user;

Thursday, January 10, 2008

VZ Add More Diskspace

To view the current diskspace status, you can enter command
vzquota stat 123 (where 123 is the vz id number)

To increase the diskspace by the current space with factor of 2, command is
vzctl set 123 --diskspace $(( 1048576*2 )):$(( 1153434*2 )) --save

To increase the diskspace by the amount, command is
vzctl set 123 --diskspace $(( 1548576 )):$(( 1753434 )) --save

To increase the diskspace by the inode with factor of 3, command is
vzctl set 123 --diskinodes $(( 200000*3 )):$(( 220000*3 )) --save

Sunday, January 6, 2008

How to set default course

When you create a new course, how do you make it so it comes up as your default setup?
Easy, by editing your moodle/course/edit_form.php file.
You can make changes here.

For example, if you want to make the format to show as topics, then you edit line 98
where it says $mform->setDefault('format', 'weeks'); and change it to
$mform->setDefault('format', 'topics');