the ultimate android space clearing guide

If you’re running into that annoying problem where you can’t install yet another awesome app on your Android phone because you are running out of space, here’s the ultimate guide to freeing up app space *dramatic music*

1. Clean up app cache

Bansky street cleaner - Chalk Farm

Your phone stores apps on its internal memory card (not RAM, but the disk) including some temporary data for each app. That cached data is the first thing you can go and remove to free up space. Depending on the app, this can be quite some data. Think apps that download resources like video or images, create thumbnails etc.

You can do this manually with the internal app settings screens and go over each app individually. I bet you have better things to do though. Instead you can install ES Task Manager, which has a cache cleaner built-in and does the job for you. Sweet. There are plenty of alternative cache cleaning tools available if you don’t like the ES one.

2. Move apps to the external memory card

Still not enough space? Damn. To free up space on the internal memory card, you can also move some apps to the external card. If you have that option, you can use the application tools to move apps individually. Not all apps support this and it usually doesn’t free up all the space either. There’s always some core files that stay on the internal drive, so don’t expect any miracles. The best way to go about it, is to sort the apps by size and try to move the biggest ones first. But if that doesn’t do the trick you might want to…

3. Uninstall some apps

Yep. Makes sense doesn’t it. The bigger the better too. It sucks, but there’s probably some stuff in there you haven’t used in months. Time to say goodbye and press the delete button. Aah, instant free space.

4. When all else fails.

Still not working? I had that. My internal memory was showing 250MB of free space and I couldn’t get a 40MB app like Chrome to update anymore. Same thing with any other app around that size. They all failed to update.
It doesn’t make sense when you look at the numbers, but my guess is that it’s like with a fragmented disk drive on a PC. At some point there isn’t a large enough open space to fit the update file in one piece. Or that 250MB of free space isn’t just for apps. I’m not sure. But what I am sure is that resetting the phone wipes the internal disk space, and frees everything up again.

Photo by Dan Brady, cc-licensed.

a vim http log file syntax plugin

Log files are dull to look at. Lines and lines of text and no pretty colors to make it nicer to look at and easier to spot those weird errors you can’t simulate on your machine.

Vim rocks and writing a syntax file is supposed to be a breeze judging from the vast amount of syntax plugins out there. I didn’t quite find one I liked for syntax highlighting HTTP log files, so I thought I’d get down and dirty with some vimscript myself and see if I could hack something together.

It turned out alright I think. So to share the fun I’m hosting the logsyntax.vim plugin on Github and the vim.org scripts library for all to use. It highlights dates, HTTP verbs, URLs, IP addresses etc for IIS, W3C extended, NCSA and probably a bunch more typical log formats.

May your logs be pretty and colorful from now on.

The vim log file syntax highlighting plugin screenshot. Look at those pretty colors.

a wordpress full site spell checker tool

A while ago I noticed that some of my older posts had some silly misspellings in it, so I was looking for a way to spell check all my posts in one shot. I couldn’t really find anything that was free, so I figured I’d try to write something myself to do this for me.

I knew about the free and open source Hunspell spell checker and that you can use it from the command line. So I thought using that together with the WordPress export XML file which has all your post’s content it should be possible to spell check the whole lot.

The end result is a PowerShell script which reads out the XML export file and runs it through Hunspell, parses the spelling errors found and finally bundling it all into a simple HTML report.

It worked nicely for me, even though it’s pretty crude and simple. I only had to use this once, so I don’t see the point of fine-tuning it a lot further.

However this could be handy for others who want to do the same thing, so I cleaned it up a bit, slapped a readme file on it and posted it on Github as the WordPress full site spell checker.
Check it out if you want to spell check your WordPress blog in a single run and maybe this will be good enough to get your job done. You find more info on how to set up and use it on the Github page.

That very basic report I was talking about.

how to exclude yourself from WordPress analytics

I use a number of analytics tools to see how little hits I get a month and one of the things that annoyed me is that my own visits as I’m writing posts or looking up older posts also get counted. There’s a silly trick to avoid this and it’s so easy it’s stupid I didn’t think of it before.

WordPress has these widgets in the Appearance menu which make it easy to put all sorts of components in your sidebar and footer. I also use the Text Widget to insert snippets of custom javascript code in my pages, things like those analytics tracker code for example.

To exclude yourself from those stats all you need to do is make sure that code doesn’t get included when you are browsing your own site. Here’s how it works.

  1. Put your web analytics script code in a sidebar text widget. Leave the title empty if you don’t want anything to show up.
  2. Click the “Visibility” button at the bottom of the widget panel.
  3. In the options, choose “Hide” if: “User” is “Logged in”.
  4. Save.

You can set visibility options on WordPress sidebar widgets.

That’s all.
The cool thing is this works with any analytics tool (or any other custom javascript code you want to exclude yourself from) without having to figure out if it has any support for that itself.

find and delete duplicate files with just Powershell

... analog computer!

Consider this. You have the same files with different file names spread out over a bunch of folders. If you are on a recent Windows machine, Powershell is all you need to get out of that mess and delete the duplicates.
This also means you get to do this from the command line which makes it extra l33t.

Cool. Let’s get started.

ls *.* -recurse | get-filehash | group -property hash | where { $_.count -gt 1 } 
| % { $_.group | select -skip 1 } | del

Bam!
You’re done.

Alright. Here’s what going on in detail:

ls *.* -recurse             # get all files in the current folder and all subfolders
get-filehash                # calculate the file hash for all files
group -property hash        # group them by the hash value
where { $_.count -gt 1 }    # select those groups with more than 1 item
% {                         # for all groups
    $_.group |              # output the group content, which are the files
    select -skip 1          # select all but the first file 
   }                        # (we don't want to delete all of them right?)
del                         # delete the file

If you want to experiment with this I’d recommend you to change the last del command with something safer, like echo which just prints out the file.

Oh yeah, **DISCLAIMER**. Don’t just randomly copy past Powershell code and execute it on your machine if you don’t know what you are doing. Certainly if it’s deleting files like the example above. You might end up deleting more than you bargained for.  :)

Photo by James Vaughan, cc-licensed.

it’s raining hardcore this weekend: get some outside agency, teknoist & prspct beats

It’s been a while so let’s drop it hard thanks to some awesome mixed from our favourite Dutch cross-breeders The Outside Agency, UK madman The Teknoist and some PRPSCT radio bizzle.
Stream online or download them, all free. Your pick.

The Outside Agency lads just put out the first Outcast mix on Soundcloud. As usual, it’s full of hardness.

The Teknoist is placing on Bangface and wants the world to know. Nothing wrong with that IMO.

Then there’s always good stuff coming from the PRSPCT label. Their Soundcloud account is full of goodness, just like this recent one.

yo dawg I heard you like package managers

Let’s say you want to do this little web project, a SPA for example, and you want to settle for Angular as your JS framework. But downloading those scripts manually is so oldskool, so you need yourself a package manager to shoot those into your still empty project folder.

For example, with something like Bower, “the package manager or the web”:

bower install angular

Cool, so how do I get Bower?

npm install -g bower

Node Package Manager huh. Hmm. So I’ll need Node first. OK. I bet there’s a Chocolatey package for that.

choco install nodejs

Awesome! So how do I get Chocolatey (we’re clearly on Windows here, use your fav *nix distro package manager otherwise)?

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

Alright, now we’re talking!
What was I doing again?

As a Windows .NET dev you could also use Visual Studio Community 2013 of course, open up the Nuget Package Manager Console and run:

Install-Package angularjs

But how do you get Visual Studio (*)?
Oh, there’s Chocolatey again.

choco install visualstudiocommunity2013

Or maybe you can use WebPi…, or… argh. Never mind.

(Post inspiration by @mattiasgeniar)

(*) As a .NET developer you have this installed already of course, but to setup a new machine, Choco is the bomb.