B’Bye Facebook.



[Print This] By mjhammel ~ May 16th, 2012. Filed under: General.

Today I deactivated my account on Facebook. I found it essentially useless except to keep up with my daughter at college, but truthfully I’d rather Skype her than browse her photos. I’m not social enough to care to see photos of everyone’s vacation or most recent beer-fest. And honestly – $16b valuation? For a dating site? Really America?

I don’t have a Twitter account and don’t use Twitter. It’s not important to me to know what Demi Moore or Ashton Kutcher had for lunch yesterday. I do have a LinkedIn account – that, at least, seems to have a purpose though its getting too social to remain useful for much longer. I get most of my news from The Daily Show. News is generally too awful not to laugh about it.

I’m on probably a dozen or more email lists. And that’s good enough. How much interaction is really necesary anyway?

Related posts

Artist’s Guide to GIMP, 2nd Edition



[Print This] By mjhammel ~ May 1st, 2012. Filed under: General.

…went to press last friday, April 27th, 2012. No word yet on shipping date for orders, but if I hear anything I’ll post it here.

The companiion web site is going live now.

Related posts

Why ChromeOS isn’t using X



[Print This] By mjhammel ~ April 14th, 2012. Filed under: General.

Found this article today. Pretty interesting, maybe if only because I agree with the guy about X still being very viable in todays embedded market.

http://www.wiredvanity.com/articles/34/on-the-x-windowing-system-and-why-google-isn-t-using-it-for-chrome-os

Related posts

Not all gifts are new



[Print This] By mjhammel ~ January 2nd, 2012. Filed under: General, Personal, Writing.

My wife picked up a really interesting gift for me this holiday season.  It's a copy of the first book I can remember checking out of a library as a kid.  It's called Pat and the Iron Horse.  I don't actually remember the story that well.  It has something to do with the great Irish potato famine and a young man coming to America to work on the railroads.  I do remember enjoying it.  A little box filled with a whole different world.  And it was all mine.  Well, until I had to check it back in. 

But now I have my own copy.  To keep and cherish.  What's great about a gift like this is how it is more about who I am than what I want.  I love that she remembers what's important to me.  Books will always be very important to me.  Real books.  Not digital copies.

Related posts

F16 an XFce: minor bits migrating from GNOME 2



[Print This] By mjhammel ~ December 11th, 2011. Filed under: Fedora, General, Linux, XFce.

So I've upgraded three machines to F16 (from F14) so far, two at work and a laptop at home.  The latter I spent a lot of time tweaking to work as much like my old GNOME 2 setup.  XFce comes close but there are some tweaks an I have a few nitpicks.  These are my notes.

Firstmake a list of all your GNOME panel-based applets and applications. 

I have a ton of menus in a panel across the top of my desktop.  I don't use the default menus much (except for an occasional use of the Applications menu).  Instead I organize my panel with a bunch of GNOME drawers, some with drawers within them.  There is no easy way to migrate these to XFce (that I know of, at least).  So I opened the properties for each applet and application icon and noted its menu position and command in  a text file.  When I got F16 up and running with a default XFce panel, I started adding these back in manually.  It's a bit of work if you have as many things in your panel as I do.  But it should only have to happen once, really.

xscreensaver can't be disabled in a session managed manner.  If you kill it, logout and login, it comes back on.  To solve that, I juse removed the package.

Firefox 8 doesn't work with my old theme (Vfox3-basic, a Mac-style theme).  I found a different Mac-based theme it's not as nice as Vfox3-basic.  Also, if you hover over a link it displays in the canvas, not in the status bar, making it difficult to read if there is text in the canvas at that spot.  Finally, the bookmarks toolbar font does not match the Firefox (re: system) font.  This is probably a theme issue.  All those Firefox updates are probably making it hard for theme authors to keep up (and Personas are useless).  To bad Chrome is just as bad.  Might be time to start exploring alternatives based on WebKit.

Worse problem encountered:  CPU fans constantly running in my laptop.  I Googled for this and ran into discussions about the compositor (3d effects) causing the problem.  However, those problems were with nVidia boards and the laptop has an Intel 915GM.  I turned the compositor off and didn't see much difference.  The problem was a bunch of "Tracker-*" tools that XFce started in its session configuration.  I disabled all of those and the CPU usage dropped dramatically.  CPU temps went from 179 F with the Tracker's on to 105F with them off.  Fans are also essentially silent now.

XFce has a bunch of extra utilities collectively called Goodies.  But these are not packaged together and are apparently not in the XFce group installed by the default XFce choice during F16 installation.  So you have to install them manually.  These include a bunch of panel bar applets.

  • xfce4-cpugraph-plugin
  • xfce4-datetime-plugin
  • xfce4-genmon-plugin
  • xfce4-netload-plugin
  • xfce4-sensors-plugin
  • xfce4-systemload-plugin
  • xfce4-weather-plugin
  • xfce4-wmdock-plugin

Some of the other minor nits I have with XFce:

  • Panel menus don't inherit alpha of panel they live in and you can't configure them individually.  Window Manager Tweeks->Compositor "Pop Up Windows" applies alpha to menus but also to the icons in them so it's not useful for this purpose.
  • The Launcher is actually used the same way as a GNOME drawer – providing a panel menu – but can't set the drawer icon without linking to an application or else you get an error if you click on it (however, you could use /bin/true as a workaround)
  • Monitor applets (CPU, Network, etc) are thin bars instead of boxes.  Boxes are easier on my old eyes.
  • DateTime plugin: two lines of text is annoying, no way to make it one line but it has a better Calendar than the other datetime plugins.
  • xfapplet doesn't work with GNOME 3 (another reason to hate GNOME 3) and GNOME 2 applets aren't available anyway.
  • Default double click on title bar for shade requires *very* fast click.  Settings->Mouse dialog: Behavior Double Click Time set to 310 seems to be a better setting.
  • The Weather plugin doesn't seem to work.  It never updates ("No Data").

Worse thing that happened in the upgrade for the laptop:  The "d" key is flaking out on me.  It is a 7 year old laptop, but still.  That's the last time I clean the keyboard. 

Updates

2012-01-09

PulseAudio is not working properly and Alsa does not allow multiple applications to share audio output.  I was listening to an online music stream and tried to run Skype but the latter complained about audio problems.  The only way to get it to work was disable the online audio stream.  XFce does not have the PulseAudio configuration tool found under GNOME 2 so I could not select the application which would get the audio output.  Also, the only selection for output device in Skype that works is "HDA NVidia, ALC888 Analog".  Choosing "pulse(pulse)" doesn't work. 

X-Chat does not show up in the system tray (re: Notification Area).  No work around for that.  Bummer – I used to use the flashing system tray icon to notify me of incoming messages.

XFce's Workspace switcher bogs down badly.  I have two monitors using nVidia's driver for TwinView.  One workspace has a browser and evolution open.  Another workspace has 10-12 GNOME terminals plus a few other windows.  Moving from the former to the latter has a significant pause before changing, and the display update is very slow.  I'm not sure if this is a problem with the kernel, the nVidia driver or XFce's window manager or workspace switcher.

ssmtp has stopped working.  It's the same version as I was using with F14 and I've tried building it from source too.  Just refuses to work.  I've got suggestions to check the TCP packets to debug the problem as well as a suggestion to use msmtp instead.  Both are on my todo list.

2012-02-19

msmtp worked out as a replacement for ssmtp.  It requires only a migration of the configuration file that describes how to connect to the remote mail server.  So that's a plus.  At work, I'm generally okay with how things function with F16 and XFce, though the workspace switching delays are very annoying.

But things are getting worse.  I just upgraded my primary desktop at home yesterday after having learned to live with the idiosyncracies of F16 and XFce at work and on my personal laptop.  But today I noticed a few new things.

Rhythmbox doesn't show up in the Notification applet.  That's a bit of a pain because I control that app from there instead of bouncing over to the workspace where the window is open.

xbmc locks up while browsing videos.  I have 500+ movies on my servers at home and I watch them while I work.  The media streams over the 802.11g wireless connection.  This worked fine for F14 (and my computer hooked to the big TV is still on F14 and works fine with XBMC).  But xbmc locks up on F16.  I think this is either an issue with MesaGL or with the kmod-nvidia drivers.  I always use nVidia's drivers and not nouveau and it's always just worked.  Also, only one of the available movie players (Totem) could play the ripped ISO files when launched from the desktop menus.  I know xine and mplayer with play them but I have to launch them manually and that's a pain.  And Totem died while playing back the first movie I tried (Indiana Jones) even though XBMC always played that one without issue.

This particular issue is a major pain to me.  It's how I work at home – watch a movie while I work.  Now it doesn't work.  That's a major step back.  I seriously considering dumping Fedora on my primary desktop and replacing it with CentOS just so I know it will work properly.  I've already replaced Fedora on my development server with CentOS 6.2 for the same reason. 

I know Fedora is a bleeding edge platform, but if users can't use it they're gonna lose out to other, more long term stable and supported bleeding edges.  I'm getting kind of tired of things taking a step back with each Fedora release that require special care to get back to where you were.  It's not really worth the effort, though not even this will make me move to Ubuntu.

Related posts

F16 Upgrade Notes



[Print This] By mjhammel ~ December 9th, 2011. Filed under: General.

I’m playing with F16 at work, prep’ing for the big migration from F14.  I’ve already installed a laptop.  Now I’m doing a dual-core server.

The first thing I noticed that is different from my usual installation process is that the asknetwork boot option to anaconda doesn’t work.  The boot process never asks for the network configuration.  However, applying the network configuration manually as boot options works as a workaround.  So the F16 command line options are now the following:

askmethod ip=<addr> netmask=<mask> gateway=<addr> dns=<addr,addr> noipv6 noselinux selinux=0

I don’t use IPv6 behind the firewall because I don’t need it yet.  I supposed I’ll be forced into it eventually, but for now this still works.

Also, the boot process hangs doing something with systemd.  After setting the boot options and hitting enter, the boot process blanks the screen and then just sits there for quite a while – perhaps a couple of minutes.  If this happens to you, be patient.  Systemd eventually times out and logs an error about “no such directory”.  After that, the install process continues as usual.

I actually have a very detailed process on how I do my upgrades that I need to put on my wiki.  Well, eventually.

Related posts

writev() vs send() when using signals



[Print This] By mjhammel ~ August 9th, 2011. Filed under: Linux, Software Development.

I ran into an interesting problem today.  I have a C application with functions calling writev() to send data across the network.  The messages being sent range from very small – a few bytes – to over 1MB.  These functions have worked great up to this point.

Today I integrated a number of high resolution timers.  When the timers go off they raise a signal which is handled by a signal handler.  It turns out that writev() can be interrupted by these signals.  Unfortunately, it doesn't seem to recover correctly from that interruption.  I haven't figured out why, but I did find out that send() does recover correctly.

Since I don't need the feature provided by the iovec structure writev() uses there was no need to keep it.  So I switched to using send() in these functions, along with wrapping the call inside a loop to guarantee the full message was sent.  See, the signal causes the send() to return early, but it returns the number of bytes it actually wrote.  So you can catch that it didn't send everything and just try resending whatever is left. 

This works great and is not affected by the frequent signals.  This was interesting only because I didn't see anything in the man pages warning me about the problems with writev() and signals.  But at least now I know what to do if I hit this problem again.

Related posts

Working with timer_create() to use multiple timers using a single signal



[Print This] By mjhammel ~ August 5th, 2011. Filed under: General, Linux, Software Development.

The man page for timer_create() (used in applications, not in kernel code) gives a useful example of how to create and start high resolution timers.  However, it fails to mention that if you use multiple timers with a single signal then you need have a single signal handler that can identify which timer just went off and pass control to the timer-specific handler.

The way to do this is as follows.  Start with a function that creates and starts timers, makeTimer(). 

static int
makeTimer( char *name, timer_t *timerID, int expireMS, int intervalMS )
{
    struct sigevent         te;
    struct itimerspec       its;
    struct sigaction        sa;
    int                     sigNo = SIGRTMIN;

    /* Set up signal handler. */
    sa.sa_flags = SA_SIGINFO;
    sa.sa_sigaction = timerHandler;
    sigemptyset(&sa.sa_mask);
    if (sigaction(sigNo, &sa, NULL) == -1)
    {
        fprintf(stderr, "%s: Failed to setup signal handling for %s.\n", PROG, name);
        return(-1);
    }

    /* Set and enable alarm */
    te.sigev_notify = SIGEV_SIGNAL;
    te.sigev_signo = sigNo;
    te.sigev_value.sival_ptr = timerID;
    timer_create(CLOCK_REALTIME, &te, timerID);

    its.it_interval.tv_sec = 0;
    its.it_interval.tv_nsec = intervalMS * 1000000;
    its.it_value.tv_sec = 0;
    its.it_value.tv_nsec = expireMS * 1000000;
    timer_settime(*timerID, 0, &its, NULL);

    return(0);
}

The function takes a pointer to a timer_t variable that will be filled with the timer ID created by timer_create().  This pointer is also saved in the sival_ptr variable right before calling timer_create().  In this function notice that we always use the SIGRTMIN signal, so expiration of any timer causes this signal to be raised.  The signal handler I've written for that signal is timerHandler

static void
timerHandler( int sig, siginfo_t *si, void *uc )
{
    timer_t *tidp;
    tidp = si->si_value.sival_ptr;

    if ( *tidp == firstTimerID )
        firstCB(sig, si, uc);
    else if ( *tidp == secondTimerID )
        secondCB(sig, si, uc);
    else if ( *tidp == thirdTimerID )
        thirdCB(sig, si, uc);
}

The handler checks that the value stored in sival_ptr matches a given timerID variable.  The sival_ptr is the same as the one we set in makeTimer(), though here it lives in a different structure.  Obviously, it got copied from there to here on the way to this signal handler.  The point is that the timerID is what is used to determine which timer just went off and determine what to do next.

All that's left is to create a timer.  Here's an example.

timer_t firstTimerID;

static int
srtSchedule( void )
{
    int rc;
    rc = makeTimer("First Timer", &firstTimerID, 40, 40);
    return rc;
}

This schedules a timer to go off every 40 milliseconds.  On my board (an embedded PowerPC-based board) the high resolution timers have a resolution of 4ms (see clock_getres()) so 40ms shouldn't be a problem.  The callback associated with this timer, firstCB(), is not shown here because it's specific to the application.

There is a lot of other stuff you can do with these timers.  You can check if the time overrun should cause an adjustment in the timer.  That helps sync with the real time clock.  Also, as with interrupts in the kernel, you should keep signal handlers fast and efficient.  Don't do anything that takes a very long time to complete.  Typically giving a thread a kick to do something should be sufficient.  But that really depends on your application.

 

Related posts

Quick note: Installing Fedora on an Asus Intel i5 w/ nVidia fails unless….



[Print This] By mjhammel ~ August 5th, 2011. Filed under: Fedora, General, Hardware, Intel, Linux, NVidia.

I'm installing on an Asus A53S at work using Fedora 14.  I won't use Fedora 15 until they clean up the GNOME 3 fiasco (I want my old workflow, not something cool just to be cool).  The installation fails when it tries to launch X.  If you don't want a stripped down system (ie by using the "text" option to the boot commands) then you need to use the following options to get a standard VESA display.

blacklist=nouveau xdriver=vesa usefbx

The first option disables use of the open source nVidia driver.  The second tells the installation to use VESA but without the framebuffer driver you still may not get things working.  Leaving any of these out can cause the X display to lock up.  At least this way you get a full X environment, after which you can attempt to get nVidia's drivers working with this.

 

Related posts

Finally updated 2010 Dept56 village images



[Print This] By mjhammel ~ April 23rd, 2011. Filed under: General.

It's rather late, but I finally uploaded the images from this years village setup.  The images are not as good previous years because I just didn't have the time to set up the shots.  Ah well.  I'll do better in 2011.

New images are ready for browsing.  I've also updated the list of buildings we have by listing the North Pole Village items.

Related posts