Posts filed under ‘Computer’
Reminder to self: When KOrganizer refuses to reload your remote calendars, no matter how hard you press F5 (reload calendars), and when all hope is lost because even in the KDE system settings there’s no way to reload calendars, and when you’ve banged your head against the monitor often enough after reading all the good advice that suggests you should simply recreate your calendars with the same settings, then delete the old calendars: Wait. What you need to do is simple and straightforward, and if you weren’t a moron just like me, you’d have guessed it, anyway:
To do that, locate the funny little arrow up in the KDE system tray, right-click on the “Akonadi module” button, select “configure”, then select the “configuration of the Akonadi server” tab, and press the “restart” button. Go back to KOrganizer, reload your calendars, and voilá — they’re updated.
This is completely intuitive and perfectly easy to understand, but I keep forgetting it.
Here’s the only workaround (out of half a dozen suggestions found via Google) that actually works for me (KDE 4.10, Galaxy S2, Android 4.0.3).
First, install ‘go-mtpfs’ and dependencies needed on your system. ‘go-mtpfs’ is a program written in Go that can mount an Android device reliably. I call it like this:
go-mtpfs /media/s2 &
The output is something similar to this:
Error: Unable to open ~/.mtpz-data for reading.
2013/04/04 12:38:25 compiled against libmtp 1.1.6
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
2013/04/04 12:38:25 device unknown: unknown (04e8:6865) @ bus 2, dev 23
2013/04/04 12:38:25 storage ID 65537: Phone
2013/04/04 12:38:25 storage ID 131074: Card
2013/04/04 12:38:25 backing data /tmp/go-mtpfs161880298
2013/04/04 12:38:25 starting FUSE.
Once mounted, I call a script that copies images and videos from the device, and when done, unmounts the device. The script looks like this:
if [ $ret -gt 0 ]; then
echo "*** Error: Camera not mounted ***"
rsync --times --verbose --update --chmod=ug+w $from/*.jpg $to_fotos/
if [ $ret -eq 0 ]; then
echo "*** Success: All pictures copied ***"
rsync --times --verbose --update --chmod=ug+w $from/*.mp4 $to_videos/
if [ $ret -eq 0 ]; then
echo "*** Success: All videos copied ***"
fusermount -u /media/s2
The output of the script is something like this:
2013/04/04 12:39:21 fetched "20130403_212621.jpg", 914042 bytes in 245 ms. 3.7 MB/s
2013/04/04 12:39:21 fetched "20130403_212628.jpg", 835851 bytes in 96 ms. 8.7 MB/s
2013/04/04 12:39:21 fetched "20130403_212645.jpg", 1044704 bytes in 79 ms. 13.1 MB/s
sent 2806681 bytes received 71 bytes 1122700.80 bytes/sec
total size is 707008144 speedup is 251.90
*** Success: All pictures copied ***
2013/04/04 12:39:23 fetched "20130403_212651.mp4", 16403453 bytes in 1259 ms. 13.0 MB/s
2013/04/04 12:39:26 fetched "20130403_212841.mp4", 25465650 bytes in 2193 ms. 11.6 MB/s
sent 41875298 bytes received 50 bytes 4407931.37 bytes/sec
total size is 3251470895 speedup is 77.65
*** Success: All videos copied ***
The performance of the ‘rsync’ operations is comparable to how it used to be with USB connections. Those have stopped functioning in KDE 4.10, that’s why I had to find an alternative way. With ‘go-mtpfs’, things are actually easier than before: Just plug in the Android device, call ‘go-mtpfs’, then the script that copies, and done.
So I felt like a Windows user this morning, restarting my computer (openSuse 12.3) and my Galaxy S2 (Android 4.0.3), hoping this would fix the issue I was encountering. But it didn’t, so I had to activate my brain to fix it.
In previous versions of openSuse (and/or KDE, currently I’m on KDE 4.10), plugging in the Galaxy S2 via USB would make the Device Manager pop up, kind of telling me “the Android is mounted”. But this doesn’t happen any more; the S2 only shows up in the Device Manager when it’s NOT connected in USB mode (in which case it will show up as a “portable media player”). In the non-USB mode, I can’t copy any files unfortunately, because there’s a KDE bug that prevents me from doing so.
OK, so the S2 doesn’t show up in the Device Manager, but is it being mounted in USB mode, anyway? Well, once the brain was on, looking at the output of
mount confirmed it was, but it’s mounted in a place completely different from previous openSuse versions. Previously, the photo and video folder used to be mounted on
/media/9650-11FF/DCIM/Camera, while now it is
/var/run/media/stefan/9650-11FF/DCIM/Camera. Just thought I’d do a quick post to save other openSuse users (or maybe this is KDE-specific even) some time.
Upgrading to Android 4.0.3 got me this (as posted on this forum):
So I got a Galaxy II from my phone provider with Android 2.3.6 installed (IIRC). I recently upgraded to Android 4.0, as provided by Samsung. The phone didn’t blow up or anything, but I’ve got a nasty bug now.
When connecting the phone to the (Linux) PC with the USB cable, I can see the folders fine, including DCIM and usbStorage. I can copy files from the PC to the usbStorage or the DCIM folder, just like before. But after disconnecting USB, when looking at the folder I copied the files to (usbStorage or DCIM/some-subfolder), there’s nothing! Connecting to the PC again, I can see them in the PC’s file manager (Dolphin under KDE), or on the command line, where they’d show up like this:
atlas/media/9650-11FF> l usbStorage/ insgesamt 4480 -rw-r--r-- 1 stefan users 4582266 2. Aug 15:24 L001-LESSON.mp3 -rw-r--r-- 1 stefan users 1006 2. Aug 15:24 L001-LESSON.txt
But when looking from the Galaxy, no luck. Nothing.
Digging further, I keep finding lots of items in LOST.DIR (not sure though if they’re related, all 4 KB in size), and often enough items in .Trash-1000/files which are certainly related (sometimes even with the exact same file names). I guess there’s a bug in Samsung’s “File-Stor” Gadget. As said initially, the bug wasn’t there in the previous Android version.
One of the things I dearly hate about working on Linux is calendaring. There are many options for calendars, and over the years I’ve found they all work to some extent, but don’t support all my requirements. I think my requirements are fairly standard:
- Calendars must be available on all my machines, including my phones.
I was trying to think of more requirements to justify a bullet list, but really I can’t. When I say “available” I mean “out of the box”, without having to set up some fancy convoluted solution involving shell scripts that copy calendar files around, which is actually what I’ve seen too often as a suggested solution to overcome calendaring shortcomings on Linux.
Over the years, I’ve been using Sunbird (I liked it a lot, but it’s unfortunately a dead end and won’t run on my 64-bit boxes any more), Thunderbird Lightning, and KOrganizer. I looked at other stuff such as Kontact on KDE, but that simply, uh, won’t fit my needs.
KOrganizer was good enough for me, until I started using an Android phone this week. I bet there are zillions of apps for that phone that would support my WebDAV-based ICS calendars, but that’s exactly the problem. I tried a few, but they were either trial ones, or full of spam, or messed up my Android interface, and so on, and I don’t intend to spend my time investigating lots of crap, hoping I’ll stumble across a working solution some day.
So, once I had given up that idea, I converted my ICS calendars to Google calendars. I don’t feel overly comfortable doing this, because I’m one of the old fashioned crowd who believe that private data should be mostly on private machines that I have control of. Anyway, I did that, and my Google calendars display fine in the standard Android calendar app that came with my phone (Samsung Galaxy S2).
The next step was to make them show up in KOrganizer. Google uses CalDAV. KOrganizer uses Akonadi (on KDE 4.x) which is a service that runs in the background and is used to attach calendars and all kinds of similar stuff to “KDE”, in this case to make calendars available for KOrganizer. Akonadi features CalDAV and Google calendars, as you can see from this screen shot:
So there must be a way to attach my Google calendars in KOrganizer, right? Well, wrong, at least for me. I searched a lot, found a dozen blog or forum posts and stuff, but they were all referring to some slightly different setup than mine (why do developers change the interfaces all the time), or simply didn’t work. I was able to work around a “wrong password” error (guess what? the password was correct, it was some fancy openSuse proxy thing that could be fixed in the KDE system settings by selecting “direct internet connection”), and eventually had a Google calendar show up in KOrganizer, except it wouldn’t display any events. Long story short, I gave up after having wasted too much time on this already, and looked at Thunderbird Lightning again (which I had given up on several years ago when it developed a habit of resetting my ICS calendars to zero byte length).
Thunderbird Lightning 1.4 supports CalDAV calendars, and thus Google calendars, out of the box. At least in theory. In practice, it does pretty much the same I had just experienced with KOrganizer: calendars are there, but don’t display any events. With Lightning, I found that, when setting up a Google calendar, it wouldn’t prompt me for username and password (and no, most of my calendars are definitely not public). That can’t be right! So I searched more, and finally found that you’ll have to install yet another add-on in Thunderbird, called Provider for Google Calendar 0.9.
With that add-on, Google calendars work fine. And not just that, the developer’s web page points out which of the many Google calendar links you’ll have to use. In the Google calendar web interface, select “Calendar settings” from the little pull-down menu that appears when hovering the mouse over the calendar name in the left sidebar. On the next page, scroll down to the bottom, and here’s what you’ll have to select:
In the window that opens, copy the link address. That’s the one to be used for Lightning.
In Lightning, select “New calendar”, “calendar on the network”, select “Google calendar” (this is what the Provider for Google Calendar add-on provides), paste the link address, and done. Things can be so easy once you know your way around. ;-)
To wrap up, this is what I did to get Google calendars working in KDE:
- In Thunderbird, install the Lightning add-on.
- In Thunderbird, install the Provider for Google calendar add-on.
- In the Google Calendar web interface, edit the calendar, click the proper XML button, and copy the URL (link).
- In Lightning, create a new calendar “on the network”, type: “Google calendar”, and paste the URL (link) from the Google Calendar web interface. You’ll be prompted for your Google username and password.
- Do so for every Google calendar you wish to add to Lightning. Note that you’ll be prompted for your Google credentials for each calendar you add.
Some might wonder why I don’t simply stick to the Google Calendar web interface, which is really nice and configurable for my needs. Well, I don’t want my calendars to be just another browser tab. I have around 30 browser tabs (Firefox app tabs) open all the time, but calendars are simply too important for my daily (or should I say hourly) work, and I don’t want them to be even slightly buried in the browser.
Good luck with setting up your remote calendars on Linux!
DocBook export and import round trip with Confluence wiki by Sarah Maddox of Atlassian. I’ve seen lots of attempts to combine Wikis and more sophisticated methods of writing documentation (e.g. using DocBook) over the years, but all were cumbersome and errorprone. The import/export roundtrip illustrated by Sarah looks like the first approach at combining Wiki and DocBook in an “out-of-the-box” way. From reading her post, it’s not error-free, and also uses tools from various companies (Scroll Wiki DocBook Exporter for Confluence, by K15t, and DocBook Import for Confluence, by RedHat), but still it’s encouraging to see that there seems to be progress in that field.
Newer versions of KOrganizer rely on Akonadi, a system-wide KDE service that was created to annoy users. Without Akonadi running, KOrganizer won’t display any resources, that is, calendars. They’ll show up as configured in the KOrganizer settings, and also in the KDE system settings, which can be quite confusing when you try to find out why the heck KOrganizer won’t display the calendars when they’re obviously there.
I must have disabled Akonadi while disabling Nepomuk, an indexing service in KDE that was invented to annoy users even more. (I was fine with the “locate” command. It was fast, reliable, and didn’t eat resources without end.) Anyway, enabling Akonadi once it’s disabled isn’t particularly easy, since you cannot do it from the system settings. You need to run this command (as user, not root):
And voilà – Akonadi is back again. Kill all KOrganizer instances (it loves to live on after terminating it with File, Quit):
ps aux | grep korg (look at the process IDs) kill -9 <process-id> kill -9 <process-id> ...
Then start it again. Resources (calendars) will show up; just tick those you want to display.
Here’s a quick heads-up on how to create PDF printouts on Linux, in case you’re as unaware of how to do that as I was.
Some applications have built-in PDF capabilities, for example OpenOffice.org does, but others like Firefox or Thunderbird don’t. Recently I needed to create a PDF printout from a Wiki page, to send it to people who didn’t have access to an internal Wiki I’m using. On Windows, I would have installed a software like PDF Creator which installs a system printer that creates PDF files from any application. When I looked around for something comparable for Linux I wondered why it seemed hard to find anything. Eventually, I ended up installing the printpdf extension, which does exactly what its name implies.
I’ve uninstalled that extension, forever, when I found out that Linux has a PDF system printer already. At least, that’s the case if you’re using CUPS (Common Unix Printing System), which is the de facto standard on Linux. (Disclaimer: I’m using openSuse Linux 11.1, so I can’t tell for sure if the PDF capability is built in on other flavors of Linux, too.)
Using it is simple. In any application, just select “Print”. In the dialog that pops up, select “Print to file”, and select the “PDF” radio button. Under Firefox, the dialog suggests to create a PDF file named “mozilla.pdf” in the the “Documents” folder of your home directory.
In other applications such as the kate editor, the dialog looks different. Here, you can simply select a system printer named “Print to File (PDF)”, which suggests to create the PDF file in your home directory, and name it “print.pdf”.
The difference between those print dialogs: The one described first is the Gnome print front-end, which my system uses for applications that were written for the Gnome window manager (like Firefox, Thunderbird, or Gimp). The latter dialog appears for KDE applications. The KDE dialog is a bit more straightforward I think – it’s not perfectly obvious that you’d have to select “Print to file” to create a PDF printout. The Gnome front-end with its tabs looks more modern, though. I believe Linux should aim for unifying things like these, because using different dialogs for the same functionality has the potential to confuse users.
I’ve just upgraded my Firefox 3.0 browsers to Firefox 3.5 on some of my machines, and thought I’d share my experience. I’ve done the upgrade on two machines so far, all SuSE 11.1 boxes running KDE 4.3, but my comments might apply to other flavors of Linux and other KDE versions as well. One box is an old 32-bit Dell desktop computer, and the other one a recent Fujitsu Amilo 64-bit machine.
I’m using a lot of browser add-ons/extensions (see my article on Firefox extensions), so I was somewhat afraid that many of them would stop working in Firefox 3.5. (This had happened to me when upgrading from Firefox 1 to version 2, and to a lesser extent when upgrading to version 3.0.) My worries were unjustified, though. Only two extensions gave problems, but I could easily fix those by switching to alternative add-ons with the same functionality:
- TinyURL Creator had to be replaced by TinyURL Generator.
- Tab Mix Plus had to be replaced with Tab Mix Plus. (No joke; Tab Mix Plus 0.3.8.1 was reported as incompatible after the upgrade, so I used the built-in add-ons search and found – Tab Mix Plus 0.3.81, which installed just fine. After restarting Firefox it worked flawlessly, with all settings restored.)
On my 32-bit box, I had a problem with sound under Flash. YouTube videos would play fine, but without sound. I poked around and searched the web, only to find that Flash sound didn’t work in other applications like Opera, either. The solution was to deinstall libflashsupport and restart the applications that use Flash. Now sound in videos is back again.
Speaking of Flash, for some reason videos on the most popular German news site, Spiegel Online, never worked with Firefox 3.0. I was pleasantly surprised to find out that they work with no problem in Firefox 3.5.
I highly recommend upgrading to Firefox 3.5, at least when you’re on Linux. Just from “clicking experience” loading pages is at least two times faster in Firefox 3.5, as compared to Firefox 3.0. The browser starts up a bit faster, too. I haven’t found the time to explore all the HTML 5 goodies that Firefox 3.5 provides, but will certainly give this a try soon.
I want to back up my photos and videos on DVD. This sounds like a pretty straightforward task to me, but apparently it’s not, at least if you’re on Linux, like I am. I have a collection of digital photos and low-resolution videos, dating back to 2001. The total file size is about 40 gigabytes, organized in folders per year, like this:
The folders vary greatly in size. Many of them exceed 4.3 gigabytes which is what you can store on a standard DVD. (Otherwise I would have just copied those folders to individual DVDs, forgetting about the wasted storage space left on many of the DVDs.)
I’ve done backups on DVD before, the layman’s way: Drag over files to k3b, KDE’s burning program, until there’s no space left, burn the DVD, remember the last file stored on DVD, then start over with the next file to be burnt on a new DVD, and so forth. But that’s tedious and error-prone. What I wanted was to simply drag all photo and video folders into some application, and then let the application slice them so that they would fit on regular DVDs. I was sure that other people had had the same problem before, so there had to be an application that does just that. But there isn’t, at least to my knowledge, although I’ve asked many people and googled many forums. The best advice I found was “do this manually” (d’uh) or “use a hard disk” (double d’uh). I just want to back up my photos and videos on DVD, come on. And I believe in read-only media when it comes to backing up historical stuff that will never change, like photos and videos.
I haven’t found a solution that slices my files so that they fit on DVD, and saves them on DVD as files, uncompressed. There’s not much point in compressing JPEG or MPEG files, anyway, and this would give me the additional advantage of being able to view them directly from DVD (for example on my mother’s TV set which can display JPEG slide shows and play MPEG movies).
I said I haven’t found a solution, but that’s not entirely true. I’ve found a Python script that’s pretty short and fairly easy to read, but it’s the opposite of fault-tolerant, and it’s also pretty buggy. One tiny user mistake is enough to stop the process, rendering the last inserted DVD a case for the trash can. Using that script comes close to doing things manually. If I could write Python I’d probably hack that script and make it available publicly. But I can’t.
So I reverted to the next best solution, which is just slicing my files into 4.3 gigabyte pieces, with no way of looking at the individual files straight from DVD. Yes, I could use tar for this, but tar stands for Tape Archiver, and was originally meant for backing up files to tape. What tar does is create one big file, “tarring” all the individual files into that monolith file, while optionally compressing them. That’s great for “full” backups, for example snapshot backups of home directories or log files that you only need to restore fully (in case of disaster, or if you’re transferring files to another disk or computer). But you cannot retrieve individual files or folders from a tar archive file. Also, there’s no built-in slicing in tar, so tar’s archive files might become bigger than 4.3 gigabytes, thus not fitting on DVD.
Enter dar. Dar stands for Disk Archiver, which sounds a bit more modern to me than Tape Archiver. Dar basically does the same as tar, that is, “tarring” files into one big file, optionally compressing them, but it has two advantages over tar:
- Dar can be configured to store that one big file in slices, that is, in a set of files not exceeding a particular file size each.
- You can retrieve individual files from a dar archive easily.
So what I did was create sliced dar files, which I decided to call darslices, each 4.3 gigabytes in size, and burn those files onto DVD using k3b. Dar seems to be less performant than tar, so it took a whole working day to create a dar archive of my 40 gigabytes. I ended up with 16 darslices, which I then burned onto DVD.
Now I said it before that I’m originally a Windows guy, and while I’m running lots of self-coded shell scripts to do repeated tasks, I still prefer to use a graphical user interface (GUI) when it comes to performing tasks that I do only rarely, like once per year. DarGUI comes to the rescue. As you can imagine, it’s a graphical front-end to dar. DarGUI is no more than that, but it’s decently coded, and, unlike so many open source applications, it has great documentation. So here’s a mini-tutorial on getting started with DarGUI, and thus with dar.
First of all, make sure dar is installed. As the name implies, DarGUI is just a graphical front-end, it doesn’t include dar. Then start DarGUI. In KDE, you’ll likely find it in the K menu under System, Backup.
To create a new archive, follow these steps:
- Select File, New (or click the Create a new archive icon).
This opens a new window with six tabs.
In the Archive tab, fill in a name for the archive file (or files, see later on). If you do regular backups (you do, don’t you?) the Add timestamp to name checkbox comes handy.
Saves archive in can be an arbitrary location for storing the dar files (or dar slices).
The Base directory field is the directory which contains all the files and directories that you want to archive. The directories that you enter on the Directories tab must be in this directory! I got this wrong the first time, although that’s exactly how it’s documented. Getting it wrong (by setting the Base directory to some other path) later on resulted in this error:
You can leave the value of Batch file value as is. Check Differential backup if you’re not doing a full or initial backup, but rather follow-up backups that just back up the files that have changed since the last full backup.
- In the Directories tab, add the directories you want to back up. For me, this was just the fotovideo folder on my massive storage device. :-)
- I didn’t use the Files tab at all, because I was interested in backing up complete directories, rather than individual files.
- Likewise, I didn’t use the Compression tab, because compressing photo or video files normally doesn’t make much sense.
- In the Options tab, I checked the Use slices checkbox, setting the value to 4500 Mb (megabytes), since this is what fits on a 4.3 gigabyte DVD.
The Test run only is handy to just try out if your setup will work. It simulates dar processing, but without actually writing files.
- I wanted to run the process immediately, so I didn’t fill in anything in the Scheduling tab.
That’s it. Now it’s time to press OK to start the process. This will open a console window which looks like this:
As said, for my 40 gigabytes of photos and videos, this ran all day. For the initial test run, I stopped it by pressing CTRL+C, then restarted the process after unchecking the Test run only checkbox in the Options tab.
Once the darslices are created and the process has ended, you can browse through the directories and files by selecting File, Open in the main window, or by pressing the Open an archive icon. Select the dar file, or the first dar file of your darslices. The interface will look like this:
Note that it can take some time until the file(s) are loaded and ready to be browsed, if you have a huge dar file or file set. While loading, DarGUI will display BUSY in the status bar.
To restore a file, apply a right click on it and select Restore selected. Then select a location to store your file to. You can do likewise for directories, or even for all directories or files in the dar archive.
Having talked about how great dar and DarGUI are, here’s a caveat that might make my whole effort look somewhat pointless. Dar relies on its darslices to be present on one physical medium. That is, you cannot retrieve individual files from a dar archive that’s stored on a multitude of media, like a set of DVDs. In other words, if I’d plan to restore my photos.2001 folder from my 16 darslices, I’d first have to copy all my 16 DVDs back onto disk. That’s not what I was aiming for in the first place, so I’ll continue looking for alternative solutions. (If you can point out a working solution I’d be more than grateful.) Still I think dar (and DarGUI) can be used for other scenarios, so I don’t regret having spent time on learning how to handle these programs.
Before I forget, I’d like to say thank you to Malcolm Poole, the author of DarGUI, for promptly replying to some questions that I had about DarGUI, and for pointing out to me that what I was looking for was actually documented. (In case you don’t know, I lead the MySQL Documentation Team, so being politely told that there’s an RTFM option always gives me a special feeling, if you know what I mean.)