Goal: I want to find some text called mytext within all php files in a directory. I also want to display all the matches and highlight them.
If this is what you want try this:
The power of less
November 30th, 2009find php syntax errors
November 30th, 2009To find syntax errors in all php pages within a directory called /var/www/html, use the following command:
Sphinx search
November 15th, 2009Have a big website with millions of records? Is MySQL full-text search letting you down? Sphinx search http://sphinxsearch.com by Andrew Aksyonoff is probably gonna solve your problems. It is an awesome product (and yes it’s open source) with less than a second search results on a data set with millions of records.
I had the opportunity to author a sphinx based search engine for vBulletin. We use it for our huge forums at Internet Brands. A demo can be viewed here:
- Honda-tech.com (35+ million records)
- CorvetteForum
- FlyerTalk
use watch command to WATCH :)
November 15th, 2009From the man watch page: “The -d or --differences flag will highlight the differences between successive updates.”
Try
watch -d -n 3 “free -m”
The above command would highlight the differences in memory consumption every 3 seconds.
slicehost vs rackspacecloud
November 5th, 2009I tried a 256 MB slice (that’s what they call a cloud) with Slicehost, a rackspace company, and the guys are AWESOME! Shortly after that, rackspace came up with rackspacecloud.com (they had slicehost, why would they? who cares
), and I have been a big big fan of rackspace. So, I decided to give rackspacecloud.com a shot. Same memory, same disk space, same everything (well I haven’t really needed rackspacecloud.com support that often) and close to half the price.
256 MB on slicehost = $20 vs 256 MB on rackspacecloud.com = $11 approximately (for me atleast)
Doesn’t quite make sense to me
Migrating website content is quick and easy
September 29th, 2009Check out my post on migrating website content here: http://priteshjshah.com/?page_id=42
find everything except something using grep
September 28th, 2009the -v switch is used to return negative results. So, to find everything which does not contain “findme” use
cat filename | grep -v “findme”
mysqlslap to benchmark mysql queries
September 28th, 2009mysqlslap is worth a look
SAMPLE /tmp/queriestobenchmark.sql file