Ever needed to export data from MySQL into a CSV file? Its actually fairly simple,
SELECT * INTO OUTFILE ‘/tmp/name.csv’
FIELDS TERMINATED BY ‘,’
OPTIONALLY ENCLOSED BY ‘”‘
ESCAPED BY ‘\\’
LINES TERMINATED BY ‘\n’
FROM [tablename]Certainly easier then writing a quick Python/Perl/PHP script to do the job.
MySQL Export to CSV File
LifeHacker: Adjust Your Car Mirrors Properly To Avoid Accidents
Adjust Your Car Mirrors Properly To Avoid Accidents via LifeHacker
Many accidents could be avoided if everyone had their car side and rearview mirrors positioned correctly, eliminating blind spots and making it easier to change lanes quickly.
Are You Reading Too Much?
Productivity501 via Are You Reading Too Much?.
Reading, after a certain age, diverts the mind too much from its creative pursuits. Any man who reads too much and uses his own brain too little falls into lazy habits of thinking.
~ Albert Einstein
The theming firehose (NB for designers & front-end developers new to Drupal) | rare pattern
You theme with the mark-up you have, not the mark-up you'd like to have.
That's the essential truth that designers and front-end developers new to Drupal need to understand. You don't get to construct your pages from scratch, building out essentials, never a wasted div, never an extraneous class. No, you have to flip the entire process around. With Drupal you're getting markup shot at you from a firehose, and as a themer you need to sop it all up and make it pretty. Don't spill a drop.
via The theming firehose (NB for designers & front-end developers new to Drupal) | rare pattern.
InnoDB is red hot, MyISAM not
Planet MySQL
via InnoDB is red hot, MyISAM not.
Everyone who started using MySQL before 5.5 started off with MyIsam. It was the default storage engine and you had to go out of your way to use anything else. It was a good looking database, rugged…
MySQL Query to get Data, Index and Table Size by Storage Engines
SELECT IFNULL(B.engine,’Total’) “Storage Engine”, CONCAT(LPAD(REPLACE(FORMAT(B.DSize/POWER(1024,pw),3),’,',”),17,’ ‘),’ ‘,SUBSTR(‘ KMGTP’,pw+1,1),’B') “Data Size”, CONCAT(LPAD(REPLACE(FORMAT(B.ISize/POWER(1024,pw),3),’,',”),17,’ ‘),’ ‘,SUBSTR(‘ KMGTP’,pw+1,1),’B') “Index Size”, CONCAT(LPAD(REPLACE(FORMAT(B.TSize/POWER(1024,pw),3),’,',”),17,’ ‘),’ ‘,SUBSTR(‘ KMGTP’,pw+1,1),’B') “Table Size” FROM (SELECT engine,SUM(data_length) DSize,SUM(index_length) ISize,SUM(data_length+index_length) TSize FROM information_schema.tables WHERE table_schema NOT IN (‘mysql’,'information_schema’) AND engine IS NOT NULL GROUP BY engine WITH ROLLUP) B,(SELECT 3 pw) A ORDER BY TSize;
Sample Report:
MyISAM 0.031 GB 0.013 GB 0.044 GB InnoDB 0.599 GB 0.471 GB 1.069 GB Total 0.630 GB 0.484 GB 1.113 GB
Compile PHP Extensions on Mac Snow Leopard OS X
If you have to custom compile PHP Extensions on Mac with Snow Leopard OS X while using MAMP , you will need to execute following commands. These are necessary to compile modules with both 32bit and 64bit support.
/Applications/MAMP/bin/php5.3/bin/phpize MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch i386 -arch x86_64 -bind_at_load" export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET
Install Emacs on Ubuntu Lucid 10.04
How to downgrade PHP to 5.2 on Ubuntu?
Here is a quick script to do this task:
Courtsey of Stijn Beauprez from here: http://thejibe.com/blog/10/5/php-5210-debs-ubuntu-104-lucid#comment-9
#! /bin/sh
php_packages=`dpkg -l | grep php | awk ‘{print $2}’`sudo apt-get remove $php_packages
sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list
sudo mkdir -p /etc/apt/preferences.d/
for package in $php_packages;
do echo “Package: $package
Pin: release a=karmic
Pin-Priority: 991
” | sudo tee -a /etc/apt/preferences.d/php
donesudo apt-get update
sudo apt-get install $php_packages
To undo the script and upgrade to php 5.3 you will need to delete the file (sudo rm /etc/apt/preferences.d/php), run sudo apt-get update, and then sudo apt-get dist-upgrade which will get the latest packages for your distribution, including the PHP packages. (Ben Holt)
Set GMail as default client on Windows
Affixa software by Notably Good Ltd. (http://www.affixa.com/) lets you easily setup GMail or Yahoo as your mail client. Using this, you can easily send attachments from any of the windows application include Office and Windows Explorer.