Archive for March, 2010
MySQL – Get the Top N of a Group
Friday, March 26, 2010 11:43 No CommentsGetting Top N of a group would be very easy if there just wasn’t that ‘LIMIT & IN/ALL/ANY/SOME subquery’ restriction. But there’s always some way around. Thx to Jon Armstrong from A little Noise for the code hint. MYSQL table ‘measurements’ | Id | Freq | Level | DateM ## Gets the last 2 measurements [...]
Linux- Recursively change permissions on files or directories only
Thursday, March 25, 2010 22:33 No CommentsIf you wondered how to change permissions recursively on files or folders only, here is the how to using the find command. Change permissions recursively to directories only: find /path/to/folder -type d -exec chmod 0755 {} \; Change permissions recursively to files only: find /path/to/folder -type f -exec chmod [...]
Apache .htaccess – Allow / Deny access from certain IPs
Tuesday, March 2, 2010 0:02 No CommentsIf your website is under contruction and you want to allow access just to certain IP numbers, placing the following code in the .htaccess file, in the website root directory, you can block access to everyone except the IP numbers you specify. order deny,allow deny from all allow from 76.33.193.98 allow from 84.23.122.204 allow from 93.34.133.203 [...]