Skip navigation

If you want to edit an existing chrome extension, it is very easy!
There are many reasons why someone might want to do this, perhaps to enable a pay only option, perhaps to remove some of the tracking elements extension designers add in.
Chrome extensions are written in javascript and each file gets a MD5 signature that chrome checks before it runs the extension.
If you don’t bypass this check, then Chrome will disable the extension thinking it is corrupted.

First, you wan to find the extension folder, on windows it is
C:\Users\\AppData\Local\Google\Chrome\User Data\Default\Extensions

Here is a Stackoverflow link that discusses the path for other OSes

Now copy this folder somewhere else, like in your `code` or `workspace` dirs.
Now go to chrome://extensions/ and enable developer mode.
Now load ‘unpacked extension’
Everytime you make a change to your extension, just go back to chrome://extensions/ and reload the extension to see your changes.

For some reason, my Macbook Pro Late 2011 8,3 will not show the TailsGreeter. All I get is a blank screen that if I hit enter, will then boot to the desktop.

It’s a pain in the ass, however there isn’t much of a point to Tails unless I can save some session data.
I was able to create my persiatnce volumne, I just can’t activate it because I do not physically see the TailsGretter screen.

So the answer is to hit tab in Grub and edit the boot command line from ‘nopersistance’ to ‘persistance’, and add rootpw= and hit enter.

Once booted into X, open a terminal and type:
su // and enter your password from the boot command line
/sbin/cryptsetup luksOpen --tries 1 /dev/sdb2 TailsData_unlocked
/usr/local/sbin/live-persist activate /dev/mapper/TailsData_unlocked

You might need to change /dev/sdb2 to whatever you persistance volume was created under.

So I was fortunate enough to recently have to store data that was stored as two merged Javascript Objects yeasterday. Yeah, I know what your thing ‘everything is an object’. It wasn’t stored as an array, just as a default Object. I wanted my change to be as stealth as possible and not interfere too much with the existing structure of the code base. And I wanted to return a sorted object.

I think I didn’t have JQuery linked in the file and didn’t want to add it unless I had to. I forget things. Anyway, Here’s the code I ended up using (and later scrapping because I decided to just do it in PHP and change some other things)

//first I had to merge my two objects
var myObj1 = somefucntionthatshouldhavebeenreturnarraysbutreturnsanobject();
var myObj2 = someotherfucntionthatshouldhavebeenreturnarraysbutreturnsanobject();
for(var attrname in myObj2) {
if(typeof availableBundles[attrname] === 'undefined') {
myObj1[attrname] = myObj2[attrname];
//so now we have both objects merged into myObj1

//sort myObj1 into a temporary variable called sortedObj
var sortedArr = [];
for (var attrname in myObj1) {
sortedArr.push({key:attrname, value:myObj1[attrname]});
//now we have a sorted array

//now we will parse the sorted array, and put it back into the object
myObj = {};

//in my case I was sorting by the value, not the key, and the value was text, hence the use of localeCompare
sortedArr.sort(function(a, b) {return a.value.localeCompare(b.value);});
for (var i=0;i

So, some interesting things to note here, is that in order to sort by value and not run into duplicate keys overwriting data, we store the value and key as objects, and in order to use the sort() method, we store store them in an array, and then pass into sort() a function that compares the values.
As mentioned in the source code, we use localeComapre to compare two strings. Since this is a sorting method you want to return a negative number os the first value is less than the second, a zero is they are equal, and a postive number is the forst value is greateer than the second. Sort() takes care of the rest.
LocaleCompare is used for strings because that's basically what the function does, it compares two strings and returns an integer based on the above rules. We just need to tell it that we want to compare using sortedArr->value, not sortedArr->key.

Typical startup picture
This post may very well be a death sentence as far as my career is concerned. Some companies need to be called out on their BS. Looking for a job near the Philadelphia area? I have noticed during my time in Philadelphia that there is a group of companies that are always hiring and never really growing. If you are a recruiter, take note, you might want to give up on trying to fill positions for these companies.

The following is MY OPINION of some shops that should probably be avoided because they always seem to be hiring and do not seem to be growing:

  • Monetate – a very `startup like` company, that is at least 5 years old. Open office, very noisy office. They are very active in the developer community. Honestly, they seem like they operate on VC money and are not making a profit.
  • CoreDial – I get emails from recruiters about once a year, always looking for an entry level PHP developer
  • SevOne – every time a recruiter has contacted me, they state that this company is under new ownership and everything has changed. Why does this company keep getting sold?
  • – free energy drinks apparently aren’t enough to get them iOS and Android devs
  • I have no relation to these companies, I have never worked at any of them. For all I know they are great companies that just can not find the employees they want. I have also been in this industry for a while and I have pretty good instincts.

    Why I decided to like everything on Facebook and what happened.

    Since June 26th I have liked almost everything my friends posted on Facebook. I was later disheartened when I saw that Wired had decided to do a
    similar write-up. However, after a bit of contemplation, I realize that maybe this is a conversation more people might be interested in having than I thought. In this article I will discuss the reasons behind WHY I liked everything on facebook, as well as what happened as a result of liking everything on Facebook. The results were both surprising and thought-provoking.

    I initially manually liked posts. However, I felt that I was still being discerning and also felt like coding something just for the fun of it. I chose to automate the process of liking everything my friends posted on Facebook by creating a PHP script to do the work for me (this is a programming blog). This PHP script runs on an hourly cron job on my raspberry pi. I decided to use Facebook’s own graph API to get a list of all my friends’ posts. This required me to get an access token from Facebook. I did this by making a html page that prompts the user to grant access, then displays the Facebook token in a popup window. I then took this access token and hard coded it into the cron job, because it’s passed as an argument into the script. This was to handle the case where I may have multiple accounts I wanted to like friends posts on. I had to ask for all sorts of extended permission though, so I doubt this would ever get approved as a real facebook app. I needed publish_actions and read_stream in order to ‘like’ a post and get the permissions to begin with.
    The ‘wall’ on Facebook is a custom sorted feed sent by Facebook. The only way to access that list of friends’ posts, as well as ads, would be to scrape the page. The graph API does provide access to friends’ posts, via the url However, this does not list the same posts that I see on my wall. My wall also displays differing content based on whether I’m using the mobile or desktop version. There’s nothing I could do here (save for scraping the page). If a post isn’t supplied to me I can’t like it. That’s okay, I figure that if I hit 80% of my friends’ posts that it would be sufficient for my needs. It’s not like this is a commercial product, after all.
    I also choose to not like anything they shared or anything they liked. I can’t tell if a post is a shared post by if status_type is set to shared_story. I figured stuff like this out just by reading the json that comes back and then looking for that post on my wall. The script only likes original content.

    Well, I did this for a couple of reasons actually. First, I did it to mess with Facebook’s algorithms. I do not want Facebook knowing too much about me. I figure I have two choices, stop liking anything, or like everything. This way Facebook only knows me by my connections, which is most likely more important than knowing what my favorite TV show is.

    Second, I did it because I thought there might be some side benefit to liking all my friends’ Facebook posts. Maybe more of my posts might get liked, or I might get invited to more things, or even just have better conversations.

    Shouldn’t we all like everything our friends post?

    And last, I did this because sort of felt that this was the right thing to do. I facebook befriended these people, and all of their posts deserve to get liked. Not just posts that Facebook decided I want to see or the posts that I intentionally won’t like myself (AKA pictures of your kids). I anticipated that this friendly script would be heralded as a gift. The gift of free likes. ‘Ol’ Chuck is so generous with his likes!’ I imagined them declaring. I envisioned my friends feeling much better about themselves, knowing that at least one person liked their post. When was the last time any of my posts got 100 likes even though I have over 100 friends? There are reasons that people don’t like a status update, and I don’t think it’s because they hate the person or the text or even the idea. It’s a laziness we all have when there are hundreds of new wall posts to capture our attention every day. We need to filter. So what happens when that filter is off? I needed to know.

    OK, great, what happened though.
    Well, unlike Wired’s result, my feed did not change too much. My script doesn’t like random pages that Facebook shows me, only posts that my friends made. That would explain why I didn’t get a lot of weird posts in my timeline. I did start to see posts from friends I have barely had any contact with on Facebook previously. In fact, by the end, most of the posts I see are from people I’m not very close to, so I think this part of the reason I started using Facebook less.
    I think another reason I am not using Facebook much is because when I look at my feed, and I see that every posts has already been liked, I just lose interest. Even though I know I haven’t seen these posts yet, I just don’t care. I get bored and leave. In essence, the script worked; my Facebook is automated. Time to go outside and live life I guess.

    I also got PM’d quite a bit late at night, when people who saw me stalking their posts thought I was awake. Sorry, If I’m awake past 10pm I will make a post about how much insomnia sucks. I did not intend to deceive people. Liking a post manually versus by way of an automated script is not much different than asking ‘How are you’ when you actually don’t care at all about how they are. It’s a courtesy. A way to say ‘I’m with you sista!’.

    Some people just can't take a compliment

    Some people just can’t take a compliment

    I also received quite a few comments asking me to turn it off. I guess for some people they get a lot of alerts that I am liking their stuff, so basically, this script ends up spamming them. Also, since they know it’s a bot and not me (I did like some stuff manually) I guess it’s not really exciting to see that I (it) liked their posts. I contemplated adding some restrictions to the script. Ways I could have it only like certain users posts, or black list other users, etc. But it was summer and life got in the way.

    Facebook feels like Myspace now.

    Some people have claimed that originally they started liking my posts because I have been liking theirs, but that faded pretty quick when people started figuring out it was automated. If I had throttled it down a bit and not let on what I was doing no one would have probably noticed a thing. However that isn’t very ethical, and I like telling people what I’m working on too much to not tell them.

    In conclusion.
    I initially set out to let this script run forever, just liking every post it hasn’t seen in the past hour, 24 times a day. After several complaints I decided to let it run out after the token expired, which should have been 60 days. However, since it has not expired like expected, I went ahead and manually pulled the plug.

    Facebook is not my sociology experiment. My friends are not my lab rats. It’s kind of funny that I say that, because Facebook has used it’s members in experiments. My source is up on Github if anyone wants to run it themselves. I’m debating writing an auto ‘Happy Birthday’ poster. Yes, I know they already exist, but I like the challenge. And I don’t think anyone will catch on to that one.

    Facebook is so utterly boring to me anymore, though. I truthfully was pretty actively engaged before all this. I’m definitely less engaged now though. I might change the script so that I only like a percentage of a persons posts, and make it so the script only runs between 8am and 5pm. However, like I said, I just do not care that much anymore. Facebook feels to me now the way Myspace felt to me the day I found Facebook.

    I had a embdded YouTube video stepping over my registration popup (using jQuery-ui’s dialog()). The solution was to add “?wmode=transparent” after the youtube url specified in the src attribute.

    I was getting an odd error whenever I tried to use yum.
    I checked my /etc/yum.repos.d/ folder and there were no ‘dag’ entries.

    [root@localhost yum.repos.d]# yum list php\*
    Loaded plugins: auto-update-debuginfo, langpacks, presto, refresh-packagekit [Errno 14] curl#22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    Error: failure: repodata/repomd.xml from dag: [Errno 256] No more mirrors to try. [Errno 14] curl#22 - "The requested URL returned error: 404 Not Found"

    I ignored it at first but eventually updates started failing and Yum wasn’t finding software I knew existed in the repos.
    The solution was that the dag repo was listed in my /etc/yum.conf

    I removed that and ran a

    sudo yum clean all

    and everything was fine again!

    If your are new to PHP and stumble upon the << and >> operators they are not similar to the << and >> operators in C++. This guide attempts to explain the concept behind shift left and shift right – what << and >> do.

    Lets say we have a variable called $a. If we were to shift it 5 times to the left it would be like multiplying it by 2 five times;  $a * 2 * 2 * 2* 2 * 2. Now since you love math you know that is $a * 25

    So when you see the syntax $a << 5, you know that is $a * 25;

    $a << 5 = $a * 25

    Lets say we have $a >> 5. In this case you can see that the we want to shift right. A great guess we be that what this operation does is it divides $a by 2 five times, $a /2 / 2 / 2 / 2 / 2, or $a / (25)

    $a >> 5 = $a / 25

    You might notice I purposefully chose 5 because I originally titled this tutorial as “PHP << and >> (bit-wise operators Shift Left and Shift Right) Explained for a five year old” – jokingly suggesting a five year old can handle it, maybe, I dunno, I have seen some smart kids. I also thought it would be easier on the eyes than seeing $a and $b everywhere.

    Some history;

    The shift operators came from the C language designed by  Dennis Ritchie. When C was designed it was running very close to the hard ware, in fact shift is an instruction from Assembly language (SHL and SHR).  This is due to the way the value is stored in memory, it’s stored in binary. A binary representation of the value, if literally moved over, will have the result (since binary is numbering system based on twos) of being divided by two.

    Side note: if you don’t know binary go learn it real quick, if you do know binary, test how well you know it here

    For example, 80 written in binary is 1010000. If I shift is right once I get 0101000, which is 40. If I shift it again (80 >>2) we get 0010100 which is 20. As you can see shift right and shift left are the opposites of each other, so if I shift it right five times then shift it left five times, it will cancel out.

    The shift operation are not mathematically associative, that is if we do the linear order in a different fashion, we will get the same result. So if we have ($a << $b) << $c, we are not guaranteed to get the same result as $a << ($b << $c).

    ($a << $b) << $c != $a << ($b << $c)

    The shift operation is not commutative either. So if we have $a << $b and we switch the terms around, $b << $a, we will get a different result

    $a << $b != $b << $a

    You are probably now wondering when  would you use this operator? Well any time you start writing code that performs a lot of integer multiplication, so for people with careers specializing in file compression, cryptography, audio and video processing, mathematics, Wall Street, accounting, banking, the list goes on.

    Here is a program that performs multiplication using only bit-shifts and addition

    $c = 0;
    while($b != 0) {
         if(($b & 1) != 0) {
              $c += $a;  //also same as $c = $c + $a;
          $d = $a << 1;
          $e = $b >> 1;
    print $c;

    It was Aliens - they gave us the knowledge!

    In fact, the Egyptians had a similar method for performing multiplication; mandatory wikipedia link.

     So now I have a question for you, please provide what you think is the answer in the comments section!

    What will be printed to the screen when the below code is ran?

    HINT: Wait until next month when I talk about bitwise ANDs and ORs  (‘&’ and ‘|’ in PHP)
        $a = (1 << 0 );
        $b = (1 << 1);
        echo ($b | $a) << 2;

    Creepier Door Knocker


    I picked up this scary face door knocker last year at Walmart for $5, they probably still sell them but I haven’t checked. I am not actually using an ardunio, but a similair thing called a Digispark made by Digistump (hard not to mix these names around) but I friggin love these things. They are not as full featured as an Arduino, but for what I’m about to do they are overkill and super easy to use and pretty cheap. They also use the same software (the software made by Ardunio). Most hobbists will probably tell you that you could make the thing for even cheaper yourself, I am lazy and I defend that trait for two reasons, conservation of enegry and the fact that I do not need to reinvent the wheel. Ten bucks is cheap enough in my opinion (I am not mass producing anything using these).

    I have some plans for what to do to it next year, I always break things up into multiple revisions. I definitely want to add a motion sensor, currently it just repeats this loop until I turn it off or until the battery dies. I also want to add sound. However instead of installing a speaker inside the knocker,  I want to try to use bluetooth and have the sound play on an external speaker hidden in the bushes or next to the porch. Maybe I can have it ping my phone so that I know someone is there before they even ring the door bell.

    Parts List

    • 1 Plastic scary old man door knocker from Walmart (here is a similar one on Amazon)
    • 2 RGB LEDs (I purchased form SparkFun)
    • 1 Digispark or any arduino (not much code here so even an Uno would be overkill)
    • 1 servo (I purchased the ‘Medium Servo’ from SparkFun)
    • ! pack of 100 Ohm resistors (1/2 watt radio shack 2711108)
    • 1 AA battery pack (Sparkfun, again)
    • 1 switch (I had it left over in the parts bin)
    • Misc: Hot glue, epoxy putty, wire, solder, USB Hub (highly recommended), some think aluminum from home depot

    So, I present to you my build log, happy Halloween!


    original door knocker

    The is the door knocker after I had removed the two cheezy red LEDs I put in it last year


    Digispark, for those not in the know

    a guy with epoxy putty goes mad

    Beginning of the servo mount, don’t worry, it gets sloppier!

    LEDs and servo installed

    Jump ahead to where I have the eyes cut out, RGB LEDs installed, and used hot glue to shape the eyes and fill in the gaps. I also have a battery pack Velcro-ed to a metal plate that I used epoxy putty (JB Weld) to hold the plate in with 4 AA batteries. The servo is mounted and fully secured using, you guessed it, HOT GLUE. Oh, and also, I burnt out the green and blue LEDs after I had hot glued them in, so the defective ones are staying there this year. I fashion an L shape key out of some aluminum sheet metal I got from Home Depot that I had lying around. I also used this to make a bracket for the top of the servo and I epoxied it down. I coated everything in liquid electrical tape and hot glue. I would still probably take it down and bring it inside if we had any rain just to be safe.

    switch install

    Here I am dremeling out a space for the switch


    The wiring for this is;


    • Brown to Digipark ground
    • Red to Digispark +
    • Orange to p0

    Battery pack

    • Red to switch then from switch to Digispark +
    • Black to Digispark –


    • Red to 100 Ohm resistor then to p4
    • Return (ground) to Digispark ground
    • Green to 100 Ohm resistor then to p5
    • Blue to 100 Ohm resistor then to p0


    For the source code I used analogWrite to set the brightness of the LEDs. I would have probably went with a progressive green fade-in fade-out but I did something wrong and burnt out the green and blue components so I only had red left.

    I did not use any servo libraries, I just used digitalWrite() and delayMicroseconds() to get the servo to the desired position. This is a really basic build up. Nothing complicated here.

    Source code can be found here










    I rarely get to make new HTML pages, in fact on a job interview the interviewer, who was a really cool down to earth guy, chuckled when I used the font tag to set text color. I knew it was depreciated, but all the sites I work on daily still use do it this way and have not been updated.

    So, being the expert googler that I am I tried to find the correct way to set mixed color. I couldn’t find it, blog opportunity!

    So to be clear, all I wanted to do was after my field name, have a red asterisk to indicate that it was a required field, except I do not know the exact color the client wants yet (third party came up with the design, my client uses a lot of different third parties…).

    So I only want to define this once in the css for easy changes later.

    What I cmae up with is this;

    css file:

    .required_asterisk {        
         color: #f00; /* red */

    Then in my html file;

    Name<a class="required_asterisk">*</a>