+day macha+


If Linux annoys me, and I think I can help it annoy you less, I'll post the information here.


bikeshed:

via asset.soup.io

"mtp" mobile phone devices in linux

MTP, a Microsoft invention, sits on a lot mobile phones and other devices these days. It’s a protocol that makes the transfer of media better/more convenient somehow (whatever is wrong with plain filesystems, I really don’t know…) Wikipedia has a list of devices it infects.

This doesn’t work to well with Linux, as with most Microsoft protocols. libmtp does support some devices, however. See if yours is listed here. As libmtp develops that list may become out of date. There’s a simple command you can type to see if your device is supported: ‘mtp-detect’.

If you receive something like ‘LIBMTP PANIC: Unable to read device information on device 12 on bus 0, trying to continue. Unable to open raw device 0’ or other errors occur then you’re out of luck, I’m afraid. If you don’t find any critical errors, then I suggest you try ‘mtpfs’ — you can view your phone’s files in a filesystem format.

unit testing

Note to self: you don’t really understand your function until you unit test it.

There exist counterexamples to this, but in general, great things are accomplished by small groups of people who are driven, who have unity of purpose. The more people involved, the slower and stupider their union is.

Errors: Alsa, dmix, unable to open slave

If you’re getting error messages like this

ALSA lib pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave

when you try to run Firefox in linux, or any other application for that matter, I may have the solution.

There’s plenty of fairly complicated stuff on the internet about that error. None of it helped me. My problem was actually mplayer.

I had it running in the background. But it was using OSS instead of ALSA. So when an ALSA application tried to run, like firefox, it freaked out, and displayed the above error.

Simply by running mplayer with -ao alsa passed to it my problem disappeared.

rsync, mkstemp, fat32, No such file or directory

When you rsync to a fat32 device you encounter problems. Problems because fat32 is an awful, awful filesystem. If you can simply not use fat32, do so. If you’re forced to use it (Hello) then here’s how to get around it.

On to the error messages. The first one you may encounter is:

rsync: mkstemp “YOUR_DEST_DIR/.FILENAME” failed: No such file or directory (2)

This mean rsync is trying to create a temporary file (that’s what mkstemp does), but fails to do so on your fat32 device. If you decide to get around this by giving rsync a new parameter —temp-dir=/tmp you encounter yet another error:

rsync: rename “FILE_IN_TEMP_DIR” -> “DEST_DIR”: No such file or directory (2)

A little searching[1] tells you that these error messages only come up when rsync tries to copy files from an all uppercase directory onto the DEST_DIR. Basically, rsync preserves file or directory names written in lower, upper or mixed case. And fat32 devices do not.

To force your fat32 device to preserve upper, lower or mixed case file and folder names mount it with the shortname option set to win95 or winnt (see man mount; win95 worked for me). Do something like this:

mount /dev/sda1 /media/storage -t vfat shortname=win95

Then your only problem is that fat32 devices poorly timestamp their files, and rsync depends on good timestamping. To make rsync ignore timestamps and go by file-size only give rsync the option:

—size-only

Now you’ve pandered to fat32’s awfulness, everything should work fine.

[1] http://ubuntuforums.org/showthread.php?t=203549

These days... [police arrest photographer for being too tall]

Government passes anti-terrorism laws.
The police use anti-terrorism powers to harass citizens.
Citizens no longer trust the police.
Citizens no longer trust the government.


Yet Mark Thomas, Scholar and Gent, brings us: http://www.guardian.co.uk/commentisfree/2009/feb/09/liberty-central-stop-and-search-police

http://www.eflorenzano.com/blog/post/my-thoughts-nosql/

good summary of non-sql datastores

The professor was disturbed that game rules encouraging competition and varied tactics hardly mattered to gaming community members who wanted to preserve a deeply-rooted culture.

He said his experience demonstrated that modern-day social groups making use of modern-day technology can revert to “medieval and crude” methods in trying to manipulate and control others.

“If you aren’t a member of the tribe, you get whacked with a stick,” he said. “I look at social groups with dismay.”

I assume he’s not a benchmark pro, but he did a decent job already. We can
nitpick his sampling methodology - but it won’t change the result. He is correct that many procs is far more memory consuming than single proc, and we already knew this.

This is a tradeoff we made consciously and deliberately. When firefox crashes, all tabs go down. When firefox memory is compromised (security), all tabs are compromised. In chrome, we don’t have those problems, but instead use more RAM. Further, Chrome is also able to implement per-tab prioritization, so that background tabs don’t make foreground tabs go slow. Firefox can’t do that.

http://groups.google.com/group/chromium-dev/browse_thread/thread/f97adb063b97a81

 I always wondered why Chrome was faster than Firefox, and it turns out it’s not because it uses less ram. The priorisation seems to be why, unless my addons weight firefox down significantly.