Sunday, December 14, 2008

Saving streaming wmv files with Linux

This past week my sister-in-law was on the radio in NYC and my father-in-law wanted me to try and record it for him. Since I live in North Carolina, obviously the only way to do that would be to stream it over the web. I figured finding and listening to the stream would be the easy part. I listen to streaming radio ALL the time (thanks WUNC!).

Before getting into all of this, you are likely going to need to install some applications. Everything I used was available through the Ubuntu repositories though I do have Medibuntu enabled in addition to all the other easily enable able ones (main, universe, restricted and multiverse). This was also all done using 8.10 Intrepid Ibex. I also know I have several of the restricted packages installed which I am pretty sure is the only reason Windows Media files work. Now for the details.

The hard part would be to actually save the stream. Here is a step by step of what I did:

  • Obviously the first step was to find a stream of the station. She was playing on WQXR - 96.3 FM and I found their Windows Media stream on PenguinRadio.
  • I found that VideoLAN - VLC media player would be my best bet. It also works in Windows too. I didn't try this on Windows but I bet it would work the same with VLC.
  • I had the hardest time trying the many command line options for vlc. I really wanted to download the file and transcode it to wav or directly to MP3 but I just couldn't get that to work. Instead I just saved it directly as WMV and decided to worry about the rest later. I had some trouble with all the many GUI options too so I went with the safer command line route. I used the command line:
    vlc -vvv "http://htc-01.media.globix.net/COMP005996MOD1/meta/wqxr_live_high.asx" --sout '#duplicate{dst=display,dst=std{access=file,mux=asf,dst=/home/forrest/download.wmv}}'
  • Here is the easy to replace version: vlc -vvv "MY_STREAM" --sout '#duplicate{dst=display,dst=std{access=file,mux=asf,dst=MY_DOWNLOAD_FILE}}'

After all that I had a 34.1MB wmv file with just under 27 minutes recorded. At this point I converted it to a wav using mplayer like so: mplayer download.wmv -ao pcm:file=download.wav

Since I wanted to play it safe and be sure not too miss anything I needed recording, I started to recording early and kept it going past time. At first I wanted to use Audacity to trim the file but I had a problem getting that to work so I used a program called sox. To truncate the wav with sox you just specify the trim option, the start time and how long to run (NOT the end time). In my case it was: sox download.wav download-trim.wav trim 14:50 9:39

Next I converted the wav to MP3 so I could make it easy to get to online before burning it to a CD. I was sick of command line options at this point so I used SoundConverter instead of Lame (though it likely uses lame as a back end anyway) to save me the trouble.

Tuesday, December 2, 2008

Upgrading to Ubuntu 8.10 (Intrepid Ibex) from 8.04 LTS (Hardy Heron) on my home desktop (in pictures)

Despite Ubuntu 8.10 (Intrepid Ibex) being out for over a month now, I just got around to upgrading today. I use my Linux box for web browsing, watching videos, general web development and other day to day tasks so I couldn't afford for it to be down long if the upgrade went badly. Fortunately, the upgrade worked like a charm. So here is the upgrade process that took a total of 1 hour and 15 minutes in pictures:











At this point something was upgraded that caused the border to not show up in the screen shots. Oh well.










After the upgrade the theme was a little funky. I went into the theme editor and changed the theme a few times and it was back to normal. I did see the new dark theme and I am going to give it a try for a little bit. I don't think it will last long but it does look pretty good at first. I also switched to the default background for a bit too.

Friday, November 21, 2008

Wine development release 1.1.9 is now available

The Wine development release 1.1.9 is now available.

What's new in this release:
- A large number of regression test fixes.
- Performance improvements in memory management.
- Improved POP3 support in inetcomm.
- Initial implementation of the XInput DLL.
- Various bug fixes.

Binary packages for various distributions will be available from:

http://www.winehq.org/site/download


One step closer to ignoring experts-exchange.com thanks to Google

The one site on the Internet that annoys me the most is experts-exchange.com. This seemingly useful site comes up in my search results frequently. The more obscure my query, the more likely an Experts Exchange page will appear in the top results. The problem with this though is they don't answer your question unless you register. This isn't just an annoying New York Times registration either. This is a full blown 7 day trial registration that leads to a $12.95 per month account. Blah!

Don't get me wrong, I don't have a problem with them trying to make money by bringing information together. It is not for me though. I have no desire to pay a monthly fee or to take the time to sign up for a free 7 day trial account to answer some simple question that is likely answered somewhere else on page 1 of my search results. Because I will never use their service I'd like to never be bothered with search results to their pages.

Fortunately, Google is helping us get a little closer to the dream of completely blocking results on expert-exchange.com. The just released a feature called SearchWiki which lets you annotate, promote and remove search results. Granted this is only for when you are logged in and on a per search basis so it is far from the optimal "block everything from this domain" option but it is a step in the right direction. At least I can take my loathing out on the result by removing it. It is as easy as 1.. 2.. 3.. You even get a fun explosion dust cloud while the result is removed.




And while doing a little more research, it looks like there is a Greasemonkey script for Firefox users to block Expert Exchange results for us already.

Also, if you are looking for answers, try Stack Overflow instead. It is actually useful.

Tuesday, October 28, 2008

Free CrossOver for Linux and Mac TODAY ONLY!

CodeWeavers is offering free copies of CrossOver for Linux and Mac users for today, October 28th only! They are doing this as part of a Lame Duck Challenge Free Offer. CrossOver is based on Wine which allows you to run Windows applications on Linux and Mac platforms by implementing the Windows API on those platforms.

As of writing this, their website is in slim mode because of all the traffic but they are still accepting email address submissions and providing downloads for their Pro and Games versions of CrossOver. Go download it now if you are a Linux or Mac user. What do you have to lose?

Friday, October 17, 2008

Ubuntu 8.10 is coming soon...

Ubuntu 8.10 is set to be released on October 30th. Only 13 more days to go.

Flash 10 is out for Linux and Ubuntu users even get deb packages!

Flash 10 was released just a few days ago (October 15th) and I am excited! Whats new? On Linux, Flash has been a second rate citizen for some time. The Linux version has been buggy, causes browser crashes and leads to excessive CPU usage. The last release for Linux was also over 6 months behind the Windows and OS X releases.

Flash 10 for Linux has been released at the same time as other platforms this time around. The Linux release now also comes with easy to install packages for Debian based distributions like Ubuntu and RPM based distributions like Fedora. Adobe is really starting to pay more attention to Linux users and I really appreciate it.

I had hoped that I could get the latest Flash from the ubuntu-backports repository but it looks like they are still working on that as the version listed now is "10.0.1.218+10.0.0.525ubuntu1~hardy1+really9.0.124.0ubuntu2" which really is still version 9. To easily install version 10 though, I just went to the Adobe Flash download page, downloaded the deb file and installed it. The installation also removes the old version for you keeping your upgrade hassle free. A simple browser restart later and I was running the latest Flash 10.



I haven't been running Flash 10 long enough to know if it has fixed all my problems yet but I do know it has fixed the annoying Flash z-index bug that caused content like menus to be drawn behind Flash content. This was most annoying to me on the Verizon Wireless website.

Flash 9 on Linux


Flash 10 on Linux

I really hope Adobe keeps Flash on Linux at the same level moving forward. Flash has been one of the chicken or the egg problems for Linux for a while and I think Adobe now realizes they should do something about that. I also think competition from Sliverlight may be a factor here as Microsoft has only partially endorsed an implementation of it as Moonlight for Linux. I see the benefits of having more popular/standardized distributions coming into play also. With Ubuntu and Red Hat/Fedora as two of the major players, Adobe can confidently create tested and easy to install packages for those platforms.

As further reading, I would suggest the Ars Technica review as it covers all platforms and goes into some performance benchmarks.

What is your uptime?

My system has been up for:

$ uptime
01:01:48 up 44 days, 7:47, 2 users, load average: 1.06, 1.03, 0.86
... but now it is time to restart. Some updates I installed over the past few days require a restart (though I don't believe it is a new kernel which is usually the only thing that requires one).

Of course this is nothing like the current uptime of the Linux server I manage (which I had to restart recently to install some more memory). I think it has been up for about a year before.
$ uptime
01:06:46 up 86 days, 2:43, 1 user, load average: 0.04, 0.02, 0.00
And this is far from any sort of uptime record too. Just an interesting tidbit. Oh, this would also not be possible if it weren't thanks to my friend the UPS. My electric power lately has been less than ideal.

Either way, it doesn't matter for anything... just interesting.

Sunday, September 28, 2008

Ubuntu Desktop Screenshot of the Day #8 - Election Season Edition

My desktop theme has been the same way too long and I haven't posted a new screen shot in a while so today I decided to tackle both of those things. Seeing as it is election season here in the US where I am, I decided to go with a nice red, white and blue theme. The background is called "another gnome wave (blue on red)" and is one of several with this same design and different colors. I am also trying out CrossOver Chromium a little more since I have been using its Windows counterpart Chrome more seriously for a few days now too. I hope to share more thoughts on Chromium later. In the screen shot you will also notice the Dictionary application. This is the first time I have ever used it because I generally use Google as my online dictionary. One last thing, the website shown is Electoral-Vote.com which tracks daily polling for each state and predicts the outcome of the election if it were to happen today (based on our antiquated electoral college system that allows a President to be elected without a majority of the poplar vote, like in 2000, and focuses campaigning to only a handful of states).

Wednesday, September 24, 2008

Like Clockwork - GNOME 2.24 Released

Like clockwork, GNOME 2.24 was released today as an upgrade from 2.22 which was released on March 12. GNOME is on a strict 6 month, time based release cycle. With a time based release schedule, changes are more incremental than in other projects but they still manage to get a lot of good stuff in. Check out the GNOME 2.4 release notes for all the details and with good screen shots.

The highlights of this release as I see it are:

  • The first release with the mobile development platform "to provide a core platform on which distributors and handheld manufacturers can build rich programming environments". Although not running GNOME specifically, that fancy new T-Mobile Android phone is running Linux.
  • A new integrated IM client, Empathy. Some are excited about Empathy possibly replacing Pidgin (formerly Gaim) in some distributions but I am skeptical. I love Pidgin. That is my only IM client on Windows and Linux.
  • The addition of tabs to Nautilus, the file manager. This has been a complaint by many for what seems like forever.
  • New Screen Resolution Controls. We shall see if this helps. Linux notoriously has issues with multi-head systems. Much if this is thanks to poor display drivers though. The whole stack needs work.
This GNOME release will show up in Ubuntu 8.10 on October 30th, Fedora 10 on November 25th and openSUSE 11.1 on December 18th. If you don't want to wait that long to try it out, most of these distributions already are in late Alpha or Beta and have close to the final 2.24 release in them. There used to be a live CD as part of a distribution called Foresight Linux and some VMware images also. I don't see those up yet for this release yet though. I am not sure if the 2.22 release ever had them created either. You may also find the Ars Technica review informative as I usually do.

Today is World Day Against Software Patents

September 24 is World Day Against Software Patents. Why are software patent so bad you ask? They are bad because they are being issued too freely for trivial ideas and then used as a tool by patent trolls for litigation. Instead of encouraging innovation as intended they are stifling innovation. Do you want to have a wish list on your website like everyone else? Too bad, you have to pay Channel Intelligence or worry about getting sued. Software patents let companies bully each other too with FUD like in this case with Microsoft and Linux. I think the threat of software patents to Linux and any developer really was best explained by Bruce Perens: "And you can never finish a patent search. The definitions are so broad, you can't ever be sure a company would or would not assert their patent on what you are doing." On one last note, there is the Open Invention Network which aims to make some of these patents royalty-free.

You can help fix the patent system. See what you can do.

Sunday, September 21, 2008

Installing Ruby on Rails on Ubuntu 8.04

I've been exploring web app frameworks lately in hopes of starting work on a new site. I first looked at some PHP implementations, namely CodeIgniter and CakePHP. I mostly looked at those thanks to all the cheap and easy hosting available for PHP. I also thought some about a Java framework like Spring or Struts but I mostly write Java these days so I wanted to branch out. What I finally decided on was Ruby on Rails. I have dabbled with Rails a little in the past and have started working on a few real projects recently that are also using Rails so I will be learning it anyway.

So far all my development in Rails has been on Windows. Rails is rather Mac centric and I am a little unsure of the Linux support. I know that the one other project I am working on is deployed on Ubuntu 8.04 server so surely I can develop on it too.

First thing is first. Install ruby:

$ sudo apt-get install ruby
And then ruby doc:
$ sudo apt-get install rdoc
(If you don't install ruby doc, you are going to get an error later when installing ruby gems.)

Now you could at this point install rails and ruby gems using apt-get or synaptic but you don't want to. Rails is currently at version 2.1.1 and ruby gems is version 1.2.0 but the Ubuntu repositories only have versions 2.0.2 and 1.1.1 respectively. If Ubuntu backports had newer versions we would be set but I don't see rails in the mix. Having a package manager built into the OS is not something that Windows and Mac have available to them natively so ruby has gems as a package manager. Unfortunately this can conflict with the OS package manager so that is why we aren't going to install ruby gems or rails with apt-get.

So now you want to download ruby gems here. Extract it (anywhere), fire up a terminal, change to the directory you just extracted and run:
$ sudo ruby setup.rb
If you happen to get the error message: ./lib/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError) then you skipped over my point to install ruby doc above. Go back and install that and you will be caught up again.

After a minute or so you will have ruby gems installed. To install rails run:
$ sudo /usr/bin/gem1.8 install rails
After a few minutes more, you are ready to start developing with rails. You may also want to consider using Eclipse and Aptana.


Also, if after this when trying to fire up WEBrick you get the error: /usr/lib/ruby/gems/1.8/gems/rails-2.1.1/lib/initializer.rb:229:in `require_frameworks': no such file to load -- openssl (RuntimeError) You will need to install libopenssl-ruby:
$ sudo apt-get install libopenssl-ruby
You may need to install mysql too even if you are only accessing a remote database so keep that in mind too.

Saturday, September 20, 2008

Good Linux Twitter Clients - Where are they?

Finding a good Twitter client for Linux is not as easy as I thought it would be. About 5 months ago, despite resisting it for a long time, I started using Twitter. I don't know why but it is a little addictive. I've now even attended my first tweetup in Fayetteville. Twittering is a lot like blogging but without having to think too much about it as you only get 140 characters to work with. If you are here though, you probably know all that already.

For the most part, I have just used the Twitter website to read and post "tweets" but looking at some analysis of traffic, there seem to be a lot of good clients out there. This is in most part thanks to the fact that Twitter has an API so you don't have to use the website only. You can use one of the endless number of clients that are written to make the experience more feature filled. There is a nice list here but for this post, I am only interested in the Linux and cross platform twitter clients.

Unfortunately once you get to running Linux, the seemingly endless selection of clients ends. There are really only 3 easy solutions if you are running Ubuntu 8.04. I say easy because you can install all 3 through Add/Remove Applications. Sadly, none of them are very good. First, there are 2 native clients: gTwitter and Twitux.


gTwitter (using version 1.0beta) is ok. First, the default view is terrible (not the one pictured below). The default shows the selected tweet from a list of initially the last 12 you have received. The list only shows the name and the time of the tweet (except the time was when it was downloaded, not when it was posted).

Switching to "Tweet View" is more helpful (see the screen shot below). In Tweet View the client at least shows all the tweets in full along with the picture of the person; however, none of the links in them work when using this view. You can't follow an @account to see the persons page or even follow normal http links. There is also no ability to reply to a person using the interface either without manually typing @ and their username. These are all very serious deficiencies.

The text entry box is also very limited. First, it is a single line. I realize 140 characters doesn't take much space but it can still fill up a single line. I want to see everything I am typing before I send it. At least there is a character counter to show you how many more characters you have left. There is also no spell check which for me is another must have.

If you want to change the settings, of which there are few, the only way to access them is from the system tray icon. I didn't even realize it was up there after searching for a very long time for a way to change the update frequency after running out of my allotted API calls.

Oh yeah, and sometimes it just randomly crashes.

I see gTwitter as a good start but sill to lacking for real use. Just using the website would be more useful at this point.



Twitux (using version 0.60) is a lot better but still has some major annoyances. It does have clear menu items so you can get to settings and features easily. It also has a number of features that, unlike gTwitter, add value over just using the website.

In addition to the basics Twitux has a view to show you different sets of tweets such as the public list, your friends, only yours, direct messages, direct replies and the timeline for the application @twitux.

The text entry is a good sized text area with spell check but to get to it you have to use the menu or Ctrl-N to pop up a dialog box. I think it should be part of the interface like in gTwitter but as multiple lines.

The most annoying part of Twitux though is the resizing issues. If tweets are long enough they don't wrap properly and there is always a little left/right scrolling that you will have to do. Why? Up/down scrolling is expected so just drop the left/right scroll and expand those tweets vertically.

So far I think Twitux is you best bet but there are some other options.


The next option is to run Twitter in Mozilla Prism. This isn't much special as Prism is just a stand alone browser (using much of the same internals as Firefox) designed to be used for a single application at a time. The idea with Prism is you have an icon for Twitter on you desktop that you can click and it will bring up this window with Twitter in it, more like a desktop application. You can use Prism for any site like your online email or calendar too. I think you get the point.

So, using Prisim is really just like using the website in its own little browser. There is not much value add there.


Before moving on to what I think the best solution I have to ask a question: Why are there so many Windows clients and so few Linux clients and of those Linux clients, why are they so lacking? I truly do not understand. On Linux, clients like this usually spring up left and right but they haven't here. Maybe developers just don't use Twitter that much or it just isn't that big of a deal to them. I will say that a Twitter client is pretty low priority.

But the best option, I think, it to use some of the newer cross platform clients that are written using the new Adobe AIR framework. The problem there though is AIR for Linux is lagging behind the Windows and Mac versions. It just moved from alpha to beta on September 18th.

I honestly haven't tried installing AIR and an AIR Twitter client on Linux yet. That is next on my list but beyond the scope of this post. I did see some success by this guy on getting Thwirl on Linx working. This was when AIR was still in the alpha stage. I really like Thwirl in Windows. I'd like to try out TweetDeck too.

If this hasn't solved your quest for a good Twitter client in Linux, you may want to read this review of the state of Twitter clients on Linux or see what folks think of Twitter+Linux on del.icio.us. I also found Pwytter recently but it doesn't look very impressive yet either.

Have you had any luck finding a better client? I'd love to know. I'm still just using the website.

Friday, August 1, 2008

My favorite useful Compiz features

Users of Compiz, a window manager that provides pretty visual effects, know that a lot of those effects are just for fun. Things like drawing fire on the screen or folding up windows like a paper airplane to close them look cool but have little real value. I think a lot of those features (plugins) were written more to show off what Compiz can do than to provide useful functionality. I don't doubt that lots of users are still using them though. Linux users cherish the ability to customize settings to the nth degree.

Personally, I am most concerned with the Compiz plugins that add functionality to my desktop. There are plenty of those too. I am going to outline some of my favorites and most useful. First though, I want to point out that if you have Compiz installed, you will want to also have the CompizConfig Settings Manager (ccsm) installed too. You can add it from Add/Remove Applications. Also, when I refer to the Super key it is most likely the Windows key or Apple Key on your keyboard. And now, on to the list:

Scale Effect (Shift+Alt+Up)
The scale effect is like the OS X "All Windows" Exposé feature that is invoked with F9. It shrinks all the windows down to fit on your desktop so you can see a thumbnail of everything running to find the window you want. This feature is most useful when you have lots of windows open. The more windows you have open, the smaller each thumbnail gets. It also puts the application icon down in the corner for you to help with identification of applications. You can use your mouse to select the window you want or while still holding down Shift+Alt you can use the arrow keys to move to the window you want.


Ring Switcher (Super+Tab)
The ring switcher is another feature for switching between windows. With this plugin all your windows are shrunk and rotated as if on a rod. The windows farther away are smaller and the window you are switching to is front and center. The window title is also displayed. Although not as useful as the scale effect for selecting a window, it is another good way to scroll through all your open windows and switch applications. Maybe you like the way this one looks better too. It is more like the traditional Alt+Tab but allows you to see all of the windows available at once.


Enhanced Zoom Desktop (Super+Mouse Scroll Up/Down)
Zoom can be a really handy feature. If you run your system at a really high resolution, sometimes you need to be able to take a closer look at something. I've found this feature very useful when watching videos that I can't resize or when using a CRT that just isn't very sharp. It also provides a universal way to zoom so instead of having to know how to zoom in different applications, you can always use this.


Expo (Super+E)
Expo is a feature that makes switching between workspaces (a feature Windows is sorely lacking) a lot easier. It will spread out all your workspaces in a row (with some nice reflection) to allow you to see what is running on all of them at once and then switch to the one you need. Since I've used Linux more I have started to rely on multiple workspaces. I usually have one just for my IM client, one for my personal web browsing, one for work web browsing, one for my media player, one for document editing, etc.. With Expo, seeing what is where is a lot easier and getting there is faster.


Shift Switcher (Shift+Super+E)
The shift switcher is another of the features for switching between running applications. It works like cover flow in iTunes. Because you only see 3 windows at a time, I don't use it as much as the scale effect or the ring switcher but it still useful when you have less windows open at once.


Window Previews
I first saw a feature like this on Windows Vista. Maybe someone else thought it up first but who cares as long as I can use it. I think this feature has great potential but it also has a HUGE problem as it currently works. If you want to see a thumbnail now, the window has to be visible already. If the windows is minimized, it will not draw the thumbnail. I can understand the technical limitations that lead to this but this feature is most useful when the window is minimized. To see these all you have to do is mouse over the application on the taskbar.


One last honorable mention that I really love is the Viewport Switcher which allows you to use your mouse scroll wheel to switch workspaces when the pointer is over the background. I could not really get a screen shot to show that.

Also keep in mind that you can customize most any of these settings for days on end to get these features to work just the way you want them to. Just install the CompizConfig Settings Manager (ccsm). Some of these features I mentioned are not enabled by default either (on Ubuntu 8.04 at least) so don't expect them to all work untill you enable them.

One last thing, if you haven't seen Compiz in action, just look on YouTube. There are tons of screencasts showing these features and the crazy awesome ones too.

Thursday, July 31, 2008

One line to backup your MySQL database

I'm helping a friend setup a cron job to backup his MySQL database. For your reference, here are some one liners to do that:

Backup to a text file:
mysqldump -u root --password=PASSWORD MY_DB_NAME > MY_DB_NAME.sql

Backup to a compressed text file (replace gzip with zip or bzip2 or your favorite compression format):
mysqldump -u root --password=PASSWORD MY_DB_NAME | gzip > MY_DB_NAME.sql.gz

Tuesday, July 22, 2008

My software RAID 1 swap partition failed!

Tonight I went to do the simple task of adding some more memory to the one production Linux box for which I am fully responsible. (Running CentOS 3.9 currently) It was to be a simple addition of 2x1GB sticks bumping this poor machine from 512MB of RAM. I figured it would be pretty quick and painless. I even had no problems with the normally very temperamental fingerprint scanner at the data center. It worked on the first try. I was off to a good start.

I did have to fight with some cables to get a keyboard and monitor hooked up once I got into the rack but that was expected. It is worse because this particular system isn't as deep as the others above and below it making plugging things in very difficult. What I didn't expect though was what I saw when I got the monitor connected. It appeared that one of the drives in the software RAID 1 I have setup failed.

I don't remember the exact errors but since the system was still running and had been for quite a while, I wasn't really worried about downtime. I was just annoyed that I would have to make another late night or weekend trip out to the data center. So I upgraded the memory and made sure everything else was back up before looking into the RAID failure.

The first thing I checked was /proc/mdstat which is "the current information for multiple-disk, RAID configurations".

[root@host raidinfo]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
Event: 3
md0 : active raid1 sdb1[1] sda1[0]
104320 blocks [2/2] [UU]

md2 : active raid1 sda2[0]
1052160 blocks [2/1] [U_]

md1 : active raid1 sdb3[1] sda3[0]
76967296 blocks [2/2] [UU]

unused devices: <>
So there it is. md2 which is made up of the partitions sda2 and sdb2 is missing sdb2. Fortunately there is just an underscore there meaning it is just not connected. An F would mean it has failed. I was pretty sure that md2 was also the swap partition which is much less of a big deal and makes the most sense. After the upgrade from 512MB of ram to 2.5GB, the box was idling at 754GB so before the upgrade it must have been using that swap partition A LOT!

To double check, I checked to see what was mounted on each virtual disk:
[root@liquidcs raidinfo]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md1 73G 21G 49G 30% /
/dev/md0 99M 85M 8.9M 91% /boot
none 1.3G 0 1.3G 0% /dev/shm
Knowing that I only have a root, boot and swap partition I knew for sure by process of elimination I was dealing with the swap.

So next I wanted to see what the system logs had to say about md2:
[root@host raidinfo]# cat /var/log/message* | grep md2
Jul 22 22:19:36 host kernel: md: created md2
Jul 22 22:19:36 host kernel: md2: removing former faulty sdb2!
Jul 22 22:19:36 host kernel: md2: max total readahead window set to 124k
Jul 22 22:19:36 host kernel: md2: 1 data-disks, max readahead per data-disk: 124k
Jul 22 22:19:36 host kernel: raid1: md2, not all disks are operational -- trying to recover array
Jul 22 22:19:36 host kernel: raid1: raid set md2 active with 1 out of 2 mirrors
Jul 22 22:19:36 host kernel: md2: no spare disk to reconstruct array! -- continuing in degraded mode
Jul 22 22:19:36 host kernel: md: md2 already running, cannot run sdb2
Jul 22 22:19:37 host kernel: md: md2 already running, cannot run sdb2
Jul 5 07:01:21 host kernel: md2: no spare disk to reconstruct array! -- continuing in degraded mode
Jun 4 06:46:44 host kernel: md: created md2
Jun 4 06:46:44 host kernel: md2: max total readahead window set to 124k
Jun 4 06:46:44 host kernel: md2: 1 data-disks, max readahead per data-disk: 124k
Jun 4 06:46:44 host kernel: raid1: raid set md2 active with 2 out of 2 mirrors

So it had failed a over a month ago, ugh. Again, at least it was swap. I am still not sure what happened though. Restoring it turned out to be a simple task. I just ran raidhotadd to add the partition back to the array and waited about a minute. (This was just a small swap partition. Another guy at the data center chatted with me for a few minutes while I was there as he was waiting 3 more hours for a 500GB RAID array to finish rebuilding.)

[root@host raidinfo]# raidhotadd /dev/md2 /dev/sdb2
[root@host raidinfo]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
Event: 5
md0 : active raid1 sdb1[1] sda1[0]
104320 blocks [2/2] [UU]

md2 : active raid1 sdb2[2] sda2[0]
1052160 blocks [2/1] [U_]
[>....................] recovery = 1.8% (20088/1052160) finish=0.8min speed=20088K/sec
md1 : active raid1 sdb3[1] sda3[0]
76967296 blocks [2/2] [UU]

unused devices: <>

[root@host raidinfo]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
Event: 5
md0 : active raid1 sdb1[1] sda1[0]
104320 blocks [2/2] [UU]

md2 : active raid1 sdb2[2] sda2[0]
1052160 blocks [2/1] [U_]
[=================>...] recovery = 88.3% (930124/1052160) finish=0.1min speed=10303K/sec
md1 : active raid1 sdb3[1] sda3[0]
76967296 blocks [2/2] [UU]

unused devices: <>

And then just over a minute later, we are back in business!!

[root@host raidinfo]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
Event: 6
md0 : active raid1 sdb1[1] sda1[0]
104320 blocks [2/2] [UU]

md2 : active raid1 sdb2[1] sda2[0]
1052160 blocks [2/2] [UU]

md1 : active raid1 sdb3[1] sda3[0]
76967296 blocks [2/2] [UU]

unused devices:

Crisis avoided. Thanks to the RAID HowTo guide and this page on recovering from the failure. I really should setup some monitoring and brush up on my RAID knowledge.

Monday, July 21, 2008

I hate Linux too!

Somehow this weekend I stumbled on the Linux Hater's Blog and it is quite a gem. It is not written by your average Microsoft or Mac zealot but, as I assume, a true and very frustrated Linux user. The Linux Hater's Blog discusses the many shortcomings of Linux that we all know are there but often don't want to admit. The author does this with a technical understanding that is far beyond your average Linux user too.

Some of the posts I have found most relevant so far have been the discussion on how having many, many choices is not better, the pain felt when upgrading Ubuntu and why my next box will likely have an NVidia card despite the open source ATI and Intel video drivers. (I wished I had an NVidia card when setting up Big Desktop.) I'm generally of the mindset of "it works" is greater than "it sort of works but here is the source if you want to try and make it work". I still respect the ideaology though.

Linux certainly has come a long way but it still has many shortcomings left to overcome. (Just read how much trouble ESR had setting up a printer on Linux in 2006.) I think we need more people sharing their pain and frustrations when using Linux to get those things fixed (so does this guy). After all, the squeaky wheel gets the grease. So come on fellow Linux users, get to complaining!

P.S. - A good place to complain about Ubuntu is, of course, the forums but also the Brainstorm site.

Saturday, July 12, 2008

Linux in the real world - in the wild

We all know that computers are everywhere in todays world. They are ATM machines, in your car, kiosks, cash registers, running factories, your cell phone, and the list could go on forever. You may not have thought about it but even these computers need an operating system. Many scarily run Windows, others run an embedded OS like QNX, VxWorks, or even plain old DOS. Most though, without you knowing it, probably run Linux. Embdedded Linux market share is high and on the rise.

I got to thinking about this again recently thanks to a Digg post: Vatican Runs Linux Yes, apparently they run Linux behind the scenes for some TVs in the gift shop. I wonder where else the Vatican is using Linux. This also makes me want to know where else have you seen or known Linux to be running? If it is embedded, you likely don't know that you have seen a device running Linux but maybe you've seen a Linux desktop somewhere like your local library, school, or in my case a hotel in Berlin.

Some companies are open about their products running Linux (and generally they have to be thanks to the GPL). Sometimes hackers just make Linux run on the device. Here are some:

Despite the high Linux usage, Windows is easier to spot in the wild though. Let me show you some proof:

At the McDonald's drive through

At the ATM

In Vegas


Piccadilly Circus in London

At the Gas Station

At the airport

Times Square in NYC and here too

Then there is the impressive showing at Toronto's The Bay department store. I could show you examples, after examples, after examples, after examples, after examples. So it is good to not "see" Linux running like this.

So back to my original question. Where do you know of Linux running in the wild? Do you have any pictures?