Wednesday, February 29, 2012

AWS EC2: Quick and secure LAMP on Amazon Linux


sudo su -
yum update
# add the AMP
yum install httpd mysql mysql-server php php-mysql php-xml php-pdo php-odbc php-soap php-common php-cli php-mbstring php-bcmath php-ldap php-imap php-gd

# Add a user and give sudo privs
useradd someUser
passwd someUser
# Give password
vim /etc/sudoers
# if this is unfamiliar to you, be careful:
# insert line "someUser ALL=(ALL)   ALL"

# Configure ssh key and disable password authentication
cd /home/someUser
mkdir .ssh
vim .ssh/authorized_keys
chown -R someUser:someUser
chmod 700 .ssh
chmod 600 .ssh/*
vim /etc/ssh/ssh_config
# insert line "PasswordAuthentication no"
service sshd restart
# Validate connection in another terminal before exiting the current session!

# Primary MySQL config
chkconfig mysqld on
service mysqld start
# Root access from local only
# Set a root password (that's good)
# Delete test db
# Delete anonymous users

# Apache chkconfig on
chkconfig httpd on
service httpd start

# Create a mysql user/schema for your site(s)
mysql -u root -p
# Enter the password you set
mysql> CREATE SCHEMA someAppName;
mysql> GRANT ALL ON someAppName.* TO someAppName@'%' IDENTIFIED BY 'somePassword';

Tuesday, February 21, 2012

Cool WebGL & Web Audio API demo

Here’s a look at some cool WebGL and Web Audio API demos that I’ve seen over the past couple weeks.
EVE Online ship viewer is a great-looking online ship viewer app built with WebGL. Very nice way to showcase the artwork in the game universe.
Web Audio API samples page has several compelling examples on how to do audio processing using it. WebGL City is one of the demos linked from the samples page. It’s a small demo of a helicopter flying around a night cityscape. The helicopter (disable music by pressing 'm’, enable helicopter sound by pressing 'n’) uses Web Audio APIs spatial audio features to pan the helicopter audio from one speaker to the other.
Some enterprising soul implemented a snake game using nothing but a WebGL fragment shader on the GLSLSandbox. I’m flabbergasted.
The Big Bang may look like any other WebGL particle animation, but the particle simulation is actually run on the GPU. The simulator is a fragment shader that reads the previous particle positions from a texture and writes the new particle positions into a FBO texture.
Blocky Earth takes Google Earth data and MineCrafts it. It communicates differences in height well. For example, I was looking at Australia and the Antarctic ice sheet, and you can see how the continental ice is several kilometers thick.
The Midem Music Machine is a fun music demo by Mr.doob and Paul Lamere. It’s a sort of a ball-driven music box with balls bouncing off bits 'n’ bops. CreativeJS has a good writeup on it, check it out.
Continuing on the computer music visualization theme, I recently ran across this page about bytebeat, a form of music generated by minimalistic code formula. The page links to one cool WebGL visualization of the music. Gregg Tavares took to the idea and built a bytebeat sandbox for making and sharing your own bytebeat tunes directly from the browser.

Author: ilmari

Friday, February 17, 2012

Why does Google create Dart?

I think Google want to use Dart engine (VM) to speed up web apps instead of the current Javascript engine (VM).
However the developers will decide to use Dart or not. It's depended on if Dart engine is supported by the other browsers and how to solve problems of Dart which is a new language without large community.

Thursday, February 16, 2012

Configuring Joomla! site use Xeround Cloud Database

  • You need to have a new DB instance created using Xeround’s service. Your Joomla! site will use this DB instance for managing its contents.
    1. To create your new cloud database you need to register for Xeround, then choose “Create New” from your Database Manager Online Console. (Detailed instructions on creating a new DB instance can be found here).
    2. Create a database schema for your Joomla! database in Xeround’s DB instance. This can be done by connecting to your cloud database using any MySQL client (for example, phpMyAdmin that’s available from your Xeround online console) and executing the following statement:
      CREATE DATABASE joomla_db;
  • Configure your Joomla! installation to use your cloud database:
    1. Download Joomla! and begin installing it on your cloud server (see Joomla!’s installation instructions here).
    2. Complete steps 1-3 of Joomla!’s installation.
    3. In step 4 of Joomla!’s installation, supply the connection details of your Xeround DB instance in the Basic Settings section:
      1. Host Name: the host name and port of your database instance, colon-separated. You can copy-paste it directly from your DB instance Details tab:
      2. Username: the username you chose for your database when you created your Xeround DB instance (step #1 of the the Prerequisites).
      3. Password: the password you chose for your database when you created your new instance (step #1 of the the Prerequisites).
      4. Database Name: the database you created in the DB instance (step #2 of the the Prerequisites).
      Your Joomla! Database Configuration page should look like this:
    4. Click the “Next” button and continue with Joomla!’s installer until it finishes.
    And You’re Done! Your new Joomla! site is powered by Xeround!

Wednesday, February 15, 2012

Field Guide to Web Applications

The demand for apps is strong, and it’s coming from everywhere! This comprehensive guide provides an introduction to many of the skills and best practices you need to build modern web apps. This field guide is designed to help you create great user experiences in your web apps. Whether you’re building your first web app, or are just looking for ways to improve existing experiences, there’s something here for you!
Read more:

Wednesday, February 8, 2012

MySQL Change root Password

How do I change MySQL root password under Linux, FreeBSD, OpenBSD and UNIX like operating system over ssh / telnet session?
Setting up mysql password is one of the essential tasks. By default root user is MySQL admin account. Please note that the Linux / UNIX login root account for your operating system and MySQL root are different. They are separate and nothing to do with each other (indeed some admin removes root account and setup admin as mysql super user).

mysqladmin command to change root password

If you have never set a root password for MySQL, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows:
$ mysqladmin -u root password NEWPASSWORD
However, if you want to change (or update) a root password, then you need to use following command
$ mysqladmin -u root -p'oldpassword' password newpass
For example, If old password is abc, and set new password to 123456, enter:
$ mysqladmin -u root -p'abc' password '123456'

Change MySQL password for other user

To change a normal user password you need to type (let us assume you would like to change password for vivek):
$ mysqladmin -u vivek -p oldpassword password newpass

Changing MySQL root user password using MySQL sql command

This is another method. MySQL stores username and passwords in user table inside MySQL database. You can directly update password using the following method to update or change password for user vivek:
1) Login to mysql server, type following command at shell prompt:
$ mysql -u root -p
2) Use mysql database (type command at mysql> prompt):
mysql> use mysql;
3) Change password for user vivek:
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='vivek';
4) Reload privileges:
mysql> flush privileges;
mysql> quit
This method you need to use while using PHP or Perl scripting.

Wednesday, February 1, 2012

Move mysql service of wamp

1. Copy all content of old mysql folder to new mysql folder.
2. In new mysql folder, open file my.ini and replace all old folder to new folder (except log-error variable)
3. To change executable path of wampmysqld service, run regedit in START >> RUN, then go to:

HKEY_LOCAL_MACHINE >> SYSTEM >> CurrentControlSet >> Services >> wampmysqld >> ImagePath
Change it to new folder.
4. Open wampmanager.ini and replace all old mysql folder to new folder.

Subscribe to RSS Feed Follow me on Twitter!