Month: September 2012

Setting up Remote Scanning

At first, I couldn’t scan from my laptop with the scanner connect to my server.  So, here’s what I found to make it work.

First, this is my setup.  I have a Dell Inspiron laptop with Ubuntu 12.04 installed.  I use it wirelessly in my house.  Then, I have an HP Printer Scanner Copier 1315 hooked to my Home “server”.  That “server” is more of a desktop with server responsibilities, but it is also running Ubuntu 12.04.

Read More

My Server Configuration

These were the steps that I went through to configure my server after installing Ubuntu.  (just to help remember)

Installing SSH

My first requirement for a server is that I be able to get to it from my laptop.  SSH will allow me to both open remote terminal sessions and copy files from nautilus.

I simply installed this ssh metapackage from the Software Center.

My first attempt to connect brought me this message:

Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.

This was because I was reinstalling my server, and I had connected to the previous installation with my laptop.  The fix was easy (it was actually in the message):

ssh-keygen -R israel

To set it up to where I could connect without a password, I ran this command:

ssh-copy-id israel


I have an HP printer, so I chose to install the HPLIP Toolbox from the Software Center.

I could launch it through ssh with the command “hp-toolbox”.  Then, I chose the Setup Device option off the Device menu for my printer.

I selected USB:

Then, I selected the device:

Then, I entered the information about the printer:

This added, the printer.  Next, I made it the default printer:

To make the printer accessible over the network, I had to tweak the cups configuration.  I edited the /etc/cups/cupsd.conf.  I added a Listen line with the machine’s hostname.

I also turned “Browsing” on to make it easier to discover the printer.

To make the network name resolve correctly, I removed this line from /etc/hosts:

Finally, I restarted the cups service with the command:

sudo service cups restart

That gave me some access, but I still had issues.  Then, I found an easier way to do it.  I ran the the printer configuration:


On the printer dialog, there is a Server > Settings option.

There, I checked the sharing options to open things up for my private network.

Java Installation

I have a personal application that I use at home, and Java is a requirement for that.  I took the easy route and installed Java using Web Upd8’s method.  That just meant running these three commands:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

I confirmed that it installed with:

skp@israel:~$ java -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b55)
Java HotSpot(TM) Client VM (build 24.0-b22, mixed mode)
skp@israel:~$ javac -version
javac 1.8.0-ea

Finally, I needed to add a mysql user.  I don’t need to install mysql because it’s embedded into my application, but I do need the user.  I used this command:

useradd -r mysql


Packt Celebrates Their 1000th Title

You may want to sign up on Packt’s website!

From what I understand, Packt is publishing their 1000th book on September 30th.  To celebrate, they will be giving out two free surprises.  I don’t know what the surprises are, but they have been good to me so far.

Here’s the official text:

To celebrate this event with our readers, we’d be gifting them with not one but two assured surprises which would be revealed to them by the 30th of September, 2012. Anyone who is already registered or signs up for a free Packt account before 30th September 2012 is guaranteed a surprise gift.

So, head on over to their website:

Fixing APK Compile Error

I have been trying to change, decompile, and recompile Trebuchet to change the items on the dock and home screen.  I keep getting errors, and I think I have finally found the solution.

The output of the command is quite long, so let me post the beginning:

skp@chestnut:~/app/hd2/dev/work$ apktool b Trebuchet-orig Trebuchet.apk
I: Copying classes.dex file...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: /home/skp/app/hd2/dev/work/Trebuchet-orig/res/values-sw720dp-land
invalid resource directory name: /home/skp/app/hd2/dev/work/Trebuchet-orig/res/drawable-sw600dp-nodpi
invalid resource directory name: /home/skp/app/hd2/dev/work/Trebuchet-orig/res/drawable-sw600dp-land-hdpi

And, here’s the end of the output:

invalid resource directory name: /home/skp/app/hd2/dev/work/Trebuchet-orig/res/layout-sw720dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL1399953021396634018.tmp, -I, /home/skp/apktool/framework/1.apk, -S, /home/skp/app/hd2/dev/work/Trebuchet-orig/res, -M, /home/skp/app/hd2/dev/work/Trebuchet-orig/AndroidManifest.xml]
 at brut.androlib.res.AndrolibResources.aaptPackage(
 at brut.androlib.Androlib.buildResourcesFull(
 at brut.androlib.Androlib.buildResources(
 at brut.apktool.Main.cmdBuild(
 at brut.apktool.Main.main(
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL1399953021396634018.tmp, -I, /home/skp/apktool/framework/1.apk, -S, /home/skp/app/hd2/dev/work/Trebuchet-orig/res, -M, /home/skp/app/hd2/dev/work/Trebuchet-orig/AndroidManifest.xml]
 at brut.util.OS.exec(
 at brut.androlib.res.AndrolibResources.aaptPackage(
 ... 6 more

What I finally found, was that I installed an old or invalid version of aapt with apktool.  It was installed into /usr/local/bin…

skp@chestnut:~/app/hd2/dev/work$ which aapt
skp@chestnut:~/app/hd2/dev/work$ ll `which aapt`
-rwxr-x--- 1 skp skp 3747857 May 15 2011 /usr/local/bin/aapt*

The easy fix was to just rename this one installed with apktool.  Then, it pulled the one from my Android SDK intallation. (I already had the platform-tools directory in the path.)

skp@chestnut:~/app/hd2/dev/work$ cd /usr/local/bin/
skp@chestnut:/usr/local/bin$ sudo mv aapt aapt-broken
[sudo] password for skp:
skp@chestnut:/usr/local/bin$ which aapt

After that, it compiled fine!

skp@chestnut:~/app/hd2/dev/work$ apktool b Trebuchet-orig Trebuchet.apk
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...

Microsoft Outlook on Linux

I’ve been using Word and Excel on my Ubuntu for a while now.  For the most part, it works pretty good.  Just recently, someone asked me about how Outlook worked.

My personal preference is GMail.  I like the interface, and I like having my mail in the cloud.  When I refresh my computer, it’s one less thing to have to backup.  For a while, I did use Thunderbird.  It works natively on Linux.  Still, I’ll explore Outlook for a second.

For the instructions on installing Office, you can see my post: Ubuntu 12.04: Office and Play on Linux

Read More

HD2 Android Cooking

This is my first delve into cooking my own ROM for HD2.  I am not at a point where I can give step-by-step directions, but I wanted to post some of the things that I figured out so far.

Danial’s (dsixda) Android Kitchen

I have heard a lot about the Android Kitchen, so I thought I would try it.  It was an easy install.  I just had to download the zip file from Git Hub and extract it into a directory:

To launch it, I go to that directory in a terminal…

… and run the ./menu command.  That brings up the Kitchen menu.

Importing My First ROM

I started with the Paranoid Android – AOKP – Sourcery ROM.  I simply downloaded it, and placed it in the

Then, on the menu, I chose option 1 to create the working folder.

When it was done, it created this working directory:

Adding My First App

Just to make a small easy change, I decided to add an app to the ROM.  I have been using the Wifi Tether program, and I decided to bake that into the ROM.  It was as easy as placing it into the working folder under data/app.

This worked fine, but for some reason, the wireless tethering won’t work on my ROM.  The app works fine, but when it tethers, it gets an error.   That’s an issue for troubleshooting another day.

Changing the Default Background

I found some instructions that suggested using the apktool program to update the background.  But, rather than that, I just used the File Roller to extract and replace the files in the apk file.

I found the framework-res.apk file inside the system/framework folder in the working directory.  I opened the file with file-roller and I went to the /res/drawable-hdpi folder.  There I extracted the default_wallpaper.jpg.

I simply edited the image with Gimp and replaced it in the apk file.

This worked great at first.  Then, my old wallpaper mysteriously reappeared.  I assume that was from Google’s syncing my phone to previous setups.

Adding Chrome By Default

I unzipped my Titanium backup of Chrome to the System directory.

This made Chrome show up in the list, but it failed to run.  I ended up moving it to the /data/app folder of the ROM, and that fixed the problem.  Chrome was installed by default.

Note: I did the same thing with Swype.  I found it also had to go in the /data/app folder.

Changing the Launcher

The ROM that I started with has the Nova Launcher in it.  I did a little reading up on launchers, and I decided to try to the Go Launcher EX.

First, I removed the Nova Launcher.  I deleted the NovaLauncher.apk file:

I tried to download the Go Launcher from their website, but it mostly sent me to the market.  Instead, I installed it from the Market.  Then, I pulled it off the phone with adb.

adb pull /data/app/com.gau.go.launcherex-1.apk
adb pull /data/app/com.gau.go.launcherex.gowidget.weatherwidget-1.apk

I simply removed the NovaLauncher.apk from the /system/app folder.  Then, I added these two apk files in its place.  That gave me the Go launcher.

I tried that out for a bit, but then I decided to go back to Trebuchet.  So, I swapped the two Go apk files with Trebuchet.apk from another CM10 ROM.

Building the ROM

After all this, I built the ROM from the kitchen.  I just used option #99.

Then, I picked option#1, the interactive mode.  Then, I took the defaults.  It creates the zip file in the output zip folder.

I had a problem with the ROM flashing.  I think that it has to do with the “if” statements in the update script.  The kitchen didn’t translate it correctly.  So, I replaced the update script with the original script from the original ROM.

Later, I went back into it and found that I could remove the if, else, and end-if lines from the update-script in the working folder.  This takes out the feature that autodetects CLK vs. MagLdr.  But, it flashes on my phone fine.  I can figure that out later.


Enabling Chrome on My Custom ROM

On my latest ROM download, I found that Chrome wouldn’t work for some reason.  It said that it wasn’t compatible with my phone, but that really confused me.  I’ve had it running on my phone with no problem in the past.

I still haven’t gotten it to work.  If you know what I am doing wrong, please point it out.  Or, you might find a tip that will help you out.  In any regard, I can’t promise any answers.

Read More