How to remove all .orig files created by Mercurial
Answer:
In your working directory, execute the command below to remove all .orig files:
# rm **/*.orig
Short and sweet.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to remove all .orig files created by Mercurial
Answer:
In your working directory, execute the command below to remove all .orig files:
# rm **/*.orig
Short and sweet.
Convert Xen IMG based VM to Virtual Box
Answer:
In order to convert a VM image (file based) running in Xen and to use in the Virtual Box, you can use the following tricks.
# VBoxManage convertfromraw -format VDI filename.img filename.vdi
That is it.
Disable auto indent when pasting text into vim
Answer:
When you copy multiple lines text and paste it into the vim , sometimes you might find the text is aligned wrongly as the following:
Line1
Line 2
Line 3
Line 4
To solve this problem, enter the paste mode by
: set paste
Then do all the pasting works, and when finished, type
: set nopaste
List all the database size in MySQL
Answer:
The following command will list out all the databases size in MySQL
mysql> SELECT table_schema "Data Base Name", sum( data_length + index_length) / 1024 / 1024
"Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema
Output:
+--------------------+----------------------+
| Data Base Name | Data Base Size in MB |
+--------------------+----------------------+
| test | 152.59375000 |
| information_schema | 0.00781250 |
| mysql | 0.61196423 |
+--------------------+----------------------+
Force MySQL to use a specific index during query processing
Answer:
Sometimes, the index picked by MySQL might not be the most optimized one, and you want to pick the index to use by yourself.
To do so, you can provide the index hints by doing something like the following.
mysql> SELECT * FROM user FORCE INDEX user_name WHERE name = 'John' AND user_name = 'john2';
So you tell MySQL to use the index user_name, instead of name (if also available).
That's all.