Archive

Author Archive

Archive your IMAP e-mail offline in Thunderbird

September 20th, 2015 5 comments

Thunderbird is an excellent e-mail client and has built in e-mail archiving, however one thing that it doesn’t do intuitively is an offline archive. Here’s the situation: you have an IMAP account in Thunderbird and you want to archive some old e-mail offline (take it off of the IMAP server completely). Simply using Thunderbird’s archive feature will create an Archives folder in your IMAP inbox and move everything to there which isn’t exactly what you want. Instead what you need to do is actually move these e-mails to a new location under your Local Folders. Once the move is complete you can verify that they are indeed now stored locally and (optionally) delete them the IMAP account.

Hopefully this helps out anyone else looking for a solution to an offline IMAP archive!




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

Distro hopping: Import music stored on NAS into Music

September 19th, 2015 No comments

So you’re running elementary OS and want to access the music files you have stored on a Network-attached-storage device within the Music program. Unfortunately while you can easily browse the network and find these files you can’t do so within Music. Luckily there is a solution to this problem! Borrowing heavily from a previous post this will walk you through how to set up a persistent media folder on your computer that will ‘point’ to the music directory on your NAS.

Step 1) Open up a terminal

Now wasn't that easy?

Now wasn’t that easy?

Step 2) Install the required software

For the purpose of this post I’m going to assume the NAS is presenting a Windows file share so we’ll need the software to be able to make use of it. Simply run the following command to install the needed software:

sudo apt-get install cifs-utils
Installing some software!

Installing some software!

Step 3) Create a location for where you want the media to appear

If this is just going to be used for your user account you can simply create a new folder in your home folder. For example create a new folder under the Music folder called “NAS”. However if we want multiple users to be able to access this then you’ll want to put it somewhere else (for example /media/NAS).

For my example I'm just going to put it under a new NAS folder inside of my Music folder

For my example I’m just going to put it under a new NAS folder inside of my Music folder

Step 4) Edit the fstab file and add the share(s) so that they auto connect on startup

So basically there is a file on your computer called fstab that contains information about all of the hard drives and mounts that the computer should create on boot. To make it so our new NAS folder points to the actual NAS directory we’re going to add a new line to this file telling our computer to do just that. Start by using your terminal and opening that file in an editor. You can use a terminal editor like nano or even a graphical one like Scratch.

To use the terminal editor nano run the following command:

sudo nano /etc/fstab
fstab in nano

fstab open in nano

To use the graphical editor Scratch run the following command:

sudo scratch-text-editor /etc/fstab
fstab open in Scratch

fstab open in Scratch

On a new line add the following (modifying it according to your system). Note that this should be a single line even though it may appear broken up over multiple lines here:

//<path to server>/<share name>  <path to local directory>  cifs  
guest,uid=<user id to mount files as>,iocharset=utf8  0  0

Breaking it down a little bit:

  • <path to server>: This is the network name or IP address of the computer hosting the share (in my case the NAS). For example it could be something like “192.168.1.123” or something like “MyNas”
  • <share name>: This is the name of the share on that computer. For example I set up my NAS to share different directories one of which was called “Files”
  • <path to local directory>: This is where you want the remote files to appear locally. For example if you want them to appear in a folder under your Music directory you could do something like “/home/tyler/Music/NAS”. Just make sure that the directory exists (that’s why we created it above :)).
  • <user id to mount files as>: This defines the permissions to give the files. On elementary OS (as well as other Ubuntu distributions) the first user you create is usually given uid 1000 so you could put “1000” here. To find out the uid of any random user use the command “id <user>” in the terminal without quotes.

As an example the line I added for my example configuration here was:

//192.168.3.25/Files  /home/tyler/Music/NAS  cifs  
guest,uid=1000,iocharset=utf8  0  0

Now save the file.

Step 5) Test that it worked

Finally in the terminal we’re going to run command to actually test it:

sudo mount -a

This will do essentially the same thing that happens when your computer first boots so if this works it should work the next time you restart as well. If you don’t get any errors then congratulations it should have all worked! You can verify by now opening up your NAS folder and confirming that it shows the contents of your actual NAS directory.

We have music!

We have music!

Step 6) Import the music into Music

Now that we have the NAS music showing up in a local folder the Music application will be able to add it no problem. Simply open up Music and use the import option to import the music from your folder (in my case ~/Music/NAS).

Ta-da!

Ta-da!

This post is part of a series:




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

KWLUG: Swapping Laptop Drives, Helping New Users (2015-09)

September 19th, 2015 No comments

This is a podcast presentation from the Kitchener Waterloo Linux Users Group on the topic of Swapping Laptop Drives, Helping New Users published on September 14th 2015. You can find the original Kitchener Waterloo Linux Users Group post here.

Read more…




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Categories: Linux, Podcast, Tyler B Tags: , ,

KWLUG: git (2015-08)

September 18th, 2015 No comments

This is a podcast and video presentation from the Kitchener Waterloo Linux Users Group on the topic of git published on August 10th 2015. You can find the original Kitchener Waterloo Linux Users Group post here.

Read more…




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Categories: Linux, Podcast, Tyler B Tags: , ,

KWLUG: Docker (2015-02)

September 18th, 2015 No comments

This is a podcast and video presentation from the Kitchener Waterloo Linux Users Group on the topic of Docker published on February 2nd 2015. You can find the original Kitchener Waterloo Linux Users Group post here.

Read more…




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Categories: Linux, Podcast, Tyler B Tags: , ,

Do you want to write for The Linux Experiment?

September 16th, 2015 No comments

Are you a Linux user? Thinking about trying your own Linux experiment? Have you ever come across something broken or annoying and figured out a solution? Or maybe you just came up with a really neat way of doing something to make your life easier? Well if you have ever done any of those and can write a decent sentence or two we’d be glad to showcase your content here.

Get the full details at our page here: Write for the Linux Experiment.

 




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Categories: Tyler B Tags:

Distro hopping: how to install Plex Home Theater on elementary OS

September 15th, 2015 No comments

Plex is great. It is a very easy to use cross-platform program that lets you view and watch your own personal media almost anywhere. The main component is the Plex Media Server which actually hosts and provides the media but they have another program that offers a very nice interface to browse and view these files called the Plex Home Theater. Unfortunately while they have builds for Windows and OS X there are currently no such officially supported versions for linux. Thankfully the community has stepped in and provided the means to get this running on your distribution of choice. This post will show how to install it on elementary OS (or any other Ubuntu based distributions).

Visiting this page you can see that there are instructions for different distributions. As elementary OS is derivative of Ubuntu we’ll use that provided repository to install the program. The first step is to open a terminal and run the following command:

 sudo apt-add-repository ppa:plexapp/plexht

This will add the community repository to your system so that you can find and install the program normally. Next you just need to run the update command to re-sync with the repositories and then the install command to actually install the program:

sudo apt-get update
sudo apt-get install plexhometheater

Once the command finishes Plex Home Theater should be successfully installed.

Plex!

Plex!

Have fun watching your movies!

This post is part of a series:




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

Distro hopping: tweaking elementary OS

September 13th, 2015 No comments

So from my last post you’ll know that I ran into a couple of issues that I’ve since been able to address.

Default browser Midori crashes

I don’t know what it is but Midori is very crash happy on my installation. It would even crash on google.com so you know something is wrong. So even though my goal was to use the distribution defaults I simply couldn’t continue that way. Instead I installed Chromium from the software centre and that seems to have worked out well.

Turning remember last place on and off

One thing that wasn’t really an issue but more of something I had to get used to was that most applications in elementary OS seem to be configured to remember where they left off. This includes things like the file manager application which I found a bit weird. Thankfully there is a way, albeit not overly straight forward, to change this behaviour.

  1. Open a terminal window
  2. Install dconf-editor by typing (without quotes) “sudo apt-get install dconf-editor”
  3. Run dconf-editor from the terminal or open it via the Applications menu
  4. Expand the tree and uncheck restore tabs: org -> pantheon -> files -> preferences -> restore tabs
    • Alternatively you can run the following command in the terminal: gsettings set org.pantheon.files.preferences restore-tabs false
Changing settings with dconf editor

Changing settings with dconf editor

Add minimize button

Similarly by default the only way to minimize a window in elementary OS is to click the icon in the dock. You can change this behaviour if you’d like by modifying a different setting in dconf editor.

  1. Expand the tree and modify button-layout: org -> pantheon -> desktop -> gala -> appearance -> button-layout
  2. Add “minimize” to where you want the button to appear. For example changing it to “close:minimize,maximize” will add a minimize button to the left of the maximize button on the right hand side of the window.
Now with a minimize button!

Now with a minimize button!

 

That’s all I’ve got for now. Hopefully someone else finds these useful for their own elementary OS installations.

This post is part of a series:




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

Distro hopping: first stop elementary OS

September 12th, 2015 No comments

Ah elementary OS, the distribution that looks so clean, so polished and well… so Apple-esque. I’ve never really played around too much with eOS, other than a brief time way back in 2013, but I have been consistently impressed reading about their latest updates so I figured this would be a natural starting point for my distro hopping adventure.

The install was very painless and if you’ve ever installed Ubuntu before you know the drill as not too much differs here. When all is said and done you are treated to your brand new desktop!

A very professional looking desktop

A very professional looking desktop

As you can see it has a nice little dock at the bottom which contains shortcuts to your applications as well as showing all running applications. This is very similar to what you would see on OS X for example.

elementary OS dock

elementary OS dock

OS X dock

OS X dock

The default browser that ships with eOS, and the one I am using to write this post, is Midori. I’ve never really used Midori before but it is a very streamlined, clean cut application with minimal settings. This fits nicely with the design of the rest of the distribution. However I have run into a few instances where the browser just up and quits due to a crash with no explanation of why it is happening which is a little bit frustrating. If I were to stay on eOS long term I think I would instead opt for a more mature browser such as Firefox or Chrome. Update: I had to install a different browser as Midori was crashing non-stop on me. Not sure if it is just my computer or what but I don’t have these problems with any other browser.

Showing the elementary OS website

Showing the elementary OS website

Next up is the e-mail application Geary. I’ve written about Geary before and have found it to be a very pretty and functional e-mail client, although lacking in expandability. However this again fits with what eOS seems to be trying to do by presenting a overall package that simply works out of the box for the majority of users.

Sorry for all of the censoring...

Sorry for all of the censoring…

There is also a simple calendar application which is very similar to the one you would find on OS X – not to keep bringing up the comparison but it does seem the fine people behind eOS set their targets on a certain popular OS. Oddly I couldn’t figure out a way to synchronize this an existing web calendar from Google. It seems to only support local calendars which is kind of a bummer.

Sure is a calendar

Sure is a calendar

Music is the… you guessed it… music management application. I quickly downloaded some tracks from Jamendo so that I could mess around with it. It seems like a pretty basic media player with no real bells or whistles but it gets the job done.

Music... no not the Madonna song

Music… no not the Madonna song

Videos… notice a trend here?… is the video application for eOS. Really not to much to say about it.

Photos similarly provides the photo management functions for eOS.

It shows your photos but doesn't do much else

It shows your photos but doesn’t do much else

Two things that I’m still struggling to get used to with eOS is that most applications seem to save where they were when you close them and that there is no minimize option for the applications. Saving state can be very handy in some scenarios but I’m not sure why the file manager has to remember which folder I was in last for example… however that is a very small complaint.

The lack of minimize is weirder. You can maximize (really a stretch button like, you guessed it, OS X has) and unmaximize but the only way to actually minimize the window to the dock seems to be to click on the application icon in the dock itself. Not a big deal but hardly intuitive (I’m sure there is a keyboard shortcut or something as well).

Overall I’m pretty happy with elementary OS as a distribution in my short time with it so far.

This post is part of a series:




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Categories: elementary OS, Tyler B Tags:

A distro hopping experiment

September 12th, 2015 No comments

Over the last little while I’ve become quite comfortable using a single distribution, Linux Mint, for my day-to-day needs. While this has obviously allowed the operating system to, in a sense, disappear into the background and let me do “real” work it has had the side effect that I haven’t been as exposed to the interesting changes happening elsewhere on the Linux landscape.

That’s why I’ve decided to run my own mini experiment of sorts where I leave the comfort of Linux Mint and start off on a journey of hopping between different distributions again. I don’t exactly know how long I’ll be staying on each distribution but the goal is to stay for around two weeks or so in order to get a good feel for that distribution. Heck I may even throw in the occasional BSD or other alternative operating system here and there as well just to mix things up. I also plan on trying to stick with the majority of the defaults (settings, programs, etc.) that ship with the distribution so that I get the intended experience.

So join me as I jump around and if you have any suggestions for distributions to try let me know!




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

CoreGTK 3.10.1 Released!

September 8th, 2015 No comments

The next version of CoreGTK, version 3.10.1, has been tagged for release today.

Highlights for this release:

  • Added some missing (varargs) GTK+ functions. This makes it easier to create widgets like the FileChooserDialog.

CoreGTK is an Objective-C language binding for the GTK+ widget toolkit. Like other “core” Objective-C libraries, CoreGTK is designed to be a thin wrapper. CoreGTK is free software, licensed under the GNU LGPL.

You can find more information about the project here and the release itself here.

This post originally appeared on my personal website here.




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

CoreGTK 3.10.0 Released!

August 20th, 2015 No comments

The next version of CoreGTK, version 3.10.0, has been tagged for release today.

Highlights for this release:

  • Move from GTK+ 2 to GTK+ 3
  • Prefer the use of glib data types over boxed OpenStep/Cocoa objects (i.e. gint vs NSNumber)
  • Base code generation on GObject Introspection instead of a mix of automated source parsing and manual correction
  • Support for GTK+ 3.10

CoreGTK is an Objective-C language binding for the GTK+ widget toolkit. Like other “core” Objective-C libraries, CoreGTK is designed to be a thin wrapper. CoreGTK is free software, licensed under the GNU LGPL.

You can find more information about the project here and the release itself here.

This post originally appeared on my personal website here.




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

Taking a look at some Linux e-mail clients

July 12th, 2015 No comments

Many people now use a browser based solution, like Gmail, for all of their e-mail needs however there are still plenty of reasons why someone might want to use a local e-mail client as well. In this post I’m going to take a look at some of the graphical e-mail client options available on Linux.

Balsa

I have to admin that I hadn’t even heard of Balsa before looking up e-mail clients to include in this list. In my limited time using it Balsa seems to be a relatively simple e-mail client that still offers quite a few options (supports POP3 and IMAP as well as PGP/GPG and even includes a spell checker) while still maintaining a very low memory footprint (less than 7MiB of RAM for an empty inbox). However one thing I couldn’t seem to get working was actually sending e-mail – it’s not that it was difficult to setup, I just simply couldn’t get it to connect to my SMTP server to send the mail. It kept timing out without giving me a cause which was annoying.

Balsa

Balsa

Balsa Project Website

Claws Mail

Similar to Balsa, Claws is also a very lightweight e-mail client that offers quite a few standard features but can also be expanded upon via plugins. Interestingly I couldn’t figure out a way to compose a non-plaintext (i.e. HTML) e-mail so perhaps the developers are of the opinion that e-mail should only be sent as text?

Claws Mail

Claws Mail

Claws Mail Project Website

Evolution

Evolution is/was (depends on who you ask) the golden standard for what an e-mail client on Linux should be. You can think of it as a complete Outlook replacement as it does so much more than just e-mail (contacts, calendar, memos, etc.) all without the need for additional plugins. This does come at a bit of a price as Evolution certainly feels heavier and uses more memory than some other e-mail only clients.

Evolution

Evolution

Evolution Project Website

Geary

Geary is a relative newcomer and has been getting quite a bit of attention as it is included as the default e-mail client in elementaryOS. This application is beautiful however very, very streamlined. You won’t find things like plugins, PGP/GPG, or loads of configuration options here, instead Geary focuses on being the best user experience it can be out of the box.

Geary

Geary

Geary Project Website

GNUMail.app

GNUMail.app is quite a bit different from the other e-mail clients on this list. It is associated with the GNUstep project and runs on both Linux and Mac OS X. Unfortunately while trying to use it on Linux I found myself at a loss… I simply couldn’t figure out how to use the thing! I managed to configure my account settings but could never get it to actually download any e-mail. So without actually being able to use the application I don’t have much else to say about it.

GNUMail.app

GNUMail.app

GNUMail.app Wikipedia Page

KMail

KMail provides the e-mail duties for the Kontact Personal Information Manager collection of software. It is a fully featured e-mail client and, because of the other Kontact applications, offers a compelling pseudo-integrated alternative to something heavy like Evolution. This is especially true if you are using the KDE desktop environment where things feel even more integrated.

KMail

KMail

KMail Project Website

Slypheed

Slypheed and Claws Mail are very similar, which makes sense because they used to be the same project (one was simply a place to try new features before putting it into the “real” project). Even though they share a linage Slypheed and Claws Mail now have different code bases and development teams. That said there aren’t very many obvious differences between the two at this point.

Slypheed

Slypheed

Slypheed Project Website

Thunderbird

Thunderbird is one of the most popular free/open source e-mail clients around and for good reason. It offers a good amount of features and can make use of plugins to add even more functionality. While it may not quite match up to Evolution in terms of advanced functionality for most people, myself included, it works very well.

Thunderbird

Thunderbird

Thunderbird Project Website




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

Big distributions, little RAM 8

July 11th, 2015 2 comments

It’s been a while but once again here is the latest instalment of the series of posts where I install the major, full desktop, distributions into a limited hardware machine and report on how they perform. Once again, and like before, I’ve decided to re-run my previous tests this time using the following distributions:

  • Debian 8 (Cinnamon)
  • Debian 8 (GNOME)
  • Debian 8 (KDE)
  • Debian 8 (MATE)
  • Debian 8 (Xfce)
  • Elementary OS 0.3 (Freya)
  • Kubuntu 15.04 (KDE)
  • Linux Mint 17.1 (Cinnamon)
  • Linux Mint 17.1 (KDE)
  • Linux Mint 17.1 (MATE)
  • Linux Mint 17.1 (Xfce)
  • Mageia 4.1 (GNOME)
  • Mageia 4.1 (KDE)
  • OpenSUSE 13.2 (GNOME)
  • OpenSUSE 13.2 (KDE)
  • Ubuntu 15.04 (Unity)
  • Ubuntu Mate (MATE)
  • Xubuntu 15.04 (Xfce)

I also attempted to try and install Fedora 21 and Linux Mint 17.2 (KDE) but it just wouldn’t go.

All of the tests were done within VirtualBox on ‘machines’ with the following specifications:

  • Total RAM: 512MB
  • Hard drive: 8GB
  • CPU type: x86 with PAE/NX
  • Graphics: 3D Acceleration enabled

The tests were all done using VirtualBox 4.3.30, and I did not install VirtualBox tools (although some distributions may have shipped with them). I also left the screen resolution at the default (whatever the distribution chose) and accepted the installation defaults. All tests were run prior to June 2015 so your results may not be identical.

Results

Just as before I have compiled a series of bar graphs to show you how each installation stacks up against one another. Measurements were taken using the free -m command for memory and the df -h command for disk usage.

Like before I have provided the results file as a download so you can see exactly what the numbers were or create your own custom comparisons (see below for link).

Things to know before looking at the graphs

First off if your distribution of choice didn’t appear in the list above its probably not reasonably possible to be installed (i.e. I don’t have hours to compile Gentoo) or I didn’t feel it was mainstream enough (pretty much anything with LXDE). As always feel free to run your own tests and link them in the comments for everyone to see.

First boot memory (RAM) usage

This test was measured on the first startup after finishing a fresh install.

First_Boot_AllMemory (RAM) usage after updates

This test was performed after all updates were installed and a reboot was performed.

After_Updates_AllMemory (RAM) usage change after updates

The net growth or decline in RAM usage after applying all of the updates.

Usage_Changes_AllInstall size after updates

The hard drive space used by the distribution after applying all of the updates.

Install_SizeConclusion

Once again I will leave the conclusions to you. Source data provided below.

Source Data




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

CoreGTK now supports GTK+ 3 and is built from GObject Introspection

July 1st, 2015 No comments

It has been quite a while since the first release of CoreGTK back in August 2014 and in that time I’ve received a lot of very good feedback about the project, what people liked and didn’t like, as well as their wishlists for new features. While life has been very busy since then I’ve managed to find a little bit of time here and there to implement many of the changes that people were hoping for. As mentioned in my previous post here are the highlighted changes for this new version of CoreGTK:

Move from GTK+ 2 to GTK+ 3

GTK+ 3 is now the current supported widget toolkit and has been since February 2011. Now that GTK+ 3 is supported on all platforms (Windows, Mac and Linux) it makes sense to move over and take advantage of the updated features.

Additionally this allows for a natural break in compatibility with the previous release of CoreGTK. What that means for the end user is that I currently don’t have any plans on going back and applying any of these new ideas/changes to the old GTK+ 2 version of the code base, instead focusing my time and effort on GTK+ 3.

Prefer the use of glib data types over boxed OpenStep/Cocoa objects (i.e. gint vs NSNumber)

When originally designing CoreGTK I decided to put a stake in the ground and simply always favour OpenStep/Cocoa objects where possible. The hope was that this would allow for easier integration with existing Objective-C code bases. Unfortunately good intentions don’t always work out in the best way. One of the major pieces of feedback I got was to take a less strict approach on this and drop the use of some classes where it makes sense. Specifically keep using NSString instead of C strings but stop using NSNumber in place of primitives like gint (which itself is really just a C int). The net result of this change is far less boilerplate code and faster performance.

So instead of writing this:

/* Sets the default size of the window */
[window setDefaultSizeWithWidth: [NSNumber numberWithInt:400] andHeight: [NSNumber numberWithInt:300]];

you can now simply write this:

/* Sets the default size of the window */
[window setDefaultSizeWithWidth: 400 andHeight: 300];

Base code generation on GObject Introspection instead of a mix of automated source parsing and manual correction

The previous version of CoreGTK was, shall we say, hand crafted. I had written some code to parse header files and generate a basic structure for the Objective-C output but there was still quite a bit of manual work (days/weeks/months) involved to clean up this output and make it what it was. Other than the significant investment in time required to make this happen it was also prone to errors and would require starting back at square one with every new release of GTK+.

This time around the output is generated using GObject Introspection, specifically by parsing the generated GIR file for that library with the new utility CoreGTKGen. The proccess of generating new CoreGTK bindings using CoreGTKGen now takes just a couple of seconds and produces very clean and simple source code files. This is also really just the start as I’m sure there are plenty of improvements that can be made to CoreGTKGen to make it even better! Perhaps equally exciting is that once this process is perfected it should be relatively easy to adapt it to support other GObject Introspection supported libraries like Pango, Gdk, GStreamer, etc.

Let’s have an example shall we?

While there are a couple of good examples over at the Getting Started page of the Wiki and even within the CoreGTK repo itself I figured I would show something different here. It has always been my goal with this project to make it as easy as possible for existing Objective-C users to port their applications to GTK+. Perhaps you were previously using a widget toolkit like Cocoa on the Mac and now you want to release your application on more platforms. What better way than to keep your existing business logic and swap out the GUI (you do practice good MVC right? :P).

So going with this idea here is a tutorial of porting the “Start Developing Mac Apps Today” example from Apple’s developer website here. This application is incredibly simplistic but basically lets you set a “volume” value either by typing in a number in the text box at the top, moving the slider up and down, or pressing the Mute button. Regardless of which action you take the rest of the GUI is updated to match.

Step 1) Setup the GUI

For this I will be using GLADE as a replacement for the Xcode Interface Builder but you could always program your GUI by hand as well.

From the Apple website we are trying to re-create something that looks like this:

apple_exampleThankfully in GLADE this is relatively easy and I was able to do a quick and dirty mock up resulting in this:

glade_mockup

 

Step 2) Configure GUI signals (i.e. events)

GLADE also makes this easy, simply click on the widget, flip over to the Signals tab and type in your handler name.

textEntrySignal

Here are the ones I created:

  • window (GtkWindow)
    • Signal: destroy
    • Handler: endGtkLoop
  • entry (GtkEntry)
    • Signal: changed
    • Handler: takeValueForVolume
  • scale (GtkScale)
    • Signal: value-changed
    • Handler: sliderValueChanged
  • mute_button (GtkButton)
    • Signal: clicked
    • Handler: muteButtonClicked

Step 3) Create classes

Even though Cocoa and GTK+ don’t map exactly the same I decided to follow Apple’s conventions where it made sense just for consistency.

AppDelegate.h

#import "CoreGTK/CGTKEntry.h"
#import "CoreGTK/CGTKScale.h"

#import "Track.h"

@interface AppDelegate : NSObject
{
    CGTKEntry *textField;
    CGTKScale *slider;
    Track *track;
    BOOL updateInProgress;
}

@property (nonatomic, retain) CGTKEntry *textField;
@property (nonatomic, retain) CGTKScale *slider;
@property (nonatomic, retain) Track *track;

/* Callbacks */
-(void)mute;
-(void)sliderChanged;
-(void)takeValueForVolume;

/* Methods */
-(void)updateUserInterface;

-(void)dealloc;

@end

AppDelegate.m

#import "AppDelegate.h"

@implementation AppDelegate

@synthesize textField;
@synthesize slider;
@synthesize track;

/* Callbacks */
-(void)mute
{
    if(!updateInProgress)
    {
        updateInProgress = YES;
        
        [self.track setVolume:0.0];
    
        [self updateUserInterface];
        
        updateInProgress = NO;
    }
}

-(void)sliderChanged
{
    if(!updateInProgress)
    {
        updateInProgress = YES;
        
        [self.track setVolume:[self.slider getValue]];
    
        [self updateUserInterface];
        
        updateInProgress = NO;
    }
}

-(void)takeValueForVolume
{
    NSString *text = [self.textField getText];
    if([text length] == 0)
    {
        return;
    }
    
    if(!updateInProgress)
    {
        updateInProgress = YES;
        
        double newValue = [[self.textField getText] doubleValue];
    
        [self.track setVolume:newValue];
    
        [self updateUserInterface];
        
        updateInProgress = NO;
    }
}

/* Methods */
-(void)updateUserInterface
{
    double volume = [self.track volume];
    
    [self.textField setText:[NSString stringWithFormat:@"%1.0f", volume]];
    
    [self.slider setValue:volume];
}

-(void)dealloc
{
    [textField release];
    [slider release];
    [track release];
    [super dealloc];
}

@end

Track.h

/*
 * Objective-C imports
 */
#import <Foundation/Foundation.h>

@interface Track : NSObject
{
    double volume;
}

@property (assign) double volume;

@end

Track.m

#import "Track.h"

@implementation Track

@synthesize volume;

@end

Step 4) Wire everything up

In order to make everything work, load the GUI from the .glade file, connect the signals to the AppDelegate class, etc. we need some glue code. I’ve placed this all in the main.m file.

main.m

int main(int argc, char *argv[])
{    
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    
    /* This is called in all GTK applications. Arguments are parsed
    * from the command line and are returned to the application. */
    [CGTK autoInitWithArgc:argc andArgv:argv];
        
    /* Create a builder to load GLADE file */
    CGTKBuilder *builder = [[CGTKBuilder alloc] init];
    
    if([builder addFromFileWithFilename:@"mac_app.glade" andErr:NULL] == 0)
    {
        NSLog(@"Error loading GUI file");
        return 1;
    }
    
    /* Create an AppDelegate to link to the GUI */
    AppDelegate *appDelegate = [[AppDelegate alloc] init];
    
    /* Get text field, wrapping returned Widget in new CGTKEntry */
    appDelegate.textField = [[[CGTKEntry alloc] initWithGObject:(GObject*)[[CGTKBaseBuilder 
        getWidgetFromBuilder:builder withName:@"entry"] WIDGET]] autorelease];
    
    /* Get slider, wrapping returned Widget in new CGTKScale */
    appDelegate.slider = [[[CGTKScale alloc] initWithGObject:(GObject*)[[CGTKBaseBuilder 
        getWidgetFromBuilder:builder withName:@"scale"] WIDGET]] autorelease];
    
    /* Create track class for AppDelegate */
    Track *track = [[Track alloc] init];
    appDelegate.track = [track autorelease];
    
    /* Pre-synchronize the GUI */
    [appDelegate updateUserInterface];
    
    /* Use signal dictionary to connect GLADE signals to Objective-C code */
    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:
                     [CGTKCallbackData withObject:[CGTK class] 
                         andSEL:@selector(mainQuit)], @"endGtkLoop",
                         
                     [CGTKCallbackData withObject:appDelegate 
                         andSEL:@selector(mute)], @"muteButtonClicked",
                         
                     [CGTKCallbackData withObject:appDelegate 
                         andSEL:@selector(sliderChanged)], @"sliderValueChanged",
                         
                     [CGTKCallbackData withObject:appDelegate 
                         andSEL:@selector(takeValueForVolume)], @"takeValueForVolume",
                     nil];

    /* CGTKBaseBuilder is a helper class to maps GLADE signals to Objective-C code */
    [CGTKBaseBuilder connectSignalsToObjectsWithBuilder:builder andSignalDictionary:dic];
    
    /* Show the GUI */
    [[CGTKBaseBuilder getWidgetFromBuilder:builder withName:@"window"] showAll];
    
    /*
     * Release allocated memory
     */
    [builder release];
            
    /* All GTK applications must have a [CGTK main] call. Control ends here
     * and waits for an event to occur (like a key press or
     * mouse event). */
    [CGTK main];
    
    /*
     * Release allocated memory
     */    
    [appDelegate release];
    [pool release];
    
    // Return success
    return 0;
}

 

Step 5) Compile and run

coregtk_result

So while this is a very basic, quick and dirty example it does prove the point. As for CoreGTK this release is still under development as I try and flush out any remaining bugs but please give it a shot, submit issues or pitch in to help if you’re interested! You can find the CoreGTK project at http://coregtk.org.

Example Source Code
File name: mac_port_example.zip
File hashes: Download Here
License: (LGPL) View Here
File size: 5.3KB
File download: Download Here

This post originally appeared on my personal website here.




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

Adding GTK+ 3 support and building CoreGTK using GObject Introspection

May 3rd, 2015 No comments

It has been a while since I made any mention of my side project CoreGTK. I’m sure many people can relate that with life generally being very busy it is often hard to find time to work on hobby projects like this. Thankfully while that certainly has slowed the pace of development it hasn’t stopped it outright and now I am just about ready to show off the next update for CoreGTK.

First off thank you to everyone who took a look at the previous release. I received quite a few nice comments as well as some excellent feedback and hope to address quite a bit of that here. The feedback plus my own ideas of where I wanted to take the project defined the goal for the next release that I am currently working toward.

Goals for this release:

  • Move from GTK+ 2 to GTK+ 3
  • Prefer the use of glib data types over boxed OpenStep/Cocoa objects (i.e. gint vs NSNumber)
  • Base code generation on GObject Introspection instead of a mix of automated source parsing and manual correction

In order to explain the rationale behind these goals I figured I would address each point in more detail.

Move from GTK+ 2 to GTK+ 3

This one was pretty much a no-brainer. GTK+ 3 is now the current supported widget toolkit and has been since February 2011. Previously my choice to use GTK+ 2 was simply due to the fact that I wanted to make it as cross-platform as possible and at the time of release GTK+ 3 was not supported on Windows. Now that this has changed it only makes sense to continue forward using the current standard.

Additionally this allows for a natural break in compatibility with the previous release of CoreGTK. What that means for the end user is that I currently don’t have any plans on going back and applying any of these new ideas/changes to the old GTK+ 2 version of the code base, instead focusing my time and effort on GTK+ 3.

Prefer the use of glib data types over boxed OpenStep/Cocoa objects (i.e. gint vs NSNumber)

When originally designing CoreGTK I decided to put a stake in the ground and simply always favour OpenStep/Cocoa objects where possible. The hope was that this would allow for easier integration with existing Objective-C code bases. Unfortunately good intentions don’t always work out in the best way. One of the major pieces of feedback I got was to take a less strict approach on this and drop the use of some classes where it makes sense. Specifically keep using NSString instead of C strings but stop using NSNumber in place of primitives like gint (which itself is really just a C int). The net result of this change is far less boilerplate code and faster performance.

So instead of writing this:

/* Sets the border width of the window */
[window setBorderWidth: [NSNumber numberWithInt:10]];

you can now simply write this:

/* Sets the border width of the window */
[window setBorderWidth: 10];

Base code generation on GObject Introspection instead of a mix of automated source parsing and manual correction

The previous version of CoreGTK was, shall we say, hand crafted. I had written some code to parse header files and generate a basic structure for the Objective-C output but there was still quite a bit of manual work involved to clean up this output and make it what it was. Other than the significant investment in time required to make this happen it was also prone to errors and would require starting back at square one with every new release of GTK+. This time around the output is generated using GObject Introspection, specifically by parsing the generated GIR file for that library. Currently, and I must stress that there is still quite a bit of room for improvement, this allows me to generate CoreGTK bindings from scratch within an hour or so. With some of the final touches I have in mind the time required for this should hopefully be down to minutes (the auto-generation itself only takes seconds but it isn’t 100% yet). Better still once this process is perfected it should be relatively easy to adapt it to support other GObject Introspection supported libraries like Pango, Gdk, GStreamer, etc.

So where is this new release?

I am getting closer to showing off this new code but first I have to do a bit of cleanup on it. This hopefully won’t take too much longer and to show you how close I am here is a screenshot of CoreGTK running using GTK+ 3.

coregtk-3

This post originally appeared on my personal website here.




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

How to easily forward Firefox (PC & Android) traffic through an SSH tunnel

March 29th, 2015 No comments

Say you are travelling, or are at a neighbourhood coffee shop, using whatever unsecured WiFi network they make available. You could either:

  1. trust that no one is sniffing your web traffic, capturing passwords, e-mails, IMs, etc.
  2. trust that no one is using more sophisticated methods to trick you into thinking that you are secure (i.e. man in the middle attack)
  3. route your Internet traffic through a secure tunnel to your home PC before going out onto the web, protecting you from everyone at your current location

which would you choose?

VPNs and SSH tunnels are actually a relatively easy means for you to be more secure while browsing the Internet from potentially dangerous locations.

Making use of an SSH tunnel on your PC

There are many, many different ways for you to do this but I find using a Linux PC that is running on your home network to be the easiest.

Step 1: Install SSH Server

Configure your home Linux PC. Install ssh (and sshd if it is separate). If you are using Ubuntu this is as easy as running the following command: sudo apt-get install ssh

Step 2: Make it easy to connect

Sign up for a free dynamic DNS service like DynDNS or No-IP so that you know of a web address that always points to your home Internet connection. To do this follow the instructions at the service you choose.

Step 3: Connect to tunnel

On your laptop (that you have taken with you to the hotel or coffee shop) connect to your home PC’s ssh server. If you are on Windows you will need to get a program like PuTTY. See their documentation on how to forward ports. On Linux you can simply use the ssh command. The goal is to forward a dynamic port to the remote ssh server. For instance if you are using a Linux laptop and ssh then the command would look something like: ssh -D [dynamic port] [user]@[home server] -p [external port number – if not 22]. An example of one would be ssh -D 4096 user@example.com -p 4000

Step 4: Configure browser to use SSH tunnel proxy

In your browser open the networking options window. This will allow you to tell the browser to forward all of its traffic to a proxy, which in this case, will be our dynamic port that we set up in step 3. Here is an example of my configuration for the example above.
If you don’t feel awesome enough doing the above graphically you can also browse to “about:config” (without quotes) and set the following values:

  • network.proxy.proxy_over_tls
    • true
  • network.proxy.socks
    • Change to “127.0.0.1” with no quotes
  • network.proxy.socks_port
    • Change to the SSH Tunnel Local Port set above (4096)
  • network.proxy.socks_remote_dns
    • Change to true
    • Note: you cannot actually set this setting graphically but it is highly recommended to configure this as well!
  • network.proxy.socks_version
    • Change to 5
  • network.proxy.type
      Change to 1

Step 5: Test and use

Browse normally – you are now browsing the Internet by routing all of your traffic (in Firefox) securely through your home PC. Note that this doesn’t actually make web browsing any more secure beyond protecting you from people in your immediate vicinity (i.e. connected to the same insecure WiFi network).


What about Android?

Just like the PC you can also do it on Android even without root access. Please note that while I’m sure there are a few ways to accomplish this, the following is just one way that has worked for me. I’m also assuming that you already have an SSH server to tunnel your traffic through.

Step 1: Install SSH Tunnel

The first thing you’ll want to do is install an application that will actually create the SSH tunnel for you. One such application is the aptly named SSH Tunnel which can be found on the Google Play Store here.

Step 2: Configure SSH Tunnel

Next you’ll want to launch the application and configure it.

  • Set the Host address (either a real domain name, dynamic DNS redirector or IP address of your SSH server) and port to connect on.
  • You’ll also want to configure the User and Password / Passphrase.
  • Check the box that says Use socks proxy.
  • Configure the Local Port that you’ll connect to your tunnel on (perhaps 1984 for the paranoid?)
  • I would recommend checking Auto Reconnect as well, especially if you are on a really poor WiFi connection like at a hotel or something.
  • Finally check Enable DNS Proxy.

Step 3: Connect SSH Tunnel

To start the SSH tunnel simply check the box that says Tunnel Switch.

Step 4: Install Firefox

While you may have a preference for Google Chrome, Firefox is the browser I’m going to recommend setting up the tunnel with. Additionally this way if you do normally use Chrome you can simply leave Firefox configured to always use the SSH tunnel and only switch to it when you want the additional privacy. Firefox can be found on the Google Play store here.

Step 5: Configure Firefox to use SSH Tunnel

In order to make Firefox connect via the SSH tunnel you’ll need to modify some settings. Once you are finished the browser will only work if the SSH tunnel is connected.

  • In the Firefox address bar browse to “about:config” with no quotes.
  • In the page that loads search and modify the following values:
    • network.proxy.proxy_over_tls
      • true
    • network.proxy.socks
      • Change to “127.0.0.1” with no quotes
    • network.proxy.socks_port
      • Change to the SSH Tunnel Local Port set above (1984?)
    • network.proxy.socks_remote_dns
      • Change to true
    • network.proxy.socks_version
      • Change to 5
    • network.proxy.type
        Change to 1

Step 6: Test and browse normally

Now that you have configured the above you should be able to browse via the tunnel. How can you check if it is working? Simply turn off the SSH Tunnel and try browsing – you should get an error message. Or if you are on a different WiFi you could try using a service to find your IP address and make sure it is different from where you are. For example if you configured Firefox to work via the SSH tunnel but left Chrome as is then visiting a site like http://www.whatismyip.com/ should show different information in each browser.

This post is a complication of two posts which originally appeared on my personal website here.




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

Cloud software for a Synology NAS and setting up OwnCloud

November 8th, 2014 No comments

Recently the Kitchener Waterloo Linux Users Group held a couple of presentations on setting up your own personally hosted cloud. With their permission we are pleased to also present it below:

Read more…




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

Big distributions, little RAM 7

October 13th, 2014 4 comments

It’s been a while but once again here is the latest instalment of the series of posts where I install the major, full desktop, distributions into a limited hardware machine and report on how they perform. Once again, and like before, I’ve decided to re-run my previous tests this time using the following distributions:

  • Debian 7.6 (GNOME)
  • Elementary OS 0.2 (Luna)
  • Fedora 20 (GNOME)
  • Kubuntu 14.04 (KDE)
  • Linux Mint 17 (Cinnamon)
  • Linux Mint 17 (MATE)
  • Mageia 4.1 (GNOME)
  • Mageia 4.1 (KDE)
  • OpenSUSE 13.1 (GNOME)
  • OpenSUSE 13.1 (KDE)
  • Ubuntu 14.04 (Unity)
  • Xubuntu 14.04 (Xfce)

I also attempted to try and install Fedora 20 (KDE) but it just wouldn’t go.

All of the tests were done within VirtualBox on ‘machines’ with the following specifications:

  • Total RAM: 512MB
  • Hard drive: 8GB
  • CPU type: x86 with PAE/NX
  • Graphics: 3D Acceleration enabled

The tests were all done using VirtualBox 4.3.12, and I did not install VirtualBox tools (although some distributions may have shipped with them). I also left the screen resolution at the default (whatever the distribution chose) and accepted the installation defaults. All tests were run between October 6th, 2014 and October 13th, 2014 so your results may not be identical.

Results

Just as before I have compiled a series of bar graphs to show you how each installation stacks up against one another. Measurements were taken using the free -m command for memory and the df -h command for disk usage.

Like before I have provided the results file as a download so you can see exactly what the numbers were or create your own custom comparisons (see below for link).

Things to know before looking at the graphs

First off if your distribution of choice didn’t appear in the list above its probably not reasonably possible to be installed (i.e. I don’t have hours to compile Gentoo) or I didn’t feel it was mainstream enough (pretty much anything with LXDE). As always feel free to run your own tests and link them in the comments for everyone to see.

First boot memory (RAM) usage

This test was measured on the first startup after finishing a fresh install.

 

All Data Points

All Data Points

RAM

RAM

Buffers/Cache

Buffers/Cache

RAM - Buffers/Cache

RAM – Buffers/Cache

Swap Usage

Swap Usage

RAM - Buffers/Cache + Swap

RAM – Buffers/Cache + Swap

Memory (RAM) usage after updates

This test was performed after all updates were installed and a reboot was performed.

All Data Points

All Data Points

RAM

RAM

Buffers/Cache

Buffers/Cache

RAM - Buffers/Cache

RAM – Buffers/Cache

Swap Usage

Swap Usage

RAM - Buffers/Cache + Swap

RAM – Buffers/Cache + Swap

Memory (RAM) usage change after updates

The net growth or decline in RAM usage after applying all of the updates.

All Data Points

All Data Points

RAM

RAM

Buffers/Cache

Buffers/Cache

RAM - Buffers/Cache

RAM – Buffers/Cache

Swap Usage

Swap Usage

RAM - Buffers/Cache + Swap

RAM – Buffers/Cache + Swap

Install size after updates

The hard drive space used by the distribution after applying all of the updates.

Install Size

Install Size

Conclusion

Once again I will leave the conclusions to you. Source data provided below.

Source Data




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).

How to set a static IP address on Ubuntu 14.04 server (and others)

September 16th, 2014 No comments

This assumes you want to set a static IP address on the network device eth0.

Open up the interfaces file

sudo nano /etc/network/interfaces

and remove or comment out the line that says

iface eth0 inet dhcp

then add the following lines in its place:

iface eth0 inet static
address [static IP address, i.e. 192.168.1.123]
netmask [i.e. 255.255.255.0]
network [i.e. 192.168.1.0]
broadcast [i.e. 192.168.1.255]
gateway [i.e. 192.168.1.1]
dns-nameservers [i.e. 8.8.8.8]

Save the file and reboot the server. On some systems you may also need to update /etc/resolv.conf and /etc/hosts




I am currently running a variety of distributions, primarily Linux Mint 18.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).