Downloading APKs directly from Google without installing them

One of my too many hobbies is to tweak, improve and customize the firmware of some of my android devices. This often results in having to reinstall all the applications I like to have on a given device. It is possible to perform and restore backups but clean installs can be better when you are dealing with stability issues.

APK Downloader used to be a great website, but it has not worked for a while. I decided to look into alternative and found a simple PC program allowing you do to something similar. It is called APK Leecher and works really well. I recommend creating a dummy Google id to ensure you are not leaking your personal information, but so far it has worked great for me.

Extracting Javascript From PDF, and Replacing Javascript Into PDF

Not being able to find easy to use tools to extract the javascript code contained in a pdf file in plaintext, nor tools to update the javascript in a pdf without changing anything else. I wrote those two small command line java tools using the excellent iText library.

PDF2JS will extract the javascript from the pdf passed as argument. On windows an example way to use it is: “java -jar pdf2js.jar myinput.pdf”, and it will output the javascript in myinput.pdf.ps.

JS2PDF will replace the javascript in the input pdf file, and write the result into the output pdf file. On windows and example way to use it is: “java -jar js2pdf.jar original.pdf javascript.js output.pdf”, the file output.pdf will contain the updated javascript.

For those interested the very simple code for each tool is provided within the archives.

Also if the pdf file you are working with has usage restrictions, make sure you remove them using the excellent qpdf with the following command line: qpdf –decrypt protected.pdf output_unprotected.pdf

Impressive archiver with high compression rates: NanoZip

I have been using 7-zip for years as my default archiver, it is fast, it unpacks zip and rar files, and compresses into .7z files much smaller than similar zip or rar archive.

However, I just discovered NanoZip which although in early alpha is truly outstanding with decent compression speed and much smaller files than 7zip. So head and shoulders above zip and rar. The interface is still clunky but if you have an urgent need to fit more data into a small amount of space try NanoZip.

For more info check CompressionRatings.com and MaximumCompression.com.

Using Eclipse as IDE and Debugger for Python

Having decided to clean-up my machine, I had to find a solution for the Python mess. Having Eclipse for Java and C++, I decided to give it a try for Python.

Here are some of the benefits I found:

1. You can reuse the dev environment without additional install
2. Eclipse with PyDev is a unified IDE and debugger
3. It is a familiar environment
4. You can use both Python 2.x and 3.x for different projects in your workspace
5. Download and disk footprint are smaller than the best alternatives
6. It is super easy to install and use

Here are the simple steps to install:

1. Run Eclipse, go to Help menu, and click “Install New Software…”
2. Click the “Add” button, enter “http://pydev.org/updates” in location and click OK
3. Select PyDev, click Next and follow the install steps accepting the licence

Here is how to make a simple Python test project

1. Go to File menu, click New then PyDev Project
2. Enter your project name, select the grammar version, and interpreter. If you have not set up any yet, just click “Click here to configure an interpreter not listed”, click New, browse to your python.exe directory and click Ok.
3. Right click your project, then New, then Source folder
4. Right click your source folder, then New, then PyDevModule

Lightweight and free alternatives to iTunes for Windows

I love Apple products but iTunes has to be one of the worst piece of software I ever used on Windows. So I decided this week-end to find free alternatives, and I am glad I did.

1. Install iphone/ipod drivers without installing itunes with CopyTransDrivers. This will still require you to download iTunesSetup.exe but it is capable of extracting and installing only the drivers.
2. Use CopyTransManager to manage your playlists and copy music on your device
3. Use iFunBox to add data files to your apps

Enjoy your uncluttered machine now :)

Running Euler Math Toolbox on Linux Mint

Euler Math Toolbox is in my opinion the best free mathematical package, however it is for Windows and it does not fully run out of the box with the latest versions of Wine. Here are the few easy steps to fix this issue.

  1. Run “Synaptics Package Manager”
  2. If you have Wine already installed you can skip this test. Enter “Wine” without quotes in the quick filter box and press enter. Right click the first wine entry and select “Mark for Installation”
  3. Enter “Maxima” without quotes in the quick filter box and press enter. Right click the first wine entry and select “Mark for Installation”. Click the Apply button.
  4. Download the windows install for Euler Math Toolbox here, right click the file and “Open With” then “Open With Wine Windows Program Loader”
  5. Run Euler Math Toolbox with the desktop icon. Open the “Options” menu then “Symbolic Settings” then “Setup Maxima Call String…” and put “z:\usr\bin\maxima” without quotes in maxima executable line, click ok, and exit Euler Math Toolbox. Yes you need to close and reopen the app so that the new setting works.

You are done. You can test it with something simple like “&solve(x^2+1)” without quotes and Euler Math Toolbox should display the results as expected.

Updating to latest version of Wine with Linux Mint without using Terminal

Another example of Linux not being ready for mass market. If you want to update to the latest version of a software, if it is not yet supported in the default repositories you are on your own. And contrary to windows, it is not as simple as downloading and running a setup program.

  1. Click your “Menu” button then “Administration” then”Run Synaptic Package Manager”
  2. Click the “Settings” menu and then click “Repositories”
  3. Go to the “Other Software” tab, click “Add” and put “deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu precise main” without the quotes in the text box
  4. Click the “Edit” menu and “Reload package information”
  5. Enter “Wine” without quotes in the search box.
  6. If you have already had wine installed, right click wine, mark for upgrade, and click the big “Apply” button.
  7. If you did not have wine installed, right click wine, mark for install, and click the big apply “Apply” button.

That’s it.

Installing GIMP 2.8 on Linux Mint without using Terminal

This is the perfect example of why Linux is not yet ready for prime time. Installing the latest version of a software is not just about downloading it and running it as you would do on windows. Worse most of the solutions (see here and here) proposed require you to use the command line, which is a serious no go for beginners.

Being a Linux noobie myself I decided to learn how to install the software without using the terminal, and found a relatively simple solution.

  1. Click your “Menu” button then “Administration” then”Run Synaptic Package Manager”
  2. Click the “Settings” menu and then click “Repositories”
  3. Go to the “Other Software” tab, click “Add” and put “deb http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu precise main” without the quotes in the text box
  4. Click the “Edit” menu and “Reload package information”
  5. If you have already removed the old version of gimp you can skip this step. Enter “gimp 2.6” without quotes in the search box, right click, mark for removal, and click the big “Apply” button.
  6. To install the new gimp, put “gimp 2.8” in the search box without quotes and when it appears, right click, mark for installation, and click the big apply “Apply” button, and you are done.

That’s it to start Gimp 2.8 just go to “Menu” then “Graphics” and “GIMP Image Editor”

Logitech Solar Keyboard K750

My original wired iMac keyboard delete key broke, so I considered replacing it with a wireless keyboard. Unfortunately the Apple keyboard is terrible for me without a proper numerical keypad, so I looked at alternatives and decided to get the Logitech Solar Keyboard K750 and I am really satisfied with it.

The look matches the iMac design, it is wireless with a proper numerical keypad, no need of batteries thanks to the solar panels, and it also has a unifying small usb connector so that you can connect all your logitech devices to the same usb instead of needing several ones.

If you use Bootcamp and Windows, you might have issues with F1, F2 keys not working properly. Just download and install Logitech’s Setpoint software, and everything will work as expected.

Trying Eclipse for C++

I have been doing a lot of Java and Flash programming recently and both development environment have been relatively enjoyable with the Eclipse framework, so I decided to give it a try for C++. Yes I know there are other alternatives for C++ like Netbeans, Codeblocks, Codelite, and even MonoDevelop now. But having to be familiar with a single GUI is actually quite enjoyable.

  1. First download and install MinGW it will be your compiler. Untick everything except C compiler and C++ compiler.
  2. Get the latest Eclipse CDT it is the eclipse environment customized for C++.
  3. Launch Eclipse, open the “File” menu, then “New”, then “C++ project”
  4. Expand the Executable box (click on the left of it, sometimes the triangle does not show up on Windows 7). Select “Hello World C++ Project”, put a name, select “MinGW GCC”, and click Finish.
  5. Go to the “Project” menu and select “Build Project”.
  6. You should now be able to run the project and see “Hello world” in the console.

This seems all good, but actually when you try the simplest things like printf, the environment will have many issues like text not showing up. If you google for it you will find pseudo solutions recommending setvbuf( stdout, NULL, _IONBF, 0 ); but this makes things worse and create a whole lot of issues. The best is really to emulate the VS behavior and to have a separate console if you need one.

  1. Create gdbinit.txt in C:\MinGW\bin and put “set new-console” without the quotes in it.
  2. Go to the “Run” menu, then “Debugger” tab, and put  “C:\MinGW\bin\gdbinit.txt” without the quotes in “GDB Command Line” and click “Apply”

Now your printf will output to the external console as they do in VS, and OutputDebugString will output text to the Eclipse console.

Overall although the printf issue is kind of bad, at the end Eclipse seem like a good environment. I like things like CTRL+SHIFT+N to automatically add a missing include file. Next time I need to write a small C++ tool, I will give it a more serious try.