Posted by robbiebow on 17 August, 2008 under geek |
I’ve cribbed this sample iptables config from the one at IPTablesRocks – basically restricting the incoming ports down to SSH (port 22) and HTTP (port 80). Be sure to follow their precautions before trying to change your iptables – get it wrong and it could cost you a fair price to get your web hosts to flush your iptables.
Posted by robbiebow on 7 August, 2008 under geek |
Problem: trying to add a new option to a select drop-down menu doesn’t display the text in IE7.
Solution:
var thisValue = 12;
var thisText = 'December';
var thisOpt = document.createElement('option');
thisOpt.value = thisValue;
thisOpt.appendChild(document.createTextNode(thisText));
$(".months_menu").append(thisOpt);
Posted by robbiebow on under geek |
Scenario: you want to select all records that have a non-unique value in a column. Use a subquery:
SELECT ... FROM ...
WHERE ... IN (
SELECT ... FROM ...
GROUP BY ... HAVING COUNT(*) > 1
);
So, to give an example, you want to select all rows from the table "books" that have a non-unique title:
SELECT * FROM books
WHERE title IN (
SELECT title FROM books
GROUP BY title HAVING COUNT(*) > 1
);