Search This Blog

Start the Android media scanner from the command line

If you're like me, and let's hope for your sake that you're not, you find it much easier to run an SSH server on your Android device than using something like adb or USB Mass Storage or any of the other crap out there.

With SSH I can simply and easily check logcat, netstat, issue commands, copy files and generally bugger about.

Sometimes you have moved quite a lot of files around and you need your media scanner to launch to update its database. This can be done via the CLI.

Putting Windows XP to sleep remotely

Have you noticed that when connected to Windows XP via RDP that the Start Menu option for putting the machine to sleep vanishes? What the Hell is that all about?

It doesn't even make sense when you can wake the machine with Wake-on-LAN to reconnect if you need to. Saving energy not really a priority here.

To make things worse the Task Manager's menus have Standby and Hibernate disabled too.

You could mess about installing VNC, but why bother? Turns out the solution is incredibly easy!

Open a command prompt and enter:

 C:\> rundll32 powrprof.dll,SetSuspendState

That's it! The computer will enter Suspend.

If you're looking to hibernate the machine instead then:

 C:\> rundll32 powrprof.dll,SetSuspendState Hibernate

Job's a good un.

Now go install Linux.

.nomedia is recursive on Android devices

Just a small note but I thought I best mention it as not everyone realises this.

Your /sdcard can often have a lot of garbage in it that you do not necessarily want to appear in your Media Album.

A solution to this is to add .nomedia (a zero byte file) to the directories that you do not want the Media Scanner to scan. What you need to be aware of is that the Media Scanner will skip this whole directory and will not recurse into subfolders. The result being if you drop the file /sdcard/.nomedia then nothing on the SD card will be scanned nor added to the Media Library.

If you're one of those people who drops everything on /sdcard then you need to tidy it up a bit. /sdcard/downloads for example is nearly always the best place to drop your downloads, and you rarely want that stuff scanned. If you do then create new directories:


for example.

This way you can simply touch /sdcard/Porn/.nomedia so that it doesn't appear in your Media Album.

Installing gcc on OpenIndiana

This shouldn't have been such a difficult task, but it has taken me four days (on and off) to work it out.

Problem: Install gcc on OpenIndiana
Pain level: 8/10
Solution: Simple!

I Googled around a huge amount and all the articles I found were utterly useless. They suggested that once gcc is installed that is should be in /usr/sfw/bin, and the reason a configure script cannot find it is because /usr/sfw/bin is not in the $PATH by default.

Well, doing a pkg search gcc reveals a load of different packages, which is quite nice - it's always nice to have a choice, but after installing a bunch of them it didn't seem to make any difference. To be honest I have no idea what files have actually been added to my system, and I haven't yet worked out how to get the file list (yes, I'm a Solaris n00b).

Anyway: easy, really: pkg install SUNWgcc

And that's it! Solved! You don't even need to update your path. Marvellousfish.

$ uname -a
SunOS openindianaVM 5.11 oi_151a7 i86pc i386 i86pc Solaris


It should be noted that SUNWgcc has problems with .visible, but the gcc package cannot find it's own dependencies! (Binaries in /opt/gcc/4.4.4/bin). Buyer beware!
My profile on StackExchange