DIY

Timur Kernel on 2013 Nexus 7 WiFi (flo)

Timur Kernel on 2013 Nexus 7 WiFi (flo)

Background on Timur’s Kernel

I got fed up with having a pretty crummy head unit in my 2012 Audi TT RS (named Ignantt), and decided that it was time to take matters into my own hands. Part of doing a Nexus 7 head unit install in a vehicle involves powering the tablet up with a USB on-the-go (OTG) cable and being able to not only power the device but also plug in USB devices into the tablet to use. In order to get this working, everyone seems to be relying on this kernel from Timur. As per Timur’s site:

This feature allows you to connect one or more USB slave devices to your tablet and charge it at the same time. This allows you, say, to operate an external USB DAC without the tablet ever running out of power. To use this feature you will need an “OTG charging” – or a std. OTG adapter combined with a USB-Y cable.

Right-o. So yesterday evening after work I spent almost the entire night trying to get this going (aside from eating dinner and hitting the gym). I really feel that this should have been significantly easier for me, and when I reflect on how the whole thing went down, the actual process IS actually easy… It’s just that there are a few points where if you deviate slightly based on your device, EVERYTHING stops working. With that said:

This guide is for ASUS Google Nexus 7 Tablet (7-Inch, 16 GB, Black) 2013 Model only (Android 5.1.1 build LMY48G). It can be adapted to work with other models, I’m sure, but I plan to explicitly call out where my missteps where so that anyone with the exact same hardware as me can have a smoother ride. I also take ABSOLUTELY NO RESPONSIBILITY if you brick your device.

Step-by-Step

  1. Make a folder somewhere on your computer (like your desktop) that you are going to put all of your downloads into.
  2. Make sure you have ADB and FastBoot on your path, OR you put all of the necessary files to run ADB and FastBoot from a command prompt into the folder you made in step 1.
  3. You’re going to need to unlock your bootloader if you haven’t already. Unlocking your bootloader WILL erase your device. Follow the steps outlined here. In short, these steps are:
    1. Enable USB debugging on the device
    2. Open a command prompt in your folder from step 1
    3. Type: adb reboot bootloader
    4. Press enter to execute the command
    5. Wait for the device to boot into the bootloader…
    6. Type: fastboot oem unlock
    7. Press enter to execute the command
    8. Use the volume buttons on the device to change selection to Yes
    9. Use the power button on the device to select Yes
    10. Unlocked!
  4. You’re going to need to flash a new stock ROM to your device. Timur doesn’t call out LMY48G as supported in his instructions, but LMY48T is!) so go to Factory Images for Nexus Devices and download the image for 5.1.1 (LMY48T).
  5. Extract the contents of the LMY48T tar.gz file into your folder from step 1.
  6. Run the flash-all.bat file that was extracted from the LMY48T download. When this completes successfully, you will have a phone in a brand new state…
    1. Follow all the instructions on the device to get set up again with your new factory ROM
    2. Go to “About tablet” in settings and check that build number is now LMY48T… If it’s not, then DO NOT CONTINUE. You’ll need to get LMY48T before continuing with these steps.
    3. Follow all the steps again to get USB debugging available again
  7. You’re going to need to flash a recovery onto your device next. I used TWRP for this. HOWEVER, not just any TWRP worked for me. I needed to use the “multirom” version of TWRP (specifically, I used TWRP_multirom_flo_20150328).
    1. Download the TWRP multirom image to your folder created in step 1
    2. Put your phone into bootloader mode by typing: adb reboot bootloader
    3. Press enter to execute the command
    4. Wait for your phone to enter bootloader mode
    5. Type: fastboot flash recovery TWRP_multirom_flo_20150328.img
    6. NOTE: if you did not download the EXACT same TWRP as me, then change it to the correct file name…
    7. Press enter to execute the command. The device should inform you that flashing worked.
    8. Use the volume buttons on the device to change selection to booting to recovery
    9. Use the power button to select boot to recovery
    10. … You should see the TWRP splash as you boot to recovery
    11. Wait for this to load
  8. You’re almost there!
  9. We need to grab the timur files now. I was a little thrown off when navigating the FTP, but you only need TWO files: the host and the services files.
    1. Download timur-services-N7-2-511e-v3-2015-10-06.zip (or whatever the latest version of services is with 511-e is) into your folder created in step 1
    2. Download timur-usbhost-flo511-v3.0-2015-10-20.zip (or whatever the latest version of usbhost is with flo511 is) into your folder created in step 1
    3. We need to push these two files to the device’s internal SDCARD, so…
    4. NOTE: please use the correct file names in the following commands if yours are different…
    5. Type: adb push timur-services-N7-2-511e-v3-2015-10-06.zip /sdcard/
    6. Press enter to push the file… ADB should tell you if it worked.
    7. Type: adb push timur-usbhost-flo511-v3.0-2015-10-20.zip /sdcard/
    8. Press enter to push the file… ADB should tell you if it worked.
  10. On the device, press the big “install” button on the main part of the TWRP recovery
  11. Add both zips that you pushed to the device (remember, they are in the /SDCARD/ folder and you’ll need to make sure TWRP is filtering by zips)
  12. Flash ’em…
  13. Use TWRP to reboot… mine prompted me to install supersu. I opted for YES.
  14. As the phone is booting up, it may say some stuff about optimizing apps… If it does this for forever and then reboots and keeps doing this again for forever, it’s very likely that you mismatched the timur files… I encountered this problem twice and had to reflash the correct stock ROM again… so head back to step 1 🙂
  15. Once the phone boots up, go to about tablet under settings and check your kernel… It should say timur in there!
  16. If you saw timur in step 15… You’ve done it!

NOTE: If anyone goes through this guide and wants to suggest clarifications, please comment and I’ll try to update it.

Gotchas

  • I had to use the correct version of TWRP (the multiboot one) to get anywhere with this. I tried latest releases of CWM and TWRP but neither could seem to mount my system partition when doing the zip installs. This was incredibly frustrating and probably chewed up around two to three hours of my time debugging. I tried rooting etc… Nothing would fix it. The ONLY thing that seemed to work was TWRP multiboot.
  • My first pass through getting timur kernel installed resulted in a bootloop, which was super frustrating. Timur called out specific builds of Android that his kernel works for, and even though LMY48G wasn’t listed, I guess at which files to use and it failed miserably. Lesson learned. This is why i suggested flashing one of the supported stock Android images RIGHT at the beginning. If you don’t get everything lined up (and he’s explicit about this… I was just being dumb) then you will very likely encounter problems and need to redo everything.

PROFIT HOT 50 – Weekly Article Dump

Magnet Forensics - Ranked #7 in Profit Hot 50!

PROFIT HOT 50

It’s with great honour that I can say the company I’m part of, Magnet Forensics, has achieved the 7th place in the Profit Hot 50 rankings for 2013. Last year Magnet Forensics was also on the list ranked at number 16th, but we’ve shown ourselves up by moving a full 9 positions! Our ranking in the Profit Hot 50 is even more impressive considering we’re the only company from Kitchener-Waterloo region in Ontario–Known for it’s incredible startup community and success stories–that made the list. We’re excited and tremendously proud of our accomplishments, but it’s certainly going to be quite the challenge for us to move up in rank next year. It’s a challenge we’re all ready to take on though. You can check out the ranking over here or at the official Profit Guide posting.

Articles

I’ll put the horn-tooting aside… even though it’s an incredible accomplishment (not sure that I mentioned that already).

  • Don’t Be A Perfectionist: Ilya Pozin discusses the downsides to being a perfectionist. Often, people call themselves perfectionists when they can’t think of some other weakness they might have (you see it a lot in interviews) and because they think it’s a loop-hole in the question. I mean, if your weakness is that you’re perfect… how can that be a weakness, right?! Well in reality, aside form being a cheesy way to answer an otherwise good interview question, perfectionism can certainly be a problem. Especially in a fast-paced startup environment, we’re often not hunting for perfect. We’re hunting for 80% perfect with 20% of the effort. It’s the only way we can keep moving fast and get products or services to our customers. Besides, we don’t know what “perfect” actually is… Our customers do. And if we never get anything to them, how the heck can we ever know what perfect is?
  • How Goofing Off Can Make You More Successful: In this article, Adam Rifkin discusses over work. It’s a great tie in to the articles I shared last week about burnout. Adam talks about why we often find ourselves in situations where we feel like we’re forced to over work to be successful and shared a handful of suggestions for how to avoid it. His top 3: Doing nothing. Socializing. Helping others. Sound counter-intuitive to your poor overworked soul? Well kick back, relax, and have a good read through his post 🙂
  • The New Rules for Career Success: In Dave Kerpen‘s article, he shares some answers from Dan Schawbel about what it means to have a successful career. Among the top points, Dan suggests looking inside your current company before looking for opportunities elsewhere. This is a a key point because instead of becoming a chronic company hopper you can actually look for other great opportunities in the company you’ve already invested yourself in. Additionally, Dan suggests acting like an entrepreneur at your current job. If you’ve already proven yourself successful at your role, look for side projects that can benefit your company.
  • The Part They Don’t Tell You About Startup Team Building: The end result of becoming a good leader is often that you obsolete yourself in your current job. It’s a strange truth about the position: You start off taking on a large workload and then lead others so that they can effectively take on your portion and more. Where does that put you as a leader though? Tomasz Tunguz discusses this leadership role evolution in his article.
  • Raspberry Pi + WordPress => PiPress: This is a bit of a shameless plug, but I thought it might be cool for any tech-savvy bloggers out there who are looking for a bit of a DIY. After reading all over The Internet for how I can use my Raspberry Pi, I discovered I could use it to host a blog. So, for what it’s worth, the text you’re reading right now is coming from a little computer just a tad bigger than a credit card.
  • The 7 Things That Will Stop You Getting Things Done: Do you find there are a lot of things throughout your day that cut into you working efficiently? Bernard Marr has a nice list of things that are likely chewing up your time and a handful of solutions for how you can minimize the effect they have on your life.
  • Business is Over: My New Post-Workday Transition RoutineJeanine O’Donnell uses a BBB acronym for helping her transition from work-mode to home-mode. How do you handle separating your work-life from your home-life? Is there even a separation for you?
  • The Business World Can Tear You Apart – If You Let It: Even after achieving financial success and success in your career, sometimes there’s just something missing. Joel Peterson shares some tips for how you can keep your career focus from taking away from the finer things in life.
  • 6 Ways to Put the Good (Bad and Ugly) in Goodbye—Part II: Last week I shared a post about a great example of how to say to goodbye to your employees when they’re leaving for other opportunities. This post by Chester Elton builds on that with more positive examples, but he also shares some downright terrible ways that people have been “let go” by their employers.
  • Adventures in Cat (and Dog) Sitting: What I Learned about Managing People: If you don’t know what your pets have in common with your employees, Whitney Johnson can help you out with that. Why is this comparison necessary? Well if you think about how some people treat their pets (letting them out for walks, feeding them when they need it, belly rubs, petting, etc…) there are a lot of parallels with your employees… Well, there should be. Your employees deserve a good environment to work in, being acknowledged for their hard work, and having engaging work.

That’s it for this week! I hope you checked out the Profit Hot 50 article I mentioned above. Follow Dev Leader on popular social media outlets to get these updates through the week!

Nick Cosentino – LinkedIn
Nick Cosentino – Twitter
Dev Leader – Facebook
Dev Leader – Google+

You can also check out Dev Leader on FlipBoard.


Raspberry Pi + WordPress => PiPress

Raspberry Pi

Background

In the past, I’ve dabbled a bit with hosting my own server on a spare outdated box that likely should have been thrown out. My least favourite thing to do is sit down and tinker with trying to get services and such configured so that they all work together… But once it’s working, it’s glorious. Enter the Raspberry Pi.

Earlier this year I decided I wanted to get a Pi. Why? I wasn’t too sure… But they’re cheap and nothing bad could come of it 🙂 Once I got the thing up and running I was reading about how people were using them. Hosting a WordPress site was definitely one of the uses, so I figured I’d try my hand at that. There are other guides on The Internet about how to do this, but this is what got me up and running.

Disclaimer: A *lot* of this is taken from IQ Jar where there’s been an absolutely amazing outline posted. Although I am repeating a lot of the same steps here, I wanted to post what I felt was a complete install guide. I found myself going back and forth between a few resources, so hopefully this will reduce that issue for you. I do very highly recommend you have a look at IQ Jar though.

Raspberry Pi: What & Where To Buy?

This part is pretty open ended. Let’s start with the “what” portion of things.

The Raspberry Pi is just the board. If you’re totally content with buying a board without a case that you can’t even power up, then you’re all set. Although, if that’s the case, you probably don’t need to read anymore of this! It’s common to pick up the following to get your Raspberry Pi working:

  • Raspberry Pi
  • Case
  • Power Adapter
  • SD Card

But once you’ve got those things, you still can’t do too much with your Raspberry Pi aside from powering it up. Some other things you’ll likely want:

  • USB Wireless Adapter
  • USB Keyboard
  • HDMI Cable

NOTE: Pay special attention to what wireless adapters and SD cards can be used with a Pi out of the box. You’ll want to save yourself the headache if others have confirmed the parts you’re looking at purchasing are compatible.

So now that you have an idea what things you’ll need to pickup, where do you get them? If you search The Googles for where to buy any of this stuff, you’ll probably get a ton of hits. Maybe that’s not totally useful for you. I’d suggest the following sites:

  • Amazon: I got everything I needed off of Amazon in one fell swoop. You can even find some combo deals that include the Raspberry Pi and a case. Heck, some even come with the SD card too!
  • ModMyPi: A great resource… There’s tons of options on this site and it’s specifically for the Pi. Probably can’t go wrong by looking here.
  • Ebay: Ol’ Faithful. Lots of options here too, just like Amazon. Bound to find something that fits the bill.
  • Newark: There are a great deal of product offerings and resources on Newark. Check them out for full packages, accessories, and additional guides/walk-throughs.

The Walkthrough

First thing: there are a million ways to do this. I’m not going to explore all the options here because I’m not an expert and because I want to provide you with my own steps that worked for me. As soon as I deviate from that… Things will get messy and complicated 🙂

  1. Download a Raspbian “Wheezy” image from the Raspberry Pi website. This is the image of the operating system your Pi will use.
  2. Download Win32 Disk Imager. You’ll need this to get the image of the operating system onto your SD card.
  3. Once both downloads have completed, run Win32 Disk Imager and use it to write the image to your SD card. You’ll need a card reader/writer in your computer, but this is pretty standard these days.
  4. Take your card out of your computer and pop it into your Pi. You should have your Pi all setup now with power, USB keyboard, USB WIFI adapter, and an HDMI cable plugged into your TV/monitor.
  5. When you power up your Pi, you should be taken to an initialization/configuration menu. If it ain’t working, there are a million and one trouble shooting guides.
  6. Some things I suggest you get going while you’re here:
    • Reduce graphics memory to the minimum (16). Should help with performance.
    • Give yourself a modest overclock. Not sure what’s deemed safe, but I went somewhere in the middle.
    • Enable SSH. Later on you’ll never even need to be near your Pi. I can actually control my Pi from my phone with this sweet app.
  7. Once you’ve got things how you want, expand the file system and reboot your Pi.
  8. When the Raspberry Pi is back up and running, you need to login to your credentials and then type “startx” and press enter. This will get you into the GUI portion of things.

Anyone well versed in *nix may not need or want to do this, but I found it easiest this way. At this point, get your wifi and everything setup. Your blog won’t be very useful if your Pi isn’t on the internet. Having the GUI portion of Raspbian will also let you quickly search the net and pull up articles if you’re running into any oddities with the components you bought. Anyway, now that your Raspberry Pi is working with all the parts you purchased, on with the rest of it:

  1. Open up a terminal. You’re going to need it for basically everything else in this guide. We’re going to start by turning your Raspberry Pi into a LAMP server.
  2. Type “sudo apt-get update” to update the various packages on your Pi.
  3. sudo apt-get install apache2” to download and install the Apache web server. You’ll want to say yes when it asks for confirmation (and same whenever this happens for the other packages we need to install).
  4. sudo nano /etc/apache2/apache2.conf” to open up the apache configuration. You’ll want to stick “ServerName localhost” at the very end of this file and then save and exit the editor. This will get rid of warnings about determining the server’s domain name.
  5. Restart apache by using “sudo service apache2 restart“. Amazing. You now have a web server.
  6. You’ll need to take care of any port forwarding to make sure your router does it’s job to get to your Pi.
  7. Next is installing PHP: “sudo apt-get install php5
  8. Type “ls /usr/lib/php5/” and take not of the entry that looks like “20100525+lfs“. Yours might be slightly different.
  9. sudo nano /etc/php5/apache2/php.ini” to open up the PHP configuration. Find the line that starts with “extension_dir” and change it so it looks like: extension_dir = “/usr/lib/php5/20100525+lfs/” (except with the name of the entry you have if it was different!)
  10. sudo nano /etc/apache2/apache2.conf” to open up the apache configuration. You want to verify you have this line in there: Include conf.d/*.conf
  11. Next up, you’re going to need to make a config file for Apache. This can be done by typing: “sudo nano /etc/apache2/conf.d/php.conf” and then putting the following text inside of the file:
    # PHP is an HTML-embedded scripting language which attempts to make
    # it easy for developers to write dynamically generated webpages.
    LoadModule php5_module modules/libphp5.so
    #
    # Cause the PHP interpreter to handle files with a .php extension.
    AddHandler php5-script .php
    AddType text/html .php
    #
    # Add index.php to the list of files that will be served as
    # directory indexes.
    DirectoryIndex index.phpSave and close nano when you’ve finished.
  12. To improve the performance of PHP, install APC by typing “sudo apt-get install php-apc
  13. Now that you’ve finished that, restart Apache: sudo service apache2 restart

Next we need to get MySQL up and running. This is going to serve as the backend for your WordPress installation.

  1. sudo apt-get install mysql-server mysql-client
  2. Follow up with the MySQL plugin for PHP: “sudo apt-get install php5-mysql
  3. Now that you’ve finished that, restart Apache: sudo service apache2 restart

Next we’re actually going to install wordpress!

  1. In your terminal: “sudo wget http://wordpress.org/latest.tar.gz
  2. Then extract the whole thing: “sudo tar -zxvf latest.tar.gz
  3. From here, you can either follow along with the official WordPress Setup instructions, or just do what I did. If you want to do what I did, just keep following here!
  4. We need to make a user in MySQL:
    1. In the terminal: “mysql -u <YOUR_ADMIN_USERNAME> -p” and hit enter.
    2. (Obviously where it says <YOUR_ADMIN_USERNAME> you should replace with the database admin username you picked)
    3. Enter your password as the prompt suggests and press enter.
    4. Next up: “CREATE DATABASE wordpress” to make the database named wordpress.
    5. And now we set privileges: “GRANT ALL PRIVILEGES ON wordpress.* TO “wordpress”@”localhost” IDENTIFIED BY “<YOUR_PASSWORD>”;” and press enter.
    6. (Again, it’s hopefully obvious to replace <YOUR_PASSWORD> with your password)
    7. FLUSH PRIVILEGES
    8. And then finally “EXIT
  5. For my install, I put WordPress right at the root of my website. To do this, we need to copy the contents of the wordpress directory to your /var/www/ directory, but we’re *NOT* copying the wordpress directory itself there: “cp -a wordpress/. /var/www/
  6. And now, we run the install script! Since we installed WordPress to the root of the website, we go to http://127.0.0.1/wp-admin/install.php in a browser. Follow the few simple steps there and you should be up and running!
  7. Remember to check the troubleshooting section on the WordPress site if something seemed to go wrong!

That’s it! You should be up and running.

What’s Next?

You might find your site is a little slow. That’s somewhat expected on your little Rapsberry Pi. Don’t fret. There are lot’s of methods for optimizing your site.

  • Check out WP Super Cache, or specifically, the guide over at IQ Jar for more information on tweaking this (it’s near the bottom of the post).
  • There’s minifying plugins for javascript and CSS files. This can do a nice job compressing the files and reducing how much data has to be transferred.
  • You can look at something like Smush.it to help with compressing your images that you serve. Again, smaller means faster.
  • Finally, you might want to test your site on GTmetrix to see if it can recommend any other optimizations to you.

Summary

To wrap up, I hope you found this guide informative. I thought a Raspberry Pi was a great way to start a little DIY project at home and it was fun to get a blog up and running on it.

References

I’m sure I consulted a million and one guides on the Internet, but the following that stick out to me (and I highly recommend you look into them):

  • IQ Jar: Crucial for getting me up and running. Specifically, these two guides here and here.
  • WordPress.com: The detailed guide here for installing WordPress once you have all the prerequisites was definitely necessary.
  • GTmetrix:  Serving content was relatively new to me. Once I was analyzing my page with this site, I was lead down a rabbit hole of different things to try and optimize. I highly recommend it!

  • Nick Cosentino

    Nick Cosentino

    I work as a team lead of software engineering at Magnet Forensics (http://www.magnetforensics.com). I'm into powerlifting, bodybuilding, and blogging about leadership/development topics over at http://www.devleader.ca.

    Verified Services

    View Full Profile →

  • Copyright © 1996-2010 Dev Leader. All rights reserved.
    Jarrah theme by Templates Next | Powered by WordPress