Posted
on February 19, 2016, 7:11 am,
by admin,
under
beanstalk.
/etc/init.d/beanstalkd stop
cd /var/lib/beanstalkd
rm -r -f *
/etc/init.d/beanstalkd start |
Posted
on February 18, 2016, 12:23 pm,
by admin,
under
git.
Posted
on February 14, 2016, 12:35 pm,
by admin,
under
apache.
Posted
on February 11, 2016, 3:23 pm,
by admin,
under
php.
<?php
curl_setopt($f1, CURLOPT_VERBOSE, true); |
Posted
on February 10, 2016, 9:47 am,
by admin,
under
php,
yii.
<?php
return Yii::$app->response->sendFile($fileName); |
Posted
on January 25, 2016, 7:03 am,
by admin,
under
yii.
Step 1:
app/config/console.php
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'app\helpers\MyFileTarget',
'exportInterval' => 1,
'categories' => ['my-category'],
'except' => ['application'],
'levels' => ['trace'],
'logFile' => '@app/runtime/logs/my-category.log',
],
],
], |
Step 2:
Create file app/helpers/MyFileTarget.php
<?php
namespace app\helpers;
use Yii;
use yii\log\Logger;
use yii\log\FileTarget;
class MyFileTarget extends FileTarget
{
public function formatMessage($message)
{
list($text, $level, $category, $timestamp) = $message;
$level = Logger::getLevelName($level);
if ($level == 'trace') {
return date('Y-m-d H:i:s', $timestamp) . " [$level][$category] $text";
}
}
} |
Step 3:
cat /var/www/yii2-installed-dir/app/runtime/logs/my-category.log |
Posted
on January 11, 2016, 3:40 pm,
by admin,
under
apache.
Edit
export APACHE_RUN_USER=imran
export APACHE_RUN_GROUP=www-data |
Save and restart apache
Posted
on January 8, 2016, 12:07 pm,
by admin,
under
linux.
If you forgot root’s password follow these steps to reset it:
1. Reboot, press ESC to get to GRUB boot loader menu
2. Choose from the list kernel with
3. From the menu screen choose
"Drop to root shell prompt" |
4. By default it gives you read-only filesystem Run this for read/write:
5. Run this to change root’s password:
Posted
on January 7, 2016, 7:10 am,
by admin,
under
mysql.
Run the following statement for bulk UPDATE
UPDATE table1 SET column2 = CASE
WHEN column1 = 'A' THEN 'AB'
WHEN column1 = 'B' THEN 'BC'
WHEN column1 = 'C' THEN 'CD'
ELSE column2
END; |
Make sure you included ELSE statement, if you skip it then it will NULL rest of the column2 fields.
So, if you have any pre-filled column2 field and you want to keep their values then use ELSE column2 to keep them.
Posted
on December 28, 2015, 5:45 am,
by admin,
under
git.