Logitech K750 and Ubuntu compatibility

Logitech k750 Solar KeyboardRecently Logitech sent me an email with a 50% off promo code and I just couldn’t let it go to waste.  I had a tough time finding something I actually “needed” and that wouldn’t just be another gadget that would go into a box soon.
Don’t get me wrong, there’s plenty of stuff I was fascinated by, but I’ve come to a point where I am tired of wasting money on crap I am fascinated by and have no real practical use for…

Now, with that being said …. the most practical item I found was the solar powered wireless keyboard; the Logitech K750.  I ordered it not completely sure if it’d even work with Ubuntu, which I really was hoping it would since I spend the majority of each day coding away within and to my surprise, it worked great!  I’ve connected it to both Ubuntu 10.04 LTS and Ubuntu 11.04 and everything worked just fine, nothing extra to configure.

Finding Answers To This question...

I found several posts when searching for “Logitech K750 Ubuntu compatible” and I kept getting pages that must have had Ubuntu somewhere on the page, but the post had nothing to do with it’s compatibility….
I found one post (don’t remember where) and the guy said he wasn’t sure if the function keys worked or not.  They DO.  There’s also this thread regarding Ubuntu 10.10.

My Impression…

I’m not writing this to do a review, so you’re out of luck if you want a full one of those.
But I was impressed with this keyboard even though some of the reviews for it made me a little cautious.

The Thinness

It seems several people mentioned how thin the keyboard was, which I thought it meant it was flimsy.  When I un-boxed it, to my surprise, it actually felt pretty solid and had a little more weight to it than you would expect from something this thin.  But I’m not complaining and it’s NOT heavy, just not a feather-light either which I saw as good.

The Keys

They are very nice and comfortable to press.  I really favor the Microsoft Comfort Curve Keyboard 2000 (B2L-00002) , which was a cheap keyboard I picked up at Wal-Mart and has faithfully served me for at least a year now.  The smoothness of the key press is great for daily coding and requires less effort.  With that being said, this keyboard well complimented it so I liked it right away.  It’s a matter of preference I guess, but after years of using the standard firm key keyboards, the soft ones gained instant favor from me.

Solar Powered

This is just awesome.  It is able to gain a decent level of light even in my not-all-that-well-lit work area, aka my home corner.  In addition to that, I found somewhere that said it can run for 3 months on the battery power, so no worries if you have several poorly-lit days ahead.  Even though there’s not a little solar utility app for Ubuntu, you can still test if your keyboard is getting a proper level of light input or not by pressing the solar key and it’ll either blink green or red, which the colors are self-explanatory.

All in all, it works great with Ubuntu or Windows and this is a pretty cool keyboard to have unless you have really high expectations or it just doesn’t fancy your tastes.  I definitely recommend it though.

How-To Make Your Own BitTorrent Torrent Tracker

I’ve been fascinated with Bittorrent since discovering it years ago.  Anyone who’s ever tried uploading large files via FTP only for them to fail on upload/download knows the frustration.  Bittorrent is a phenomenal free way of sharing those large files across the internet.

Recently I started searching for a How-to or at least a Guide for Coding my own Bittorrent PHP Tracker.  I was quickly amazed by how little helpful tips and pointers I could find on this and ended up resorting to re-working a light-weight tracker called OpenTracker into my project dubbed ReOpenTracker. (more on that later)

Where To Start – What Data Is Being Transmitted?

One of the first things I had to figure out is “What information is being sent to and from the tracker?”.  This was tricky since uTorrent and Transmission clients don’t show you the information being submitted and received.  After piddling with the code from OpenTracker, I figured out what was being sent.  To find what was being received, I wrote the values of $_REQUEST and $_SERVER to a text file, then viewed the query string and parameters.  This also gave me the necessary query string to do manual queries to the announce URL.

I later discovered the website http://wiki.theory.org/BitTorrentSpecification, which has a wealth of information (it’s like a user manual to Bittorrent for developers).  It has everything you need to know and in regards to what’s being sent/received and the sections Tracker Request Parameters and Tracker Response outline the required and optional parameters for both of these.
It also explains Bencode, which I found the Wikipedia link to be particularly helpful at explaining this as well.
If that isn’t enough resources, I also stumbled across a PHP class named Torrent RW on PHPClasses.org and also can be found on GitHub, which turns out to be a very extensive PHP5 OO class that creates, reads, and other cool stuff with torrent files.  From briefly looking through it, it looks very well written and includes tracker functions such as scrape and announce methods.

What Next?  Start Writing Your Code!

Like I stated earlier, I chose to dissect the code from OpenTracker because it was the lightest tracker I found and that made for much easier comprehension as a newbie to the technical side of torrents.  Unfortunately there aren’t very many notes in the code to help you along, but with the above resources, you should have enough to start making a torrent tracker or a big mess, whichever comes first.

You are more than welcome to take a look at and use the code from my ReOpenTracker project as well.  I have tried to carefully document the code not just for my sake, but for those who might want to build on what I wrote.

The ReOpenTracker Project

The whole purpose of the ReOpenTracker project was to make a simple PHP5 class that allows me to quickly add a BitTorrent tracker to any project.  By writing it as a class, it makes for a more modular design for plug-in authoring, etc.  It also served as a good way to educate myself on how a BitTorrent tracker works.  At this point, I’m wanting to add additional flexibility to it such as very basic private tracker options, stat tracking, and .torrent file uploading and parsing, but this all just depends on how much time I’m able to spare on it.

I hope you find this basic guide useful and helpful for getting started on writing your own BitTorrent tracker since I couldn’t find anything like it.  I’ll add more details later if necessary that might help some of you.

Ubuntu 11.04 with Toshiba A665-S5170

Satellite A665-S5170 laptopI recently decided to upgrade from Ubuntu 10.10 (Maverick Meekrat) 64-bit on my Toshiba A665-S5170 laptop to the recently released Ubuntu 11.04 (Natty Narwhal).  I couldn’t find anything via Google on compatibility with the Toshiba A665-S5170 so I decided I’d post my results here.

Experience with Ubuntu 10.10

I liked the interface on 10.10, especially compared to the new 11.04.  But there were some issues that just didn’t work correctly with 10.10 and I’m just not one to spend hours trying several different “fixes” that I’ve found to get me no closer to fixing the issue.  It either works or it doesn’t.

I tried Here’s the list of things:

  • Sound - I don’t know why, but my built-in speakers never would work.   I messed with the sound settings and tried all of the different configuration options, but no luck.  I didn’t find anything really helpful either that pertained specifically to my type of laptop, so I didn’t use it very much since I always had to use headphones to hear.
  • N-band Network - When trying to connect to my D-Link DIR-655 router set to “N” mode only, it would never connect.  It seemed to be an issue with the network adapter, but I also found nothing mentioning this issue.  It would appear to be connected, but then it would eventually prompt me for the network key again and never connect.  It did however connect to G-band routers just fine.
  • Illumination and Eco Buttons - The touch button strip with the eco button and illumination buttons just right of the power button don’t light up.  I did some searching and it doesn’t seem there is a solution for this.
  • My Wifi - This is rendered useless in Ubuntu.  My Wifi is nice, especially when needing to share your internet connection with others if you’re hard-wired to a modem, but this isn’t a big deal.

Experience with Ubuntu 11.04

The upgrade was simple.  However, the interface is VERY different than previous versions.  I was not a fan of the window close/minimize buttons being moved to the left in Ubuntu 10, but that was a MINOR inconvenience compared to 11!  The Unity interface sucks in my opinion, but it’s here to stay unfortunately.  The launcher is very annoying to use and the fact everything is drastically moved around compared to previous versions requires re-learning Ubuntu’s interface.

However, beyond my dislike for the new interface and still no way to choose how it should look via the appearance menu, it DID fix a couple of the issues with the Toshiba A665-S5170.

Here’s the above issues and their status with Ubuntu 11.04:

  • Sound - It was fixed by installing the Default Sound Card app.  This may have fixed the issue in 10.10, so I can’t attribute this to 11.04.
  • N-band Network - It connects to the N-band just fine now and I’ve had no problems at all.  Nice being able to enjoy the speed benefits of the N band!
  • Illumination and Eco Buttons - Still no luck on this one.  I also noticed Ubuntu doesn’t utilize the Eco mode, which I don’t really expect it to since it’s a very specific application.  It does an excellent job on battery life, so I can’t complain.
  • My Wifi - Still nothing on this.  I haven’t searched for it since installing 11.04, but seeing how new 11.04 is at the time of writing this, I’d assume it’s highly unlikely anyone has put any effort into making this feature work.  I could be wrong though.

So there you have it.  It DOES work on the Toshiba A665-S5170 and that was the most important factor to me.  I haven’t fully tested everything such as the e-sata port, hdmi output, but the things I use on a regular basis seems to be supported just fine and working great.

UPDATE

If you are wondering how to change the menu system in Ubuntu 11.04 from the new Unity crap back to the way it was in Ubuntu 10.04/10.10, I found a great video tutorial that shows how to!
http://gytisam.wordpress.com/2011/04/17/howto-change-unity-to-classic-menu-in-ubuntu-11-04-2/

GSkill RipJaws F3-10666CL7D compatible with Asus M4A78LT-M LE

I recently did some research on upgrading the RAM on my Asus M4A78LT-M LE build since at the time of building it, DDR3 RAM was about $65 per 2GB chip and I opted to just go with 2GB until the price fell.

The good news is, it’s definitely MUCH cheaper now and I became fascinated with the clock speeds of the GSkill RipJaws F3-10666CL7D-4GBRH, but neither ASUS nor GSkill showed anything saying it was compatible with my motherboard.  Since there was other RAM of similar specs in ASUS’s list of compatible RAM, I decided to take a chance and give it a try.

Upon my first attempt, it failed.  The computer would power on, but nothing would load, not even the BIOS.  The monitor remained in sleep mode and the fans didn’t slow down any.  So after a few attempts of restarting the computer, I thought I was at a loss.

I then decided to check the ASUS website for BIOS update and the update Version 0801 had to do with RAM stability, so I went ahead and updated the BIOS.  This did the trick.
Now I’m completely clueless what speeds the RAM is running at and I don’t know how to check, but it DOES work.  I’m not into over-clocking, so as long as it works, it’s good enough for me.  I’m running Windows 7 64-bit in case you’re wondering.

I hope this helps someone since I couldn’t find anything saying where this combination works and has been tried.  Feel free to comment if you can provide additional helpful info.

Make HTML select element expanded like multiple but only one item selectable

This is a very simple topic, but after searching Google for the wording in the title of this post, I wasn’t having any luck and a friend of mine told me how to do it, so I’m posting this in an effort to help someone else searching for the same thing I was.

The trick is the size attribute on the select element.

<select size="4">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
</select>

iPhone 3GS Replacement Digitizer Glass – Seller Reviews – DirectFix.com

I recently spend a few hours searching online for a new iPhone 3GS replacement digitizer glass and decided I would go with DirectFix.com for the purchase since there was negative feedback on many of the others regarding being sent the wrong part.

I received the part today and proceeded to follow their video tutorial, which was excellent.  But when it came time to turn it on and test out the new screen, it was unresponsive.  I thought I had done something wrong or not connected a cable properly, so I re-opened the iPhone and noticed the #2 connector wasn’t connected very well.  After trying to get it to plug in and it continually popping right back out, I compared it to the original screen’s connector and sure enough, I’ve been had!

Everything said it was a 3GS, but it definitely isn’t.  The invoice, the bag …. but the actual screen, now fully installed, is a 3G and will not work.  Considering their firm statement in regards to their NO REFUND/RETURN policy, I’m really thinking I’ve been ripped off $30.  I’ve sent them an email and I’m still pending a reply, but I’ll dispute this with paypal if I have to since I purchased a 3GS screen and have yet to receive one.  That’s like you buying a dvd from someone and they mail you a VHS tape.  That’s not what you bought nor is this what I bought.

I’ll keep you all posted, but for those who’s curious what the difference between the 3GS and 3G connectors are, here’s a photo I took comparing the two.  The 3GS is on the left and the 3G is on the right.

3GS and 3G digitizer connector comparison

Also, feel free to post your reviews on other companies selling the 3GS digitizer because I had very little luck finding any helpful reviews or recommendations as to where to purchase one from.  I wouldn’t mind paying a little more from a reliable store than to buy one and be sent the wrong part to only be stuck with it.

UPDATE:

DirectFix DID exchange the screen and sent me the proper one, which worked fine after installation.  Upon fixing an additional iPhone 3G that had both a busted LCD screen and digitizer, I decided to go with Hyratech for that repair.  Hyratech sent the correct parts the first time, but I was unable to get the LCD to come on, despite trying all of the techniques I found online for solving this issue.
I decided to go ahead and pay Hyratech $20 to install it since I wasn’t sure if I was missing something or if the LCD may be defective and it was just simpler and easier to go that route.
They got it fixed quickly and said the LCD was just fine, but never did say what it was they did to make it work.  It worked great all the way up until the person I fixed it for broke both again about a month later….

Canon 5DMKII won’t write to CF card

My brother purchased a 5DMKII a couple of months ago and in the middle of shooting a wedding, it suddenly quit writing to the compact flash card!  It would still read the card, but it just wouldn’t write.

The first thing that came to mind was that the card maybe malfunctioned, but even after trying other cards, it wouldn’t write.  We thought it it may have been a heat issue since he was shooting outdoors in mid to upper 90 degrees temperatures, which would pose a serious issue, but neither one of us could find anything on Google about this issue.

Well, he sent it in to Canon for repairs, which it is still under warranty, and they fixed it and said it was a failure in the PCB ( I think that’s what it was called ) chip, which is on the main circuit board, and apparently is responsible for reading/writing data to the CF card.
They replaced the circuit board and it’s fixed!  It seems the temperature wasn’t the issue and it’s a rare/random failure in the electronic chip.  Since there’s no mention of it via any Google searches, perhaps this is true….

SQLite Primary Key column not auto incrementing

When developing with PHP, I frequently use SQLite databases since they’re very disposable and keeps from cluttering my MySQL server with a bunch of development/testing databases that may be abandoned or no longer used.
One of the problems I’ve had is when dealing with the Primary Key column and discovering that it for some reason won’t auto increment like it should.

So I did some testing and troubleshooting and finally figured it out.
Here’s a few “guidelines” that may help you out so you can avoid these issues too.

MY ENVIRONMENT:

I am using PHP 5.3.2 and PDO.
PDO is available with PHP as of PHP 5.1, but Sqlite3 is available as of PHP 5.3.0 which you can read more about at http://us.php.net/manual/en/book.sqlite3.php.

INTEGER not INT

Very often when writing PHP scripts, the option to choose between MySQL or SQLite database types comes into play.  Also, many of us learn how to use a database with PHP using MySQL first and SQLite is a little different regarding the acceptable SQL syntax.  MySQL will gladly accept INT as a substitution for INTEGER and SQLite won’t complain either, but in my experiences SQLite doesn’t see the two as being the same for some reason.

Take a look at this example: (You can try it yourself if you like)

$sql = "CREATE TABLE test_table (
            id INT PRIMARY KEY,
            name VARCHAR(50) DEFAULT NULL )";

This will create the table without any errors, but when you insert a new row, the id column won’t increment and will simply be empty.  You can add NOT NULL to it, but it still doesn’t make any difference.

The other thing I noticed was that it wasn’t bias towards using an empty string value for this field when the data type was set to INT as in this example:

$sql = "INSERT INTO test_table (id, name) VALUES ('', 'JohnDoe')";

Now try it again and add AUTOINCREMENT to it like this:

$sql = "CREATE TABLE test_table (
            id INT PRIMARY KEY AUTOINCREMENT,
            name VARCHAR(50) DEFAULT NULL )";

Now all of the sudden you should get an error (if you have the error attribute set) similar to this:

'SQLSTATE[HY000]: General error: 1 AUTOINCREMENT is only allowed on an  INTEGER PRIMARY KEY'

So this clearly shows that INT and INTEGER are NOT the same.
As soon as you change INT to INTEGER in your SQL syntax, the primary key works just fine and it doesn’t matter if the AUTOINCREMENT is present or not.

Specifying Field Lengths Will Cause Problems

The only field data types SQLite requires (at least in PHP) a field length for is the ‘VARCHAR’ type.  From my understanding, it doesn’t enforce this length, but I may be wrong.  Either way, specifying data lengths to other field types normally won’t cause any sort of errors, but they will be ignored.

However, in the case of the PRIMARY KEY field, it seems to have the same effect as using INT instead of INTEGER, even if the data type you specify IS INTEGER.
Here’s an example:

$sql = "CREATE TABLE test_table (
            id INTEGER(5) PRIMARY KEY,
            name VARCHAR(50) DEFAULT NULL )";

Now if you insert a row, you will see that the id column isn’t incrementing.
If you add AUTOINCREMENT to the end, you will see the SQLite error message I mentioned above.
So be sure to leave off the data length from your SQL syntax for the primary key field.

That pretty much sums it up and hopefully helps you avoid the headaches I had before figuring this out.

Additional SQLite SQL syntax caveats

Something I see used often in SQL syntax for MySQL is the ( ` ) character as in this example:

$sql = "INSERT INTO test_table (`id`, `name`) VALUES ('', 'JohnDoe')";

They look a lot like apostrophes, but they’re actually what’s called spacing acute characters.  On a U.S. Keyboard, it’s the key just above the TAB key.
They have no real purpose (that I know of) other than just making it “nicer” looking.

The problem comes when trying to use that syntax in SQLite queries.
SQLite doesn’t like these characters and it will result in an error.  This also was a lesson that took me a lot of wasted time to figure out, so just avoid them to begin with.

How to make unauthenticated Twitter user feed/timeline requests

I recently wanted to add a user’s public feed to a website, but I didn’t want to go through all of the unnecessary trouble of user authentication for it.  After all, it IS public data so it shouldn’t require a login to retrieve the data.

The Twitter API offers a very convenient way of making queries by simply using a GET request to a URL.  What I quickly discovered though was the difficulty in finding the correct URL structure or format for querying a specific user.
I found the information at http://dev.twitter.com/pages/every_developer , item #8, but it doesn’t give any specific examples and only shows how to do a public “everyone” feed request.
Here’s what it says at the time of writing this: ( in case it changes later… )

8 ) A command line is all you need to use the Twitter API

If your system has curl (and it should!), you’ve already got a great way to poke around the Twitter API. Here are some examples:

Fortunately, I found some help in the facebookapi IRC channel and was given this link, which was EXACTLY what I was trying to find:

http://dev.twitter.com/doc/get/statuses/user_timeline

I really hope this helps someone else.  Remember though, this only works for public feeds, otherwise authentication is required.