Categories
Android Hacking Hardware Linux Science and Technology

How My Love Affair with Google Ended When I Decided to Stop Being their Unpaid Beta Tester

(This blog post was originally started back in 2016 when I decided to give up on Android for good. I never got around to posting it, even though it’s basically finished, and I still agree with it today! You can pretty much just replace any mention of “Nexus phones” in your head with “Pixel phones” and the argument still works.

With Google seemingly losing interest with Pixel phones in mid-2020, the post is just as relevant today as it was nearly five years ago.)

Logo for Android Version 4.4

The Passion of the Android

Spend a little while on any site that focuses on anything Android, whether it’s phones or apps, and you’ll quickly realize that the Nexus phones produced by Google are held in esteem above all others.

Their specs are lauded.  Their problems glossed over.  Their ability to “always have the latest OS version” (an ability iPhone owners take for granted) unlike phones you get directly from cell phone companies (think AT&T and Verizon), is held in the highest regard, especially.

To the visitors and commenters on these sites, the ability of a Nexus phone bought from Google, to have the newest version of Android before all other phones in the massive Android universe is more important than anything else, be it a sacrifice of 1) speed (because of the higher memory usage of newer software versions), 2) reliability (because of the presence of hidden bugs inherent in all new software), or 3) compatibility (because of app makers not always being able to get new versions of apps release in time to support new versions of Android, if something has broken the app).

All sorts of reasons are brought up for why this is best.  “The phone companies don’t want to upgrade the Android versions on their phones in a timely fashion because they’re lazy and don’t care.“  “The phone makers (also called OEM’s) don’t want to upgrade the Android versions on their phones in a timely fashion because they want you to buy a new phone.

Since version 2.3 of Android, the version of Android running on your phone has been far less important because of Google Play Services

While there are very important reasons that upgraded software on your phone is important (like security fixes, patches, etc), the insane concern for the version number on your phone always being the latest defies all understanding.  Since back in the Android 2.3 days, the Android team at Google even moved most of the important parts of Android (the fun parts that get updated) into a standalone app called “Google Play Services” a few years ago to combat the problem of OEM’s and cell phone companies not updating the Android versions of their phones.

If you have an Android phone, you can go into the full list of apps installed in your settings and see “Google Play Services” there — you can’t stop it from updating, and no one, including the cell phone companies and OEM’s, can stop it either.  This way, even older phones running older versions of Android can still have compatibility and quite a bit of neat new features that newer versions of Android get (like the Android Device Manager, Android’s answer to the iPhone’s “Find My Phone” feature).  The changes to this hidden service layer are subtle, well tested, and ensured to not cause any problems in the massive universe of different Android phone types.

Getting a fully new version of Android is less important in this way, but still offers some benefits here and there (like encryption being a default setting in Android 6.0).  Still, cell phone companies and OEM’s only release full new versions of Android for their phones after months, sometimes a year or more, of testing.  Why is this important?

Yo, do you even test, dude

When you’re a company like HTC (my favorite Android phone maker), or a cell phone company like Sprint, you live and die by your core product. If you work at HTC and your phones suck when it comes to reliability or user experience (or UX), you’re toast.  If you work at Sprint and your service is slow and the phones people buy from your stores don’t work (even though you don’t make them), people stop buying your phones and recommending your service to their friends.

The iPhone/iOS team at Apple does this behind the scenes for months with their products, both phones and operating systems.  Car companies do it for their car software.  Your microwave uses software that was tested for years to make sure the buttons always worked when you pressed them, and to ensure that it didn’t set your food on fire.

Why I bring this up is because I’m reasonably certain, after years of using Nexus phones, that the Nexus team at Google either doesn’t do this type of UX testing, or does it very, very little.

And why would they?

Google doesn’t make money selling phones.  It’s a B2B (business-to-business) company that makes 90% of its profits selling ad space to commercial entities (I went through the work of looking through its investor documents, found here (page 32): https://abc.xyz/investor/pdf/20160331_alphabet_10Q.pdf)  Everything else Google does is minor, and whatever minuscule amount of profit it makes from selling Nexus phones is an even smaller part of that.

Google doesn’t make money selling phones.  It’s a B2B (business-to-business) company that makes 90% of its profits selling ad space to commercial entities

…and there’s nothing wrong with that.  The employees of Google are very good at what they do.  They should focus on their core business, and put the bulk of their resources into effectively selling ads.



		
Categories
Computing Linux Science and Technology Ubuntu

rsync to AWS using .PEM key

Took me a little while to figure this out, but it’s a pretty standard implementation of the rsync command — you use the “-e” command and then specify an entire ssh command to use, like below:

function amazonrsync {
rsync -rave “ssh -i ~/.ssh/AWS_key.pem” $1 $2
}

That’s an entire shell function, by the way, that makes the whole thing easier to use.  Feel free to put it in your shell alias file.

Source: Rsync to AWS EC2 Using .PEM key – AnthonyChambers.co.uk Blog

Categories
Computing Hacking Internet Linux Programming Science and Technology Ubuntu

OpenVPN One-Command Server Install Script

I have been looking for a script like this for about a year now:

https://github.com/Nyr/openvpn-install

For some reason that I never understood, installing and setting up an OpenVPN has always been a pain in the ass.  I’ve had one I’ve been using for about a year, but it’s on Amazon’s AWS as was installed through an appliance install, and I really wanted to learn how it worked myself.

Every tutorial I saw either didn’t make sense, or the steps didn’t work.  I set about to try and create a one-script install myself, and then thought, “No — somebody has to have done this before.”

And lo and behold — that’s where I found the above github repo.  It’s amazing, and it works.  I’m going to donate to this person, because they saved me a good bit of work.

 

Categories
Computing Hardware Linux Ubuntu

GeekBench for Linux ARM?

Just got a Rasberry Pi and you’re wanting to benchmark it against other computers that you’ve benchmarked with GeekBench?

It’s not possible, for the most part — no release version of GeekBench for the ARM platform exists, but the creator of GeekBench did release a one-time build of GeekBench 2 a while back:

Source: GeekBench for Linux ARM? / Geekbench / Discussion Area – Primate Labs Support

Categories
Internet Linux Programming Science and Technology Ubuntu

mysql_connect() breaking with an upgrade to PHP7?

mysql_connect() has been finally removed from PHP7 (it was deprecated for some time), and now you have to use mysqli_connect();   The same goes for any other mysql_ commmand.  (I simply did a find/replace for “mysql_” and changed it to “mysqli_” in my php code.

Also, if you’re running your own server, you probably need to install the “php-mysql” after upgrading to PHP7 — it doesn’t seem to be installed along by default anymore.

Categories
Hacking Linux Programming Science and Technology Ubuntu

Using Dreamhost’s VPS as a MySQL Server

[Editor’s Note: Dreamhost no longer allows sudo access on their VPS servers, so the below is no longer possible. If you’re reading this, you might want to check out Amazon’s AWS. Nowhere near as user friendly as Dreamhost, but MUCH more powerful.]

I’ve been a happy customer of DreamHost for many years now — for $9.95 a month, I was able to get loads of diskspace and unlimited bandwidth, all from a great company that was staffed by great people who were very technically competent.

It is “shared hosting,” however — that means you’re getting it that cheap because you’re sharing server CPU power, available RAM, etc, with many other people who are also getting a great deal. You’ll notice this in any WordPress sites you may run on Dreamhost’s shared hosting — there’s about a 7-10 second delay between when you navigate to your site and when your page actually loads, mostly because your server processes are waiting in line behind everyone else’s.

So, Dreamhost does offer a “VPS” service — with this, you’re getting an absolute amount of RAM, CPU power, etc, that will only be used for your sites. It’s a tiny bit more expensive, at $14.95 or so a month, but it’s worth every penny.

If you’ve run WordPress installations on a Dreamhost site, though, you know that your mysql databases are on a seperate server entirely, and that may slow things down as well. Even if you move your WordPress installs to a VPS, your mysql databases will still be on shared hosting. DreamHost offers a “MySQL VPS,” but it costs another $15 a month (minimum), and you have no control over it at all.

A better solution would be to run your own MySQL server on DreamHost’s main VPS, since they give you root command-line access. There are a few hiccups in this process (some put there by DreamHost itself), but otherwise you should be able to do it.

  1. First, create an admin user for your VPS that has sudo abilities, and log into your VPS with that through ssh.
  2. Second, you have to tweak apt so you can even install the mysql-server package. It appears as if part of installing packages through apt involves temporarily storing files in /tmp and then running them from there.Unfortunately, the /tmp directory is mounted on DreamHost’s VPS servers with the noexec option, which means that you can’t run files that are present in that directory. That basically prevents you from installing the mysql-server package until you tweak apt to temporarily stage files in /var/tmp instead. Do this by:Creating a file called apt.conf in the /etc/apt/ directory, and edit it so the contents are the following:
    APT::ExtractTemplates::TempDir "/var/tmp";
  3. Then, install the mysql-server package:
    sudo apt-get install mysql-server;
    

    (When it asks to set a root password, make sure and set one.)

  4. Now, edit the file /etc/mysql/my.cnf and set the following options:
    bind-address=psXXXXX.dreamhostps.com

    (Replace psXXXXX with the name of your dreamhost VPS.)

  5. Restart your mysql service:
    sudo service mysql restart

At this point, you should be able to log in to your new mysql server:

mysql -u root -p

and then perform what SQL functions you need to.

A great thing to do is to install phpmyadmin using the tutorial here: http://wiki.phpmyadmin.net/pma/Quick_Install

First you’ll want to create a user (that isn’t your root user) to log into phpmyadmin:

mysql> CREATE USER ‘newusr’@’%’ IDENTIFIED BY ‘your_password';
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘newusr’@’%’ WITH GRANT OPTION;

At this point, you can sync your old databases to your new mysql server using the built-in sync tool that’s in DreamHost’s installations of phpmyadmin.  Then, just edit the wp-config.php file in the folder of your WordPress installations, and change the line that says the following to your DreamHost VPS:

define('DB_HOST', 'psXXXXXX.dreamhostps.com');

Sources:

http://howtogetitworking.com/2011/06/28/installing-mysqld-dreamhost-vps/

https://bugs.launchpad.net/ubuntu/+source/debconf/+bug/90085

http://serverfault.com/questions/72356/how-useful-is-mounting-tmp-noexec

 

 

Categories
Life Linux Ubuntu

Converting Your Existing Ubuntu Installation Into a VirtualBox Virtual Machine

Update for 2018: some of the commands have been changed  below to reflect new  possibilities present in Ubuntu 18.04, namely the excellent losetup command.)

I often find myself in the position of having to transfer all my files, applications, and other configurations that make my laptop “mine” onto a new laptop.

What’s so strange about that, you might add? Well, I go through all of this once every six months.  It’s not that I keep buying new computers — I don’t.  But I often obtain them in other ways — I trade, I help someone buy a new computer and in turn get their old one, etc.

So, tired of having to constantly re-install everything (or, at the very least, if I’ve imaged one laptop to another, having to spend a week or so having to get everything running just right), I decided to just convert my current main computer into a VM that I could just run on any computer, running any sort of OS that’s enough to run VirtualBox.

(This tutorial was created with VirtualBox in mind, but other VM’s have similar ways of converting the final file after you get to about step 3 or so.)

It seems like it should be easy, and after a little bit of work, I found out that it’s not too hard.

  1. First, you’ve got to make an image of your current installation.  (This is much easier if you have your entire Ubuntu install on one partition, i.e., no /home partitions on another hard drive or partition.  You can probably figure out how to manage that, but this tutorial will be just for one-partition installs).
    • Boot your computer with another startup disk (CD, jump drive, whatever), and then perform the following command:
      • dd if=/dev/sda1 of=image.bin
    • “/dev/sda1” refers to the partition name that your main install is on — you can find this by doing a “sudo blkid” or “sudo fdisk -l”
    • “image.bin” refers to the output file that the image will be contained in — this can be anywhere you want, but set it to a location that’s not on the hard drive you’re trying to image.
  2. At this point, I tried to turn the image.bin file into a .vdi file so that VirtualBox could use it for a virtual machine — the problem is, at this point, your .bin file is just a partition, and not a real “virtual” hard drive.  There’s no partition table, etc. — you have to simulate these things.
    • You do this by creation an empty “sparse image” where we’ll copy the image, simulating a hard disk, and then create a partition table:
      • dd if=/dev/zero of=newhd.img bs=1G count=0 seek=100
      • In this, “newhd.img”represents the location of the file we’re creating, and “100” represents the size of the virtual hard drive we’re creating, in gigabytes.  You may want to make this larger or smaller depending on the image you made.
    • Now, edit the image with “fdisk newhd.img“, and, following the commands presented in the fdisk interface, create a new partition table, and create a partition as large as the image you created. (The commands inside fdisk are pretty self-explanatory.)
    • Now, make the partitions available as individual devices to your system.
      • sudo kpartx -a newhd.img
    • Now, copy the original .bin file you made in step 1 onto the newly mounted partition:
      • sudo cp image.bin /dev/mapper/loop0p1
    • Now, run a disk check, and expand the copied partition to fill all of the available space, and then finally close the mounted partitions:
      • sudo e2fsck -f /dev/mapper/loop0p1
      • sudo resize2fs /dev/mapper/loop0p1
      • sudo kpartx -d newhd.img
  3. At this point, you should have a newhd.img file, which represents the entire hard drive you’ll virtually mount in your VM — the only step left is to convert it from a raw image of a hard drive into a .vdi file for use in VirtualBox:
    • VBoxManage convertfromraw -format VDI newhd.img newhd.vdi

The only steps left at this point are to create your new VM in VirtualBox, and then start it using this HD.  It more than likely won’t boot, so what you’ll need to do is start it with a livecd of your choice, and then fix the boot (I used the wonderful boot-repair utility available to Ubuntu).

 

 

Sources:

https://unix.stackexchange.com/questions/41137/convert-image-of-a-partition-into-image-of-a-disk-with-partition-table

https://superuser.com/questions/554862/how-to-convert-img-to-usable-virtualbox-format

https://askubuntu.com/questions/69363/mount-single-partition-from-image-of-entire-disk-device

Categories
Hardware Linux Science and Technology Ubuntu

HP Pavilion Touchpad Not Working (you need to “kick” it)

So, for about two days the touchpad on my HP laptop stopped working.  Of course it was right after a kernel update in Ubuntu, so I immediately blame that.  You know… because 9/10 times it is.

So, I’m checking and checking things but can’t find anything.  It’s weird.  It’s not like it’s not working correctly, or is misconfigured — it’s like Ubuntu, which is actually pretty good at picking up on hardware changes today, can’t even see it.  So on a hunch I reboot into Windows, but it’s not working there either.

So now, instead of having to tromp through the utterly useless Ubuntu forums (full of unresolved issues where people complain about some update or the other breaking something), I can now expand my search to various HP Windows forums. Where in about five minutes, I found this gem.

Apparently, on some HP laptops (or maybe all laptop hardware is set up like this, I’d honestly never encountered it before), you have to perform what’s called a “kick”:

  1. Turn off your laptop.
  2. Unplug your AC adapter.
  3. Take out your battery. (If you can’t take out your battery externally, time to pull out a screwdriver and start taking your laptop apart.)
  4. Hold down the power button on your laptop for at least 30 seconds, preferably more (just to make sure, since time is a relative construct perceived differently by all sentient forms of matter).
  5. Put in your battery, and turn back on.  Your touchpad should now be visible to your OS, be it Ubuntu or Windows, again.

Why or how this works is anyone’s guess.  I think it resets the BIOS (it seemed to do a strange double boot the first time plugging it in after performing this procedure, which is similar to what happens on a BIOS upgrade).  I’m just glad it does.

Categories
Hardware Linux

Fun stuff about home server management you don’t learn until you’re already knee-deep in problems

  • The hardware-based “Raid 1” hard drive mirroring (for safe data “insurance”) that’s built into most motherboards today isn’t real Raid 1 — it’s a type of “fake” Raid 1 that’s really just a fancy software wrapper: https://help.ubuntu.com/community/FakeRaidHowto
  • It’s actually really, really easy to control what hard drives are mounted (and to what directories) on Ubuntu by editing the /etc/fstab file.  Yeah, that’s about it.  No fancy programs you have to run or weird modules/packages to install.  No need to search through Google for hours thinking that “there’s got to be something more to it than that.”

 

Categories
Android Linux

Startup Script for CM9 on the Droid Incredible 2

There’s a small bug when running Cyanogenmod 9 (Android 4.0.4) on the Droid Incredible 2 — every time you reboot, you have to run the command “killall drmserver” as root, or you won’t be able to install or upgrade any applications.

Now, why this isn’t baked into the OS, I don’t know, but in lieu of having to start a terminal every time you start up your phone and run this command, you can actually create a startup script.

It’s never that easy on linux (seems to be different on every distro), but the way it seems to be done on CM9 is:

1) First, create the directory ‘/data/local/userinit.d’ with the following command:

mkdir -p /data/local/userinit.d

2) Then, create your script in this directory and make sure and make it executable (chmod 755, at least) — I had something like:

#!/system/bin/sh

killall drmserver