Skip to content


Getting started on debugging an Android app on Samsung Galaxy devices

I used that on a Galaxy S3, but probably this works with a lot more Galaxy devices. Also the first step is common to any Android device I think (at least where Android is recent enough).

Step 1: enable developer tools on your Android device:
Go to settings → More → About device (on the Galaxy S3, that’s at the bottom of the System subsection)
Tap 7 times on the build number (on the Galaxy S3, again that’s at the bottom of the section)
You should get a message that developer tools are now unlocked

Step 2: enable debugging:
After the previous step, go back to the menu screen where you previously found “About device”. You should have a new menu item (just above “About device” on a GS3) called “Developer option”.
Go there and enable USB debugging

Step 3: install Samsung USB drivers on your computer:
Grab the Samsung Android USB Driver for Windows there (or you can also use my mirror) and install them. That should work without a restart provided you didn’t have ADB running while performing the installation.

Now you’re ready to plug your GS3 and get compiling ;)

Sources:

Posted in programming.


[Titanium] Solving an early build failure

I believe this error message is quite standard at the end of a failed build in Titanium:
[ERROR] Application Installer abnormal process termination. Process exit value was 1

A probably rarer sight is when this occurs very early in the build, when few to none previous build messages are available to provide any clue on what the heck is happening. I had one of those lately, a failed build after just one single, unhelpful message, with a complete log consisting of just:
Titanium Command-Line Interface, CLI version 3.4.0, Titanium SDK version 3.4.0.GA
Copyright (c) 2012-2014, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
[INFO] : Found Titanium module id=ti.draggable version=1.0 platform=android deploy-type=test path=D:\PROG\PROGRAMMING\xxxxx\modules\android\ti.draggable\1.0
[ERROR] Application Installer abnormal process termination. Process exit value was 1

So I just searched for any possible solution, and gladly the first suggestion I found was a good one: simply delete the whole “build” folder, so as to recompile a whole new build from scratch (some corrupted temporary build file(s) I guess). Deleting the build folder, however, turned out to be quite a pain: I had permissions issue, Windows telling me I should be an administrator to delete that folder, even though I was one. I ended up booting to Linux just to delete that nasty folder (if you don’t have a dual boot, I guess you just won a live DVD ;)), but it worked, and so did the compilation.

Source, with additional possible fixes (although some of those were given as a solution to much more verbose build logs) is here: http://developer.appcelerator.com/question/142108/error-application-installer-abnormal-process-termination-process-exit-value-was-1

Edit a few hours later: Titanium really has a lot of potential generating such shitty errors. Another common sight is "build\android\build-manifest.json does not exist in Titanium Studio". Same kind of mess, same kind of fix. Note that another option is to use Project → Clean, but for me it didn’t work because that Titanium idiot somehow managed to create a file (I think that was build\android\assets\app.js) that it’s not able to delete itself. Even more options are presented in this stackoverflow post. Good luck, we all need it with those massively stochastic errors :s

Posted in programming.

Tagged with .


[Titanium] Solving no Android SDKs were found under the specified SDK location

It seems that with every Titanium upgrade comes a bunch of big, annoying issues. I just upgraded from Titanium 3.3.0 to 3.4.0, and this time the issue was Titanium wouldn’t see the Android SDK anymore. The proper error message was well hidden, at first all I could see was that Titanium wasn’t able to find my debugging device (and external LG 975) anymore. After upgrading the Android SDK (a few minor upgrades I believe) and messing around in the options, I eventually found a proper error message in Preferences → Studio → Platforms → Android (note that I have absolutely no idea how to reach that Preferences window without using the tool icon next to the OSes under “Deployment Targets” in the tiapp.xml GUI editor): “[Android SDK Home] No Android SDKs were found under the specified SDK location”.

So, Titanium couldn’t see the Android SDK, even though I indicated the proper path (very same as the one used with the previous version). Puzzling, as usual…

I found people mentioning this issue when upgrading to Titanium 3.2 from 3.1. Not really my case, but now I know/suppose that’s a recurring issue.

Then I found someone mentioning I should delete a specific config file, namely C:/Users/[username]/.titanium/config.json. I did, and it worked. As I was curious, I kept a copy of the old version, and then compared it to the new version. The only difference is that the new version removed an item at the end. The old version was:

{
	"user": {
		"locale": "en-us"
	},
	"app": {
		"workspace": ""
	},
	"cli": {
		"colors": true,
		"completion": false,
		"logLevel": "trace",
		"prompt": true,
		"progressBars": true,
		"failOnWrongSDK": false,
		"httpProxyServer": "",
		"rejectUnauthorized": true,
		"width": 100,
		"ignoreDirs": "^(\\.svn|_svn|\\.git|\\.hg|\\.?[Cc][Vv][Ss]|\\.bzr|\\$RECYCLE\\.BIN)$",
		"ignoreFiles": "^(\\.gitignore|\\.npmignore|\\.cvsignore|\\.DS_Store|\\._.*|[Tt]humbs.db|\\.vspscc|\\.vssscc|\\.sublime-project|\\.sublime-workspace|\\.project|\\.tmproj)$"
	},
	"paths": {
		"commands": [],
		"hooks": [],
		"modules": [],
		"plugins": [],
		"sdks": [
			"C:\\Users\\Admin\\AppData\\Roaming\\Titanium"
		],
		"templates": []
	},
	"android": {
		"sdkPath": "D:\\PROG\\PROGRAMMING\\adt-bundle-windows-x86_64\\sdk"
	},
	"sdk": {
		"selected": "3.3.0.GA"
	}
}

and the new version removed

	"sdk": {
		"selected": "3.3.0.GA"
	}

Source is here, and contains a few other things to try, in case this one doesn’t work for you…

Posted in programming.

Tagged with .


Our server exploded

Well, not really, but the result is quite similar. The server crashed early in the night, only this time a reboot didn’t help. There had been hard drive issues for a while, only I really didn’t have time to do yet another migration, and I was hoping RAID 1 would help (one of the drives had issues, but the other worked fine, without a single error in S.M.A.R.T. diagnosis) to remain online long enough until my schedule cleared up.

So, well, a few sites are back up, the others will take longer.

Some interesting lessons were learned, though:
– Murphy’s law has been once again verified
– when a server starts behaving strangely (like, Tor deamon stopping for no reason), trash it
– *particularly when you have diagnosed hard drive issues
– *and when the strange behavior also includes random crashes
– don’t rely on RAID 1 for proper redundancy at EUserv, their RAID controllers seem… well, a bit wacky. Either that, or I’ve been really massively unlucky with them. But their vKVM thing for dealing with non-booting servers is quite neat ;)
– don’t use a trial offer as a secondary DNS just because the quota is about good enough. At BuddyDNS I used to use my 300k monthly queries quota in about 25 days and finish the month without secondary, but after just 7 hours of downtime today that quota was used up. I may have missed a few e-mails :s
– don’t set your DNS serial blindly to the “recommended” format of YYYYMMDDXX without thinking it through first: once you’ve done that, it’s very hard to go back to 1, 2, 3, etc. (this is how I ended up on buddyDNS on the first place, because trying to go back to 1 2 3 broke my previous secondary DNS provider)
– some other lessons were learned, but promptly forgotten before making it into this post. The lesson for this is write down the lessons you learn as soon as you learn them.

Last but not least, very sorry for that downtime folks :(

Edit: well it turns out that all it took to bring the server back online was to run an fsck from the vKVM… Now smartmontools doesn’t even detect any fault on the “bad” hard drive, and more surprisingly, not a single reallocated sector either. The lesson to trash the server will still apply though (when I have the time), and this notepad stays on the new server anyway ^^

Posted in Uncategorized.


[Titanium] Unable to find Android SDK tools: zipalign

I recently upgraded Titanium, and possibly also my Android SDK (this is getting a bit messy, with the old SDK, used by Titanium, living along with the new SDK brought by the new, beta, Android Studio). And when compiling an app for Android, which I hadn’t done in a long while, I encountered this error:

[ERROR] : Unable to find Android SDK tools: zipalign.
[ERROR] : You have an incomplete or out-of-date installation.
[ERROR] : Verify your Android SDK packages or reinstall the Android SDK by running titanium setup android or manually downloading from http://appcelerator.com/android-sdk.

I opened the Android SDK manager, but no obvious package seemed to be missing. Finally, I found someone suggesting to move around that “zipalign” tool itself. So, I eventually found zipalign.exe in adt-bundle-windows-x86_64\sdk\build-tools\android-4.4W, and copied it into adt-bundle-windows-x86_64\sdk\tools. Success! :)

Also, thanks very much to the guy who posted a close enough answer there: http://developer.appcelerator.com/question/175598. Too bad his answer wasn’t marked as the proper solution, the chosen one is rubbish…

Posted in programming.

Tagged with .


How to back up freenet download list

Freenet has the annoying habit of corrupting its download database on a fairly regular basis, even when you don’t encrypt said database, and even when you run it from a very fast drive (even a RAM disk…). On top of that, it doesn’t provide an obvious feature to back up the download list. And as you probably have noticed, once the database is corrupted you can’t even show the list of downloads. So, what we need is an easy way to back up said list, easy enough to be run proactively on a regular basis without being much trouble.
It turns out there is an easy way, apart from the fact that it’s not shown on the Freenet interface. The list of current downloads can simply be obtained from http://127.0.0.1:8888/downloads/listFetchKeys.txt

Posted in software.


How to disable GZIP compression in Firefox

Sometimes, when debugging websites, it can be useful to use Wireshark to observe their network traffic. The only problem with that is that it doesn’t work with encrypted traffic, of course, but also it doesn’t work with compressed traffic. Gladly, Firefox can be configured to tell website that it will not to accept compressed web pages. For this you simply need to remove/empty the “accept-encoding” HTTP header:
– Go to about:config
– search for network.http.accept-encoding
– and empty it (default is gzip, deflate)

Et voilà, Firefox will now receive web pages without GZIP compression.

Posted in Firefox, web development.


Oops, they killed Gallery 3. Now what?

I’ve been neglecting my picture gallery lately. And when I finally found the time to upload a great, long overdue gym picture (I’m sure you’ll like it even if you don’t go to the gym ^^), I also took the time to have a look at the administration panel, particularly at the update section. And I quickly noticed the latest Gallery news, “Gallery is going into hibernation“, which sadly means the project is abandoned. Not much of a surprise, since development had been really slow, and Gallery 3, although it still seemed to me like the best choice, never really felt finish.

Gallery is GPL, which means that anyone with skill and time could take over, but it’s not enough to make sure a project continues, particularly when there are quite many alternatives – and even if those aren’t as good. Wikipedia has a list of photo gallery software, which seems quite exhaustive, except maybe it misses Zenphoto, which is kind of an intermediate between a gallery and a whole CMS.

After a brief overview of this list, and of the comments on the Gallery closure announcement, it seems to me that the best alternatives would be either Coppermine Gallery or Piwigo. What I like about Coppermine is that it keeps it simple and doesn’t overuse JavaScript. But the design feels really quite old, and hard to browse (notably, there doesn’t seem to be proper support for tags). So I’ll probably go for Piwigo. I read somewhere that they recently created a migration plugin to convert a Gallery 3 gallery into Piwigo, so when the time comes hopefully it won’t be too hard to migrate.

Final note: here’s a demo gallery using Coppermine, and one using Piwigo.

Posted in multimedia, open source.


aToaD #12: KeePass and KeePassX

If you follow the IT news closely enough, not a week goes by without a story of compromised credentials. For instance, a recent, really big one was reported there on Hold Security, with more than a billion credentials stolen from various vulnerable websites. Security being a race between those who make it and those who break it, I think we’ll always see such kind of news. Maybe fewer as website operators grow more careful, but still some.
Meanwhile, the impact of such hacks can be minimized by following trivial recommendations you probably read about many times already: use strong and unique passwords. Strong so that they can’t be bruteforced even if the site didn’t hash them very strongly (like, md5 with no salt), and unique so that even if the hacker eventually managed to get the clear-text version (non hashed storage – bad but still occurs more often than you think -, or if the server was compromised enough to capture passwords as people logged in), then it will only let them steal one account of yours, not all of them.

Those recommendations are trivial, yet many people know them but still don’t follow them. And if you’re one of those people, I suppose you know why: it’s just impossible to remember so many passwords. As I’m writing those line, my password database contains over 500 credentials… There’s just no way to remember that. The solution resides then in… a password manager. The concept is simple: put all your unique passwords into a database, and encrypt it with a single, very strong password which you must not forget. Down from 500+ to only one big password to remember, sounds like a good deal.

Many services provide that. You probably heard of LastPass, maybe also RoboForm. Those are close source (you usually want to avoid that in cryptography), commercial solutions. I’m not sure about RoboForm, but LastPass is cloud-based and when they have an outage you lose access to your passwords (happened about a week ago).
My personal favorite is KeePass, which is free and open source, and stores things locally, not in the cloud (you can should then back up the KeePass database using your favorite backup service(s) – possibly SpiderOak?). Unfortunately, it only works natively on Windows (although it should work on Linux and Mac OS via Mono). If you want a native solution under Linux, a possibility is then KeePassX, which is sadly still in alpha stages (although it worked pretty fine last time I tried it, it mostly lacks polishing and richer features).

For an extra layer of security, you can also configure your firewall to prevent KeePass from accessing the network. And each KeePass release is signed with the OpenGPG key of one of the developers, you can check that signature too (see this old post if you have no clue about OpenPGP).

Update (2014-08-21)

Well, as I was saying as an introduction, if you follow the IT news, you see those database hacks on a regular basis. Here’s one which hit the news just today: Data breach at UPS Stores in 24 states (CNN).

Posted in A Tool A Day, security.


How to give different headers to different pages in LibreOffice

Following my previous adventures with LibreOffice, I wanted to place chapter names in headers, which means different pages would have different headers… which doesn’t seem to have an obvious solution, since the way headers (and footers) usually work is “same stuff for every page” (even though this can mean same automatic field with a different value on every page).

Anyway, LibreOffice provides a way to set different headers via page styles. The “Style and Formatting” dialog (accessible via F11), which you probably already use to format text at the character or paragraph level, also contains a “Page Styles” part. When you edit page styles, you can set specific headers, but also footers, margins, and even paper format.

The way I worked was to create one chapter per file, then combine all files manually. In each file, I defined a chapter-specific page style (like you would define any other style), which I then imported into the merged file (in the “Style and Formatting” dialog, top-right menu button them “Load styles” and import from file – don’t forget to check “Pages”), before copy/pasting the content. I’m not sure if there’s a better way or not, but to switch between different page styles in the global document, I used page breaks (Insert → Manual break), where you can specify the page style to be used after the break (default value being “[none]“).

Useful information on the LibreOffice wiki too: Defining Different Headers and Footers

Posted in LibreOffice & OpenOffice.