Friday, April 16, 2010

"minicom.runscript": syntax error in line 00 (word contains ESC or quote)

minicom's runscript has a line length character limit of 88

Any send command longer that this:
send "1234567890123456789012468901245678901234567890123456789012345678901234567890123456789012"

results in this error:
"YOUR_SCRIPT.runscript": syntax error in line XX (word contains ESC or quote)

The solution is to use "\c" as the 87th and 88th character and continue on the next line:
send "12345678901234567890124689012456789012345678901234567890123456789012345678901234567890\c"
send "Unfortunately, this is the absolute maximum line length that minicom runscript handles\c"
send "the end"

Wednesday, April 14, 2010

Random MAC Address

ifconfig eth0:0 hw ether `(date; cat /proc/interrupts) | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'`

Stolen from CommandLineFu

Monday, April 12, 2010

setTimeout() fires function twice? Firefox Bug?

After 7+ hours of listening to Crockford on JavaScript and some other lectures, I've decided to write my own JS Framework for a current project. As I'm working through various bits I discovered what appears to be a bug in Firefox 3.6.

This fires twice, unexpectedly:
function all(){
            var promise = make_promise();
            // Simulate async call from some source
            setTimeout(function(){
              promise.fulfill(fixture);
            }, 3000);
            return promise;
          }

This fires just once, as expected:
function all(){
            var promise = make_promise();
            // Simulate async call from some source
            function fulfill(){
              promise.fulfill(fixture);
            }
            setTimeout(fulfill, 3000);
            return promise;
          }