Archive

Archive for the ‘General’ Category

How to Backup and Restore a MySQL Database

June 7th, 2009 1 comment

To make a database backup using the MySQL command-line utilities, execute the following command:

$ mysqldump -u username -p –opt dbname > dump.sql

It will ask you for password because we used -p paramater over there. If the MySQL programs are not in your path, you will need to manually specify the location of the mysqldump program:

$ /path-to-your-mysql-bin/mysqldump -u username -p –opt dbname > dump.sql

Download the dump.sql and keep it in a safe place (CDR, Zip disk, etc).

If you need to restore your database, you can do so like this:

$ mysql -u username -p dbname < dump.sql

This is the simples way to restore and backup your database.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Categories: General Tags: ,

Gedit Modifications for PHP

May 17th, 2009 3 comments

Since i am coding with codeigniter framework on gedit, i was looking for snippets for codeigniter on gedit

download gedit snippet for codeigniter

By the way if you want to make your gedit more useful for programming surely you may add some third party plugins as many as you want or simply just active default plugins. Idea is that firstly download a plugin then extract its content to ‘~/.gnome2/gedit/plugins/’ directory. Once you have installed the plugin you want, you need to enable it via Edit>Preferences and then the Plugins Tab. Such as;

- Snippets
- Class Browser
- Bracket Completation
- Character Map
- Embedded Terminal
etc..

You can basicly find out third-party plugins by clicking on this link

VN:F [1.9.22_1171]
Rating: 6.0/10 (8 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Categories: General, Linux, PHP, Programming Tags: , ,

Amazon Architecture

May 10th, 2009 No comments

This is a wonderfully informative Amazon update based on Joachim Rohde’s discovery of an interview with Amazon’s CTO. You’ll learn about how Amazon organizes their teams around services, the CAP theorem of building scalable systems, how they deploy software, and a lot more. Many new additions from the ACM Queue article have also been included.

Amazon grew from a tiny online bookstore to one of the largest stores on earth. They did it while pioneering new and interesting ways to rate, review, and recommend products. Greg Linden shared is version of Amazon’s birth pangs in a series of blog articles.

Information Sources

  • Early Amazon by Greg Linden
  • How Linux saved Amazon millions
  • Interview Werner Vogels – Amazon’s CTO
  • Asynchronous Architectures – a nice summary of Werner Vogels’ talk by Chris Loosley
  • Learning from the Amazon technology platform – A Conversation with Werner Vogels
  • Werner Vogels’ Weblog – building scalable and robust distributed systems

    Platform

  • Linux
  • Oracle
  • C++
  • Perl
  • Mason
  • Java
  • Jboss
  • Servlets

    The Stats

  • More than 55 million active customer accounts.
  • More than 1 million active retail partners worldwide.
  • Between 100-150 services are accessed to build a page.

    The Architecture

  • What is it that we really mean by scalability? A service is said to be scalable if when we increase the resources in a system, it results in increased performance in a manner proportional to resources added. Increasing performance in general means serving more units of work, but it can also be to handle larger units of work, such as when datasets grow.
  • The big architectural change that Amazon made was to move from a two-tier monolith to a fully-distributed, decentralized, services platform serving many different applications.
  • Started as one application talking to a back end. Written in C++.
  • Read more…

    VN:F [1.9.22_1171]
    Rating: 0.0/10 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    Categories: General Tags: ,

    What is MVC Architecture? (Model – View – Controller)

    April 19th, 2009 71 comments

    MVC Architecture has implemented by Trygve Reenskaug at 1979 for the first time. It was implemented on Smalltalk at Xerox labs. Then benefits and advantages of this architecture has been accepted by most of the coders and software engineers.

    It was an information about MVC’s history above. Now lets talk about what really MVC is. What do you understand from MVC. The word M stands for Model, V stands for View and C stands for Controller. I am going to mention about each item.

    The figure above may help you while thinking what structure it might have. Let’s start with Model.

    Model:
    It handles data processing and database works part. Model processes events sent by controller. After processing these events then it sends processed data to controller (thus, controller may reprocess it) or directly to view side.

    View:
    View prepares an interface to show to the user. Controller or model tells view what to show to the user. Also view handles requests from user and informs controller.

    Read more…

    VN:F [1.9.22_1171]
    Rating: 8.4/10 (500 votes cast)
    VN:F [1.9.22_1171]
    Rating: +172 (from 204 votes)
    Categories: General, Programming Tags: , , ,

    Let’s get started with jQuery

    February 27th, 2009 No comments

    Nowadays you may see tons of Javascript frameworks coming up. The truth is that it makes your code efficient if a framework used instead of pure javascript code. Most of the javascript frameworks helps you to solve crossbrowser difficulties. Probably you heard about Prototype and MooTools. You may see some people are trying to decide between these frameworks. I should say i am fan of jQuery. jQuery comes with tons of futures and flexibility and you can do a big work with less effort and it is not just a regular library however jQuery is even ajax and effect library. It does evertything i need with piece of code.

    jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

    Let’s say you are using some other libraries as well, there it goes, jQuery is such a good friend with other libraries. API designed with conciseness and convenience as the driving factors.

    Before start with jQuery i want you to know some basics about it. You can download the framework basically from www.jquery.com then download it on your desktop. This is how jQuery places in html code.

    <html>
    <head>
    <strong><script type="text/javascript" src="jquery.js"></script></strong>
    <script type="text/javascript">
    <strong>// Your code goes here</strong>
    </script>
    </head>
    <body>
    <a href="http://jquery.com/">jQuery</a>
    </body>
    </html>

    You can start with placing your core *.js file which is jquery.js for this example.

    Read more…

    VN:F [1.9.22_1171]
    Rating: 4.0/10 (6 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    Categories: General, Jquery, PHP, Programming Tags: , , ,