General

MySQL Different command for Backup and Restore Databases

Backup Database Making backup all databases: mysqldump -u usuario -p –all-databases > dump.sql Making backup only one database: mysqldump -u usuario -p –databases db1 > dump.sql Making backup many databases: mysqldump -u usuario -p –databases db1 db2 db… > dump.sql Making backup using gzip compresson mysqldump -u usuario -p –all-databases | gzip > dump.sql.gz Making […]

PostgreSQL create a user account and grant permission for database

Here I mentioning the steps require to Create a Postgres User and give them access to particular Database Firstly run command  “sudo su” to make a user as a super user create a new User in unix or you can use the existing one as well, You can create a new user by command # […]

Ubuntu Boot hangs on “checking battery state”

Today Morning,  I was trying to upgrade Ubuntu 13.04 to 13.10 and suddenly power get fails and my system shutdown. and after that  my when I try to own the system . it  hangs at “Checking battery state” while booting. So after that following steps was done to solve the problem press ALT + F5 […]

How scrum team Rolls

In Many Places People ask me what are the work and Processes Followed in your company. and while describing them about Agile Methodologies we follow, they Always come with a series of Questions? What is Scrum? What is Sprint?… and all So here are is a short description on it How Scrum Team Works. In […]

Count the Users total commits from git

Here is the command to list all the users with their git commits $ git shortlog -s -n and output will be in following fromat commit_count   user_name

encoding::UndefinedConversionError: U+00C2 from UTF-8 to US-ASCII in Unbuntu Linux

This is an error due to the some locale language package inavailable in your linux system You can check the list of locale in your system by following command sudo locale -a Then You can re-generate the locale for your system using commande sudo locale-genand this will solve your Encoding issue 🙂

Get Sum of field from associated table in Rails/Mysql

Sometime you have relationship like  campaign has_many causes and need to calculate sum of raise_amount raised from each campaign from the associated table In mysql this can be done by a simple query select campaigns.name,SUM(raises.raise_amount) as total_sum FROM campaigns LEFT OUTER JOIN raises ON campaigns.id=raises.campaign_id GROUP BY campaigns.id; In Rails it can be achieved by this […]

How to get size of mysql database in MB ?

Run this query and you’ll get the size of databases in MB   SELECT table_schema “DB Name”, Round(Sum(data_length + index_length) / 1024 / 1024, 1) “DB Size in MB” FROM information_schema.tables GROUP BY table_schema;

Error While starting Postgres in ubuntu

Getting following error while trying  to start postgres * The PostgreSQL server failed to start. Please check the log output: 2013-05-29 14:29:02 IST FATAL: could not create shared memory segment: Invalid argument 2013-05-29 14:29:02 IST DETAIL: Failed system call was shmget(key=5432001, size=39321600, 03600). 2013-05-29 14:29:02 IST HINT: This error usually means that PostgreSQL’s request for […]

Install Rails Passenger Module on Apache2.4

I tried to install passenger-install-apache2-module and getting error : Apache2 headers not found. its seems that Passenger is not getting a Path of an Apache2.4 to solve this., we need to export these ENV into bash export HTTPD=”/usr/local/apache2/bin/httpd” export BINDIR=”/usr/local/apache2″ export APXS2=”/usr/local/apache2/bin/apxs” export APR_CONFIG=”/usr/local/apr/bin/apr-1-config” export APU_CONFIG=”/usr/local/apr/bin/apu-1-config” or we can Direct pass the path as passenger-install-apache2-module […]