Thursday, December 30, 2010

Cloudboard: Share text between computers

When I received my CR-48 (read: Chrome notebook), I instantly noticed a need for a shared clipboard between my computer and the CR-48. I downloaded Google's Web Clipboard, however, it took a while for the pastes to appear on both machines and I had to sit and wait for it them to load. So I made my own extension that simplifies the process and allows you to share any type of text right from the context menu. Cloudboard was born.

Install the extension, login via Google to the Cloudboard site and get your token, then start sharing. You can right-click on images, urls, pages and text to share with your other computers and all you have to do is click on the clipboard next to the address bar to see a list of your pastes. If you want to refresh, hit the refresh button, or just open the popup again, it is updated instantaneously with your other Chrome installations.


Feel free to leave any comments that you have. I will be working on notifications, so you can be automatically notified when a new paste exists.

Thanks,
James Hartig

Thursday, December 16, 2010

See the User's IP Using Lighttpd Behind Cloudflare (Updated with Apigee)

Using Cloudflare to protect your website is a great choice, however, it can break your existing applications because the IP that your server sees is not the user's, it is Cloudflare's. Cloudflare has a module for Apache to rewrite the IP with the correct one (here), but not for lighttpd. The following 3 steps will get your IP rewritten and have your access logs printing out the correct IP for the connecting user.

Step 1: Open your lighttpd.conf file and append "mod_extforward" to the end of the server.modules list.

Step 2:  Paste the following code block anywhere in the file (well at least after the server.modules lines)
$HTTP["remoteip"] == "204.93.240.0/24" {
extforward.forwarder = ( "all" => "trust" )
extforward.headers = ("CF-Connecting-IP")
}

$HTTP["remoteip"] == "204.93.177.0/24" {
extforward.forwarder = ( "all" => "trust" )
extforward.headers = ("CF-Connecting-IP")
}

$HTTP["remoteip"] == "199.27.128.0/21" {
extforward.forwarder = ( "all" => "trust" )
extforward.headers = ("CF-Connecting-IP")
}

$HTTP["remoteip"] == "173.245.48.0/20" {
extforward.forwarder = ( "all" => "trust" )
extforward.headers = ("CF-Connecting-IP")
}

$HTTP["remoteip"] == "103.22.200.0/22" {
extforward.forwarder = ( "all" => "trust" )
extforward.headers = ("CF-Connecting-IP")
}


Step 3: Restart lighttpd and you're good to go!

You should now see the actual user IPs in the access logs and in your applications.

If you want to add Apigee as well:
$HTTP["remoteip"] == "75.101.150.28/32" {
extforward.forwarder = ( "all" => "trust" )
extforward.headers = ("CF-Connecting-IP")
}

$HTTP["remoteip"] == "174.129.236.240/32" {
extforward.forwarder = ( "all" => "trust" )
extforward.headers = ("CF-Connecting-IP")
}

Thanks,
James Hartig

Thursday, December 9, 2010

Chrome Notebook. My Hands-on Review


I received my very own Chrome Notebook today and so far, I love it. Yes it has its quirks, but... its a Google notebook! For the most part everything works, there are just some odd things that fail to work. 

  • First of all, the "Next tab" button, doesn't do anything but jump/bump the side of the screen (odd?).  Once you open a new Window, it switches between windows, but it should not have been labeled a next tab button if it switched windows. 
  • Sync does work, it just takes forever to load.
  • There is a slight lag to the keyboard.
  • Selecting text doesn't work in all cases (read: text boxes). Fixed on restart.
  • Cursor sometimes doesn't change until you click feverishly.
  • Trackpad is hard to get used to, sometimes freaks out.
  • Flash player does not work very well on YouTube, Hulu, etc. Works fine for Grooveshark.
  • USB/SD cards do not work at all. The content browser comes up but it is empty.
  • Can take screenshots but there doesn't appear to be any purpose yet except to send them along with a bug report.
  • Shortcuts to move to next or previous tab do not work.
  • Battery time never finishes "Calculating".


Those are all the issues I noticed so far. But otherwise, the startup time was less than 10 seconds. I haven't ran into any extensions that don't work and websites seem to load and run very smoothly. Also, bettary life seems to be very good. I miss the delete button, but you can do Alt+Backspace to achieve the same thing. Dedicated search button is sweet, especially since it saves me time trying to work the trackpad.


Sent from my Chrome notebook.

Thanks,
James Hartig

Wednesday, December 8, 2010

Woopra in your Tumblr

Tumblr used to not allow third party Javascript in their custom HTML, but this seems to have been lifted. I do not know when but I just tried last night and it seems to work fine now. Woopra is a website that allows you to view your website traffic in real-time. You can now add Woopra to your Tumblr blog to watch your visitors and get detailed information on how they read your blog.


  1. Go to https://www.woopra.com/members/ and get the Setup code for the JS script.
  2. Go to http://www.tumblr.com/dashboard and goto Customize on the right side.
  3. At the top of the customize page, hit Theme, and then click Enable custom HTML
  4. Scroll down to the bottom of the HTML box (also under Theme option) till you see
  5. Paste the Woopra setup code right above then click Save + Close
  6. Watch the results in Woopra!

Enjoy!

Thanks,
James Hartig

Thursday, December 2, 2010

2 Random PHP Array Functions

Convert an Array into XML
http://jhartig.pastebin.com/B5sZ0rkK

Convert an Array into text like print_r
http://jhartig.pastebin.com/J6QWJCTW

Don't know what you would use them for. But, enjoy!

Thanks,
James Hartig