Feeds:
Posts
Comments

Archive for the ‘Unix’ Category

I have been using Grive2 for a couple of years, to help me get the numbers from our photovoltaic panels into Google Drive storage. That has been going very well… until today.

The new or updated files from my panels did not show up today, although they had been created correctly on the EeePC. When I tried the Grive2 synchronisation by hand, the tool reported a 401 error: access not allowed. I suspected an issue with the Apps authorisation for the Google account concerned, so I deleted the existing ‘grive’ App and launched a new registration request. Alas, to no avail; this is what Google had to say:

Why, oh why, Google?

All I can say is: come on, Google! This has been working fine for a couple of years – why cut it off now? If you really had to cut off access, why not alert the its users first? And what is “temporarily”: a day? a week? forever?

I will copy the files by hand for a few days, but that solution won’t last long. After all, we automate processes so we don’t have to remember doing them, the more so when the process is tedious. Copying files by hand is tedious, and error-prone too…

Read Full Post »

Raspberry Pi Gets Even Cooler

Where did they get their inspiration, I wonder?

More details can be found on TechCrunch: “The Raspberry Pi store is much cooler than an Apple Store“.

Read Full Post »

We’re six years later, and I still haven’t gotten around to any kind of “Tinkering With The Raspberry Pi“. That does not mean that I still have to write down the production numbers from our solar panels by hand, however. The Asus eeePC, running Xubuntu and a bit of software a former colleague of mine and I hacked together, takes care of that. In doing so, it constructs a number of text files: one for each day, listing the current production in Wh every ten minutes, and one for each year, detailing the total production for each day. The backup of these files is made every day by a tool called ‘grive2‘ (but I’ll write about that later).

The setup works fine, almost all the time. But somehow the SMA Sunny Boy gets confused and creates ‘yearly’ files for years other than the current calendar year. Those files are utterly useless and clutter the hard disk as well as the backup, so I decided to get rid of them automatically. To prepare for the first days of a new year, the script should also be able to leave the file for the previous year in place – there may be two valid ‘yearly’ files in January, should I fail to archive the old year on New Year’s eve or on Jan. 1st.

To exercise my *nix shell skills, I decided to do that in ‘bash‘ rather than extend the current Python tools.

As is my habit, I decided to start with a demo script that does what I want on dummy data. For demo purposes the JDoodle website is a great resource, at least for ‘bash’ scripting (I did not try any of the 67 other languages available on the site). This allowed me to work on the code on my Mac-with-big-screen, and take the necessary screenshots for this post.

Here is the code I came up with:

Click on the image to get it in the form of a PDF file,
ready for copy/paste operations.

Nothing spectacular, as shown by the output. Now all I have to do is turn this into a little non-demo script and add it my crontab on the eeePC… Come and see in six years or so ;-)

PS. I’m just dabbling in bash scripting, so if there are better solutions for my problem, don’t hesitate to explain them to me, please.

Read Full Post »

Just so I don’t forget it myself: I’m using Grive2 to backup a few hundred files to Google Drive from the little Asus portable. Why? Because I finally took the time to automate the daily readout of our solar panels on that little Linux machine, and I don’t want to lose that information (one little file every day!) should anything happen to the portable.

I found the instructions on how to install and use Grive2 here: “How to sync your Google Cloud on Linux with Grive2“. Basic stuff, easy to execute: ideal for an eternal beginner like myself ;-)

I had to change the crontab entry, because the line in the example wasn’t working for me. I replaced the ‘grive -path /home/wouter/somedirectory‘ part of the crontab entry with ‘cd /home/wouter/somedirectory && grive‘. And that did the trick.

There are other solutions, of course, but this was sufficient for me, at least for now.

PS. Yes, I really should replace that machine with a Raspberry Pi… but that will have to wait until later.

Read Full Post »

It’s something I need to remember: how do I install an old PyUSB package on Xubuntu (or a similar Debian-based OS). Why, you ask? Because I need that old version 0.4.3 for the little script that reads the solar energy numbers from the SMA Sunny Beam.

Image of the SMA Sunny Beam monitor for our solar panel installation

The SMA Sunny Beam monitor for our solar panel installation

Luckily, it isn’t too hard to do. This is my context:

Step one is to make sure you have the required header files to compile the PyUSB package. So you open up a terminal session and execute

sudo apt-get install libusb-dev
sudo apt-get install python-dev

Step two: Extract the root folder and all the files from the PyUSB archive, and make that folder your current directory in the terminal session.

Step three: compile and install the package with this command:

sudo python setup.py install

That’s it. When all goes well, you’ll be able to verify the existence of two new files on your system, in a directory called “/usr/local/lib/python2.7/dist-packages“:

usb.so
pyusb-0.4.3.egg-info

Done!

Read Full Post »

Short Operating System News

I’m sorry to read that Cyanogen will stop its work on the renowned alternative to Google’s Android. I like CyanogenMod a lot, as evidenced by my writings on the subject. We’ll have to wait and see if LineageOS can replace it.

The good news: Pixel OS for Raspberry Pi. I should really get one… but then again: there are already too many computers on my desk!

Read Full Post »

A few weeks ago I had trouble with some of the sd-cards in my camera’s. Taking pictures was not the problem, but the cards would not show up in the Finder or on the Desktop of my Mac Mini. Having no clue as to why those cards remained invisible, I booted my preferred alternative: Xubuntu.

Again, the cards did not show their contents, but at least Xubuntu told me what was going on: “unknown filesystem type 'exfat'“. The cards were formatted in exFAT – I suppose the Fuji X20 did that. A quick search instructed me on what to do, and a few minutes later I could see (and backup) my photos. So for those of you who found themselves in the same situation, here’s “How to Mount and Use an exFAT Drive on Linux“. Easy and very useful!

Trying out my new smartphone ;-)

Trying out my new smartphone ;-)

Since then, somehow that same sd-card is now handled like any other on the Mac. Did the Mini need the latest MacOS update, or was it just the reboot that did the trick? I’ll never know, but I did learn again that Xubuntu (or Linux in general) is more than just a toy for IT geeks – it can be very useful. But you all knew that, no?

Read Full Post »

Older Posts »