Monday, April 29, 2013

Backup database with Crontab

How to backup database with schedule. here the codes. First let's create a chunk of codes to backup
nano /home/arul/backup_database.sh
and type these code:
mysqldump -u dbuser -pdbpass dbname > /home/arul/backup/file_name_backup_`date +\%Y%m%d`.sql
then let's set the schedule to execute the code with Crontab
firstly, edit your crontab.
crontab -e
type the code:
0 0 * * * /home/arul/backup_database.sh
You can list crontab execution code with:
crontab -l

PHP Interactive Shell

Using the interactive shell you are able to type PHP code and have it executed directly.

  
$ php -a
Interactive shell

php > echo 5+8;
13

Wednesday, April 24, 2013

JQuery Organisation Chart Plugin

Here the jQuery plugins for Organinisation Chart,
Check it out:

  1. Google Chart Tools
  2. Visual jQuery - Org Chart
  3. Caprica -jquery-orgchart
  4. Basic Primitives - org chart

 

 

Design and manage your database with GUI application

Hi Guys,
you wanna to design, create, view..etc database, everything you can do with GUI database application
here the some applications you can try:

MySQL Workbench
 Download













Navicat
 Download
















Valentina
 Download


Customize your Mac Finder with XtraFinder

With Xtrafinder, you can custom your Finder like enable Tab, Cut.. etc.
simple way, download and install. donwload Xtrafinder

Friday, April 12, 2013

Execute PHP script from Crontab

Here's just example, the PHP code will excute in every 5 minutes
Open your terminal and type
crontab -e
and new line
*/5 * * * * /usr/bin/php /home/arul/myscript.php
For more informatioin about the guide Crontab, you can see on this Crontab Manual

Tuesday, April 9, 2013

How to display name of application command path on unix base

Just open your terminal, type the command.
for example we are search where the php function locate
>type php
will return display
php is /usr/bin/php

Monday, April 8, 2013

Configuring Phusion Passenger on Mac OS X Lion

Phusion Passenger can manage your Ruby on Rails Applications to running on Apache Web server, I have installed on my MBP, check it out.

Firstly, intall the "passenger" gem
> sudo gem install passenger
> sudo passenger-install-apache2-module 

you would see the wizard installation, follow the instructions step by step :)
now, passenger is installed.

Copy these lines.

LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-3.0.19/ext/apache2/mod_pa$
PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-3.0.19
PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Then, adding a chuck of code before to "httpd.conf"
sudo nano /etc/apache2/httpd.conf

Now, edit Vhost
sudo nano /etc/apache2/httpd.conf

find and uncomment this line code:
"include /private/etc/apache2/extra/httpd-vhosts.conf"

Next, we need to adding new local domain
sudo nano /etc/hosts
Add new your domain.

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost
127.0.0.1       projectname.local
Edit your Vhost file
sudo nano /etc/apache2/extra/httpd-vhosts.conf
Add codes below:

< VirtualHost *:80>
ServerName projectname.local
DocumentRoot "/Users/oya_andriani/Documents/My Labs/depot/public"
RailsEnv development
RailsBaseURI /
 < Directory "/Users/oya_andriani/Documents/My Labs/depot/public/">
        AllowOverride None
        Order allow,deny
        Allow from all
 < /Directory>
< /VirtualHost>

Finaly, restart your apache
sudo apachectl retart
It's done, access your local domain with your browser.

Thursday, April 4, 2013

Install ImageMagicK on OSX Lion

Intalling ImageMagicK using MacPort:
if you are using MacPort as a package manager for Mac,
you will need to perform the following steps to get ImageMagic working on OSX Lion

Open your terminal

Remove existing ImageMagic on your Mac
sudo port uninstall imagemagick
sudo port install imagemagick

Macport installing sudo: port: command not found

Hi Guys,

When installing MacPort from source i found trouble in this part
port: command not found 
i have found the solution after googling, that easy way.. here's check it out.


nano .bash_profile
add a chunck of code below:
export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
then type this line code
sudo port -v selfupdate
that's all, enjoy!