Roshan Book

My Tech Notebook

Tag Archives: ububntu

Starting YII development in ubuntu – Part 1

1. Download yii folder

2. Go to var/www directory in terminal

3. TO create a new project follow:

first you need to get into your webroot by

cd /var/www <– in my case

create a folder that you want your demo to be install in my case I create a folder named ‘blog’ under /var/www/yii/

then set permission to 777 by: sudo chmod 777

then type in the following command

php yii/framework/yiic.php webapp /var/www/yii/blog

if your php program has not been installed, the system will give you an install command then do it and come back to do the same.

then you can access your demo by http://localhost/yii/blog <— in my case

4. To enable gii

go to protected>config>main.php and uncomment gii module

5. To access gii generator go to http://localhost/myproj/demo/index.php?r=gii/default/login

6. To convert url mapping into path format go to config>main.php and uncomment

‘urlManager’=>array(
‘urlFormat’=>’path’,
‘rules’=>array(
‘<controller:\w+>/<id:\d+>’=>'<controller>/view’,
‘<controller:\w+>/<action:\w+>/<id:\d+>’=>'<controller>/<action>’,
‘<controller:\w+>/<action:\w+>’=>'<controller>/<action>’,
),
),

 

7. Passing variable data from controller to view

In Controller

public $message = ‘Hello World rom controller’;

public function actionIndex()
{
$this->render(‘index’,array(‘content’=>$this->message));
}

Now variable content is available to modified

In View

<?php echo $content ?>

Alternatively we could do

<?php echo $this->message   ?>

8. CRUD generation

a) Config database

b) Go to protected>>config>>main.php

c) Uncomment db componenent

d) Give the username , password, and db name

e) Comment out sqlite configuration which lie just above the mysql configuration

 

9. GO to gii

10. Select model generator

11. Enter table details and generate the model

12. We now have Message.php under model directory

13. Now click on CRUD generator

13. Enter Model name

14. Click generate

15. You can try it out by goign to baseurl/modelname

16. Access database content via these codes in controller

public $message = ”;

public function actionIndex()
{ $message=Message::model()->findByPK(3);
$this->message=$message->content;
$this->render(‘index’,array(‘content’=>$this->message));
}

How to Install Webmin on Ubuntu 11.10/11.04 Server

Source: http://www.upubuntu.com/2011/09/how-to-install-webmin-on-ubuntu.html

Webmin is a web-based interface based on Perl for system administration under Unix-based systems. With Webmin, you can easily set up, via your web browser, new user accounts, manage disk quotas, configure files, control the Apache server as well as MySQL and PHP. In this guide, we will see how to install Webmin on a server running Ubuntu 11.04 or 11.10.

Webmin Installation

Before we start, you should first install the LAMP web server on your system. Now follow these instructions to install Webmin on Ubuntu 11.10/11.04:

1. Open the Terminal and run this command:

sudo gedit /etc/apt/sources.list

At the end of the file, add these two lines, then save and close:

deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib

2. Import now the GPG key using these commands:

wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
sudo apt-get update

3. Install now Webmin with this command:

sudo apt-get install webmin

Accessing Webmin

To start Webmin, open this address using your web browser:

https://ubuntu:10000/

To login to webmin, you need to use your root account details. If you still haven’t assigned a password to your root account, then create a root password using this command via the terminal:

sudo passwd

Enter a new password, then resubmit it to confirm. Then use your root account access details to login to webmin.

 

To restart Webmin, use this command:

sudo /etc/init.d/webmin restart

That’s it!

 

How To Install The GTK3 Mac OS X Lion Theme On Ubuntu 11.10

Source: http://www.upubuntu.com/2011/11/how-to-install-gtk3-mac-os-x-lion-theme.html

In this tutorial we are going to help you install the GTK3 Mac OS X Lion theme for Ubuntu 11.10 Oneiric Ocelot. This will make Ubuntu 11.10 look like the new Mac OS X Lion OS. This theme is created by MBOSSG at deviantART.

A- Mac OS X Lion Theme Installation

1. Installing Cursors

Open the terminal and run these commands:

wget http://dl.dropbox.com/u/47950494/Mac-Lion-Cursors.tar.gz
sudo tar -xzvf Mac-Lion-Cursors.tar.gz -C /usr/share/icons

2. Downloading The Theme

[Note]: If you have already a “.themes” folder at your home directory, then skip the fisrt command.

Run these commands:

mkdir ~/.themes
wget http://dl.dropbox.com/u/47950494/Mac-Lion-Theme.tar.gz
tar -xzvf Mac-Lion-Theme.tar.gz -C ~/.themes

3. Installing Icons:

[Note]: If you have already an “.icons” folder at your home directory, then skip the fisrt command.

Run these commands:

mkdir ~/.icons
wget http://dl.dropbox.com/u/47950494/Mac-Lion-Icons.tar.gz
tar -xzvf Mac-Lion-Icons.tar.gz -C ~/.icons


B- Enabling The MAC OS X Lion Theme

Method 1

Install first GNOME Tweak Tool with this command:

sudo apt-get install gnome-tweak-tool


Launch GNOME Tweak Tool and in the Theme tab, enable these options then reboot:

Cursor theme > Mac-Lion-Cursors
Icon theme > Mac-Lion-Icons
GTK+ theme > Mac-Lion-Theme
Window theme > Mac-Lion-Theme

Method 2:

Or run simply these commands from the terminal:

gsettings set org.gnome.desktop.interface gtk-theme ‘Mac-Lion-Theme’

gsettings set org.gnome.desktop.interface icon-theme ‘Mac-Lion-Icons’

gconftool-2 –set –type string /apps/metacity/general/theme ‘Mac-Lion-Theme’



Screenshots:

 

 

Enjoy!


Add New Comment

Optional: Login below.

Image

Showing 5 of 15 comments

%d bloggers like this: