Wednesday, March 17, 2010

Display the list of databases in MySQL

mysql> show databases;

Sunday, November 22, 2009

Setting Drupal 'files' folder permissions

> cd /var/www/example.com/sites
> chmod a+w default

Thursday, November 12, 2009

Making git ignore certain files and folder

Create .gitignore file in project folder

> touch .gitignore

List the files and folder name in .gitignore file, example

tmp/*
sites/default/settings.php
*~
\#*
.#*

Change Linux file/folder permission

Linux permission structure

user-group-other
rwx-rwx-rwx

r- read
w- write
x- execute

To see the existing permissions, type

> ls -l
or
> ls -l file or folder name

to change user permission

> chown -R +rw file/folder name

to change group and other permissions

> chmod -R go+rw file/folder name

You can use (option a for user/group/)

> chmod -R a+rw file/folder name

Monday, November 9, 2009

Import / Export MySQL Database

To export;

mysqldump -u username -ppassword database_name > FILE.sql

To Import:
mysql -u username -ppassword database_name < FILE.sql

Friday, November 6, 2009

Alternative to VI

nano - is a simple editor on debian, much better than VI

Thursday, November 5, 2009

Installing apache2, PHP5

sudo apt-get update
sudo aptitude install apache2