Rdio Replacement

My wife and I freaked out a little bit when we heard Rdio is going away. Now we have to find an Rdio replacement! Since we live in Canada we can’t get Pandora yet so we can’t even hope to find in Pandora what we found in Rdio. Music is very important in our lives so it’s a pretty big deal when our favourite music streaming service goes out of business. We have Spotify since it came with my phone plan but it just doesn’t cut it for us, it doesn’t provide the same music discovery experience we loved on Rdio and the Roku app for Spotify really sucks!

After searching for a couple days we came up with some solutions for a replacement to Rdio which I will describe in some detail in this post in case anyone wants to try them out.
Continue reading “Rdio Replacement”

How to grep a $_REQUEST, $_GET or $_POST variable in all files recursively

Have you ever wanted to do a grep search on all files for a variable such as $_REQUEST, $_GET or $_POST but couldn’t figure it out? I have tried to do this a few times but end up just giving up because I don’t usually figure it out. This time I wanted to jot down my solution and figured I may as well put it here so everyone can see it. Skip to the end to see the right command to use.

Basically I wanted to recursively search through all files in the current folder including all sub-folders. In this case I was looking for $_REQUEST[‘ID’] in some PHP scripts. However when I tried to do a regular old grep -r on it…

grep -r '$_REQUEST['ID']' .

… well obviously we can’t have the extra single quote around the ID part. So I tried escaping them:

grep -r '$_REQUEST[\'ID\']' .

Unfortunately that also doesn’t produce anything (ctrl+c out of that > prompt). OK, so there is a special way to escape single quotes on a shell. You have to break out of the single quote and then escape it. Let’s try that:

grep -r '$_REQUEST['\''ID'\'']' .

Well, that didn’t work. Now we have blankness again.

So I tried:

grep -r '$_REQUEST[' .

And it tells me grep: Invalid regular expression

Ok, so it must be using the [ as a regular expression. Alright well then let’s escape that too and see if we get our list of files yet.

grep -r '$_REQUEST\['\''ID'\''\]' .

Jackpot! That gives me a list of files, and the line of code with $_REQUEST[‘ID’] highlighted and that’s exactly what I am after. Note that there are no double quotes, they are all single quotes.

Servers, Code, Websites, the Whole Internet

So many websites out there. They number in the billions. So many people trying to make their mark in the world wide web. Why start another website? Well I’m hoping to write about things I find useful, especially if I might want to reference it in the future, and especially if I’ve already had to go searching more than once for the information. If I just put it on this site then I won’t have to go searching all the time. Hopefully other people will also find this information useful.

Lately I’ve been doing a lot of coding, and a lot of gaming. Some day I’d like to code a game. But for now I’ll just stick to playing games and coding other things. The closest thing to coding a game I’ve done probably would be plugins for Minecraft. I’ve programmed several Minecraft/Bukkit plugins in the past but due to Minecraft being bought by Microsoft and all the turmoil surrounding all that I’m going to have to wait awhile to update those. I used to run a small Minecraft server which had a really nice little community but now I just have a small, whitelisted vanilla server running. But that isn’t really coding a game exactly, merely plugins for a game.

Although another thing I did when I first started programming many years ago when I was playing around in QuickBASIC was making somewhat of a clone of a game we had as kids called Alien Invaders Plus which I code named Happy Al. I don’t know what ever happened to that but it was a pretty good learning experience at the time. I kind of wish I still had it.

That was how we were taught back then, starting with Watcom BASIC and then eventually QBasic and then to Visual BASIC. After that I found QuickBASIC and played around with it for awhile. Even tried some C at one point and probably some others. I had even successfully dabbled in machine code with WinDasm32 at one point. Then I kind of moved into the field of web development which I’m now self-employed in (though I kind of suck at making graphics). I’ve been starting to work on some Android apps now as well. The new Android 5.0 Lollipop is coming out tomorrow so that is something to look at.

Maybe if things go well I can make some Android apps or maybe even some Android games. But I have a feeling that will be a ways off yet.