Mindblown: a blog about philosophy.
-
mod_deflate bug
Hmm, another day, another bug: #33499. This time it is mod_deflate and PHP don’t play well together. PHP makes a GIF/JPG file and yet mod_deflate still compress it. Solution: use mod_filter (which only available from 2.1), or disable Apache’s compression for PHP files and let PHP do the compression via ob_start(‘ob_gzhandler’);
-
Get network stats for RRD graphing
This snippet displays Active, Passive and Established connections reported by “netstat –statistics” for saving into RRD or other monitoring tools.
-
Apache versus lighttpd
Both run on the same server: Apache/2.0.59 (port 80) & lighttpd 1.4.19 (port 8080). 2 tests: dynamic & static files. To make things a little realistic, it’s from a EU client to a US server. Serving a dynamic file eu$ ab -n 1000 -c 10 “http://us.server/run-some-sql.php” Server Software: Apache Server Port: 80 Document Length: 824…
-
Counting TIME_WAIT with netstat
# netstat -tan | grep ‘:80 ‘ | awk ‘{print $6}’ | sort | uniq -c Sample Output: 15 CLOSING 26 ESTABLISHED 31 FIN_WAIT1 7 FIN_WAIT2 14 LAST_ACK 2 LISTEN 24 SYN_RECV 2428 TIME_WAIT
-
Qcache_not_cached should be small
If not, you’re wasting overhead on checking and invalidating the query cache, for a large/busy query cache, it gets more expensive. Thus, the lesson is to know which query should not be cached and explicitly use “SELECT SQL_NO_CACHE …” in your SQL statement. It means tables with many UPDATES/INSERTS should not use query caching.
-
What happens when you do "rm -rf /*"
Just for the fun of it. Here is what happens: [root@s10 ~]# cd / [root@s10 /]# dir bin dev initrd lost+found misc opt sbin srv tmp var boot etc lib media mnt proc selinux sys usr [root@s10 /]# rm -rf * rm: cannot remove directory `boot’: Device or resource busy rm: cannot remove directory `dev/shm’:…
-
Firefox Performance Tips
Check memory cache usage about:cache?device=memory Reference Disable disk cache config:about => browser.cache.memory and browser.cache.disk
-
SHOW COLUMNS FROM MyDatabase.MyTable
That operation will always require a disk read, which is rather expensive, especially for larger tables. For example, for a 500MB table in my test, it takes 0.23 seconds just for this query. I thought the table schema should not depend on its size. Guess there is something more technical than my basic understanding.
-
Related keywords & spelling suggestion API
Google Toolbar Auto Complete Replace your own “q=keywords”: http://google.com/complete/search?output=toolbar&q=Ad+Server Google SOAP Search API http://scholar.google.com/apis/reference.html#1_3 Yahoo Related Keywords API http://developer.yahoo.com/search/web/V1/relatedSuggestion.html Yahoo Spelling Suggestion API http://developer.yahoo.com/search/web/V1/spellingSuggestion.html
-
Check username availability via AJAX with jQuery
HTML Checking… JavaScript $(“#loading”).hide(); var orig=$(“#loading”).html(); $(“#UserNameInputID”).blur(function() { $(“#loading”).html(orig); $(“#loading”).show(); loadTextPage(“loading”,”check.php?username=”+$(“#UserNameInputID”).val()); }); /** load a text page into this div */ function loadTextPage($pDivID,$pURL) { $.ajax({ url:$pURL, dataType:’html’, success:function (txt) { $(‘#’+$pDivID).html(txt); } }); Server-side check.php
Got any book recommendations?