Here’s a quick command you can use to find any folders that are over a GB in size on a Linux OS.
sudo du -h / | grep '[0-9\.]\+G'
Here’s a quick command you can use to find any folders that are over a GB in size on a Linux OS.
sudo du -h / | grep '[0-9\.]\+G'
I recently found myself with the need to connect to a Mongo DB instance from a PHP application running on Amazon EC2. The PHP docs led me to this MongoDB extension, which seemed to be a good fit for my needs. Still, the matter of installation was a little bit less clear, considering that the EC2 instance was pretty barebones and lacked a fair number of the “standard” libraries that would enable this single line installation to work.
After a bit of finagling, I got everything to work via the steps I’ve outlined below.
Whenever a MySQL query contains a WHERE conditional, the database server must find all the matching rows before it can execute any operations. In order to optimize this matching, a database administrator might define an index on any columns he or she knows will be used more frequently in WHERE conditions.
Adding an index to an existing table with many rows, however, can take a long time or even fail entirely. Here’s a quick tip to deal with those situations.
Here’s a list of MIME Types for Office 2007 files (those pesky files extensions that end with an x). Useful for file type checking in web applications and the like.
If you’re SSH’d into a MySQL server and want to export MySQL query results to CSV (readable by Excel), simply add the below snippet to the end of your query.
INTO OUTFILE '/tmp/results.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'
Note that ‘/tmp/results.csv’ in the code above should correspond to a writeable destination, and the file can’t already exist.