Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, November 08, 2011

Building ElectricSheep on Fedora 16 (and enabling in KDE4)

UPDATE: Apparently these steps also work on Fedora 17. Moreover, if you use Gnome3, there are some additional instructions that can help you get ElectricSheep setup.
Quick link: Updated makeSheepFedora16.sh install script
A while back, I wrote a post summarizing how to get ElectricSheep running on Fedora 15 with KDE 4.6.5. Today, I "upgraded" to Fedora 16 and was surprised to find that library updates were incompatible with ElectricSheep. Symbol mismatches made it impossible to simply symlink old shared libraries to new shared libraries. Moreover, the version of electricsheep that built fine on Fedora 15 would not build on Fedora 16.

So I made some modifications to Tait Clarridge's script to fix the build. My hacks seem to work for me so far; hopefully they do not introduce regressions into the already old version of electricsheep.

So to get ElectricSheep running on your Fedora 16 system, try downloading and running my modified makeSheepFedora16.sh script. As a bonus, it (hopefully) will install ElectricSheep as a screensaver if you are running KDE. However, the same DPMS caveats about mplayer from old post still apply until Fedora updates their mplayer to a recent version (why does it take these people so long?).

Wednesday, August 31, 2011

Electric Sheep on KDE 4.6.5 with Fedora 15 (using Intel graphics card)


This post begins with a few important updates; scroll down to see the bulk of the original post.

Fedora 16 update: If you are using Fedora 16, then see updates from a newer post about how to get ElectricSheep built and running.

DPMS Update (getting monitors to sleep/standby/suspend/turn off on schedule again): It turns out that electricsheep is preventing my monitors from getting DPMS sleep/standby/off signals because of a bug in mplayer that was fixed today in SVN r34074. If you pull down the updated mplayer and build it yourself, your DPMS problems with electricsheep will be fixed. If you aren't willing to pull down the SVN source and build the fixed binary, you could use something like this sample electricsheep-wrapper script that starts both electricsheep and a secondary process that reads waiting times from xset q, sleeps for those times, and then issues the appropriate xset dpms force commands. To use the hack, all references to electricsheep in KDE or xscreensaver configuration files must be changed to electricsheep-wrapper and the electricsheep-wrapper script has to be installed in a directory in the PATH. Or, again, you can just wait for mplayer to get patched in your Linux distribution.

KDE update: electricsheep's SourceForge SVN includes a Desktop file for KDE, and so I've updated the stuff below to use it instead. It's probably a good idea to check out their updated SVN repository at GoogleCode to see if the support files have improved.

Multiple Monitors update: KDE will stretch one electricsheep across all of your monitors. Instead, if you want electricsheep to put a different instance on each monitor, use xscreensaver instead of kscreensaver. To do so, you'll have to follow the instructions for using xscreensaver on KDE, which are also on the xscreensaver man page. I modified step 4 to use my own custom system-level kscreenlocker that doesn't force everyone on the system to use xscreensaver. Additionally, to get electricsheep to show up in the xscreensaver-demo menu, you need to not only install the relevant electricsheep.xml file (find it in the source repo's or built it yourself), but you also have to add a line to your own ~/.xscreensaver configuration file. I don't know why the former doesn't generate the latter. On one of my machines, it does. On the other, it doesn't.

Of course, YMMV.


I installed electric sheep today because I was bored of my ASCIIQuarium KDE screensaver and not thrilled about the other options (some of which bail out on my dual screen Intel setup). [ If you're not familiar with Electric Sheep, you should check out the Electric Sheep Wikipedia page which discusses how the screensaver evolves over time. It's a distributed computing project, and the genetic algorithm that guides the evolution actually takes input from Electric Sheep users (well, not me, because I don't have the keyboard support to "up" and "down" the sheep I see). So the screen saver is constantly downloading and processing new AVI's, generating new content, and contributing it back to the network. I like it because it's pretty screen saver diversity at the cost of a few computing cycles and some disk space. ] It wasn't so bad, but it also wasn't trouble free. Here's what I did (which almost worked entirely without me having to do anything special):
  1. Use the Fedora-specific script from Tait Clarridge's page on downloading and installing electric sheep in Fedora (if you are running Fedora 16, see my updated script instead).
  2. Learn from Giulio Guzzinati about the need to add an electric sheep KDE Desktop file to get the screensaver into the KDE Screen Saver configuration tool.
Unfortunately, Giulio Guzzinati's desktop file didn't work for me, and so I had to build my own use the desktop file inside the electricsheep distribution. Here the file that ended up "working" for me (which is downloadable as electricsheep.desktop, but I copied from electricsheep.desktop.kde in the SVN repo).
[Desktop Entry]
Exec=electricsheep
Icon=kscreensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
TryExec=xscreensaver
Actions=InWindow;Root;Setup;
X-KDE-Category=Fractals Screen Savers
X-KDE-Type=xv
Name=ElectricSheep

[Desktop Action Setup]
Exec=electricsheep-preferences
Name=Setup...

[Desktop Action InWindow]
Exec=electricsheep -window-id %w
Name=Display in Specified Window
NoDisplay=true

[Desktop Action Root]
Exec=electricsheep -window-id %w
Name=Display in Root Window
NoDisplay=true

X-Ubuntu-Gettext-Domain=desktop_kdeartwork
As explained in Giulio Guzzinati's post, you can place that file in
/usr/share/kde4/services/ScreenSavers/
You can probably put it in
~/.kde/share/services/ScreenSavers/
as well (you might have to create that directory first) if you'd rather do something local. That put the Electric Sheep across both of my monitors. If you'd rather put a separate electricsheep in each monitor, use xscreensaver instead of KDE's screen saver. If you're having trouble getting your monitors to go to sleep while electricsheep is running, then you need to get an updated mplayer that fixes the bug that causes that problem (see the updates at the top of this post for more information). Alternatively, you can use a hack like this electricsheep-wrapper script to re-enable DPMS-like timeouts during the screensaver. To use the hack, all references to electricsheep in KDE or xscreensaver configuration files must be changed to electricsheep-wrapper and the electricsheep-wrapper script has to be installed in a directory in the PATH. However, it probably won't be too long until the mplayer DPMS fix reaches your Linux distribution.

Monday, August 22, 2011

Converting an EMF (MetaFile) on Linux using unoconv

When I needed to convert a graphic from an EMF (Windows Enhanced MetaFile) on my Linux machine today, all of my Google searchers were turning up with conversion utilities for Windows or wine at best.

Fortunately, it appears as though unoconv converts from EMF and is available in the standard Fedora repositories. I issued:
unoconv MYMETAFILE.emf
and it spit out a MYMETAFILE.pdf, and I was happy.

Tuesday, March 08, 2011

Installing Adobe Digital Editions on Linux with Wine

UPDATE: I have not had time to address the download issues some people have had when trying to install ADE. However, see the comments on this post for some additional tips on where to find an ADE installer download that you can run inside Wine.
Unfortunately, Adobe does not provide a simple download link for the Windows version of Digital Editions, and so if you want to purchase a PDF or ePub e-book with Adobe ADEPT DRM protection, it is very difficult to get up and running on Linux even if you have Wine installed. Here's how I did it.
  1. Install Wine on your system. Most Linux distributions provide Wine as an optional install (e.g., sudo yum install wine from the command line on Fedora).
  2. You will need Gecko extensions available to run the iexplore.exe web browser that comes with Wine. Visit the Wine Wiki's Gecko page for information on how to install Gecko. Your Linux distribution may have a "wine-gecko" package. If it doesn't, then follow the simple instructions on the Wine Wiki.
  3. You will also need Adobe Flash installed on your Wine system, and so you should visit the Wine Wiki's Flash page to get the install_flash_player.exe download link. Download the exe and run it in Wine (e.g., wine install_flash_player.exe from the command line).
  4. Now, start the iexplore.exe browser bundled with Wine. After I ran Wine for the first time, it setup a .wine directory in my home directory (i.e., ~/.wine). I found the iexplore.exe in ~/.wine/drive_c/Program Files/Internet Explorer. Change to that directory and run iexplore.exe (e.g, wine iexplore.exe from the command line).
  5. Now you can visit the Digital Editions installer (which is written in Flash). From the Wine Internet Explorer, enter in the URL:
    http://www.adobe.com/products/digitaleditions/ade_web_library.swf
    That should startup a little installer. Follow the prompts to download and install Digital Editions. You will even be able to launch it from there.
    • The installer will install the single Digital Editions executable to ~/.wine/drive_c/Program Files (x86)/Adobe/Adobe Digital Editions as digitaleditions.exe.
    • You can run it again but executing that file through wine (e.g., wine digitaleditions.exe from the command line in that directory)
    • Alternatively, you can use the "Digital Editions" shortcuts that the installer probably placed on your desktop.
  6. Once Digital Editions is started, you should be able to drag-and-drop ACSM files you've downloaded from e-Book commerce sites (like Google Books), and it should download the Adept-DRM'd version of your media.
    • DRM'd books are stored in the My Digital Editions folder that will be created in your home directory.
    • If you want to put them elsewhere, you need to edit the symbolic links in ~/.wine/drive_c/users/USERNAME where USERNAME is your Linux username. The My Documents folder was symlinked to my home directory by default. I got rid of the symlink and created a real directory there instead, but you could point the symlink somewhere else if you'd rather. Regardless, the My Digital Editions folder will reside inside the My Documents folder (alongside a My Books folder, but I don't know what gets put in there... maybe non-DRM stuff you put into ADE?).
Once you have your DRM'd books, you should be able to transfer them onto devices that have also been authorized with your Adept key (e.g., a Sony Reader that has been authorized with the same account you used inside Digital Editions). I suppose it's possible to get the Digital Editions running inside Wine to notice when your reader is connected, but I haven't tried it (that might involve installing the Sony Reader Library software within Wine, and I received some ugly errors when I tried to do that (but YMMV)).

Sunday, March 06, 2011

Another rant on the supremacy of rolling release cycles for OS distributions (why Arch beats Fedora and Ubuntu)

As I sit here right now, I notice that my Arch Linux package manager ("pacman") is downloading KDE 4.6.1. KDE 4.6.0 was released at the end of January, and it was automatically installed on my system shortly after it was released. I don't notice a lot of new features, but there is one feature that I now use all the time. For a long time, dragging a KDE window to one of three edges of the screen would cause it to either be maximized (top) or resized to fill either the left half (left) or right half (right) of the screen for easy side-by-side tiling. This feature exists in Windows Vista, and I know a certain fiancée who uses it all the time. In KDE 4.6.0, they've added more granularity – the left and right edges of the screen are now partitioned into thirds. Dragging a window to the top or bottom third causes it be resized for a quarter of the screen as opposed to a half of the screen. The middle third resizes for half of the screen as before. So now it is easy to do even more sophisticated tiling by dragging, and I use it all the time.

But I can't use that feature on my machine at the office (Fedora 14) nor the HTPC connected to my TV (Ubuntu 10.10). That's because both Fedora and Ubuntu are on 6 month release cycles, and KDE is also on a 6 month release cycle. Consequently, my Fedora office machine is stuck back on some KDE 4.5.5 components, some 4.4.10 components, and some KDE 3.5.10 components, and it seems arbitrary which components are which KDE version. More importantly, it may be another year before I can ever expect to get quarter-window tiling on these machines (enterprise distributions, like RedHat EL, are even worse; you may wait a decade for features to trickle down the official release path). There are ways in which these distribution gatekeepers try to get around this delay by supporting auxiliary repositories of updated software, but then that is a whole other mess I would have to cover in another rant.

It's frustrating to me that these Linux "distributions" take on a release cycle that elevates them to a level on par with the software that supposedly is the sole driver of their value. It is one thing to wait for the next release of Windows to come out because Windows is a product itself; however, Ubuntu or Fedora is just a distribution – a glorified collection of independent software components that are possibly rapidly evolving and have some dependency structure on each other. Arch Linux recognizes this. It recognizes that a good package manager trumps a great "distribution" any time, and pacman is a great package manager (and it doesn't have a stupid name, like "yum" or "apt-verb", and isn't just a wrapper for yet another silly-named package manager (like "rpm" or "dpkg")). In doing so, it allows for everything from minimal Linux installations to maximally bloated Linux distributions, with the distinction that every package is truly up to date (and not just up to date relative to some arbitrary collection of version numbers). Arch Linux is not the only distribution with this nice feature. Gentoo, for example, also uses a rolling release cycle... and Gentoo is also well-known for its excellent package manager "emerge".

[ ...and on the subject of package managers, the pacman-wrapper yaourt augments the terrific pacman with the ability to automate building packages from source, even when you want to both customize your build environment and automatically build updates when they are available... so yaourt brings some of the nice features of Gentoo's rolling release cycle directly to Arch Linux's rolling release cycle ]

Frustration is certainly not the only feeling I can associate with the Fedora and Ubuntu distributions forced on me (by my employer in the former case and Boxee in the latter case); there's also fear. Every six months with Fedora or Ubuntu, you have to go through the horror of upgrading the entire distribution at once. I'd rather tackle upgrading problems with one package at a time as opposed to the entire OS twice a year. Not to mention the psychological trauma that upgrades cause – regardless of how nice the system works, I always have in the back of my head that maybe it would be better if I just formatted and installed fresh right now (but then the fear of the next upgrade prevents me from doing that). An operating system should not be a major cause of distress, but I find nothing but distress in Ubuntu, Fedora, and the other deleterious distributions in that pernicious pack that do not adopt rolling releases.

So there you go. I just quarter-window tiled this window, and it saddens me that when I go back into the office on Monday, I will lose half my day to half-window tiling and resizing... and then I'll lose a day or two later this year when FC15 comes out. Stupid six-month distribution release cycles...

Friday, February 11, 2011

Scripts to get Mercurial up and running on OSU CSE machines (SunOS and Linux)

UPDATE: A day after I posted this, Mercurial and Python (and Git) were added as optional subscriptions for users of these machines. So login to your desired machine and execute subscribe, then select MERCURIAL and whatever PYTHON is available (version 2.4.x or higher). Quit subscribe to save your changes, and re-login (of course, you can also do the same thing with GIT).
If you are a student, staff member, or faculty member in the Computer Science and Engineering department at The Ohio State University, you may have found yourself wanting to use a DVCS like Mercurial (hg) for SCM. Unfortunately, the version of Python that comes bundled on these enterprise systems prevents installing Mercurial, and some other issues on the SunOS system (like the lack of round() in the math library) prevent building a recent version of Python 2 that is needed for installing Mercurial. There are ways around this mess, and I have done my best to automate them within a script.

So give it a shot:Download the appropriate script to your desired target machine. Next, edit the script (e.g., using pico, nano, vi, or emacs) to verify that the INSTALLDIR location at the top of the script is what is desired – if you are going to run the script on both types of machines, your INSTALLDIR must be different in the two scripts. Then run the script on the machine (e.g., ./install_hg_osu_cse_sun.sh) and follow the instructions. The script is interactive, and so you will be able to manage its behavior as it runs. Be sure to follow its instructions at the end about setting your PATH and PYTHONPATH; if you ran the script on both types of machines, you will have to be clever in your script RC/profile file to set these differently based on the machine you are on – I recommend using uname to detect the different machine type.

After that, you should have a working Mercurial. In the Linux script, you may adjust the Mercurial and Python 2 versions downloaded, but in the SunOS script, you need to leave the Python 2 version alone as later versions of Python will not build on the SunOS machines (due to the problems with the old math library). On either machine, if you are adventurous, you can use the installed Mercurial to clone the stable Mercurial repository (hg-stable) and keep your installed Mercurial up-to-date with the very latest stable version.

Thursday, February 10, 2011

PlugBox Linux on my Pink PogoPlug: 4GB USB partition was the key

So I just installed Plugbox Linux on my pink PogoPlug v2, which was selling for about $50 on Amazon when I bought it last week.

The only problem I had was solved when I put my entire Plugbox Linux distribution on a partition of my USB stick that was only 4GB (or smaller). I used an ext3 file system, but an ext2 file system works as well (and probably FAT too). I made the partition bootable in the partition table, but that isn't necessary with the way the current version of u-Boot looks for the kernel. u-Boot looks for a partition with /boot/uImage on it. Others say that they've put /boot on a small 32MB partition by itself, but I had to put everything on one partition.

To figure all of this out, I did enable the netcat console. That let me watch u-Boot as it booted before it hands things off to the kernel on uImage. However, if I would have used a 4GB partition (or smaller) to begin with, I don't think I would have even bothered setting up the netcat console.

Hopefully everything keeps working!

Monday, July 23, 2007

The Quick Reference Site (Cards and Books)

UPDATE 3: I did find the source of that regular expression card at Gordon McKinney's Pro IT Blog. Well, it's not a LaTeX source, but it's at least in letter format.

UPDATE 2: I found another good list of quick reference cards at the plantOzh blog. It includes a a regexp card, Perl 5 booklet, and CSS cards (1.0, 2.0). Yes, these cards are archived at the blog, so all of the commentary below still applies.

UPDATE 1: It's also annoying when someone simply archives existing quick reference cards because sometimes those archives use A4 paper. If these were linked to their origins, the source code (perhaps LaTeX) might be available, making a conversion to letter paper easy.

Lately, I have been quick reference happy [1, 2, 3, 4]. I cannot explain why, but I suddenly want to surround myself with quick references.

I think I found a great new quick reference resource. It's The Quick Reference Site, which features quick reference cards, e-books, and other papers and tutorials. From the site:
Throughout the years I have collected a huge pile of documents that deal with almost every aspect of software development. The purpose of this site is to centralize this information and to make it available to everyone who may need it or shares my passion on this subject. There are still a lot of documents in my "archive" that I like to share with you all.
At the moment this site represents only a fraction of what I want to provide, so a lot of work still needs to be done. As a result, you should consider this site as a work in progress. I'll try to keep you updated on the most challenging, powerful and continuously evolving software technologies of the moment. I hope that especially Java and C++ fanatics (like myself) will find some valuable information over here.
As far as I can tell so far, the author archives quick references that he has found over time and links us, the readers, to those archives. The advantage of this is that it minimizes the chances of broken links. The disadvantage is that the archives may not be the most recent versions. Additionally, if this site ever goes down and our bookmarks point there, those bookmarks will be broken.

Some quick reference cards that I want to point out (if you go to his list, you can also read descriptions of these programs):

So, that's fun.

On a slightly unrelated note, you can also check out Hawk Wings to find a QuickSilver quick reference and the QuickSilver user manual.

Wednesday, July 18, 2007

MATLAB Quick Reference Cards (and more)

UPDATE: I list an AMSTeX reference card below. There is also an AMSLaTeX reference card available at refcards.com.

This is meant to be a follow-up to the "TeX Reference Card (and others)" post.

I found a list of a bunch more quick reference cards, which include applications/packages like MATLAB, MATLAB toolboxes, Perl, MFC, MySQL, Linux, UNIX, Vi, Vim, Windows, AMSTeX, TeX, and a bunch more...

However, I was just looking for MATLAB quick reference cards. So, here are these (some of which did not come from the above site):
So, that's nice. I recommend one of the bottom two [i.e., 1, 2].