Categories
Uncategorized

Linux Woes

Linux

Oh Linux… sometimes you make it really hard to love you.

While the recent data rescue went well, other things have not been as easy. Let’s see where we are, shall we?

Home Server
This is the old dead-screen PowerBook that ran for years without issue. Until it had an issue. I rescued the data from it, and then I figured I would do a re-install of Linux on it, but so far it’s been all failure. The external VGA connection doesn’t seem to want to display anything, so without a screen to see the install, I don’t even know if it’s booting up properly. (This is a recurring theme, btw.)

Raspberry Pi
One of my Raspberry Pis occasionally hangs on boot. Sometimes. Other times it works fine. Since it’s headless I needed to attach it to a TV to see this. The other Raspberry Pi I have does have an HDMI-VGA adapter, which works when you edit config.txt properly. Sometimes. And yeah, my RF Modulator to use the composite video seems to have died, so that option was out as well. Also, the SD card cracked. These are all fairly minor things, but they add up.

(New) Xubuntu Laptop
While it’s a new machine to me, it’s a 10 year old laptop running Xubuntu. It was going to be (will be?) my new Lab Computer, controlling the RepRap, and hopefully running Octoprint, which won’t run on the Eee PC I now use to control the RepRap. I left it running with my account logged in and it went offline… kernel panic. Hmmm, let me check right now. Yeah, it’s hosed up. I try to ssh in and get ‘Input/output error’ so something isn’t right. Dammit.

Eee PC
Well, this little beast keeps chugging along. Besides the fact that it can’t do much, it can control the RepRap, and it does a pretty good job of not losing the wifi connection. All good.

Another One
Since I may need a replacement for the old PowerBook that was the Home Server, I figured I’d try an old G4 iMac with a dead display. Multiple attempts with Ubuntu Server and Xubuntu Desktop all failed. Won’t boot from a CD or DVD. I did read about an NVIDIA driver conflict, urgh. I may try some other distros, but I’m thinking it may be an issue with the fact that the built-in display is dead and the external VGA connection isn’t doing the right thing. Bummer.

Keep in mind I’m considered really good at this stuff… but I guess when shit goes wrong, it really goes wrong.

Categories
Uncategorized

MPD Radio Controller

If you read about my Radio Milwaukee Radio and thought having just one station to listen to was rather silly, we can do something about that.

One station means no choices (and no controls) but with multiple stations we need a way to select which one you want to hear, and there are clients that can make that possible. Since the Raspberry Pi is on our home network via WiFi, that means any other device on the network can control it.

mpd

I first tried MPD-Web-Remote, which looks great on iOS devices, and fine in any WebKit-based browsers, but I’m a Firefox fan, and it looks like total crap in Firefox, so I kept looking…

mpd

I prefer MPD-Webinterface, which looks good in Firefox, and not as great on iOS devices. Of course, since these are just web applications running on the Raspberry Pi you can install as many of them as you like. (You’ll obviously need to have a web server running on your Pi. I dropped Apache on mine along with PHP using the standard apt-get method.)

And since these are PHP web apps, you’ve got the source, and can edit the CSS as you see fit, so customizing the look should be pretty simple.

Want more options? There’s a giant list of MPD clients on the Music Player Daemon Community Wiki.

And hey, if you’re wondering how I got 3 stations listed instead of just one, compare the original code to this code:

#!/bin/bash
 
mpc clear
mpc add http://radiomilwaukee.streamguys.net:80/
mpc add http://129.89.70.253:80/wuwm_1.mp3
mpc add http://75.102.5.99:80/wpr-ideas-mp3-64
mpc play
 

This creates a playlist with 3 items, and will start playing the first item in the list, so put whatever you want as the default first. This list will play the 88.9 Radio Milwaukee stream until you select another one.

mpd

You can even add new streams (temporarily) using the MPD-Webinterface. At the bottom of the interface is a text field, just paste in a stream URL and hit return to add it to the list. (I pasted in http://wmse.msoe.edu:9000 for WMSE 91.7) I said ‘temporarily’ because only the three that are hard-coded in our bash script above will survive a reboot/restart.

Oh, keep in mind you need the actual stream URL, not the playlist URL, which is one that usually ends with a .pls file extension. Normally you’ll need to view the source of a .pls file to see the stream(s) listed within it.

That’s it for now kids… have fun with your Raspberry Pi Radio!

Categories
Uncategorized

Linux Data Rescue

Rescue Me!

Sometimes it’s hard to believe my adventures with Linux go back nearly 15 years. For the first few years I kept a notebook titled The Road to Linux, which, looking back now, I find mildly entertaining.

I have a history of cobbling together old hardware into working Linux machines, and it wasn’t until 2007 when I actually bought a working Linux laptop. The Eee PC was a tough little machine, and after I got a MacBook Pro I didn’t use it much, until last year when I made it control my RepRap. It’s worked well for that. (The external monitor at home helped quite a bit too.)

I’ve been running a Linux server at home for a long time, and a few years back a friend offered me a broken PowerBook, so I managed to get Ubuntu on it and made than my low-powered Linux home server. It’s worked well, and really had no issues… until I decided to go crazy and run a system update on it. I know, and you know, that backups are important, and you know, and I know, we all still fail to do them properly sometimes.

Well, the system update failed, leaving the system unbootable. And yeah, I had two things on it that I sort of needed. Urgh. Time for some data rescue! I’ve got lots of experience doing data rescue with Macs, but not as much with Linux. Still, it was fairly easy.

Since this was my “home server” and not anything for work, I was probably a bit lax on properly administering it. (I won’t be in the future.) Most of my boxes with databases have cron jobs to dump them to disk every now and then. This one didn’t, and that’s where the fun begins.

I ended up opening the PowerBook and pulling out the drive (thank goodness I’ve got a full set of Torx drivers) and connecting it to the Universal Drive Adapter to turn it into an external USB drive. But what could I connect it too?

As luck would have it, a few months back a relative gave me an old Dell laptop to “wipe clean” and dispose of. I of course dropped Linux onto it. I ended up using Xubuntu, which works well on a 10 year old laptop. Seriously, I do love the ability for Linux to turn old, old, old hardware into something useful.

I plugged the Universal Drive Adapter into the Dell running Xubuntu and copied all the files I needed from the drive. Done. Mostly… except for that one database.

The database rescue took a few more steps. Luckily, I had installed MariaDB onto the laptop. I’ve always used MySQL but in a “what the hell” moment, I decided on MariaDB, which is “an enhanced, drop-in replacement for MySQL.” Indeed it was.

I ended up running a few familiar MySQL commands, first to create an empty database, then to add a user with the proper permissions, and then it was just a matter of copying the correct files from /var/lib/mysql into place from the old drive to the new drive, and bam! My data was all in MySQL, well, in MariaDB.

Just to confirm all was good, I dropped the proper files in /var/www and poked at Apache enough to get my app running and test the database connection. All good.

So now that I’ve got all the data I needed from the PoweBook’s drive, I should probably wipe it and re-install Linux on it. Again. ;)

Categories
Uncategorized

Selling a car on craigslist

CR-V

I sold my car on craigslist. I’ve used craigslist before, but never to buy a big ticket item, and I’ve never sold a big ticket item until now… it was very interesting.

I posted the ad on a Sunday (not just any Sunday, but Super Bowl Sunday) and within an hour I had 7 people email me, 3 of whom decided to email me twice. I began to think that maybe we should have had a higher price, but no matter, the deed was done.

Here’s a few excepts from some of the great responses I got:

Do you still have car available i am really interested please let me no thanks

You can sand namber because i wants see you car thanks you

Crv if do I got money

hey i like to buy u car please call me for apoitment

Hi” U still have d cr v?

OK, so guy #1 (as in, the first person to respond via email) gets the call, and he says he can come out that night to check out the car. His email said he lived in Pewaukee, but somehow when I called him he was no where near Pewaukee and said it would take an hour to come over. He called me an hour later lost in Pewaukee, which was no good because the car was in Delafield. Anyway, he made it, we took the car for a drive, and he offered me less money than I asked for. Not great. We talked for a bit, and he really wanted it, but didn’t have enough cash, but said he could get it by the next day… I told him to return in 24 hours with the cash for the asking price, and I’d sell it to him.

The next day guy #1 calls and says he can’t get the rest of the money, and offers me less. I tell him I’ll have the second guy (guy #2) looking at it that night (who has already said he’d pay the asking price if the car ran good) and oh yeah, emails from ten other people interested, and if none of them panned out, I’d call him back… On to guy #2.

I set things up with guy #2 to come over around 6:30, and before it’s even 5:00 he calls and says he can’t make it. So yeah, back to guy #1 who explains now that he isn’t going to buy the car, but his friend (guy #3) wants to. Yeah, it’s still only been about 26 hours since I listed the car, if you’re keeping track.

So 6:30 rolls around and I get a call from guy #1 saying he and guy #3 are running late. No worries… They eventually arrive, and we look things over, and we do the paperwork, and there’s some money involved, and it’s done. My 1999 Honda CR-V is no longer my 1999 Honda CR-V. It’s weird, mainly because (if you know me) I’ve been saying I would never replace it. Well, I replaced it, but that’s a story for another time.

tl;dr: I sold my car on craigslist!

Categories
Uncategorized

Radio Milwaukee Radio

Radio Milwaukee Radio

I started working on this project months and months ago, so I should probably share what I’ve got so far… as always, it’s a work in progress.

If you live in Milwaukee and listen to the radio, you’re probably familiar with 88.9 Radio Milwaukee. I’m certainly familiar with it, as it’s a great station, and not just for the music, but for their pieces that spotlight the great things happening in Milwaukee.

Since I don’t actually live in Milwaukee right now, it’s a little difficult to pick up the broadcast at home, but no worries, since they stream it over the Internet, we can use a Raspberry Pi (a cheap single-board computer) to play the stream.

Radio Milwaukee Radio

All we need to do is add some power and some speakers (and a little bit of code) and the Radio Milwaukee Radio is ready to go!

I used this post to figure out how to run a script at system startup. Since the Raspberry Pi runs Linux, I’m comfortable mucking around on the command line via SSH, others might not be, but since the worst thing you can do is destroy the entire system and have to re-load it onto an SD card, the risks are small.

Oh, and here’s the script.

#!/bin/bash

mpc clear
mpc add http://radiomilwaukee.streamguys.net:80/
mpc play

MPD is the Music Player Daemon, which deals with playing the stream, and MPC is the Music Player Client which controls the MPD server. The script tells mpc to clear whatever it’s doing (just in case) and then add the 88.9 stream, and start playing it.

(It’s a bit more complex that just that, as there are some startup services that need to be added, but I still need to clean up that code.)

I’ve seen a lot of complex Raspberry Pi radio streaming projects, and while I’ve also played around with different clients to control things remotely via a browser running on a phone or tablet, I wanted to keep this really simple, and create a single-purpose device that did one thing… play the awesome stuff I hear on Radio Milwaukee.

(I also put together a short video showing it in action.)

Note: I also wrote up a post about laser etching the logo on the Milwaukee Makerspace site.