DISCLOSURE: Let me first say that i don't condone messing with systems inappropriately and against the wishes of facebook.

Have you ever wanted to blow up a fiends phone with notifications? Well now you can!
This little script lets you click every single *like* button on what ever FB page you're on and unless things have changed with FB they should get a notification for each like button you click!
I actually did this a few years ago and it was a bit different implementation so it appears that FB changes their site code quite often.

// Likebom.js
// Created by Chris Rice 2016
/* jshint esversion: 6 */

// To activate it just call clicker()
// Top stop it jsut call stopClicker() or you know... close the window..

// Timer that can be used to stop the bomb
var timer;
var clickRate = 500; // Be careful with click rate. You can get banned for too fast of a rate.

// Gets all the clicks and activates them
// then scrolls farther down the page to find more buttons to click
var clicker = () => {
  var buttons = Array.from(document.querySelectorAll("a[data-testid='fb-ufi-likelink'][aria-pressed='false']"));
  clickButtons(buttons, clicker);
  scrollTo(0, 500000);

var stopClicker = () => {

// Steps recursivly through all the buttons and clicks them.
// Calls a callback when clicking is completed.
// Be careful of the 400
var clickButtons = (buttons, completedCallback) => {
  timer = setTimeout(() => {
    var button = buttons.pop();
    if (button !== undefined) {;
      clickButtons(buttons, completedCallback);
    } else {
  }, clickRate, buttons);

To start it up just open up the debugger in chrome and paste the script in. Then call the function clicker().

Thats it! Bombs away!

Getting your app translated is a fickle beast that almost every developer out there eventually comes to hate. So much so that most developers either put it in as an afterthought or forgo it all together. It places unique restrictions at all levels of development and can make maintaining a site a nightmare. Even when its done correctly culture norms or tendencies can make it all pointless. For instance it may be natural for American users to flow from A -> B -> C but that doesn't mean that someone in Indonesia who naturally likes to go from B -> A -> C is going to like it, or understand it, or want to use your site. (And we want everyone to love our site, don't we?)

Because of this a lot of the time developers usually fall down three avenues for completing localization.

  1. Build entirely different sites for each locale with their own unique structure but the same overall feel and goal
  2. Separate content entirely on their own by locale
  3. Provide in place translations for content, i.e. word for word replacement.

#1 is usually how the big boys do it. Its the only way to completely adapt a site to suit the needs of the targeted culture. Its also un-godly expensive and completely ridiculous to maintain. But hey, if you got the money.
#2 is what most people are forced to do if you have a CMS and / or post content regularly. Its a pain to reformat each post / page for each locale your targeting but it'll net you enough flexibility.
#3 is what everyone else has to deal with. You usually have to get pretty low level but it is easier to work with than #1. It's still harder to maintain than #2 though.

For the most part everyone deals with #2 and #3.

But with the power of Ember (and other JS apps) we have a unique opportunity in that we can achieve #3 without as much maintenance overhead and we also have the flexibility to very easily achieve #2 by varying our API responses! With a properly adapted API, Ember localization becomes just a tedious nuisance instead of an architectural nightmare.

Localization Example

This is a presentation that i've given about globalization and localization at Ember San Diego.

It has in detail how to go about exactly localizing your application.

Direct link:

Sometimes its just amazing the things that i encounter on a daily basis when rewriting incompetent code

Example 1

(CONVERT(BIT, CASE WHEN ISNULL(gm.enddate, '2999-12-31') >= GETUTCDATE() THEN 0 ELSE 1 END) <> 1 
AND CONVERT(BIT, CASE WHEN ISNULL(gm.startdate, '1975-01-01') <= GETUTCDATE() THEN 0 ELSE 1 END) <> 1)

Example 2

string iMasterUserLogin = data.GetUserParentUserLoginID(username).FirstOrDefault() ?? "";
if (iMasterUserLogin != null) return iMasterUserLogin;
return null;

Example 3

Convert.ToByte('0' + (int)sc.Data)

Ember is a great framework with a lot of potential and a very sound philosophy behind it but it has one major flaw, the learning curve.

I have noticed that even though I've optimized my server to the point where its pulling around 60w it is still wasting energy by running all the damn time when its not being used. I estimate that there is only about 5 hours of actual usage a day on it, that means I'm losing big when it comes to my energy bill. The problem with that 5 hours of usage is that it comes at random times when either someone else or I decides to access one of the many services that it serves up. I could be watching a TV show i recorded from my couch or my roommate could be streaming an episode to their phone on the other side of the country. So how do I manage to get the server to stay asleep and wake up at a moments notice based on a request that could come from 1 room away or across the country?

WOL of course! It might not be used how it was intended but it works like a charm. Here is what you need:

  • A router or something on the network running linux. My DD-WRT Asus RT-N16 fits this bill perfectly. 
  • A WOL capable computer and a server that knows when to go to sleep. I'm using an Ubuntu 12.04 box.
  • A basic idea of what iptables is and does.  Here is a good overview:

Alright with that out of the way here is how to go about doing this. 

Follow this guide to move the server to its own dedicated VLAN: Located here.

  • NOTE: You have to restart the router by doing exactly what it says or the second DCHP subnet will not come online and the server will still be served from the same subnet pool as before.
  • We do this step because normally all internal network traffic that is on the same subnet is handled by the routers internal switch and does not hit the actual router itself. So when we do this we force the traffic all the way up to the level where we can observe it passing through the router rather simply. From what I've read the performance hit is negligible and for sensitive machines like a server it allows for greater security because we can isolate it from the rest of the network and only allow to get to it what we want. 

Add the iptables rules to allow for communication between the VLANs by adding it to the firewall commands on the DD-WRT web GUI under Administration > Commands > Save Firewall. Of course i would advise trying these commands out by hand before committing them.

iptables -I FORWARD -i vlan+ -o vlan2 -j ACCEPT
  • What I am doing here is allowing communication out to the WAN from all the VLANs including the new one that was just made. In my case the WAN is on vlan2 and my new vlan is vlan3. 
  • At this step you can set up all the iptables rules regarding communication between the VLANs you want. 
  • Your server should now be at this point be operating normally and should be able to communicate as it needs to. 

Now that you have a working network connection for the server again you can proceed on to the WOL feature. Modify these iptables commands to your liking and add them to the Save Firewall noted above to set up log rules so that when the router sees and incoming valid request it gets logged so the WOL script can act on it. 

iptables -I FORWARD -o vlan3 -p tcp --syn --dport 22 -m limit --limit 1/min -j LOG --log-level 7 --log-prefix 'local '
iptables -I FORWARD -o vlan3 -p tcp --syn --dport 443 -m limit --limit 1/min -j LOG --log-level 7 --log-prefix 'local '
iptables -I FORWARD -o vlan3 -p tcp --syn --dport 139 -m limit --limit 1/min -j LOG --log-level 7 --log-prefix 'local '
iptables -I FORWARD -o vlan3 -p tcp --syn --dport 548 -m limit --limit 1/min -j LOG --log-level 7 --log-prefix 'local '
iptables -I FORWARD -o vlan3 -p tcp --syn --dport 3240 -m limit --limit 1/min -j LOG --log-level 7 --log-prefix 'local '
iptables -I FORWARD -o vlan3 -p tcp --syn --dport 45631 -m limit --limit 1/min -j LOG --log-level 7 --log-prefix 'local '

Let me break down these commands.

  • First we are attaching these commands to the FORWARD table because that handles internal network communication. Also since we only care about traffic going to our server we specify that the outbound path of the packet has to be to the server on VLAN3. 
  • -p tcp --syn signifies that I only should log the SYNC tcp type packets that get sent during initial connection. 
  • --dport 22  says what port the packet must be going to.
  • -m limit --limit 1/min -j LOG --log-level 7 --log-prefix 'local '  is the juicy bit. It means that it will only log 1 of these type of packets every minute. This helps keep the log clean immensely and helps to keep the WOL script from running erroneous WOL requests.  The 'local '  bit is used to provide a better way of parsing the log. 

After running these commands ​/var/log/messages​ now has entries like these when you make a connection with the server from inside the local network or outside. 

local IN=br0 OUT=vlan3 SRC= DST= LEN=64 TOS=0x00 PREC=0x00 TTL=63 ID=27548 DF PROTO=TCP SPT=54171 DPT=443 WINDOW=65535 RES=0x00 SYN URGP=0

For me /var/log/messages also had a butt load of other iptables log messages that i didn't need and subsequently caused issues with the WOL script. There are two solutions to this. Either append the commands above to log the requests into a different log file or disable all the existing extra logging. I choose the second route because I didn't want to handle setting up a new log file that rotates so my flash dive doesn't get filled up. 

  • Disable firewall logging from the GUI under ​Security > Firewall > Log 
  • Manually edit /opt/etc/init.d/S94fixtables and comment out any instance of -j LOG​ present. ( This one was tricky and i have no idea why the logging is forced on in this.  It appears this is only present when you install optware.  After commenting these out I didn't shouldn't see anymore random  [DROP BRUTEFORCE] , [DROP INVALID WAN] entries. Be warned though, if ipkg updates this file then the log entries come back again. )

Now for me after these two steps the log was clean enough to use for the script. I put the script under /opt/etc/wol but it really doesn't matter where it goes as long as its executable. Just plop this script somewhere and have it start automatically when the router boots. I've seen people have issues with the startup commands not running under Administration > Commands​ . So its possible to use their solution ( Forum link here ) or just create a service to start it. 

#Enable JFFS2 and place script in /jffs/ then run on startup in web interface.
#You can check the log from


echo "<meta http-equiv=\"refresh\" content=\"10\">" > $LOGFILE
echo "["`date`"] AUTO WOL Script started. <br>" >> $LOGFILE

while sleep $INTERVAL;do
NEW=`dmesg | awk -F'[=| ]' '/local/ {print $19}' | tail -1`
SRC=`dmesg | awk -F'[=| ]' '/local/ {print $7}' | tail -1`
if [ "$NEW" != "" -a "$NEW" != "$OLD" ]; then 

 if ping -qc $NUMP $TARGET >/dev/null; then                                                  
     echo "["`date`"] NOWAKE $TARGET was accessed by $SRC and is already alive. <br>">> $LOGFILE     
      echo "["`date`"] WAKE $SRC causes wake on lan. <br>">> $LOGFILE                          
      `$WOL -i $BROADCAST -p $WOLPORT $MAC >> $LOGFILE`                                            
      echo "<br>" >> $LOGFILE                                                                   
      sleep 5                                                                                   

This is a modification of the webserver wakeup script from the dd-wrt wiki and it is pretty much the same that they have there. I just changed the commands around for better logging and stripped out any extra code. It basically checks the dmesg log to see if a new entry has come in and if there has and the server is not pingable then it sends the WOL command. I have it checking the log every 5 seconds because most of the services I use have a long timeout period but it can be adjusted to happen more often. I also had a problem with pinging my server and it turned out to be a UFW rule that is enabled by default, here is how to allow ICMP pings. 

That's it, the router will now be sending WOL magic packets when ever a valid service tries to contact the server. I haven't gotten to the point where the server puts itself to sleep so I can't really describe that in detail just yet. My next step is to move the services that require the server to be constantly running over to the router and to use a pound​ to proxy the HTTP services so that only authenticated requests cause the server to wake up and start slinging content. 

Alright so its been a couple weeks since I got the HTPC in working order and since then I've been playing with trying to get the thing as optimal as possible as well as preparing for the final component, the LED controller. Here's a quick summary of my findings.

  • The AMD A6 3650 is quite a nifty processor but it puts out quite a bit of heat with sucks. Fortunately, based on this post it can be under-volted to 1.2V while maintaining its full clock rate! It reduced the idle temp by 9C and the load temp by 12C!
  • I was also able to overclock the crap out of the GPU side of the A6 to well over 40% of stock frequencies. I could have kept going higher but considering my temperature concerns I decided to refrain.
  • The extra fans aren't needed at all. With the CPU fan drawing in air directly from the outside the case gets plenty of circulation all by itself. Makes the system MUCH quieter. I decided to keep one fan on the hard drive because its a cheap and very, very quiet fan.  

Now here's a big one that i forgot to mention before i think. The power connector between the Xbox PSU and the Pico PSU needs ​MORE THAN 1 GROUND​. I was having stability issues with the system until i added a jumper between the grounds on the power connector. You can see what i'm talking about below in the green wire. 

Here is a photo from below to get an idea of what those pins above mean: ​I HAVE FLIPPED THE IMAGE HORIZONTALLY SO IT IS EASIER TO READ. 


Now onto the LED controller!

First here is some quick links to what i used to get it working.

Please note: I have yet to program my chip so i have not tested out the LED controller to see if it works. But i'm pretty sure it will! 

Tutorial to get the RF-Board working :

Here is the how-to for getting the LED's working:

The pinout for the RF-Board connector can be found in the pdf here:

Wiring diagram for the PIC16F628A that loosely used:

Be careful with this wiring diagram above and make sure you understand what is getting connected to what and not just blindly soldering things together because the connectors pictured are not intuitive ( to me at least ) and the pin numbers on the J1 RC-CON do not match up to the actual connector.

The pins should be numbers like this instead to match the pinout in the documentation:

 1 2 3 4
5 6 7 8 9

The only changes i made to this diagram is that instead of relying on the power button on the board to start the controller sync process I pulled the sync button from the dead xbox and stuck it on there. Since the power button puts the signal to ground when its pressed all that needs to be done is to take pin 9 from the micro controller and feed it to the button and connect the other side of the button to the nearest ground. In my case this was the USB ground. 

Now for the photos, please forgive me for using the same color wire I ran out of all the other colors! As always you can click on a photo to enlarge it!

Here is a photo of all the components on the board in place!


Here is a photo of the underside connections, please note that the front of the connector is on the bottom right. The purple wire is the power button switch positive line, black is ground, white is the USB data positive & negative, and the yellow is the +3.3Volt from the USB connector that is out of frame on the left. 


Here's one of it inside the case! What is neat about sealing power from the USB 5V is that the it is completely disconnected from the rest of the board and can be unplugged and powered off at will without messing with the power button! So all that is needed is a serial header, USB header, and the connector for the motherboard PWR button. 


Now what's really cool is that really the PIC chip isn't needed because controllers can be sync'd using this method. I may end up taking this route because the programmers for these little buggers are quite expensive for something i only need to use once. 

​Now to finish things up!

Throw some hot glue on this bitch


Put some electrical tape under just to be sure nothing happens.


Stuff everything in there and close it up:


That's it, all done.... FOR NOW..  If i do happen to get the chip in and get it working i'll post up here. If you have any questions please comment!


Here are the links to the other parts of this build, check them out!

Part 1:

Part 2:

So in my quest to stuff a computer inside an Xbox I decided to take the hard road and reuse as much as i can from the original Xbox. My original plan was to reuse the power supply, RF board, hard drive bay, and front USB ports. But due to heat concerns and f-ups on my part I doubt i will be using the hard drive bay or the usb ports.

So that just leaves the power supply and the RF board. I have some leads on the RF board from this thread: Attach RF Board to PC but it looks like this will be a whole ordeal unto itself. Now as for the power supply, after a full weekend of frantically cutting, soldering, and breathing led laden fumes i have the computer together and working with the Xbox 360 power supply! 

Step 1: Gather the parts

I decided to use use a standard blank circuit board as the base to put everything on so that i can solder the connectors together without having to deal with mounting. I also decide to grab some molex connectors make it so that the entire thing can be disassembled and reassembled quite easily.  

For my build i am using the folowing parts. These can be modified slightly to suite the power requirements of the mobo you are using. 

  • 1100ohm resistor
  • 1N914 or 1N4148 Logic Diode ( can't remember which one i used )
  • 2N3906 PNP transistor
  • 2.2uf 50V max capacitor

Step 2: Unsolder the connectors from the Xbox motherboard. 

I tried using an oven at 375F originaly but it didn't work out so well because the plastic started to get soft on me. So i went out and bought a butane powered solder iron and got each one out by hand. 

Step 3: Test fit! 

I really am starting to like the Mini-ITX AMD A-Series combo. Its very, very tiny and should be fast as hell.

Step 4: Let the wiring of the power supply begin!

Now before i begin i should say that i'm using this document to determine the pin-outs of the Xbox power supply:
HOWEVER: This explanation for the diagram is not correct! It says that you need to ground pin 7 in order to turn the power supply on. What you actually have to do is feed the 5v from pin 8 to pin 7 and keep it there. 

Now this step is quite difficult because of the stupid way Microsoft decided to handle the standby mode on the power brick. For those of you that don't know the Power Brick will turn off all its 12v output when it deeps itself not in use. Luckily it will still output 5v even in this mode. This is indicated on the power supply be the orange light. Unluckily though the only way to turn the power supply on and keep it on is to feed the 5v into its neighboring pin. Why this sucks is because with standard ATX Power Supplies ( and by standard i mean EVERYONE ELSE ) the motherboard flips the power supply from standby mode to active mode by grounding the PS_ON pin.  

So what we have to do is somehow create a circuit that feeds 5v into the correct pin on the Xbox power supply when the PS_ON line drops to ground. The tricky part here is that the PICO PSU takes a single 12v line and does not have the ability to feed it the 5v standby power. Also when you splice the 5v from the Xbox power supply to the ATX cable the Xbox PSU faults out and shuts off. Well thanks to a little help from SD Electronics here in San Diego i have a working circuit that powers up both the Pico PSU and the Xbox PSU when the power button is pressed on the motherboard. 

EDIT: Here is a better diagram, still don't have a scanner though!

Here is a circuit simulator showing how it behaves.  Note: You need JAVA to run the applet!

Now this is pretty strait forward except for 1 thing. The capacitor connected to ground above the diode is used to store the minute charge that gets by the diode so that when the motherboard drops the PS_ON pin to ground the Xbox PSU has time to come online before the PICO PSU flips itself on and then realizes it doesn't have enough power and aborts the startup by failing to send the  PWR_OK signal to the motherboard.  The size of the capacitor does not matter, the larger it is the longer it will take for the voltage to drop to zero after the circuit has been grounded and hence the longer it will take for the Pico PSU to start. 
So to set this up do the following things:

  • Connect pin 8 on the Xbox PSU to pin 9 ( +5Vsb purple )  on the ATX Power Cable at the motherboard side. Do not splice but instead cut the wire so that only the motherboard ATX is connected to pin the Xbox PSU pin 8. 
  • Connect pin 8 to the emitter ( pin 3 ) of the PNP transistor. 
  • Connect pin 7 to the collector ( pin 1 ) of the PNP transistor. 
  • Build the circuit described above. 
  • Cut the wire for pin 14 ( PS_ON, green ) between the mobo and the psu.
  • Attach the Pico PSU side of the PS_ON wire to between the diode and the capacitor shown above.
  • Attach the mobo side of the PS_ON wire to the far side of both diodes shown above. 

That's it! You can see my test of the circuit here below! Please Note that the capacitor is not connected correctly in this photo. 

It seems i forgot to take photos of the completed soldered in circuit but i will as soon as i get a chance! 

Step 5: Power it up!

As noted before the power button now activates the motherboard and power supply at the same time! As for the RF panel and xbox power button i'll get to that in a latter part of this build.

Here it is all together!

Now i've been told before that the Xbox case is a bad design but god damn this thing sucks. Even with a big hole in the top and two other fans i'm still having problems keeping the system below 50C!
More to come when I get the RF board working!

EDIT: Updated the live circuit diagram, list of materials, circuit wiring instructions, circuit diagram, links to the previous parts of this project. 

Here are the links to the other parts of this build, check them out!

Part 1:

Part 3: 

So a few years ago my Xbox finally choked out its last pixel and died in the horrible fire that is RRoD. After a failed attempt at trying to restore it to life it was stuffed in my closet never to see the light of day again. 

That was until a few days ago when I was spec'ing out my new HTPC build and couldn't find a case that i liked. Every single case was either, too big, too boxy, or too small to fit everything i needed. Even with the mini-itx standard cases were around 12'' long! That's way too deep! So I've decided to try my hand at building an HTPC into an Xbox360. 

Now this has been done before i know. There are some spectacular case mods ( case in point: ) and some terrible ones out there. But I want to do something slightly different. 


  • Retain Xbox 360 shape and appearance. 
  • Retain as much of the original functionality as possible. ( This is going to require a lot of work )
  • Stuff as much power in it as possible. 


Parts to Reuse: 
(Xbox Board Pinout: )

So thats the plan! I'll update when I make progress and be sure to site anything i use. 


Here are the links to the other parts of this build, check them out!

Part 2:

Part 3:

Ever since the Kinect came out I've been toying with ideas on how to use it to do some really cool motion controlled stuff for my MythTV box. But its always been too expensive to buy one just for playing with but an awesome gizmodo deal came along and I snatched one up.  It's really a neat little device, unfortunately it doesn't like to play nice with Linux easily I'll tell you that. I've been working on getting it working with Mythtv and Linux for quite a while now and i've hit a few walls. But I figured i'd post up here to see if anyone else has come across a fix for my issues. 

First a few caveats: I'm running a AMD Phenom 9600 on an Ubuntu 11.04 x64 install using kernel 2.6.38-11-generic. The 64bit OS with an AMD core seem to be the wrench in my pudding in this situation.

Here are the tutorials and information that I found helpful during my attempted install:

Now following these tutorials directly failed to give any results that worked. (possibly due to my 64bit situation) but with a few modifications I managed to get to a stage where OpenNI sample generates a picture.

Unfortunately i can not get NITE skeleton tracking to work properly.

It fails with this error:

      252 INFO       OpenNI version is 1.3.2 (Build 3)-Linux-x86 (Jul 19 2011 15:45:45)
      295 INFO       Filter Info - minimum severity: ERROR, masks: NONE
Illegal instruction

There were a few key differences in the process I performed and the process performed in the tutorials. The major differences are as follows. 

  • Use of unstable binaries of NITE and unstable tree of the driver and OpenNI located here:
  • Remove all instances of ​SSE3​ where SSE_GENERATION ​is found and replace with SSE2.
  • Using the default tree of the primesense Kinect drivers.
  • There are a few more but i seem to have misplaced my notes (oops!).

So here's the deal the roadblock i've found. Its appears that NITE is not SSE2 compatible. One of the links in that i gave in the top tells the story but thats the jist of it. You can not run any software the uses NITE on a cpu that doesn't support SSE3.

If they ever get this completely working I will post up my procedures for sure. I am also interested in using the Kinect with Mythtv using the klirc​ module but preliminary test builds show it needs to major work which i am also looking into and taking vigorous notes.

        Its been a long couple weeks relearning php and learning my way around the drupal content management system but after all that time I can finally say the site is ready enough to go live. That's not to say that the site is completely done, there are several things i wish to still add and several section that sill need some work but i'll talk about that a little later.  While this site may be dedicated to advertising myself to people around the world I also wish to use this blog as a sort of storage of solutions for all the random problems that i come across during the course of the day. I hope to post solutions to problems that I encounter that either have no solution that is easily googable, or solutions that have not been cached by google yet. Hopefully I created this site with good enough SEO(i doubt this is the proper way to use it in a sentence) so that other people who encounter the same problems can find a solution without being a tripple black belt at google fu. I may do this by reposting blog entries from other sites or just creating my own content. I will tell you this right now, I am not an english major and don't expect anything posted to be gramatically correct in any way. 

Click through to read the rest of this post...