If you have large production MySQL database that you wish to backup or replicate for testing, it is important to handle the export gently :)
For me, I use mysqldump. Remember that you must include several optional flags, which will speed up the export and most importantly avoid stressing your production MySQL.
mysqldump -u[username] -p[password] [database_name] --no-autocommit --quick --opt > dump.sql
–no-autocommit: Insert “SET AUTOCOMMIT=0;” and “COMMIT;” into the SQL dump. Enable speedier import later on.
–quick It retrieve a row at a time from MySQL instead of the entire rowset. It is very useful for dumping large databases.
–opt: This is enabled by default and it is a shorthand for –add-drop-table, –add-locks, –create-options, –disable-keys, –extended-insert, –lock-tables, –quick, and –set-charset.
An interesting trivial task is to concatenate two tuples in python.
Let’s say we try this out:
a = ('dd')
b = ('aa','bb')
print a+b
Unfortunately likely we will get the following error:
Traceback (most recent call last):
File "test.py", line 20, in <module>
print a+b
TypeError: cannot concatenate 'str' and 'tuple' objects
Read the rest of this entry »
Was trying to fork a forked github repo for crunchbang welcome script, and realised it is not possible.
Apparently, this is a “feature” of github and there’s no plan to remove it.
What do you think? Leave a comment.
The long awaited Motorola Moto X without the blessing of El-Goo is here, finally.
The Made in America customizable phone ala Texas is slapped with a USD 200 with contract price tag, whilst the price without a contract is unknown for now.