MOG first impressions

I’ve been using Grooveshark since 2008 and haven’t had much complaints after moving to their premium service a year later. But recently, the disorganization (duplicate tracks, mislabeled or wrongly tagged tracks), plus the very low quality mobile streaming (even on WiFi) has left me searching for an alternative.


Enter MOG.

While definitely not a newcomer to music streaming services, coming from a music-oriented blog and community way back from 2005, MOG is nowadays probably one of the largest industry-backed services of its kind. Their claimed library of 11 million songs is impressive, and from a quick search, I could easily find all but the highly obscure artists or those difficult to license (no Metallica or The Beatles here, but it has some missing from Grooveshark: Pink Floyd, The Chemical Brothers and Korn).

The first thing I noticed is how well organized the music is. No duplicates here, everything is nicely tagged, all albums have high-quality covers and everything is easily browseable.

The other impressive thing when compared to Grooveshark is the high bitrate streams and downloads. Everything is 256-320 kbps, and you can really tell the difference from Grooveshark’s (probably) 96-128 kbps. The albums are flawlessly ripped, no skipping or cut up tracks, the quality is really top notch from what I’ve seen so far, be it on mobile or the site.

Speaking of mobile, the app is highly streamlined with very little eye candy, contrary to Grooveshark’s more intuitive mobile client.

The asking price of $5/mo for web/STB/TV/Roku/Boxee/Sonos streaming is very reasonable. For $10/mo, though, you get the mobile (iOS/Android) clients, which is just $1 more than Grooveshark’s Anywhere. You can sign up for a 14-day trial here.

All in all, I’m very impressed so far with MOG and will be putting up my final impressions once my trial is over.

Why do people dislike Perl?

I happen to enjoy using it much more than shell scripts for anything that needs a more complex logic or real data structures. It gives me better portability, a ridiculously large selection of easily installable modules, and the freedom to scale should I need it.

I could say this for Python or Ruby as well (and I certainly prefer using them if given the choice), but Perl is much widely adopted across many different platforms (perhaps because of its age). You can be almost certain a modern server will have at least Perl 5, while you can’t say the same for Python, and good luck with Ruby.

Sure, you can shoot yourself in the foot easily with Perl, and TMTOWTDI causes confusion, but the beauty of Perl is that you can easily start with the features you’re comfortable with and use everything else as you need it. Ruby also has this distinction.

A common complaint I hear is that Perl code is difficult to maintain.

I can say this for any language. If the author wasn’t a sadist that purposely obfuscated code, and the code is well documented, there’s no reason why Perl code would be any less maintainable than any other language.

AWK would also be a good choice for some things, but Perl has a more standard syntax, is of more general use and is (I think) comparable in speed.

Dumb car radio powered by smartphone

Recently I’ve been interested in purchasing a new car radio, as my current one has no auxiliary input and is basically a rudimentary device. Thinking about different options, and even considering a carputer project, it occurred to me that there should be a car radio that would be powered by your smartphone and allowed seamless integration with the car.

Read More »

Fixing write permissions for NFS Windows client

So after a recent Arch upgrade, Samba mysteriously stopped working, and I really wasn’t in the mood to troubleshoot what broke it. I have always disliked Samba (and CIFS as a whole), so was pleasantly surprised to learn an NFS client has been shipping with Windows for like, ever, now.

After installing and configuring NFS in Arch (a bit more involved that I would’ve liked but not too painful), and installing the NFS client service in my Windows machine, I was able to connect and browse the share, but had no write permissions (despite it being configured as rw).

This was of course related to the awesome Unix file permissions. Depending on the UID/GID the client authenticates with, it will have the permissions as specified by each file’s mode. By default, the Windows NFS client connects with -2/-2, which maps to ‘other’ on the Linux side, so you’d need write permission for ‘other’ on every file. This is a problem unless all your files have it, but mine default to 644 (read-only for ‘other’), which is a pretty common and safe mode.

There’s a couple of ways I tried to fix this, and only the last one worked.

The NFS server has the ability to force all anonymous connections to a specific UID/GID. This is done using the following share options:

/export/home 192.168.137.0/24(rw,nohide,no_subtree_check,async,all_squash,anonuid=1000,anongid=100)

What all_squash does is basically treat all clients as anonymous, whereas anonuid and anongid assign a single UID/GID for these anonymous connections.
For some reason, this didn’t work for me. I’m guessing it has something to do with the Windows client, but I still couldn’t write to the share.

Luckily, I found the following tip/hack: http://blogs.msdn.com/b/sfu/archive/2009/03/27/can-i-set-up-user-name-mapping-in-windows-vista.aspx

  • Start Registry Editor (regedit.exe)
  • Locate
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default
  • Create two DWORD values named AnonymousUid and AnonymousGid
  • Set these values to the UID and GID you would like this NFS client to use
  • Restart your Client for NFS service using the Microsoft Services for NFS MMC snap-in

This simply forces the client to identify with your chosen UID/GID (instead of the default -2/-2), which is basically what I needed. You could remove the all_squash and the other options, but I left them there anyway, it works great. This tip is for Vista, but it also works on 7, not sure on previous Windows versions.

Now I have access to all my Linux files from Windows again, and without bloody Samba. The only thing I’m still figuring out is how to automatically connect to the share at Windows startup. I’ll update this post when I have a reliable method.

Cheers!

Format selected text with AutoHotkey

In case you don’t know, AutoHotkey is an awesome GUI automation tool for Windows. I use it all the time to speed up monotonous stuff I usually do by hand. I’m not that proficient with the language, so it takes me a lot of searching and experimentation to get it to do what I want, but I just finished creating a new snippet of usefulness and decided to share it here.

In the following example I get the selected text and transform it so that it can be used in an SQL list (used as values inside an IN clause). For example, selecting the following text:

594410186
594410082
594410187

… and pressing Alt+G, converts it to:

'594410186',
'594410082',
'594410187'

Which saves me a few seconds of copy/pasting the text in an editor and applying the regex manually. Did I mention I LOVE AHK? :-)

Here’s the snippet:

GetSelectedText()
{
   tmp = %ClipboardAll%    ; save clipboard
   Clipboard := ""         ; clear clipboard
   Send, ^c                ; simulate Ctrl+C (=selection in clipboard)
   ClipWait, 1             ; wait until clipboard contains data
   selection = %Clipboard% ; save the content of the clipboard
   Clipboard = %tmp%       ; restore old content of the clipboard
   return selection
}

; Enclose each line in '$1',
; Used to format a list of strings for SQL
Alt & G::
  selection := GetSelectedText()
  newStr := RegExReplace(selection, "m)^(.*)$", "'$1',")
  StringReplace, newStr, newStr, `r`n, `r, All   ; fix newline
  SendInput %newStr%{Backspace}                  ; paste everything and delete last comma
  return

Favorite chiptunes

I have already written a bit about the demoscene and chiptune in the past, but I had to write a separate post about these two tunes I keep coming back to whenever I need a fair dose of nostalgia and optimism.

I haven’t heard a lot of chiptune, nor do I know much about the scene, but these are by far my favorite tunes from that culture. If someone knows others that are equal gems as these, please share.

DataChild of SAE – Tune 1 (IT | MP3 V2)

Zoef of FLT – Tune 2 (XM | MP3 V2)

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Now, the IT and XM files are in module format that (unless someone converted them afterwards) are the original files as exported by the artist’s software, meaning they’re the lossless versions you should be listening to. In order to do so, I recommend downloading foobar2000 and the excellent foo_dumb plugin, or use any module file player of your choice.

Some years ago I converted and edited both these tracks to V2 MP3s for my own amusement, and to be able to play these universally. You can download these from the links above as well. I took the liberty to loop the tunes twice, and add some fade out at the end.

You can also find these files on scene.org (the original installer is found here) where you can download these and more sound files, and I definitely recommend you checking out that site as well as pouet.net.

Read More »

Manifiesto zapatista

Politics doesn’t interest me at all, but I was just listening to Manu Chao’s Clandestino for the umpteenth time, and this quote from “Welcome to Tijuana” rang a bell as much now as anytime I’ve heard it before.

Nuestra lucha es por el respeto a nuestro derecho a gobernar y gobernarnos, y el mal gobierno impone a los más la ley de los menos.

Nuestra lucha es por la libertad para el pensamiento y el caminar, y el mal gobierno pone cárceles y tumbas.

Nuestra lucha es por la justicia, y el mal gobierno se llena de criminales y asesinos.

Techo, tierra, trabajo, pan salud, educación, independencia, democracia, libertad… Éstas fueron nuestras demandas en la larga noche de los 500 años. Éstas son, hoy, nuestras exigencias.

The quote is an excerpt of the “Manifiesto zapatista en Náhuatl”, of which you can read the full version here.

Here’s a great Manu Chao poster with the quote:

Approximate Analogy

When you ask me whether I believe the god in the Bible is real, and I answer “No”, if I ask you—a Christian—whether you believe the Hindu god Brahmā is real, and you answer “No”, then you have a good reference of my position.

About password management

Amidst the recent PSN debacle, I have come yet again to doubt in any information I give to third parties. You would think a huge company like Sony could at least have some basic security measures covered. But from the recent reports, it seems they stored every account’s password in unencrypted form. This is—aside bat-shit crazy—a basic security faux-pas even non-security folk know by heart.

So it made me rethink again the basic method I use to protect what in turn protects my online data: passwords. I won’t mention other alternative forms of authentication, because I don’t deal with them on a daily basis.

Here are some of the main rules I follow when it comes to passwords:

  • Never use the same password with more than one account. I have actually broken this rule on a few occasions, but mostly for throwaway accounts. However, if what you need protecting is important and you wouldn’t want it to get into anyone else’s hands, make sure to use a unique password for every site/system you access.
  • Always use a complex combination of letters, numbers and symbols as your password, at least 8 characters long. Make sure not to include any word available in the dictionary, any personal information (dates, names, etc.), or anything related to the specific account (same username/password >.<). Alternate between capitalization, number sequences (never in order) and special characters. Some might even suggest using characters outside of the ASCII set, but this might give you problems with certain systems, so YMMV. Good password: #-slUpfoLu!9. Bad password: 123abbey.
  • If possible, use a memorable sequence of characters. A random string such as “\sVSS’rEXsO-1cL$Z3jF” is a pretty damn secure password, but how convenient would it be to have to type that some time? Or how hard would it be to memorize? I have been using this mnemonic password generator for the past few years, and it’s been great. It generates fairly complex strings, that are easily remembered through practice. It gives you the actual pronunciation of the string to help you with that. I usually spice up the generated string by setting some letters uppercase and changing or adding a few special characters and numbers. I can easily remember several passwords generated by this tool in case I need to login manually somewhere. But I rarely do, because I…
  • Use a password manager. All the above rules would be pretty hard to follow if you didn’t use a password manager. I’ve been using KeePass for several years now, and have been pretty happy with it. It runs on all major OS’ (including smartphones), and it supports several authentication mechanisms to access your password database. If you just use a single master password, though, make sure it’s very, very, hard to crack, as you definitely don’t want this slipping into anyone’s hands. Another great password manager that gets security right (but fails terribly at UI) is LastPass. I’ve been using it mostly for web sites and it’s been an invaluable tool for me. It has a plugin for all major browsers and even a mobile app. Definitely worth the $12 yearly price for the Premium upgrade.

There are plenty more considerations when it comes to security, but these are the major ones I follow for passwords.

Anything I missed / could do better? Let me know in the comments.

Session log of an insomniac

ivan@brain:~$ date +%T
01:56:41
ivan@brain:~$ sleep 21600
command not found: sleep
ivan@brain:~$ ps -e | wc -l
834
ivan@brain:~$ halt
halt: must be superuser.
ivan@brain:~$ :'-(