Category Archives: Technology

A-drupaling I shall go…

I finally quashed (more or less) a couple of issues that had been nagging me with the website that I created and maintain for Orange District, Occoneechee Council, BSA. I did some maintenance this weekend, upgrading Drupal core as well as some modules that needed updates. The web-based module updater broke when I switched to PHP 5.4, as my ISP is deprecating PHP 4 and 5.2, and I needed to do manual module updates. Hopefully the web module updater will get fixed in Drupal 7, but some of the things I read made me think it won’t be until Drupal 8. Also, I’d been having a problem with the calendar view throwing lots of warning errors and I’d not been able to find out what was causing it. Seems to have varied causes with module/database dependencies but predominantly in Views and CTools. This also started when I went to PHP 5.4. I was able to figure out what to back out to get the warnings to stop (a Google calendar overlay), but I’d like to get that functionality back. I opened up an issue on the FullCalendar module to see if anyone has ideas.

Also, I spent some time this weekend working up a website for a friend who’s a local farmer. We found a nice Drupal template and have a skeleton set up

Not so fast on the ChromeOS swap file…at least on the ARM ChromeBook

I first thought I’d stumbled upon a way to turn on the virtual memory on my ChromeBook, but as I’ve looked at it and read about it, this does not yet work on the ARM version of ChromeOS on my ChromeBook. However, it’s been a useful exercise, as I’ve read up on a number of things. This trick does work on non-ARM ChromeOS, and may be useful on a CR-48! I’ll have to wait on mine. A useful thing in tracking memory utilization and page discards (the main symptom of low memory) is found on the chrome://discards URL. It will show you basic memory stats plus the count of discards since the last reboot. My initial euphoria about memory was caused by rebooting after making the attempt at the swap setting. I’d not realized how much difference rebooting made in reducing the page discard rate.

So, those with Samsung ARM ChromeBooks will have to wait, but if you start seeing a lot of page discards (and confirmed with the discard URL), just reboot (only a few seconds on Chrome!) and it will be much better…

More fun with Chromebooks, enabling the swap file…

I’ve been enjoying my Chromebook, but one issue that’s been a bit frustrating has been the way it discards (& reloads) tabs when you have several tabs open. This isn’t an issue on the 4GB ChromeOS devices like the ChromeBox or the Samsung 5 550. However, on a 2GB ChromeOS device, it’s been a bit of a pain. More than 4 or 5 tabs would mean a reload, particularly with memory-intensive AJAX pages like Gmail. It looks like I’ve found a way around it. I’ve been spending a bit of time on the ChromeBook Central Google Group, and ran across this thread on enabling zRam (swap file). So far, I’m quite impressed with the results. Right now, I’ve got 10 tabs open, and still have ~240MB free per top in crosh. I’m not sure what the downside is, and why this is not enabled in the build for 2GB devices. I’m running on the beta channel with R23. Time will tell if there’s any problem, but I sure wonder why Google doesn’t put this in as a default on 2GB ChromeOS devices.

Some website hacking…

A little sys admin/app admin foo this evening for some websites I run. We have a family recipe repository in a MediaWiki instance, and I have a couple of Drupal sites for some Boy Scout groups…my ISP (1and1) is deprecating PHP 4 and PHP 5.2, and I thought I’d migrate to PHP 5.4, the only version that’ll be supported in April. I planned to get a jump on it by setting my account’s global PHP to 5.4. Well, it broke the old version of MediaWiki I was using. A good time for an upgrade! MediaWiki is pretty easy to upgrade, but first I had to move the data from a version 4 MySQL database to a version 5 MySQL, then run the upgrade script. Worked fine, except that it was throwing an error for the default timezone config. Apparently PHP 5.4 is stricter about this. Finally figured where to set that, and it worked. Then, I noticed that the calendar module on my Scout site was throwing pages of warnings. Surfed drupal.org and this appears to be a problem that appears in some cases with PHP 5.4. I’ve taken that option off the menu right now and posted a message on my site about it, while I poke around for a solution. I’ve got a couple modules to upgrade as well as a point release of Drupal, so I might do that and try the calendar again before I dig too deeply.

The moral of this story is that you shouldn’t start hacking your websites unless you want to spend the evening fixing them 😉

Google Drive iOS app

The newest update to the Google Drive app is very helpful to those of us who frequently want to work with Google Docs from iOS devices. Now, we’ve got an effective tool for collaborative editing of both Docs and Sheets in the GoogleVerse. I’ve used the Docs update tool frequently, and am excited to have an equivalent tool for Sheets now. If you’ve not tried the Drive app, I give it two thumbs up!

New generation Samsung Chromebook 11.6/wifi

I just received my new ChromeBook today (see my earlier thoughts about this). I love the quick setup of Chrome! I have two ChromeOS devices at the office (a Samsung ChromeBook 5 550, and a ChromeBox; see my earlier posts) so I’m familiar with ChromeOS as a user. I just popped it out of the box this afternoon, logged in, and it downloaded an update, my “Chromeness” 😉 , and then I was good to go. Have just used it a couple of hours, but I’m quite impressed so far. The keyboard feels very nice, the display is clear and bright and it’s a pleasure to use. I’ve used it to make a Google phone call and a Google videoconference. It’s carrying 1/2 the memory and has a slower processor than the ChromeBook 5 550, but I’ve not seen a performance difference so far. Have not tried streaming video yet, nor graphically intense web sites, but I do have 12 browser tabs open now.

Overall, it has a build “feel” that’s just as good as the 5 550, and $200 less. For $249, it’s hard to beat for most of what I need to do that’s not handled by my iPad and iPhone ;-). I’m happy to have personally bought this one for myself. I’ll pass the 5 550 on to someone else at the office to evaluate.

More Chrome OS developments…

Today, Google introduced a new Chromebook. I’m quite interested in this development, as I think they’ve finally hit a price point that may help this to get traction in the market. In July, I wrote about my foray into using ChromeOS devices. I’ve been using both the Chromebook and Chromebox regularly since then. I’m typing this on the Samsung Chromebook 5 550, which has proved itself a very useful device.

My primary reaction to the Chromebook 5 550 was that while it was a great device, its price point of $449 made it pricey for the functionality restrictions of the Chromebook. Take this last statement with a grain of salt. Most things we do today are browser-based, and there are not many things I need to do regularly that I can’t do with the Chromebook. However, at a price point of $249, one begins to wonder if the added complexity of a regular laptop is compensated by the added functionality. Again, the key is to think about what you do, not what you might do.

I’ll be interested to read some hands-on evaluations…it’s kinda big for my Christmas stocking, but…

Playin’ with wikis…

I like wikis! I’ll confess that back in the dark ages about a zillion years ago, when I first heard about wikis back in the late 90’s (for the curious, here’s the history of the wiki), I said to myself, “why would anyone every want to create a website that lots of folks can edit?” My lack of imagination about things like this is why I’m not an entrepreneur, I guess 😉

I’ve used different wiki software, but mostly I’ve used PmWiki and MediaWiki. MediaWiki is more powerful and complex, but I like PmWiki for a “quick and easy” wiki that provides reasonable flexibility. They are both in PHP and will run most anywhere. I’m running a PmWiki instance on my Raspberry Pi now. I’ve used PmWiki to create exercises for the Systems Analysis class I teach at UNC-CH. We’ve got a family “notebook” running in PmWiki. I’ve got a family recipe archive in a MediaWiki instance, and some other things as well.

I’ve been sitting here on a rainy September Sunday doing some updates, and just reflecting on fun with wikis.

A Raspberry Pi…

rasp-pi.jpg

I bought myself a Raspberry Pi, a small single board computer, about the size of a credit card. You can order one for $35, put it together with some parts you probably already have, and you’ve got a fully functional Linux computer. I haven’t really decided what to do with it yet, but it’s a good excuse to refresh my Linux skills. It supports a USB keyboard/mouse (I actually used one from an old 1st gen iMac that’s sitting in my closet (can’t bear to throw it out 😉 ) so it’ll use anything. Has HDMI output (with sound) to a TV, as well as composite video and 3.5mm audio. It’s got an Ethernet port, of course. Supposedly you can do WiFi by adding a USB WiFi adapter. Power comes from a micro-USB cellphone charger (1A or better). Storage is from an SD card (they recommend 4GB or larger; I used 4GB and it has ~2GB free after install). It boots from that, but you can supposedly add an external USB hard disk. You have to download the image (Debian-based) and write it to the SD card with something like “dd” depending on your environment (I did it from my current iMac). You could build multiple images, and just replace the SD card to boot to a different OS version.

I plugged it in (it has nice little activity lights that blink 😉 ) and it booted to its config program. I set the locale, timezone, enabled ssh connectivity it was ready to go. You’ve got your traditional command line, and can start an xserver for a GUI. I’ve not gotten remote windows working yet, still reading up on how the graphical display manager works. I did have one problem with sound drivers (no sound at first) but found a hit on the RPI forum and installed one program and sound worked to the HDMI-connected TV.

The standard distro is oriented to Python development. It also has Perl loaded on, but no PHP. It does have gcc. I’ve just started poking around.

I’ve got all the peripherals unplugged now, and the only thing connected is the Ethernet cable and the power. Have ssh to a bash shell (its default shell setting), and that terminal connection is just fine for the time being…it can sit there, and run, drawing just a tiny bit of power, while I figure out what I want to do with it. Pretty cool!

Writing a line of code, woohoo!

All I get to do at work these days is go to meetings and read email. Most any technical stuff these day is on my own personal time. Today was one of those times when I actually debugged and fixed something. I maintain the archives of a flyfishing listserve at http://archives.flyfishlist.org which includes postings going back to 1990! I used to harvest and index the files monthly, but it’s gotten to be more like quarterly. Recently, I indexed the postings from April thru August. I noticed, though, that when I retrieved the articles, I was getting an extra blank line between all content, which made things much harder to read.

I looked systematically, wondering where the extra line was originating. I download the archive files via email from the server at the University of Kentucky, and then I strip out the email headers and run a PERL program against the file to put it into a format that the WAIS retrieval engine can index. The problem could have come from the server at UKY, from Gmail, from the browser I was using to save the archive files, from updates to PERL on my Mac or other things I’d not thought of…likely not the Linux VM since that’s been pretty static.

Using the “od” (octal dump) utility (found in Linux and MacOSX) I found that the problem seem to be that the archive files, as I saved them from the server, had lines separated with LF/CR (hex 0a 0d). The “good” archives from earlier times were using only the Unix line separator LF (hex 0a). I looked at the PERL program that I was using to reformat the archive for indexing, and decided that it was a good place to insert code to strip out the CR.

Time to try to remember how to write a regular expression! Pulled out the PERL book with a cheat sheet of examples 🙂 and came up with the fix, adding one line of code (plus a comment):

# added next line 9/2/12, apparently gmail saves now with LF/CR

$logLine =~ s/r//; # delete a carriage return

That’s it…but it was fun to figure out!