Several months ago, I was given credentials to download a piece of software, and I needed to download another copy only to find that I had forgotten the password. I anticipated it would take quite a while to email the people in charge, and on a whim I decided to take action. Right click, view source.

To my surprise, all the authentication was done in JavaScript, though in all fairness it was “encrypted.” I’ve changed the underlying keyphrase in a code example, and I pose a small puzzle – find the password.

You may find jconsole helpful.

var pass=new Array()
var t3=""
var lim=8
pass[0]="fE13Cw9emtKIg1F"
pass[1]="wKTuZEy387Im8b2"
pass[2]="3NKevEgjpWWwmSE"
pass[3]="CryO6BmP9XpUlke"
pass[4]="8R4Gf2sgs5Xs5KI3"
pass[5]="62GZJ9Dzc2y8lBTU"

var extension=".html"
var enablelocking=0
var numletter="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
var temp3=''
var cur=0

function max(which){
return (pass[Math.ceil(which)+(3&15)].substring(0,1))
}

function testit(input){
temp=numletter.indexOf(input)
var temp2=temp^parseInt(pass[phase1-1+(1|3)].substring(0,2))
temp2=numletter.substring(temp2,temp2+1)
return (temp2)
}

function submitentry(){
t3=''
verification=document.password1.password2.value
phase1=Math.ceil(Math.random())-6+(2<<2)
var indicate=true
for (i=(1&2);i<window.max(Math.LOG10E);i++)
t3+=testit(verification.charAt(i))
for (i=(1&2);i<lim;i++){
if (t3.charAt(i)!=pass[phase1+Math.round(Math.sin(Math.PI/2)-1)].charAt(i))
indicate=false
}
if (verification.length!=window.max(Math.LOG10E))
indicate=false
if (indicate)
alert("Correct password.")
else
alert("Invalid password. Please try again")
}

You can also get it in a testable html page.

Tagged with:
 

Growlnotify

If you’re a Growl user, you probably appreciate (or are annoyed by) being able to get updates from various applications in a relatively out-of-the-way fashion.

There is a command line utility included with Growl called growlnotify. It allows you to send up your own alerts from your own code (say using exec(3) or in your shell scripts), but it’s nice to use for other things, too. If I have a command that’s conceivably going to take a while, I tack on a && and growlnotify. Just like some people use

make && ./myapp

when they run their code to ensure it’s running the latest saved version, it’s a nice way to get a heads-up instead of waiting a few minutes for that god-awful command to run. For example, recently I was using curl(1) to get a bunch of files off of a server (when I fall behind on a webcomic, it’s just easier to download a bunch of them and browse them quickly in Preview instead of clicking through each), and it ended up taking a good 10 minutes:

curl http://boasas.com/boasas/[1-940].gif -o "#1.gif" && growlnotify --message "I'm done downloading" --title "curl"

I get back to reading my dailies, and by the time I’ve forgotten that I set it going, up pops a nice little notification:

Growlnotify

I will note that it can be a little finnicky. It generally has better success when no title is supplied, and if you’re going to be running it with &&, I might suggest making it a

mycommand && echo $? && growlnotify --message "my message" --title "mycommand"

Since it gets its message argument from standard in, you can also pipe to it if your command returns a value of which you’d like to be notified:

make ; if [ $? -eq 0 ]; then echo "Success"; else echo "Failure"; fi | growlnotify --title "make"

Growlnotify Make

Tagged with:
 

XBMC

My XBox is now my gateway to my media. $4.73 for Splinter Cell (how this particular hack gets the Linux installer running), and $21.81 for an Action Replay kit to transfer the files. Now, all the media on the LAN are at the fingertips of my XBox. Music, Pictures, Movies and TV Shows – the whole gambit.

I used this Lifehacker article as a guideline. All in all, it took about an hour.

Watching Scrubs TV Shows Music
Weather / RSS Watching A Movie
Tagged with: