In vim to undo is ‘u’ and to redo (i.e. undo undo) is ‘Ctrl+R’…
Author Archives: Jay Jay
jQuery htmlspecialchars equivalent to encode text as HTML
Found this which said:
$('<div/>').text('This is fun & stuff').html();
CSS height 100% not working
My CSS height value wasn’t being applied. Found this. The problem was that I needed to specify heights for all of the ancestor elements. Bug fixed!
Debugging Courier on Debian
I found Debugging authentication problems…
I edited /etc/courier/authdaemonrc and added:
DEBUG_LOGIN=1
Then I created a mail.debug log file:
# touch /var/log/mail.debug # chown syslog:adm /var/log/mail.debug
Then I created a mail.conf file for rsyslog in /etc/rsyslog.d/mail.conf:
mail.debug /var/log/mail.debug
Then I restarted the rsyslog service:
# service rsyslog restart
Now I have debug logs for mail services!
…oh, no, wait… I only have LOGIN debugging enabled.
Found this, edited /etc/courier/imapd-ssl and added:
IMAPDEBUGFILE=courier.log
Then restarted courier imapd-ssl:
# sudo /etc/init.d/courier-imap-ssl restart
Now there is a courier.log file in: /var/pcmail/jj5@progclub.org
Piping PHP CLI output to less broken
Today I had an interesting problem.
When I ran:
# php test.php | less
The ‘less’ program entered input mode and the up and down arrow (and j, k keys) weren’t working.
Eventually I figured out a solution:
# php test.php < /dev/null | less
The PHP CLI seems to be interfering with the terminal and piping in /dev/null to PHP CLI stdin fixes the problem!
Roundcube download 1.0.2
Downloaded Roundcube 1.0.2 and installed it at ProgClub…
NTP on Ubuntu
Read about how to configure NTP server on Ubuntu.
Stock photo site
Found dollarphotoclub.com a stock photo site where you can buy images for $1…
Calculate a median with MySQL
Today I read this article and found this technique for calculating a median value:
SELECT x.val from data x, data y GROUP BY x.val HAVING SUM(SIGN(1-SIGN(y.val-x.val)))/COUNT(*) > .5 LIMIT 1
Startup Metrics for Pirates: AARRR!
Got referred to Startup Metrics for Pirates: AARRR! — good fun.