Tuesday, July 22, 2014

One Last Reminder About Flash and Java

I'm late to the game, but via TenFourFox Development and reiterated at PowerPC Liberation, the danger from Flash and Java on OS X PowerPC is no longer hypothetical but real. We knew sometime back that the Flashback virus exploited holes in older versions of Java, and if anyone ever compiled its payload as a universal binary we'd be screwed, too. Now we have recent news that Flash has its own killer virus out in the wild called Rosetta Flash. It works in a similar fashion, using security holes to take over your machine, and PowerPC versions of Flash will not be updated to fix it. So like Cameron Kaiser says, it's time to definitely stop using it.

As fiftysixk suggests, though, saying goodbye to Flash can also be an opportunity. There are dozens of ways to bypass its plug-in and stream video through external players. There's PPC Media Center, MacTubes, YouView, TenFourFox's QTE plug-in, various Mplayer plus Youtube-dl hacks, to name a few. The Youtube-dl hacks can be interesting. Youtube-dl supports a ton of sites, not just Youtube, and is frequently updated. In fact, it's the backend for PowerPC Media Center. You can also use Youtube-dl with Mplayer, with a terminal command like this (UPDATE: it appears this no longer works as Youtube broke the "--prefer-insecure" option, natch):

mplayer -quiet -framedrop -cache 8192 -cache-min 10 -cookies -cookies-file ~/.cookie.txt $(youtube-dl -gf 18 --prefer-insecure --cookies ~/.cookie.txt $(pbpaste))

Unpacking it from the inside out, "pbpaste" pastes the copied video URL into the Youtube-dl command retrieving the direct video URL, which is then passed to Mplayer to play. The "--prefer-insecure" option is needed because Mplayer can't play HTTPS links. However, Linux users can use Mpv and drop that option since Mpv plays HTTPS links just fine. Also on Linux, you'd want to install the package xsel and replace "pbpaste" above with "xsel --clipboard". Then save it as a bash script and you're rockin'.

As for Java, a faustian informant tells me there's a Java 6 version available for OS X PowerPC, but I believe it's too old to have the security fixes for the Flashback virus. There's a thread at the Minecraft Forums talking about it, and people also talk about using it to play Runescape, but it's still a huge security hole. You don't want to do any gaming like that unless you can completely disconnect from your network.

Let's stay safe out there!

Friday, June 13, 2014

Mpv a Better Mplayer?

You may have seen references here and elsewhere to a new kid on the video-player block called Mpv. It's a fork of Mplayer2, which is a fork of Mplayer, which must be feeling so inadequate right now. So how does Mpv compare? It has a few new features but is generally the same as Mplayer, a shell-based video player with a thousand options under the hood. So I thought I'd do a little test comparison, running the same files through each player and see how they measure up in CPU usage. Just for kicks, I'll throw in VLC, too.

For my testing, I used a Powerbook with a 1.5 GHz G4 running Debian Wheezy. As Mpv is only available in the Jessie repository, getting it on Wheezy was a bit of a pain but possible. Also, I used three movie files to compare: a black and white 640 X 480 Xvid file, and two color 720p files, one an mp4 and the other an mkv. This testing isn't all that rigorous or in-depth, but I think it's useful as a general impression and might be an eye-opener. On to the numbers!

I'm too lazy for tables, so here are the CPU percentages for the standard def Xvid (rough average after a few minutes of playing):

Mplayer – 26%-28%
Mplayer2 – 30%
Mpv – 30%
VLC – 34%

And the 720p mp4:

Mplayer – 60%
Mplayer2 – 78%
Mpv – 65%
VLC – 76%

The 720p mkv maxed out the CPU with heavy frame skipping, so the following results are with the skiploopfilter=all option:

Mplayer – 100%, occasional frame skipping
Mplayer2 – 100%, constant frame skipping
Mpv – 100%, occasional frame skipping
VLC – 100%, constant frame skipping

So for CPU efficiency, Mplayer still comes out the best, but Mpv is a definite improvement over Mplayer2. As some additional information, I only used the drop late frames option on the first two files, passed as "-framedrop" in Mplayer & Mplayer2 and "-framedrop yes" in Mpv (VLC has a corresponding option in its preferences). I also set my file manager to launch these files with a double-click, so I didn't launch them from a terminal.

None of this means Mplayer is automatically a better choice than Mpv. Mpv has several new features, like an improved onscreen display and it can also stream HTTPS links which Mplayer can't. Lately Youtube's been throwing up HTTPS links for its videos, so Mpv is a necessity unless you use Youtube-dl and its --prefer-insecure hack (and for a debate on the etymological propriety of insecure vs. unsecure as can only be found on Github, look here!).

Also, Debian maintainers are having one of their periodic Olympus Mons-sized insanity episodes by eliminating Mplayer from Sid:

Yeah. That happened.

Sid and Jessie users can still get Mplayer from the deb-multimedia.org repositories, but still, Mplayer not part of your distro? Whuh?

I think I mentioned in another post that Mpv worked on G3s out of the box, whereas Mplayer (and VLC) had to be compiled with the "--disable-altivec" configure option. I recently found that the Mplayer and VLC from deb-multimedia.org worked perfectly fine on my G3 running Jessie. I don't know if this is true for Wheezy, but it might be worth a look.

And one last video note for OS X users, Adam A.'s Youtube-dl GUI, PPC Media Center, got a recent update with some Comedy Central fixes among other improvements, so download the latest from that linked post :)

Sunday, May 18, 2014

All You Can Do With Tenfourbird

It's been a couple of years now since Mozilla announced they were dialing back development of their email client Thunderbird and would basically proceed with security updates only, so you'd be forgiven if you thought there was nothing new to see here. Which brings us to Tenfourbird, TenFourFox's younger sibling (bastard hellspawn?) that brings current Thunderbird releases to PowerPC Macs. It turns out there have been new features recently added to Thunderbird (without a lot of hoopla), and lest you miss out, I thought I'd take a renewed look at all the ways Tenfourbird can take over help you manage your life.

I won't bore you with all the email features since we all know it's an email client that supports IMAP and POP and has a robust address book, etc., etc. One new feature you may not know of is its support for chat networks.

Tenfourbird chat

As you can see, the new chat feature supports IRC, Google Talk, and Twitter among others. I tried the Twitter client. It's not a full-fledged feature-rich one, but you can see your timeline, get real-time updates, and send out tweets.

Another great use of Tenfourbird is as an RSS and Usenet reader. They work in a similar way. You subscribe to feeds or newsgroups and they're displayed in the folder pane as folders with all your recent and unread messages. Very convenient for reading through a lot of headlines quickly.

Tenfourbird RSS and Newsgroups

Then there's the Lightning add-on that Tenfourbird is bundled with. When you enable it in the Add-ons tab, it gives you a calendar/task manager, and you can also sync it with your Google calendar by installing the Provider for Google Calendar add-on. Here's me demoing the events manager. As you can see, I'm not much of a calendar person.

Tenfourbird Lightning Calendar

One final new feature is called FileLink, where you can upload a large attachment to an online storage service and send the recipient a download link instead of emailing them the whole attachment. This is useful when going up against email size limits your server imposes, and it's all automatic once you set it up in the Attachments preferences. By default, you can set it up with your accounts at Box, Ubuntu One, or YouSendIt, and you can add Dropbox with the Dropbox for FileLink add-on.

Also on the subject of add-ons, Tenfourbird's developer provides versions of Enigmail specifically compiled for PowerPC, so you can have support for OpenPGP and have some semblance of privacy.

The only downside is there's no easy way to sync Tenfourbird's data across all your computers. You can use a file syncing utility like Unison to sync your Thunderbird profile folders, but you have to remember to actually sync them after each use. You can sync your online calendars to a degree, and if you only have IMAP email accounts then no problem there, but I have a mix of IMAP and POP accounts. On my secondary computer I have Icedove, so I set my POP account there to leave messages on the server so I can still download them onto my primary computer even if they're already read. That's not really syncing, but it keeps things more or less in order.

All in all, Tenfourbird gets five out of five stars.

Saturday, May 3, 2014

LibreOffice on PowerPC Lives (and so does TenFourFox)

It apparently escaped my attention that LibreOffice dropped support for Tiger and Leopard, and hence PowerPC, sometime about six months ago. What, doesn't anyone tell me anything around here!

Anyway, Tiger users can always dual boot Linux for new versions, but here's the good news. Someone stepped in and started a PowerPC port of LibreOffice for Leopard. That's right, Leopard users can download the latest version at OSU Open Source Labs. It appears the maintainer is very active and knowledgeable, having sent patches upstream, and he even uploaded screenshots for the eyes of the non-believers.

The last official release that supports Tiger is at the LibreOffice archives.

Meanwhile, I've been taking TenFourFox 29 beta out for a spin. It hasn't suffered from the bug from hell that has affected Firefox 29 on PowerPC Linux. I'm sure everyone involved would appreciate your contribution if you have any knowledge to lend. But back to TenFourFox, the new GUI is zippier than ever. Page rendering is fast even though I'm running on a separate profile with no script or ad blocking add-ons. If Mr. Floodgap keeps this up, it'll end up the goto browser for Snow Leopard.

Saturday, April 19, 2014

Integrate Rox-filer With Your Openbox Desktop

Awhile back I wrote about Rox-filer and I promised to augment that post with another detailing how to integrate it with your Openbox desktop, and right on schedule I'm here to do that now, several months later. Why Rox-filer, you ask? Besides being lightning quick, it's also somewhat similar to the old Mac OS 9 Finder so it brings back a bit of that Mac feel to your computer. It has its quirks and it takes a little extra work to set up things like desktop icons, mounting external devices, and integrating it with your Openbox menu, but it shouldn't take long with clear and well-articulated instructions. Okay, I can see your ironically raised eyebrows, but remember, this blog is free ;-)

Let's start with desktop icons. Rox has a Pinboard function that allows it to draw the desktop background and enable dragging and dropping icons onto it. It's not quite like other file managers where you drag and drop and the files get moved to the Desktop folder. Instead, dragging and dropping creates an iconified link on your desktop. The actual file remains in its original location.

So first you go into Rox's preferences by right-clicking on a Rox window and selecting "Options." Then click the "Desktop" section and make sure "Pinboard only" or "Panel and Pinboard" is selected (the Rox panel is somewhat gauche and ugly so I won't use it here). Next, in a terminal enter "rox --pinboard=MyPinboard" ("rox --pinboard=" with nothing after the equal sign conversely kills it). Here your desktop should turn a dull grey, because Rox is now painting your desktop. To get back your wallpaper, right-click on the desktop and choose "Backdrop..." and drag and drop your wallpaper file to the popup window. If you're wondering where your Openbox menu went, don't be alarmed. Go back into Rox's preferences, and in the "Compatibility" section click "Pass all backdrop mouse clicks to window manager." This gives you your Openbox menu back.

So now that you have it all set up, you can drag files (and applications) to your desktop. These are launchable icons that are right-clickable to bring down extra options, including removal. There are other options in the preferences for fine-tuning including choosing your icon theme, so make use. Once you're satisfied, you can put the command "rox --pinboard=MyPinboard &" in your autostart file (don't forget the "&" at the end if it's an Openbox autostart file).

Now let's move on to mounting external media. It's easy for optical discs. You just open the mount point in Rox (/media/cdrom0 on Debian) and it automatically mounts. You can set the mount point as a Rox bookmark or add a pipe menu in your Openbox menu (more on that below) for shortcuts. Mounting external drives is basically the same, but they need unique entries in /etc/fstab for something called static mounting. At least you only have to do it once ;-)

(EDIT: Thanks to a tip in comments, you can automount any external media with udisks-glue. The steps are: install udisks-glue, then add "udisks-glue &" without quotes to ~/.config/openbox/autostart, and that's it! When you login again, your external drives will automount in /media. So with that you can probably disregard the next few paragraphs until you get to the pipe menus section. And on the subject of pipe menus and udisks-glue, take a look at obdevicemenu.)

First, create a mount point in /mnt with sudo mkdir /mnt/name of your drive. Next, you want to get the UUID (universally unique identifier) of the device by plugging it in and entering in a terminal sudo blkid /dev/sdb1. Or it may be sdc1 if you have two internal drives taking up sda and sdb. You'll know when you plug in the device with your /dev directory open. Just see what gets added, sdb1 or sdc1, whichever. The "1" at the end refers to the first partition, so if you're attaching, say, a Mac in Target Disk Mode, you'll likely enter sdb3 because OS X system partitions are usually the third on a disk.

Once the blkid command reveals your UUID (and your file system under "TYPE"), create a new line in /etc/fstab that looks something like this (all on one line):

UUID=5956-17FF /mnt/FLASH_DRIVE vfat user,noauto,noatime,nofail,rw,flush 0 0

That's for my thumb drive. The "vfat" is its file system, the flush option is specifically for vfat file systems, and the nofail prevents failure messages at boot when the drive might not be attached. For non-thumb drives you may want user,noauto,noatime,nofail,rw,defaults.

Now to mount when you attach it, just open the mount point for that specific drive in Rox and it mounts. Unmounting should work by closing the folder and getting a dialog, but if it doesn't you can right-click on the folder and choose the unmount or eject options. And you can create bookmarks of your mount points for shortcuts, too.

I mentioned earlier you can add shortcuts in your Openbox menu in the form of pipe menus. With pipe menus, you can browse the contents of your home folder from right inside your Openbox menu and launch files or choose a folder to open in Rox. You can also open mount points to mount devices.

This involves getting a script file and adding entries to Openbox's menu.xml that call the script and create the pipe menus. So first go to this Archbang wiki page and copy and paste the contents of the script into a new file. You just need to make one change. Where it says "spacefm", change it to "rox-filer" or whatever your file manager is. Save it as obpipemenu-places and make it executable with sudo chmod a+x.

Next, add the correct entries to ~/.config/openbox/menu.xml, placing the entries in the file where you want them to appear in the menu. Mine look like this:

<menu execute="/home/dan/Source/scripts/obpipemenu-places" id="browse" label="home folder"/>

<menu execute="/home/dan/Source/scripts/obpipemenu-places /media" id="browse2" label="media"/>

<menu execute="/home/dan/Source/scripts/obpipemenu-places /mnt" id="browse3" label="mnt"/>

Save the file, then choose Reconfigure from your Openbox menu (or openbox --reconfigure from the terminal) and you should see something like this:

Openbox and Rox

One more note on integration, Roxterm has a lot of drag and drop compatibility with Rox-filer similar to the Finder and Terminal.app in OS X.


You didn't think all this would be bug-free, did you? There are a couple of conflicts with Conky I can point out. First, right-clicking on the desktop may cause your Conky output to blink. Since this is annoying, you can stop it by going into the "Compatibility" section in the preferences and selecting "Override window manager control of the pinboard and panels." Also, Conky transparency doesn't play well with Rox's pinboard. It'll show a black background on your Conky window. This might not be apparent at first if you have your previous wallpaper program running, too, but when you kill it and just have Rox drawing your desktop, you'll see it. The solution is to have both wallpaper programs running simultaneously, oddly enough. I use feh, which is low resource, anyway.

I also found a window focus bug. When I open a Rox window with the Pinboard running, the first click on the window unfocuses it, or if I first right-click on it, it brings down the Openbox menu as if I were clicking on the desktop. This is also annoying. To fix it, go into Rox's preferences, in the "Compatibility" section, and deselect "Pass all backdrop mouse clicks to window manager." But now you can't bring down your Openbox menu, right? Well, you can do it with a keybinding. I actually prefer this instead of hunting for an open space on the desktop to right-click on. Rather, you just hit a key combo wherever your cursor happens to be. To set a keybinding, edit your ~/.config/openbox/rc.xml by inserting the following into the <keyboard> section where all the keybindings are:

<keybind key="W-KP_Enter">
  <action name="ShowMenu"><menu>root-menu</menu></action>

The "W" in "W-KP_Enter" refers to the Windows key (Apple key on Apple keyboards) and "KP_Enter" is the Enter key (on the bottom row on laptops, or on the keypad on extended keyboards). Or you can delete the "W-" part and just have the keybinding be Enter. Looking at the other keybindings, you'll see that "S" refers to Shift, "C" is Control, and "A" is Alt. You can look up the other keys with the xev command, such as the spacebar being "space".

I think that about covers it. Oh, wait, I forgot setting up default applications. That can be done with the "Set Run Action..." menu item when right-clicking on a file. Drag and drop your chosen application's .desktop file from /usr/share/applications into the popup window, and you're all set.

You can also add an "Open With..." function, only in Rox it's called "Send To..." To add applications to your "Send To..." menu, select "Send To..." and then "Customize" and it'll open a folder at ~/.config/rox.sourceforge.net/SendTo to drag and drop symlinks from /usr/share/applications into. To drop a symlink, choose "Link (relative)" from the resulting menu. You can also divide the applications by file type by adding hidden folders like .text, .image, and .video into the SendTo folder and dragging the proper symlinks into their respective folders. You should rename the symlinks to get rid of the ".desktop" at the end. Now you should see a menu of applications popup when you click on "Send To..." :-)))

You're still here? Go. Go home.

Ferris Bueller

Wednesday, March 26, 2014

Some Video Notes

If you've used youtube-dl from the command line lately, you may have noticed some breakage when passing a Youtube link to a video player, such as:

mplayer -quiet -framedrop -cache 8192 cache-min 10 $(youtube-dl -gf 18 "http://www.youtube.com/watch?v=aP_-P_BS6KY")

Homie won't play that. It's 'cause lately Youtube has been returning HTTPS links which Mplayer and VLC can't stream. As a temporary fix, youtube-dl's developer added the option "--prefer-insecure" which, when added to the youtube-dl command, will return HTTP links which Mplayer and VLC can play.

mplayer -quiet -framedrop -cache 8192 cache-min 10 $(youtube-dl -gf 18 --prefer-insecure "http://www.youtube.com/watch?v=aP_-P_BS6KY")

Mein developer cautions that this could break at any moment and that he'll look for a more permanent fix in the future.

This situation (I've upgraded the severity from snafu to situation) can also adversely affect any Greasemonkey scripts you have for link extraction, though in my observation it's hit and miss. Thankfully none of this seems to affect OS X's PPC Media Center, but if you're on Linux or utilizing scripts that have command line args, you'll definitely want to upgrade youtube-dl (youtube-dl -U) and try out the new option.

Also Youtube related, Nathan left a comment on my Some Cross-Platform Flash Alternatives post and mentions Minitube is now available for Debian Jessie and also works on Wheezy by...Well, I'll just let him explain it:
Another Flash alternative you can do is downloading the Debian Testing version of Minitube here: https://packages.debian.org/jessie/minitube . It works perfectly if you install it on Wheezy with dpkg, and then do a "sudo apt-get -f install" to install all the required dependencies. You can then add Minitube to Open With (It's in /usr/bin), and simply right-clicking any link to a YouTube video will open it in Minitube.

And one final cool thing, there's a new fork of mplayer2 called mpv. It's available in Jessie, too, though I haven't tried using the above method to get it onto a Wheezy box. I never liked mplayer2 'cause it used a bit more CPU than MPlayer, but mpv seems to have fixed that. Also, G3 users will be happy to know you won't have to compile it with the configuration option "--disable-altivec" to prevent a crash when playing video. Mpv works out of the box, no compiling necessary.

Now let's get back at the productivity Nazis at Lifehacker and watch some frickin' videos at work!

Saturday, March 22, 2014

Compton Comes to Debian

(EDIT: This is also excellent for LXDE in case any of you got the impression this was for Openbox only.)

No, not the city, the compositor. Compton is a compositor program, like xcompmgr or cairo-compmgr, that adds effects to your desktop such as shadows and transparency. In fact, Compton is actually a sequel to xcompmgr that aims to improve and expand on the original with a whole host of bug fixes and new features, in particular adjusting window opacity.

Adjusting window opacity--for example, making all background windows transparent--is a feature I've been wanting for a long time. On OS X, there used to be an input manager called SetAlphaValue that did this, but it only worked for Cocoa windows and didn't work for the Finder or iTunes. For Linux, XFCE has had its own built-in compositor for awhile, and it's probably the only thing that's tempted me to switch, but I'm determined to be an Openbox loyalist. Xcompmgr is what we were stuck with, until Compton came along. The only problem was it wasn't in Debian's repositories, and for some excellent reason which is now completely lost to me, I never tried compiling it. But I don't have to dwell on my laziness anymore, because Compton has now arrived. It's now in the Jessie and Sid repositories, which I just noticed a week ago.

So after installing it, what do you do with it? Well, like xcompmgr, you can input all the settings from the command line (-cCf -D1 -t -8 -l -13 -r 10 -o .4), but with Compton you can also put all that junk in ~/.config/compton.conf and just enter "compton -b" in your autostart file (the -b daemonizes it). Here's my compton.conf:

# Shadow
# Enable client-side shadows on windows.
shadow = true;
# Avoid drawing shadows on dock/panel windows.
no-dock-shadow = true;
# Don't draw shadows on DND windows.
no-dnd-shadow = false;
# Zero the part of the shadow's mask behind
# the window (experimental).
clear-shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 7;
# The left offset for shadows. (default -15)
shadow-offset-x = -11;
# The top offset for shadows. (default -15)
shadow-offset-y = -8;
# The translucency for shadows. (default .75)
shadow-opacity = 0.5;

# The shadow exclude options are helpful if you
# have shadows enabled. Due to the way compton
# draws its shadows, certain applications will
# have visual glitches (most applications are
# fine, only apps that do weird things with
# xshapes or argb are affected).
# This list includes all the affected apps I
# found in my testing. The "! name~=''" part
# excludes shadows on any "Unknown" windows,
# this prevents a visual glitch with the XFWM
# alt tab switcher (also prevents shadows on
# Openbox menu, so I commented it out).

shadow-exclude = [
# "! name~=''",
"name = 'Notification'",
"name = 'Plank'",
"name = 'Docky'",
"name *= 'Firefox'",
"name *= 'VLC'",
"name *= 'Chrome'",
"name *= 'Chromium'",
"class_g = 'Conky'",
"class_g = 'Kupfer'",
"class_g = 'Synapse'",
"class_g ?= 'Notify-osd'",
"class_g ?= 'Cairo-dock'",
"class_g ?= 'Xfce4-notifyd'",
"class_g ?= 'Xfce4-power-manager'"

# Opacity
# The opacity for menus. (default 1.0)
menu-opacity = 0.94;
# Default opacity of inactive windows.
# (0.0 - 1.0)
inactive-opacity = 0.6;
# Exclude applications from opacity.
focus-exclude = [
"name *= 'mplayer2'",
"name *= 'VLC'",
"class_g = 'XScreenSaver'"

# XRender backend: Step size for alpha pictures.
# Increasing it may result in less X resource
# usage, though some of your effects may become
# disabled.
alpha-step = 0.04;

# This prevents opacity being ignored for some
# apps. For example without this enabled
# xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;

# Keeps Openbox OSD focused.
mark-ovredir-focused = true;

# Limit Compton to repaint at most once every
# 1 /refresh_rate second to boost performance.
# Incompatible with certain VSync methods.
sw-opti = true;

# Unredirect all windows if a full-screen
# opaque window is detected, to maximize
# performance for full-screen windows.
# This option prevented my Openbox desktop from
# loading when put in my autostart file, so I
# commented it out.
#unredir-if-possible = true;

Basically, this creates subtle shadows around windows and menus and makes all background windows transparent. Also, menus are slightly transparent. There are some glitches as not every application draws windows exactly the same, but as you can see, you can enter exclusion rules for both shadows and opacity if any are giving you problems. The excluded applications are from sample compton.conf files I copied and pasted from the web (obviously I'm not using Chrome), but I've added the opacity exclusions for my screensaver and video players. Also I found a couple of Openbox-specific glitches that are noted in the comments.

So, looks good, you say? But what about performance? Surely this luxurious fanciness slows your desktop to a crawl, does it not? Well, I don't have 3d acceleration on this laptop, so I have to use the XRender backend instead of glx. And even then, performance is good. Menus and window switching are slightly less responsive, but not enough to be annoying. CPU usage increases, but it's only momentary. All-in-all I give Compton an A+ and think maybe it's time for a Jessie upgrade on all my computers.

Saturday, March 8, 2014

PPC Media Center Update

Just a quick FYI, Adam A.'s youtube-dl GUI wrapper that I posted about has been updated to support Comedy Central while cutting out the commercial breaks. Here's the Mediafire link (outdated: see above link for updated version), and I'll always keep the original post updated with the latest version, too. And if you haven't downloaded this yet, really, you must. We won't hold your previous delinquency against you.

Tuesday, March 4, 2014


I don't know what this is about, but I'll leave it here to get your hopes up ;-)