Blog Archives

Emailing a JavaScript Error

I wanted to get an email whenever my SailsJS (based on ExpressJS) app crashed. My logging stack consists of winston with a custom transport which emails me via AmazonSES. Instead of getting a nice stack trace, all I got was emails with {}

Posted in email, javascript, nodejs, servers, wherewolf Tagged with: , , , , , , ,

Amazon RDS – MySQL – Creating new user Error #1045

On Amazon RDS MySQL creating a new database user with all priviledges results in an error of #1045 – Access denied for user ‘mastername’@’%’ (using password: YES) Using: GRANT ALL PRIVILEGES ON *.* TO ‘testuser’@’localhost’ REQUIRE NONE WITH GRANT OPTION

Posted in Database, servers Tagged with: , , , , , ,

MySQL Latin1 to UTF8 conversion

Many people think it’s as simple as doing a mysqldump->sed->mysql command (or clicking Change->Collation in PhpMyAdmin) but that only changes the encoding for NEW data, while leaving the old data intact and possibly coming out dirty. Luckily there is a

Posted in bash, Database, linux, servers Tagged with: , , , , , , , , , ,

Javascript – Pretty Array to Human Readable String

To take a JS array like [“item1”, “item2”, “item3″….] into a nice human readable string of “item1, item2 & item3” with all the first items getting comma separated and the final one with an ampersand use: resultString = array.length >

Posted in javascript, servers Tagged with: , , , , ,