Friday, December 19, 2014

Am I Getting Hot or Cold?

Yes. A post on monitoring your PowerBook's temperatures when running Debian or similar variations of Linux. As mentioned in a previous post, I am a big fan of Conky, which I utilize to show me several pieces of information regarding my PB and other PowerPC systems at any given time. Conky shows me such things as CPU, battery, and memory usage, as well as the capacities of each plus disk space usage across all partitions, up and down network statistics on all interfaces, and top process CPU consumers. I should note that right now, when completely idle with no GUI applications running, Conky states CPU is at 1%, which I see as very ideal. Usually it's Conky taking up a majority of that 1% of CPU.

The only thing I was missing was a way to monitor temperatures that are reported by the machine's included sensors. PowerPC portables have a history of running quite warm. Obtaining this same information in OS X is incredibly easy using a dashboard widget such as iStat Pro. Still being incredibly new to many things Linux and even PowerPC, I had to start doing a little bit of research to see if or where this information could be stored for retrieval. After perusing the different Conky options, I came to the conclusion that the desired information could not be natively retrieved using any existing Conky options as most deal with the (ugh) Intel architecture.  If I'm wrong, please let me know either through the comments belows or via email if you don't feel like publicly shaming me.

One way to start was to run the lsmod command, which would provide me with a list of loaded kernel modules.  One of those sure had to be doing something temperature/fan related?  Well, a few stuck out at me including, ic2-powermac, although it was not being used by anything, but I ran into this module when doing some research online.  The other one in particular was therm_adt746x, but again was not being used by any drivers. I'll be doing some more reading of these modules in the near future.

Luckily, I also discovered a couple of the sensors and output I could retrieve from various files under the /sys/devices/temperatures folder. I simply did a search of the file system using locate temperature. There were only two sensors listed along with a few other configuration files that I have yet to investigate any further.

For each sensor, there were 3 relevant text files (actually 4 for sensor1): sensor[#]_limit, sensor[#]_location, and sensor[#]_temperature. Sensor 1 also included a sensor[#]_fan_speed file. I ran cat on each of the 3 files (again 4 for sensor1), just to obtain some sort of idea of what information it would provide. Here is a quick overview:

  •     fan_speed – provides the current speed of the fans in RPMs
  •     limit – specifies the upper limit of the temperature that the sensor can reach before I assume either you start to have issues or the fans kick in
  •     location - specifies the location that the sensor is monitoring the temperature for
  •     temperature – this file provides a single number, which happens to the latest temperature reading in degrees Celsius (converting this to Fahrenheit should be trivial)
According to the locations, one sensor was for the CPU_BOTTOMSIDE and the other PWR_SUPPLY_BOTTOMSIDE. My understanding (again please correct me if I am wrong) is there should be other additional sensors on the PowerBook that we could pull values from. If there are, I'd love to figure out how to do just that. For example, on the OS X side, when looking at temperatures in iStat Pro, it also provides temperature values for CPU top, battery, trackpad, and HD. Perhaps there is some additional documentation somewhere covering this sort of information?

Great, so how can I customize Conky to pull in these values and output them to the grid of information I have running on my desktop? Well, one of the first ideas that came to mind was using a shell script that essentially grabs the temperatures and fan RPM values from the corresponding files and assigns each to a variable that can then be output by Conky. Perhaps there is an easier way to do this?

Yes there is. Here is where exec object comes in handy. This particular object will let you specify a shell command you'd like to run and output.  If you want to have the command ran at your own set intervals, use the execi command instead, but be aware that the interval value you set must be lower than your configured update_interval (mine is set to 1.0 second) for Conky.  So for each sensor I added the following line:

Bottom CPU Temperature: ${exec cat /sys/devices/temperatures/sensor1_temperature}

Battery Temperature: ${exec cat /sys/devices/temperatures/sensor2_temperature} 

According to the man pages for Conky, running shell commands within Conky tends to be more resource intensive.  Personally, I have seen a small average of about a 1% increase in CPU consumption, but that could be to other configuration changes I've made recently to the PB.  These two additional lines in my Conky configuration file worked and do as they are intended, so in some ways a success.  Here's a screenshot:


One last thing I would like to share about Conky.  If you want to disable any sort of flickering Conky may be experiencing, add double_buffer yes to your list of options. Makes everything look like it is running much smoother. I was going to post a link to my conky.conf file somewhere, but decided if somebody was interested in taking a look at it, I send it to them via email.

I know I've barely scratched the surface on how all of these sensors work, but it's a start. One thing I haven't quite figured out is how often the temperatures are being updated in those specific files, so the quest for answers and understanding continue!

Hopefully you enjoyed this post and can use it as a starting pointing for doing your own temperature/fan speed monitoring on your PowerPC machine(s) or even as a gateway to other great ideas for information that can be displayed by Conky. 

I still have yet to finish the post on my PowerBook 1400CS (waiting on a few more parts) as well as the introduction to Clang on PowerPC. The latter is a post I am taking extra care to refine before I put it out there in the wild.

Sunday, December 7, 2014

Don't Push My PBButtons

So I wanted to cover something I ran into when first installing and configuring my Debian distro that almost drove me over the edge.  Now as you read on and discover the former source of my misery, you may laugh at its minuteness, but I'm quite particular about configurations and making sure things work exactly as I wanted them to, which as you can probably guess is never easy as you'd like it to be.  However, they (who are they?) say Linux is all about being able to customize everything to your liking. 

The problem was with configuring the G4 PB's eject key to work as you'd eject, I mean expect.  That is, upon pressing the eject button, it would eject any CD or DVD you currently had inserted into your system if any.  Just as if I was still using good ole Mac OS X.  Sounded like a piece of cake.  Every other key on the keyboard did exactly what it said it would do including the volume up, volume down, and brightness keys.  However, whenever a disc was inserted, I had to revert to using the probably better known eject command line tool, which is simple enough, but I'd still like to have the key working as well.

Still being in the infancy of my foray into using Linux (and Linux on PowerPC), I started to research how certain keys were mapped in Debian and other Linux variations on PPC hardware.  I quickly learned certain specific key mappings worked through what software is known as pbbuttons. This runs as a background daemon and can be restarted with the usual restart methods at your disposal. It has a configuration file stored in the /etc directory. Full path is /etc/pbbuttonsd.conf.  Being in the /etc directly, the file will require root/sudo privileges to edit.

The configuration file has a number of customizable options that are way beyond the scope of this post, but as always, I encourage you to peruse the file and make adjustments where you see fit.  It includes such settings as the default values for the brightness values at login/startup, different configurations for when on battery power, and default values for sound and volume.

Anyways, the specific section we were looking for was the [MODULE CDROM] that allowed you to customize which keyboard key to act as the eject key, the delay when pressing that key and which CD/DVD device it was to work with. Right away, I learned from the config file that eject was mapped to the key 161.  Okay, that's nice, but what actual key on the PowerBook's keyboard does that actually map to exactly?  So... more research, which taught me another handy command line utility (honestly, what command line tool isn't?) called xev. Pretty straightforward tool. Just type xev and it will open a new window that intercepts events such as moving a window, resizing a window, or clicking on something, and spits out information regarding that particular event. For example, you can punch any one key on the keyboard and it will print out a number of pieces of information regarding that key.  When I hit the escape key, the utility printed back the following information.

KeyRelease event, serial 46, synthetic NO, window 0x2800001,
    root 0x121, subw 0x0, time 2053168, (639,-2), root:(840,578),
    state 0x10, keycode 169 (keysym 0x1008ff2c, XF86Eject), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


I changed the keycode value accordingly, but sadly, no go. Long story short, the keycode returned by the utility is not correct and the 161 was actually the value for the eject key as was originally hoped.  So why was it still not working?

Well the only other configuration option that could be the issue was the CD/DVD device it was mapped to. I double checked and it was pointed to /dev/cdrom.  Sounds correct, but I decided to change directories over to the /dev directory to make sure such a device did in fact exist. I ran my alias command for 'ls -alh' to list out the contents of the directory as well display ownership and permissions among other things.
lrwxrwxrwx   1 root root           3 Dec  7 14:15 cdrom -> sr0

Almost right away I noticed in the permissions that the advanced permissions flag (first character in the list of permissions) was set to l, which indicates it is a symbolic link.  So moving my eyeballs further to right, the listing indicated that cdrom was a symbolic link to /dev/sr0.  I immediately updated the conf file to use the actual sr0 device instead of the symbolic link.  I saved the changes and restarted pbbuttonsd.  And what do you know, the key finally worked! Victory!

Here is the full posting of the CD module section if you are interested.
# [MODULE CDROM]
dev_CDROM             = "/dev/sr0"
EjectCDKey            = 161
EjectCDKeyDelay       = 0


In short, you need to map the CD/DVD drive to the actual /dev/[device name] as symbolic links will NOT work. I thought I would share this little tidbit of information in hopes that it helps somebody else someday.  I'll wrap it up here though and continue working on a few other posts I am putting together, including my work on my PowerBook 1400CS, installation of Debian Jessie on a G4 Quicksilver and working with the Clang compiler on PowerPC architecture.  Comments are welcomed!

Friday, November 14, 2014

Some Hardware News

A couple of things that I've come across lately that I have felt obliged to share with you.  The first is that an individual by the name of Robert Innocenti has embarked on a new project to develop new portable PowerPC hardware that would utilize some of Freescale's newer lineup of 32/64-bit PPC CPUs.  Much more information can be found on the website.  If you are even remotely interested in assisting in some way or another, I encourage you to do so.  For a project of this scale, it requires participation from people with varying skills and abilities. I wish him and the team the best at bringing this to fruition.
In other PowerPC hardware related news, somebody has found another way to make G5 PowerMacs (and as a result earlier model Mac Pro's) useful.  Well, I think it is much less useful than what those machines are still capable of today still, but I still commend him for the effort.  I have to admit, the recycled furniture does look pretty cool, although I'd much rather load the machine up with a Linux distro and tinker with upgrades and various PCI card add-ons.

Never thought there would be so much news about PPC hardware in this day and age.  But there you have it.   If you have suggestions or questions I could answer in future blog posts, please let me know in the comments below or shoot me an email! I'm currently trying to get the trackpad working on my new 1400CS in order to complete my blog post regarding the new hardware and its specifications.

Saturday, October 25, 2014

PowerBook DVI to HDMI to HDTV

My wife and I own a 55" Vizio LED HDTV that is a little less than a year old.  It's a fantastic TV that has already served us quite well.  It has a 240 Hz refresh rate, which has its pros and cons, but we have become accustomed to such a high frame rate even in slower moving scenes.  The display itself is 1920x1080, with very vibrant in your face colors and picture quality.  At least it comes off that way after using my G4 PB's thin-film-transitor (TFT) liquid crystal display all day.

Knowing the television (anybody actually spell that word out anymore?  I feel like the device itself has outlived its name) has 4 HDMI inputs, I decided I should dedicate one for when I want to hook my PowerBook up to it when I feel like working on a significantly larger more colorful display.  So I set off to purchase both an HDMI cable of appropriate length as well as an HDMI to DVI-D adapter.  Knowing the signal on both output types is digital, I knew such an adapter would exist as well as exist at a reasonable cost, although I had never previously looked for or came across one. Of course, HDMI is capable of transferring both audio and video, but the dual-link DVI port on the G4 only does video. Meh.  I can live with that.

I purchased an 8 ft Insignia HDMI cable as well as the specified adapter from Best Buy for nearly $50.  I should have stuck with ordering each from the webs to save a little cash, but felt like making a quick run to Best Buy. Either way, the quality of the adapter and cable are fitting for my needs.

Once all the connections were in place, I fired up the old laptop and let it boot to Debian.  Right away, the resolution on the laptop's display was blown up at 1024x768, but that is to be expected.  Soon as I logged in, the display was replicated onto the TV, although resolution was not optimal there either (again at 1024x768).  I had to manually set the resolution to 1920x1080p via Preferences -> Monitor Settings.  The Refresh Rate was set to Auto, but would not go any higher than 60 Hz, which was also to be expected.

In regards to the resolution, Debian actually offered both 1080p and 1080i.  The i in 1080i option stands for interlaced, meaning the video is interlaced with frames being broadcast at 30 frames/second but played backed at 60 frames/second.  It does this by displaying each frame twice, one on the even scan line field and one on the odd.  The whole idea behind this option is to try and reduce any possible perception of flickering and increase that of motion.  On the other hand, 1080p (progressive scan), does not interlace the video, but instead draws it line by line, which provides excellent quality for fast paced video such as a scene from an action movie.  Why does all this matter on this post?  It doesn't. I just wanted to share with you some extra information. I couldn't see any noticeable difference between the two.  However, I did not test this out when playing a video back at full screen in an app such as mplayer or VLC.  Perhaps it would be worth looking into?

Boy did it look good though.  The machine has the on-board Mobility Radeon 9700 graphics card without 3D acceleration, but the machine was able to handle the output quite easily with the card's 128 MB of VRAM. See my photo of it in action below.
 

So maybe it is not all that practical, but I enjoyed working through the setup and typing up this post on a larger 55" display.  Perhaps if I can find a way to use the HDTV as an extended external display using something such as xrandr that would be even more useful.  Another blog post for another day.  :)


Thursday, September 25, 2014

Me Daily Apps

So I thought it might not be a terrible idea to discuss the software I currently use on my Debian Wheezy systems.  Perhaps you'll find something here you been looking for your whole life. Maybe not. Doesn't matter.

First of all I use the LXDE (Lightweight X11 Desktop Environment) for my desktop environment.  I know there are more feather light options, but I found LXDE to be the best fit for my needs.

The biggest app I use is Kupfer.  I use it all the time to open files (which open in the default associated app), folders, apps, HTTP links, you name it.  Basically just about anything you can think of in one way or another.  Huge thank you to Zen over at the PowerPC Liberation blog for introducing me to this tool.  It saves me several (and I do mean several) seconds of time from switching back and forth from the trackpad to the keyboard.  I prefer to stick with just keyboard commands, but I'm not opposed to the trackpad by any means either.  Depends on the task at hand.

I have most of my other commonly used apps in my "natively" running dock that automatically shows and hides as I hover over it, similar to the OS X dock.  For the GUI filesystem browser, I use the default File Manager that is included with the LXDE desktop environments (if I'm not in a terminal, which is usually the case).  I wouldn't mind test driving alternatives, but I just haven't made time for it.  It does what I want it to and I don't have any issues, except that I can't seem to get the mounted Lubuntu partition from showing up in the side bar along with the OS X partition. Nothing in the File Manager's preferences  helped, but I'm still digging around on the system. Let me know if you know the way.

For my browser, I also use the default Iceweasel that is a fork of Firefox.  The only add-on I use with it is XMarks for syncing my bookmarks between different systems.  As a webkit alternative, I use Midori as it is incredibly quick, smooth and lightweight in terms of resources. I've used a few others, but nothing that I thought was worth keeping around.  If an app is not going to serve a purpose for me, I make sure to not keep it around and take up valuable bytes of space.

For my PDF/document viewer, I use the cleverly named Evince.  It handles PDFs pretty well and it supports several of the expected features associated with a PDF viewer.  Speaking of documents, I also have the LibreOffice suite installed to be able to create and edit documents, spreadsheets, and presentations.  I've actually come to enjoy using these more than regular old Microsoft Office suite.

As discussed already in one of my previous articles, I use an RSS feed aggregator by the name of Liferea.   For FTP, I use the well known FileZilla, which is actively maintained and updated on a regular basis. Along with that I use Transmission and for media I run both VLC (some of you may gasp at that) and Audacious for music playback.  Eventually, I'll make use of a better suited piece of software for video playback, but haven't spent too much time looking into it. What I don't have or use is any form of streaming radio, although that would be worth having.  I'll have to research that further.

I have Hotot installed as my Twitter client, but I don't use Twitter as much these days and this application no longer runs on PPC.  And for the final nail in the coffin, it is no longer being maintained or updated by anybody.   In fact, it doesn't currently work on any of my machines, so it shall be soon tossed into the nothingness

For coding, I rely heavily on vi in the color coded LXTerminal and Geany. Geany supports a multitude of languages including the most commonly known ones such as C, C++, Python, etc. For compilation (or is it compiling?), I am currently using GCC 4.6.3 and am just starting to make use of the Clang compiler (more on that in the future... you can learn along with me! :) ).

Oh and lastly, on a entirely separate note, if you haven't heard by now, there is a monster vulnerability in bash associated with the handling of environment variables that has been around for far too long.  Debian has already pushed out security fixes for this, so make sure to run  sudo apt-get update && sudo apt-get upgrade on your system to receive the patches.  You are set up to receive security patches and updates right? Lord have mercy on you if you aren't.

That's it for this article.  Once again, I droned on a tad bit with nontechnical opinionated words (sounds like several big name tech writing companies these days).  Hopefully you read about an app or two here that might be just as useful or more useful to you on your own PPC Linux system.  I didn't quite cover all the apps I am using, but it's a pretty decent start. Let me know what you are using in the comments below.  And of course, suggest any new topics or questions if you have any.




Sunday, August 24, 2014

Get a Liferea!

As mentioned in a previous post, I am going to cover, in my opinion, the wonderful and extremely lightweight application known as Liferea (not that most RSS readers aren't lightweight).

I love feed readers as they allow me to keep tabs on all the articles from various blogs and sites I follow on a regular and irregular basis.  I love being able to organize and group feeds by content and purpose.

As its very core, it's an RSS reader, but if you want to sound fancy, you can call it a news feed aggregator, but I'll stick with RSS for the time being. The name itself is actually an abbreviation for Linux Feed Reader.

Here is a screenshot of it in action.

Anyways, it's in the main Debian repositories and can be installed with the usual apt-get install command.  In case you need the full thing type the following in your terminal app of choice or install it via the Synaptics Package Manager via Main Menu -> Preferences menu.

sudo apt-get install liferea

The app consists of mostly C code with small amounts of XML, HTML, and a few other oddball languages.  I haven't quite peaked at the code yet, but according to the statistics, it's a little over 27,000 lines of code.

Pros
1. As I mentioned in the intro, the app (for all of you iOS haters, forgive me for calling it an "app") is extremely simple and as a result incredibly lightweight. Having it running in the background and periodically refreshing my feed list is unnoticeable. The software's website states that not many features are or will be added as the goal of the app is to keep it simple and lightweight.  However, anybody willing to contribute their own time and features are welcomed to do so.

So far the app has not crashed once for me nor has it given me any other sort of issues.

2. The developers and contributors have provided excellent documentation for the application that is accessible from within the application itself.  Much more information can be found on their FAQ.

3.  The app does have a built in browser, but you can actually custom configure it to launch an external browser of your picking. To set it to something such as Iceweasel, head to Tools -> Preferences -> Browser tab and enter in "iceweasel %s" without the parentheses under the Manual option at the bottom of the tab.  The %s is the variable placeholder for the actual URL that is to be loaded by your browser of choice.

4. Plenty of keyboard shortcuts for commonly used tasks such as doing a manual update of all of your subscriptions with Ctl + U (or Command + U if you have swapped these button's functions).   I shan't go over them all here, but having them available saves me time from swapping back and forth between the trackpad and keyboard.  Huge win in my book.

5. Support for all walks of feeders.  I'm sure there are some that are not supported and will not work, but I haven't run into one yet. 

6.  Lastly, there is support for organizing your subscriptions into folders that you can name each whatever you please.  Yes, a no brainer, but definitely worth mentioning.  Moving subscriptions between folders is simply a drag and drop of that subscription or subscriptions.

Cons
1. Unfortunately, the latest version (1.10.11) has not been made available on the PowerPC platform.  I am going to help change that here in the next couple of days.  I'll provide an update to this existing post once it has been made available.

2. On the security front, it has some pretty big gaping holes.  The first being that any proxy or authentication configurations to certain feeds are stored in plain text in ~/.liferea/feedlist.opml.  Ouch.  Obviously, if you aren't using any feeds that require any sort of authentication and/or proxy configuration, no worries.  The second is that the content database cache data is also stored in plain text.  The maintainers have also made it known that there could be and probably are other possible existing security issues.

Of the two issues described above, the first does not affect me and the second doesn't concern me a whole lot as the content I have in my feed is nothing I feel the need to be concerned about having in plain text.  If I'm looking at this from the wrong perspective, let me know.

3. This may sound a bit picky, but there is no keyboard shortcut for adding a new subscription or folder.  Seems like it would be simple enough to implement, but perhaps moving forward I could help in that arena as well.

All in all, it's the best lightweight Linux RSS reader I've been able to find to date and right now the pros outweigh the cons by a significant margin. There are a ton of other preferences and features that I did not cover, so check them if you feel enticed enough. If you know of something more lightweight, powerful, or perhaps even secure, I'd love to hear about it in the comments below.

And of course, if you have any suggestions, questions, or requests on a post for me to cover regarding PowerPC Linux let me know.  Lastly, on another side note, I've decided instead of posting about all the different PowerPC hardware I own, I will create a dedicated hardware page.

Monday, August 18, 2014

New Hardware

I just ordered both a PowerBook 190CS and an 1400C on eBay for a combined total of $64.90.  I'll post pictures of the hardware once it arrives.  Neither one comes with a power adapter, so I've been on the hunt for genuine replacements.  I know I'll probably end of spending more money on the adapters than I did either laptop combined.  I see there are dedicated Linux distros for 68K Macs, so I've started to read up on the documentation to help prepare for when I finally am able to install it on either or both.

I see that progress on it has pretty much been halted since 2005, but my goal is to help revive that with whatever time I can spare.  Not only that, but to encourage others to do so as well.  If you are interested, I strongly encourage you to check it out and volunteer some of your time. Of course, there are other distributions available and I wouldn't condone you for utilizing one of those instead. :)

Lastly, I wanted to post a screenshot of my desktop from the G4 PowerBook running Debian Wheezy 7.6.



Speaking of that, the command below is one of several ways to show you what version of Debian you are currently running.  Running from LXTerminal or whatever terminal utility/program you prefer.

lsb_release -a

According to the utility's man pages, the utility is designed to provide Linux distribution-specific information. The -a option (sometimes commonly referred to as a flag) tells it to print all information provided by the utility.  A very simple utility with only a handful of available options, but useful when needing to know your currently running version of Debian.

My next post will cover one of my favorite types of applications, an RSS reader called Liferea.

As always, please provide any comments or suggestions you may have in the comments below.  My goal is to help keep older PowerPC Mac hardware alive and useful.


Tuesday, August 5, 2014

Here's to the PowerPC ones

Here's to the PowerPC ones.  The misfits. The rebels.  The troublemakers.  The round pegs in the square holes.  The ones who see things differently.

That is the perfect motto for this blog. Yes. Another blog covering the PowerPC architecture and Apple's almost near vintage (at least in the mind's of some) PowerPC line of computers.  This blog is primarily focused at helping other users out there of PowerPC hardware make the best out of their aging machines and hopefully have fun doing so along the way.

I think it might be beneficial to describe the PowerPC hardware I currently own and utilize on a daily basis.  My favorite device and daily driver is my recently restored 1.67 GHz G4 PowerBook (Model #A1138). I only paid $25 for it with the shipping included.  It's rocking the maximum 2 GB of RAM, a replacement OWC Mercury DVD/CD drive, a brand new genuine Apple replacement battery and power adapter, new keyboard with a working backlight, new lid hinge lock  (what a pain to get that put back into place), and a replacement heat sink with a fresh coat of thermal paste. And last but not least, it has a 120 GB OWC Mecury Legacy Pro SSD.  The SSD helps the whole thing run a lot quieter and just a little bit cooler.  When I ran the last PowerPC compatible version of GeekBench on it, it came back with a score of 935, while the average is 843.

The nice thing about the OWC SSDs is that they don't require TRIM support as their drives have there own drive maintenance built in to the actual drive.  See here for a bit more information.

Not only that, but I have it set up for a triple boot between OS X Leopard, Debian Wheezy, and Lubuntu 13.10.  Seems like over kill, but it allows me to dabble in all sorts of interesting things.  Kudos to PowerPC luddite Dan for helping me properly partition and install Linux.

Whew.  That went a little longer than I anticipated, but so I'll cover the other devices in a future post.

Anyways, I will be posting guides and information regarding different things I do on each of my machines.  My guess is a lot of it will be Linux related, but that's a good thing as these machines do quite well on certain distros and are still officially supported by a handful of them (including Debian).  I've learned a great deal since I started to run Linux on these machines, so I hope to share that same knowledge and experiences with others.

Some of the posts will center around doing development in Linux, so feel free to skip over those if you aren't much into development.

Lastly, I'll cover hardware upgrades and repairs if I happen to run into any as they are sure to come up with such old hardware. :(

If you have any suggestions about something you would like to be covered in detail about anything PowerPC related, please post them in the comments below or shoot me an email at brockwittrock at gmail dot com.