tag:blogger.com,1999:blog-75317888519058872922024-02-02T10:53:05.349-08:00My Tech NotesUnknownnoreply@blogger.comBlogger43125tag:blogger.com,1999:blog-7531788851905887292.post-21885381988268748282013-09-04T23:53:00.001-07:002013-09-04T23:53:26.743-07:00How to Enable Remote Desktop For Standard Users in Win 7<ol style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14.44444465637207px; line-height: 22.22222328186035px; margin: 0px;">
<li>Click Start -> Control Panel -> Systems</li>
<li>Click Remote Setting on the left hand nav</li>
<li>Select "Allo connections from computers running any version of remote desktop (less secure)</li>
<li>Click Select users</li>
<li>Add the "Standard" users that you want to enable the remote desktop</li>
</ol>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-7531788851905887292.post-45382623586606381572013-09-02T19:12:00.000-07:002013-09-02T19:12:15.432-07:00Git Pull Error - There is no tracking information for the current branchUsually I can just do a git pull to get the latest update from master. However, I receive the following error/warning when I try to do git pull.<br />
<br />
To solve this, I need to do "git pull origin master"<br />
<br />
D:\xampp\htdocs\website>git pull<br />
remote: Counting objects: 5, done.<br />
remote: Compressing objects: 100% (3/3), done.<br />
remote: Total 3 (delta 2), reused 0 (delta 0)<br />
Unpacking objects: 100% (3/3), done.<br />
From 192.168.1.15:web/website<br />
25bc2eb..0b66cee master -> origin/master<br />
There is no tracking information for the current branch.<br />
Please specify which branch you want to merge with.<br />
See git-pull(1) for details<br />
<br />
git pull <remote> <branch><br />
<br />
If you wish to set tracking information for this branch you can do so with:<br />
<br />
git branch --set-upstream-to=origin/<branch> master<br />
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-59090013947617702292013-07-08T20:09:00.000-07:002013-07-08T20:10:53.681-07:00Alias "{alias}" is invalid. Make sure it points to an existing PHP file and the file is readable.<div class="source" style="background-color: white; border: 0px; margin: 0px 0px 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<div class="file" style="background-color: transparent; border: 0px; font-family: Verdana; font-size: 12px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
The following error occur on my Yii web app</div>
<div class="file" style="background-color: transparent; border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #f3f3f3; font-family: Verdana; font-size: 15px; line-height: 24px;">Alias "ext.dropdown.DropDownBox" is not valid. </span><span style="font-family: Verdana;"><span style="font-size: 15px; line-height: 24px;"> Make sure it points to an existing PHP file and the file is readable.</span></span></div>
<div class="file" style="background-color: transparent; border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Verdana;"><span style="font-size: 15px; line-height: 24px;">I have checked that all of the permission is readable. This error only occurs in production and not in our test environment (mac and windows).</span></span></div>
<div class="file" style="background-color: transparent; border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Verdana;"><span style="font-size: 15px; line-height: 24px;">It turns out that our prod environment is using Centos and in my code I call</span></span></div>
<div class="file" style="background-color: transparent; border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Verdana;"><span style="font-size: 15px; line-height: 24px;">"</span></span><span style="background-color: transparent; font-family: Verdana; font-size: 15px; line-height: 24px;">$this->widget('ext.dropdown.DropDownBox', array(..." which should have been</span></div>
<div class="file" style="background-color: transparent; border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Verdana;"><span style="font-size: 15px; line-height: 24px;">"</span></span><span style="background-color: transparent; font-family: Verdana; font-size: 15px; line-height: 24px;">$this->widget('ext.drop<b>D</b>own.DropDownBox', array(..." </span></div>
<div class="file" style="background-color: transparent; border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-family: Verdana;"><span style="font-size: 15px; line-height: 24px;">Centos is very strict on case sensitivity. My extension folder name is with capital D "dropDown" and therefore I should have called the extension with capital D. </span></span></div>
<div class="file" style="background-color: transparent; border: 0px; font-family: Verdana; font-size: 12px; font-weight: bold; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
D:\xampp\YII\framework\YiiBase.php(316)</div>
<div class="code" style="background-color: transparent; border: 0px; font-family: Verdana; font-size: 12px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre style="background-color: #ffffee; border: 1px solid rgb(238, 238, 238); font-family: Menlo, Consolas, 'Lucida Console', monospace; font-size: 11pt; line-height: 18px; margin-bottom: 0.5em; margin-top: 0.5em; outline: 0px; padding: 0.5em; vertical-align: baseline;"><span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">304</span> if($isClass && (class_exists($className,false) || interface_exists($className,false)))
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">305</span> return self::$_imports[$alias]=$className;
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">306</span>
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">307</span> if(($path=self::getPathOfAlias($alias))!==false)
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">308</span> {
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">309</span> if($isClass)
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">310</span> {
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">311</span> if($forceInclude)
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">312</span> {
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">313</span> if(is_file($path.'.php'))
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">314</span> require($path.'.php');
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">315</span> else
<span class="error" style="background-color: #fce3e3; border: 0px; display: block; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span class="ln error-ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; font-weight: bold; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">316</span> throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing PHP file and the file is readable.',array('{alias}'=>$alias)));
</span><span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">317</span> self::$_imports[$alias]=$className;
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">318</span> }
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">319</span> else
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">320</span> self::$classMap[$className]=$path.'.php';
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">321</span> return $className;
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">322</span> }
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">323</span> else // a directory
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">324</span> {
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">325</span> if(self::$_includePaths===null)
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">326</span> {
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">327</span> self::$_includePaths=array_unique(explode(PATH_SEPARATOR,get_include_path()));
<span class="ln" style="background-color: transparent; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-width: 0px 1px 0px 0px; color: #999999; margin: 0px; outline: 0px; padding: 0px 0.5em 0px 0px; vertical-align: baseline;">328</span> if(($pos=array_search('.',self::$_includePaths,true))!==false)
</pre>
</div>
</div>
Unknownnoreply@blogger.com6tag:blogger.com,1999:blog-7531788851905887292.post-69416033100920892332013-07-05T02:19:00.000-07:002013-07-05T02:19:05.108-07:00Jenkins fecthing upstream git changes take forever<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">Started by user <a class="model-link" href="http://192.168.1.15:8080/user/null" style="color: #5c3566;">anonymous</a>
Building remotely on <a class="model-link" href="http://192.168.1.15:8080/computer/Windows%20Server%202003" style="color: #5c3566;">Windows Server 2003</a> in workspace c:\jenkins\workspace\your_app
Checkout:your_app / c:\jenkins\workspace\your_app - hudson.remoting.Channel@4296f09:Windows Server 2003
Using strategy: Default
Last Built Revision: Revision 9dc0a0401d62dd02f41a85ce00450d23ca85114f (origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">.</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">.</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">.</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">.</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">
</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">It just never ends</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">
</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">To solve this:</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">
</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">1. Go to your jenkins server</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">2. Go to jenkins workspace and do git pull</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">3. </pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">The authenticity of host '192.168.1.15 (192.168.1.15)' can't be established.
RSA key fingerprint is 6e:a3:e2:b5:b4:9f:02:4c:35:50:4f:8f:52:57:2b:d0.
<b><i>Are you sure you want to continue connecting (yes/no)? yes</i></b>
Warning: Permanently added '192.168.1.15' (RSA) to the list of known hosts.
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 11 (delta 9), reused 0 (delta 0)
Unpacking objects: 100% (11/11), done.
From 192.168.1.15:k24/obat24</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">
</pre>
<pre style="background-color: white; font-size: 11px; white-space: pre-wrap; word-wrap: break-word;">The reason jenkins does not work is because git is asking whether you want to add the rsa key fingerprint. You need to do this once manually and after that jenkins will be able to do the git pull for you.</pre>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-53214936034631328462013-07-01T08:28:00.002-07:002013-07-01T08:28:55.629-07:00Yii Require Once Error CpanelI tried to install Yii the first time on my cpanel hosting. However, when I try to launch my website I got the following errors:<br />
<br />
Warning: require_once(/home/user_name/public_html/yii/demos/your_app/../../YII/framework/yii.php) [function.require-once]: failed to open stream: No such file or directory in /home/user_name/public_html/yii/demos/your_app/index.php on line 12<br />
<br />
Fatal error: require_once() [function.require]: Failed opening required '/home/user_name/public_html/yii/demos/your_app/../../YII/framework/yii.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user_name/public_html/yii/demos/your_app/index.php on line 12<br />
<br />
However, when I try the Yii demo apps like hangman, it works.<br />
<br />
So I copied yii/demos/hangman/index.php to your_app/index.php file and it works. The reason I got the above error is because the yii path on my cpanel is different than on my local.<br />
<br />
My cpanel index.php (I install yii on my public_html/yii)<br />
<br />
<pre style="font-size: 11px;"><?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../../framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following line when in production mode
// defined('YII_DEBUG') or define('YII_DEBUG',true);
require_once($yii);
Yii::createWebApplication($config)->run();</pre>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-86369792799131489562013-06-30T20:16:00.000-07:002013-06-30T20:16:04.724-07:00Yii Active Records<a href="http://qatechnotes.blogspot.com/2013/06/how-to-enable-gii-tools-in-yii.html" target="_blank">Yii Active Record</a><br />
<br />
PostController.php<br />
<br />
//Assuming we have a database table with ID, title, content, category_id and user_id as a field<br />
<br />
public function actionActiveRecord()<br />
{<br />
//example of what Yii Active record can return<br />
$model = Post::model()->find('id = 1');<br />
echo $model->title;<br />
$model = Post::model()->find('category_id = 2 AND user_id = 1');<br />
echo $model->title;<br />
<br />
//alternatively you can use Yii Active record find by attributes<br />
$model = Post::model()->findByAttributes(array(<br />
'category_id' => 2,<br />
'user_id' => 1,<br />
));<br />
<br />
echo $model->title;<br />
<br />
//or you can use findByPk<br />
$model = Post::model()->findByPk(1)<br />
<br />
//if you need to display more than 1 data findAll<br />
$model = Post::model()->findAll('category_id = 2');<br />
foreach($model as $m){<br />
echo $m->title."<br/>";<br />
echo $m->content."<br/>";<br />
}<br />
}Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-28072360856496815072013-06-30T01:11:00.003-07:002013-06-30T01:11:30.707-07:00How to enable Gii Tools In YII<a href="http://qatechnotes.blogspot.com/" target="_blank">Setting GII Tools in YII</a><br />
<br />
1. Open your_app/protected/config/main.php<br />
2. uncomment the following th enable the Gii tool<br />
/*<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'gii'=>array(<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'class'=>'system.gii.GiiModule',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'password'=>'Enter Your Password Here',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// If removed, Gii defaults to localhost only. Edit carefully to taste.<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'ipFilters'=>array('127.0.0.1','::1'),<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>),<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>*/<br />
<br />
3. The UrlManager code needs to be uncommented as well<br />
/*<br />
'urlManager'=>array(<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'urlFormat'=>'path',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'rules'=>array(<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'<controller:\w+>/<id:\d+>'=>'<controller>/view',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>),<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>),*/<br />
4. Change the Gii password<br />
5. Go to your localhost/your_app/giiUnknownnoreply@blogger.com2tag:blogger.com,1999:blog-7531788851905887292.post-82279750299551124562013-06-29T19:03:00.000-07:002013-06-29T19:03:13.632-07:00How To Install YII Framework on Windows<a href="http://qatechnotes.blogspot.com/" target="_blank">Step By Step Guide to Install YII Framework on Windows</a><br />
<br />
Installing YII Framework on Windows<br />
<br />
1. Download YII framework on www.yiiframework.com<br />
2. Install XAMPP<br />
3. Put YII framework (rename to YII) on the XAMPP folder. e.g c:/xampp/yii<br />
4. Open System Properties -> Advanced -> Environment Variables -> Edit System Variables (PATH) -> Put YII path into the<br />
system variables. e.g c:/xampp/YII;c:/xampp/php<br />
5. Open CMD<br />
6. Go to c:/xampp/htdocs/<br />
7. Execute "yiic webapp your_app"<br />
8. Automatically your_app will be generated<br />
9. Open localhost/your_app<br />
<br />
Yiic will automatically generate your web application.<br />
<br />
PS C:\xampp\htdocs> yiic webapp your_app<br />
Create a Web application under 'C:\xampp\htdocs\your_app'? (yes|no) [no]:yes<br />
mkdir C:/xampp/htdocs/your_app<br />
mkdir C:/xampp/htdocs/your_app/assets<br />
mkdir C:/xampp/htdocs/your_app/css<br />
generate css/bg.gif<br />
generate css/form.css<br />
generate css/ie.css<br />
generate css/main.css<br />
generate css/print.css<br />
generate css/screen.css<br />
mkdir C:/xampp/htdocs/your_app/images<br />
generate index-test.php<br />
generate index.php<br />
mkdir C:/xampp/htdocs/your_app/protected<br />
generate protected/.htaccess<br />
mkdir C:/xampp/htdocs/your_app/protected/commands<br />
mkdir C:/xampp/htdocs/your_app/protected/commands/shell<br />
mkdir C:/xampp/htdocs/your_app/protected/components<br />
generate protected/components/Controller.php<br />
generate protected/components/UserIdentity.php<br />
mkdir C:/xampp/htdocs/your_app/protected/config<br />
generate protected/config/console.php<br />
generate protected/config/main.php<br />
generate protected/config/test.php<br />
mkdir C:/xampp/htdocs/your_app/protected/controllers<br />
generate protected/controllers/SiteController.php<br />
mkdir C:/xampp/htdocs/your_app/protected/data<br />
generate protected/data/schema.mysql.sql<br />
generate protected/data/schema.sqlite.sql<br />
generate protected/data/testdrive.db<br />
mkdir C:/xampp/htdocs/your_app/protected/extensions<br />
mkdir C:/xampp/htdocs/your_app/protected/messages<br />
mkdir C:/xampp/htdocs/your_app/protected/migrations<br />
mkdir C:/xampp/htdocs/your_app/protected/models<br />
generate protected/models/ContactForm.php<br />
generate protected/models/LoginForm.php<br />
mkdir C:/xampp/htdocs/your_app/protected/runtime<br />
mkdir C:/xampp/htdocs/your_app/protected/tests<br />
generate protected/tests/bootstrap.php<br />
mkdir C:/xampp/htdocs/your_app/protected/tests/fixtures<br />
mkdir C:/xampp/htdocs/your_app/protected/tests/functional<br />
generate protected/tests/functional/SiteTest.php<br />
generate protected/tests/phpunit.xml<br />
mkdir C:/xampp/htdocs/your_app/protected/tests/report<br />
mkdir C:/xampp/htdocs/your_app/protected/tests/unit<br />
generate protected/tests/WebTestCase.php<br />
mkdir C:/xampp/htdocs/your_app/protected/views<br />
mkdir C:/xampp/htdocs/your_app/protected/views/layouts<br />
generate protected/views/layouts/column1.php<br />
generate protected/views/layouts/column2.php<br />
generate protected/views/layouts/main.php<br />
mkdir C:/xampp/htdocs/your_app/protected/views/site<br />
generate protected/views/site/contact.php<br />
generate protected/views/site/error.php<br />
generate protected/views/site/index.php<br />
generate protected/views/site/login.php<br />
mkdir C:/xampp/htdocs/your_app/protected/views/site/pages<br />
generate protected/views/site/pages/about.php<br />
generate protected/yiic<br />
generate protected/yiic.bat<br />
generate protected/yiic.php<br />
mkdir C:/xampp/htdocs/your_app/themes<br />
mkdir C:/xampp/htdocs/your_app/themes/classic<br />
mkdir C:/xampp/htdocs/your_app/themes/classic/views<br />
generate themes/classic/views/.htaccess<br />
mkdir C:/xampp/htdocs/your_app/themes/classic/views/layouts<br />
mkdir C:/xampp/htdocs/your_app/themes/classic/views/site<br />
mkdir C:/xampp/htdocs/your_app/themes/classic/views/system<br />
<br />
Your application has been created successfully under C:\xampp\htdocs\your_app.<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-77445755754434919282013-06-26T18:39:00.002-07:002013-06-26T18:39:28.794-07:00How to Startup Tomcat server in MACHow to Startup/Shutdown Tomcat server in MAC<br />
<br />
/Library/tomcat/bin/startup.sh<br />
/Library/tomcat/bin/shutdown.shUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-28299244970946865142013-06-22T07:18:00.000-07:002013-06-22T07:18:05.631-07:00How to display .gitignore file in netbeansTo display .gitignore file in netbeans simply modify the miscellaneous options in:<br />
<br />
Tools->Options->miscellaneous ->Files<br />
<br />
And change the Files ignore by the IDE:<br />
From:<br />
^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(?!(htaccess)$).*$<br />
<br />
To:<br />
^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(?!(htaccess|gitignore)$).*$Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-78253171847355443662013-06-21T01:27:00.000-07:002013-06-21T01:27:00.138-07:00CSS style submit button heightTo adjust the text on the submit input button use the following CSS style:<br />
<br />
line-height: 2;Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-7531788851905887292.post-32567897679784369142013-06-03T23:41:00.002-07:002013-06-03T23:41:50.056-07:00Unable to create Git index.lock File Existsfatal: Unable to create '/Users/username/Sites/testsite/.git/index.lock': File exists.<br />
<br />
If no other git process is currently running, this probably means a<br />
git process crashed in this repository earlier. Make sure no other git<br />
process is running and remove the file manually to continue.<br />
<br />
Just delete the index.lock file<br />
<br />
rm /Users/username/Sites/testsite/.git/index.lock<br />
git pullUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-53013047987122483662013-06-02T23:57:00.001-07:002013-06-02T23:57:42.702-07:00Apache Access Log, Error Log in Macis located in<br />
<br />
tail - f /var/log/apache2/access_log<br />
tail - f /var/log/apache2/error_logUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-47765354335706000362013-05-31T21:23:00.002-07:002013-05-31T21:23:59.511-07:00PHP error - It is not safe to rely on the system's timezone settingsTo fix the bellow error:<br />
<br />
1. Find you php.ini files<br />
2. to see your php.ini files- you need to pass in the INFO_GENERAL parameters as without the parameters you will get the same error as phpinfo() will trigger the timezone issue settings<br />
3. Edit your php.ini files and go to<br />
<br />
<pre>; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =
</pre>
<br />
Change to what ever your time zone is. For a list of php timezone please visit http://id1.php.net/manual/en/timezones.asia.php<br />
<br />
<pre>; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Asia/Dubai"
</pre>
<br />
Ps: don't forget to delete the ";"<br />
<br />
4. Restart your apache server. if you are using mac use "sudo apachectl restart"<br />
<br />
<br />
date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Dubai' for 'WIT/7.0/no DST' insteadUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-62806094274430197542013-05-31T20:09:00.001-07:002013-05-31T20:10:49.743-07:00CException CAssetManager is invalidTo fix the below error:<br />
1. Set the group permission to WWW using<br />
sudo chown user:www assets (mac)<br />
sudo chown user.www assets (linux)
<br />
<br />
<pre>------------------
Websever Error
CException
CAssetManager.basePath "/Users/user/Sites/website-code/assets" is invalid. Please make sure the directory exists and is writable by the Web server process.
/Users/user/YII/framework/web/CAssetManager.php(138)
126 }
127
128 /**
129 * Sets the root directory storing published asset files.
130 * @param string $value the root directory storing published asset files
131 * @throws CException if the base path is invalid
132 */
133 public function setBasePath($value)
134 {
135 if(($basePath=realpath($value))!==false && is_dir($basePath) && is_writable($basePath))
136 $this->_basePath=$basePath;
137 else
138 throw new CException(Yii::t('yii','CAssetManager.basePath "{path}" is invalid. Please make sure the directory exists and is writable by the Web server process.',
139 array('{path}'=>$value)));
140 }
141
142 /**
143 * @return string the base url that the published asset files can be accessed.
144 * Note, the ending slashes are stripped off. Defaults to '/AppBaseUrl/assets'.
145 */
146 public function getBaseUrl()
147 {
148 if($this->_baseUrl===null)
149 {
150 $request=Yii::app()->getRequest();
</pre>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-48643005670353414122013-05-27T02:22:00.002-07:002013-05-27T02:22:45.802-07:00Windows Batch File Not ExecutingI use jenkins to automate my cucumber test automation.
I use windows to execute the batch command in Jenkins
<br />
<br />
<pre>bundle install --path vendor
set test_env=test_server
bundle exec cucumber features\regression\dashboard.feature
</pre>
<br />
However, only the first line is executed by jenkins. It turns out that jenkins creates a .bat file for those above commands and jenkins calls the commands as
<br />
<br />
<pre>cmd \c call hudson.bat
</pre>
<pre></pre>
And apparently the cmd "Call" command only works on the first command.
To fix the issue simply append the keyword "call" on every command.<br />
<br />
The solution:
<br />
<pre>call bundle install --path vendor
set test_env=test_server
call bundle exec cucumber features\regression\dashboard.feature
</pre>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-83550170044407561252013-05-27T02:20:00.000-07:002013-05-27T02:20:27.676-07:00Jenkins does not execute All Windows Batch CommandI use jenkins to automate my cucumber test automation.
I use windows to execute the batch command in Jenkins
<br />
<br />
<pre>bundle install --path vendor
set test_env=test_server
bundle exec cucumber features\regression\dashboard.feature
</pre>
<br />
However, only the first line is executed by jenkins. It turns out that jenkins creates a .bat file for those above commands and jenkins calls the commands as
<br />
<br />
<pre>cmd \c call hudson.bat
</pre>
<pre>
</pre>
And apparently the cmd "Call" command only works on the first command.
To fix the issue simply append the keyword "call" on every command.<br />
<br />
The solution:
<br />
<pre>call bundle install --path vendor
set test_env=test_server
call bundle exec cucumber features\regression\dashboard.feature
</pre>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-22709454310864061122013-05-24T01:34:00.003-07:002013-05-24T01:36:17.808-07:00Cannot run program sh in jenkins<pre style="background-color: white; font-size: 11.111111640930176px; white-space: pre-wrap; word-wrap: break-word;">Error from Jenkins console:</pre>
<pre style="background-color: white; font-size: 11.111111640930176px; white-space: pre-wrap; word-wrap: break-word;"></pre>
<pre style="background-color: white; font-size: 11.111111640930176px; white-space: pre-wrap; word-wrap: break-word;">[cuke-test] $ sh -xe C:\Users\username\AppData\Local\Temp\4\hudson4066016990068916818.sh
The system cannot find the file specified
FATAL: command execution failed
<a class="lowkey" href="http://stacktrace.jenkins-ci.org/search?query=java.io.IOException" style="text-decoration: none;">java.io.IOException</a>: Cannot run program "sh" (in directory "c:\jenkins\workspace\<span style="font-size: 11.111111640930176px;">cuke</span><span style="font-size: 11.111111640930176px;">-test"): CreateProcess error=2, The system cannot find the file specified</span>
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:763)
at hudson.Launcher$ProcStarter.start(Launcher.java:353)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:988)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:955)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:58)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 17 more
Build step 'Execute shell' marked build as failure</pre>
<pre style="background-color: white; font-size: 11.111111640930176px; white-space: pre-wrap; word-wrap: break-word;"></pre>
<pre style="background-color: white; font-size: 11.111111640930176px; white-space: pre-wrap; word-wrap: break-word;">Solution:</pre>
<pre style="background-color: white; font-size: 11.111111640930176px; white-space: pre-wrap; word-wrap: break-word;">- It turns out that I copied a job from a linux slave and therefore the default build step that was used was "Execute shell". To fix the issue just change the "Execute shell" to "Execute Windows batch command"</pre>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-7531788851905887292.post-2414270207558579502013-05-07T18:24:00.006-07:002013-05-07T18:26:58.050-07:00Git Setup Remote Tracking Branch<br />
<b>Git global setup</b><br />
<br />
git config --global user.name "Test User"<br />
git config --global user.email "testuser@gmail.com"<br />
<br />
<b>Create Repository</b><br />
<br />
mkdir testproject<br />
cd testproject<br />
git init<br />
touch README<br />
git add README<br />
git commit -m 'first commit'<br />
git remote add origin git@gitlab.testserver-123.testuser/testprojects.git<br />
git push -u origin master<br />
<br />
<b>Existing Git Repo?</b><br />
<br />
cd existing_git_repo<br />
git remote add origin git@gitlab.testserver-123.testuser/testprojects.git<br />
git push -u origin masterUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-23215077513273110002013-05-03T00:56:00.001-07:002013-05-03T00:56:33.565-07:00Capybara Check Select OptionsTo check Select options using Capybara<br />
<br />
To choose the select option:<br />
<br />
<pre>select('Morning', :from => 'Shift')
</pre>
<br />
To check the value of the select options:<br />
<br />
<pre>page.has_select?('Shift', :selected => 'Morning')
</pre>
<br />
<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-72918093116513790232013-03-28T01:06:00.003-07:002013-03-28T01:06:55.358-07:00Creating GIT branch and merge<br />
<pre style="border: 0px; color: #070707; font-size: 14px; line-height: 1.2em; margin-bottom: 1em; margin-left: 1em; margin-top: 1em; padding: 0px; vertical-align: baseline;">--- to create:</pre>
<pre style="border: 0px; color: #070707; font-size: 14px; line-height: 1.2em; margin-bottom: 1em; margin-left: 1em; margin-top: 1em; padding: 0px; vertical-align: baseline;">git checkout master
<span class="gp" style="border: 0px; color: navy; font-family: inherit; font-style: inherit; font-weight: bold; margin: 0px; padding: 0px; vertical-align: baseline;">$</span> git checkout -b new-branch</pre>
<pre style="border: 0px; color: #070707; font-size: 14px; line-height: 1.2em; margin-bottom: 1em; margin-left: 1em; margin-top: 1em; padding: 0px; vertical-align: baseline;">--- to merge</pre>
<pre style="border: 0px; color: #070707; font-size: 14px; line-height: 1.2em; margin-bottom: 1em; margin-left: 1em; margin-top: 1em; padding: 0px; vertical-align: baseline;">git commit -am "commit file in branch"</pre>
<pre style="border: 0px; color: #070707; font-size: 14px; line-height: 1.2em; margin-bottom: 1em; margin-left: 1em; margin-top: 1em; padding: 0px; vertical-align: baseline;">git checkout master</pre>
<pre style="border: 0px; color: #070707; font-size: 14px; line-height: 1.2em; margin-bottom: 1em; margin-left: 1em; margin-top: 1em; padding: 0px; vertical-align: baseline;">git merge new-branch</pre>
<pre style="border: 0px; color: #070707; font-size: 14px; line-height: 1.2em; margin-bottom: 1em; margin-left: 1em; margin-top: 1em; padding: 0px; vertical-align: baseline;">
</pre>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-57402131973049577072013-03-19T06:47:00.001-07:002013-03-19T06:47:29.585-07:00Resizing image to create thumbnail in MACto resize an image or images in a directory use the following command:<br />
<br />
//to resize all of the images in a directory to 245x245 size<br />
sips --resampleHeightWidth 245 245 *Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-55648755474694462312013-01-22T19:21:00.001-08:002013-01-22T19:21:49.355-08:00How to remove custom Alexa toolbar from Chrome extension completelyI created a custom free Alexa toolbar and installed it as an extension on my Chrome. <br /><br />So whenever I open my chrome, the custom alexa extension appears as another menu on chrome. However, the extension apparently makes my browser test automation to fail. <br />I remove the extension manually from the chrome setting. I thought the extension is removed completely.<br /><br />However, it turns out that Alexa still saves the extension on your hardisk. Whenever, my test automation runs, it loads up the extension to chrome again. I tried to remove it again, but it always appears. This is very annoying. <br /><br />To find the location of the Alexa chrome extension just open regedit and search for "Alexa" and remove any of alexa information.<br /><br />For me the culprit is stored in "C:\Users\<username>\AppData\Local\Alexa\atbpg-MSXGM-1.2.crx". And this file will be loaded by chrome automatically. <br /><br />I deleted the file and the Alexa chrome extension never comes up again.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-70813483147207884362012-11-07T15:10:00.002-08:002012-11-07T15:10:28.689-08:00Internal error in Forbidden Patterns Policy<br />
Microsoft Visual Studio<br />
<br />
This override warning in VS occur when editing files<br />
<br />
Internal error in Forbidden Patterns Policy.<br />
Error Loading The Forbidden Patterns Policy policy (The policy assembly 'Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ForbiddenPatternsPolicy, Version-10.0.0.0,<br />
Culture=neutral, PublicKeyToken=b03f5fd23423' is not registered.). Installation instructions:<br />
<br />
Error Loading The Forbidden Patterns Policy policy (The policy assembly 'Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ForbiddenPatternsPolicy, Version-10.0.0.0,<br />
Culture=neutral, PublicKeyToken=b03f5fd23423' is not registered.). Installation instructions:<br />
<br />
To solve this please ensure you have the TFS Powertools extensions for Visual Studio installed.<br />
<br />
Goto tools->extension manager and you should find it in the online section.<br />
<br />
http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f<br />
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7531788851905887292.post-75241404641694499342012-11-07T04:29:00.002-08:002012-11-07T04:31:09.091-08:00Rails SMTP email setupI am using rails 3.2.6.
<br><br>
To setup SMTP email using ruby:
<br><br>
1. Add the following code into the /config/environment.rb
<br><br>
require File.expand_path('../application', __FILE__)
<br><br>
# Initialize the rails application
AppName::Application.initialize!
<br><br>
ActionMailer::Base.delivery_method = :smtp
<br><br>
ActionMailer::Base.smtp_settings = {<br>
:address => "smtp.host.com",<br>
:port => 587,<br>
:user_name => "email host",<br>
:password => "email password hot",<br>
:authentication => :plain,<br>
:enable_starttls_auto => "true"<br>
}
<br><br>
ActionMailer::Base.raise_delivery_errors = true
<br><br>
2. Create /app/mailers/appnamemailers.rb with the following content<br>
class Appnamemailers < ActionMailer::Base<br>
default :from => "email@hostemail.comd"<br>
<br><br>
def welcome_email()<br>
@url = "http://www.example.com"<br>
mail(:to => "test@gmail.com", :subject => "Welcome to rails app")<br>
end<br>
end<br>
2. To test run rails console<br>
3. Execute the command Appnamemailers.welcome_email().deliver<br>
Unknownnoreply@blogger.com0