Archive for the ‘Tyler B’ Category

How to mount a Windows share on startup

April 28th, 2014 2 comments

I recently invested in a NAS device to add a little bit of redundancy to my personal files. With this particular NAS the most convenient way to use the files it stores is via the Windows share protocol (also known a SMB or CIFS). Linux has supported these protocols for a while now so that’s great but I wanted it to automatically map the shared directory on the NAS to a directory on my Linux computer on startup. Thankfully there is a very easy way to do just that.

1) First install cifs-utils

sudo apt-get install cifs-utils

2) Next edit the fstab file and add the share(s)

To do this you’ll need to add a new line to the end of the file. You can easily open the file using nano in the terminal by running the command:

sudo nano /etc/fstab

Then use the arrow keys to scroll all the way to the bottom and add the share in the following format:

//<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 “” 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 /media you could do something like “/media/NAS”. Just make sure that the directory exists (create it if you need to).
  • <user id to mount files as>: This defines the permissions to give the files. On Ubuntu the first user you create is usually give uid 1000 so you could put “1000” here. To find out the uid of any random user use the command “id <user>” without quotes.

So for example my added line in fstab was

//     /media/NAS     cifs     guest,uid=1000,iocharset=utf8     0     0

Then save the file “Ctrl+O” and then Enter in nano.

3) Mount the remote share

Run this command to test the share:

sudo mount -a

If that works you should see the files appear in your local directory path. When you restart the computer it will also attempt to connect to the share and place the files in that location as well. Keep in mind that anything you do to the files there also changes them on the share!

I am currently running a variety of distributions, primarily Linux Mint 17.
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).
Check out my profile for more information.
Categories: Linux, Tyler B Tags: , , , , ,

Ubuntu 14.04 VNC woes? Try this!

April 28th, 2014 No comments

If, like me, you’ve recently upgraded to Ubuntu 14.04 only to find out that for whatever reason you can no longer VNC to that machine anymore (either from Windows or even an existing Linux install) have no fear because I’ve got the fix for you!

Simply open up a terminal and run the following line:

gsettings set org.gnome.Vino require-encryption false

Obviously if you use VNC encryption you may not want to do this but if you’re like me and just use VNC on the local network it should be safe enough to disable.

I am currently running a variety of distributions, primarily Linux Mint 17.
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).
Check out my profile for more information.

Extend the life of your SSD on linux

February 9th, 2014 2 comments

This past year I purchased a laptop that came with two drives, a small 24GB SSD and a larger 1TB HDD. My configuration has placed the root filesystem (i.e. /) on the SSD and my home directory (i.e. /home) on the HDD so that I benefit from very fast system booting and application loading but still have loads of space for my personal files. The only downside to this configuration is that linux is sometimes not the best at ensuring your SSD lives a long life.

Unlike HDDs, SSDs have a finite number of write operations before they are guaranteed to fail (although you could argue HDDs aren’t all that great either…). Quite a few linux distributions have not yet been updated to detect and configure SSDs in such a way as to extend their life. Luckily for us it isn’t all that difficult to make the changes ourselves.

Change #1 – noatime

The first change that I do is to configure my system so that it no longer updates each files access time on the SSD partition. By default Linux records information about when files were created and last modified as well as when it was last accessed. There is a cost associated with recording the last access time and including this option can not only significantly reduce the number of writes to the drive but also give you a slight performance improvement as well. Note that if you care about access times (for example if you like to perform filesystem audits or something like that) then obviously disabling this may not be an option for you.

Open /etc/fstab as root. For example I used nano so I ran:

sudo nano /etc/fstab

Find the SSD partition(s) (remember mine is just the root, /, partition) and add noatime to the mounting options:

UUID=<some hex string> /               ext4    noatime,errors=remount-ro

Change #2 – discard

UPDATE: Starting with 14.04 you no longer need to add discard to your fstab file. It is now handled automatically for you through a different system mechanism.

TRIM is a technology that allows a filesystem to immediately notify the SSD when a file is deleted so that it can more efficiently manage the underlying storage and improve the lifespan of the drive. Not all filesystems support TRIM but if you are like most people and use ext4 then you can safely enable this feature. Note that some people have actually had drastic write performance decreases when enabling this option but personally I’d rather have that than a dead drive.

To enable TRIM support start by again opening /etc/fstab as root and find the SSD partition(s). This time add discard to the mounting options:

UUID=<some hex string> /               ext4    noatime,errors=remount-ro,discard

Change #3 – tmpfs

If you have enough RAM you can also dedicate some of it to mounting specific partitions via tmpfs. Tmpfs essentially makes a fake hard drive, known as a RAM disk, that exists only in your computer’s RAM memory while it is running. You could use this to store commonly written to temporary filesystems like /tmp or log file locations such as /var/logs.

This has a number of consequences. For one anything that gets written to tmpfs will not be there the second you restart or turn the computer off – it never gets written back to a real hard drive. This means that while you can save your SSD all of those log file writes you also won’t be able to debug a problem using those log files on a computer crash or something of the like. Also being a RAM disk means that it will slowly(?) eat up your RAM growing larger and larger the more you write to it between restarts. There are options for putting limits on how large a tmpfs partition can grow but I’ll leave you to search for those.

To set this up open /etc/fstab as root. This time add new tmpfs lines using the following format:

tmpfs   /tmp    tmpfs   defaults  0       0

You can lock it down even more by adding some additional options like noexec (disallows execution of binaries on the filesystem) and nosuid (block the operation of suid, and sgid bits). Some other locations you may consider adding are /var/log, /var/cache/apt etc. Please read up on each of these before applying them as YMMV.

Categories: Hardware, Tyler B Tags: , , , , ,

Change the default sort order in Nautilus

February 9th, 2014 1 comment

The default sort order in Nautilus has been changed to sorting alphabetically by name and the option to change this seems to be broken. For example I prefer my files to be sorted by type so I ran


and browsed to org/gnome/nautilus/preferences. From there you should be able to change the value by using the drop down:


Seems easy enough

Seems easy enough

Unfortunately the only option available is modification time. Once you change it to that you can’t even go back to name. This also appears to be a problem when trying to set the value using the command line interface like this:

dconf write /org/gnome/nautilus/preferences/default-sort-order type

I received an “error: 0-4:unknown keyword” message when I tried to run that.

Thanks to the folks over on the Ask Ubuntu forum I was finally able to get it to change by issuing this command instead:

gsettings set org.gnome.nautilus.preferences default-sort-order type

where type could be swapped out for whatever you prefer it to be ordered by.

Great Success!

Great Success!


January 28th, 2014 2 comments

A while back I made it my goal to put together an open source project as my way of contributing back to the community. Well fast forward a couple of months and my hobby project is finally ready to be shown the light of day. I give you… CoreGTK

CoreGTK is an Objective-C binding for the GTK+ library which wraps all objects descending from GtkWidget (plus a few others here and there). Like other “core” Objective-C libraries it is designed to be a very thin wrapper, so that anyone familiar with the C version of GTK+ should be able to pick it up easily.

However the real goal of CoreGTK is not to replace the C implementation for every day use but instead to allow developers to more easily code GTK+ interfaces using Objective-C. This could be especially useful if a developer already has a program, say one they are developing for the Mac, and they want to port it to Linux or Windows. With a little bit of MVC a savvy developer would only need to re-write the GUI portion of their application in CoreGTK.

So what does a CoreGTK application look like? Pretty much like a normal Objective-C program:

 * Objective-C imports
#import <Foundation/Foundation.h>
#import "CGTK.h"
#import "CGTKButton.h"
#import "CGTKSignalConnector.h"
#import "CGTKWindow.h"

 * C imports
#import <gtk/gtk.h>

@interface HelloWorld : NSObject
/* This is a callback function. The data arguments are ignored
 * in this example. More callbacks below. */

/* Another callback */

@implementation HelloWorld
int main(int argc, char *argv[])
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    /* We could use also CGTKWidget here instead */
    CGTKWindow *window;
    CGTKButton *button;

    /* 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 new window */
    window = [[CGTKWindow alloc] initWithGtkWindowType:GTK_WINDOW_TOPLEVEL];

    /* Here we connect the "destroy" event to a signal handler in 
     * the HelloWorld class */
    [CGTKSignalConnector connectGpointer:[window WIDGET] 
        withSignal:@"destroy" toTarget:[HelloWorld class] 
        withSelector:@selector(destroy) andData:NULL];

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

    /* Creates a new button with the label "Hello World" */
    button = [[CGTKButton alloc] initWithLabel:@"Hello World"];

    /* When the button receives the "clicked" signal, it will call the
     * function hello() in the HelloWorld class (below) */
    [CGTKSignalConnector connectGpointer:[button WIDGET] 
        withSignal:@"clicked" toTarget:[HelloWorld class] 
        withSelector:@selector(hello) andData:NULL];

    /* This packs the button into the window (a gtk container) */
    [window add:button];

    /* The final step is to display this newly created widget */
    [button show];

    /* and the window */
    [window show];

    /* 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];

    [pool release];

    return 0;

    NSLog(@"Hello World");

    [CGTK mainQuit];
Hello World in action

Hello World in action

And because Objective-C is completely compatible with regular old C code there is nothing stopping you from simply extracting the GTK+ objects and using them like normal.

// Use it as an Objective-C CoreGTK object!
CGTKWindow *cWindow = [[CGTKWindow alloc] 

// Or as a C GTK+ window!
GtkWindow *gWindow = [cWindow WINDOW];

// Or even as a C GtkWidget!
GtkWidget *gWidget = [cWindow WIDGET];

// This...
[cWindow show];

// the same as this:
gtk_widget_show([cWindow WIDGET]);

You can even use a UI builder like GLADE, import the XML and wire up the signals to Objective-C instance and class methods.

CGTKBuilder *builder = [[CGTKBuilder alloc] init];
if(![builder addFromFile:@""])
    NSLog(@"Error loading GUI file");
    return 1;

[CGTKBuilder setDebug:YES];

NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:
                 [CGTKCallbackData withObject:[CGTK class] 
                     andSEL:@selector(mainQuit)], @"endMainLoop",
                 [CGTKCallbackData withObject:[HelloWorld class] 
                     andSEL:@selector(hello)], @"on_button2_clicked",
                 [CGTKCallbackData withObject:[HelloWorld class] 
                     andSEL:@selector(hello)], @"on_button1_activate",

[builder connectSignalsToObjects:dic];

CGTKWidget *w = [builder getWidgetWithName:@"window1"];
if(w != nil)
    [w showAll];

[builder release];

So there you have it that’s CoreGTK in a nutshell.

There are a variety of ways to help me out with this project if you are so inclined to do so. The first task is probably just to get familiar with it. Download CoreGTK from the GitHub project page and play around with it. If you find a bug (very likely) please create an issue for it.

Another easy way to get familiar with CoreGTK is to help write/fix documentation – a lot of which is written in the source code itself. Sadly most of the current documentation simply states which underlying GTK+ function is called and so it could be cleaned up quite a bit.

At the moment there really isn’t anything more formal than that in place but of course code contributions would also be welcome!

Update: added some pictures of the same program running on all three operating systems.

Hello World on Windows

Hello World on Windows

Hello World on Mac

Hello World on Mac

Hello World on Linux

Hello World on Linux

This post originally appeared on my personal website here.

I am currently running a variety of distributions, primarily Linux Mint 17.
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).
Check out my profile for more information.

Screen brightness work around (part 2)

January 19th, 2014 No comments

As mentioned before I am having some issues with my laptop’s hardware and controlling the screen brightness. Previously my work around was to set acpi_backlight=vender in the grub command line options. While this resulted in having full screen brightness it also removed my ability to use my keyboard function keys to adjust the screen brightness on the fly (not so good when you’re on battery). Removing this option allowed me to manually adjusted my screen brightness again but once again always started the laptop at zero brightness. What to do?

While far from a perfect solution my current work around is to use xdotool to simulate key presses on login which raise the screen brightness for me automatically. Here is the script that I run on startup:

for i in {1..20}
     xdotool key XF86MonBrightnessUp

While this works great it still isn’t perfect. Because xdotool requires an X session it means I cannot run it before one is created. If you were unaware the login screen, in my case MDM, does not run inside of X (it actually starts X when you successfully login). So while this will automatically brighten my screen it won’t do so until I type in my username and password, leaving me to type into a fully dark screen or manually adjust the brightness up enough to see what I’m doing. Hopefully I’ll have a better solution sooner rather than later…

I am currently running a variety of distributions, primarily Linux Mint 17.
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).
Check out my profile for more information.

Listener Feedback Podcast Update (December 2013)

December 15th, 2013 No comments

Quite a few new Listener Feedback podcast episodes have been released in case you missed them:

There is also now a dedicated Ogg Vorbis podcast feed (containing all released episodes) for those of you who prefer that.

I am currently running a variety of distributions, primarily Linux Mint 17.
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).
Check out my profile for more information.

Fix annoying high-pitched sound

November 28th, 2013 No comments

If you’re like me you’ve been suffering through a crazy high-pitched sound emanating from your laptop speakers. Apparently this is a common issue with certain types of audio devices. Thankfully via the power of the Internet I’ve been able to finally find a solution!

It turns out that the issue actually stems from some power saving features (of all things) in the Intel HDA driver. So I simply turned it off and guess what? It worked.

1) Open up (using root) /usr/lib/pm-utils/power.d/intel-audio-powersave

2) Replace or comment out the line:


3) In its place put the line:


4) Reboot

Hopefully this also works for you but if not check out the site I found the solution at for some additional tips/things to try.

I am currently running a variety of distributions, primarily Linux Mint 17.
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).
Check out my profile for more information.

Fix no screen brightness on boot problem

October 14th, 2013 No comments

I recently upgraded my laptop to a brand new Lenovo Y410P and promptly replaced Windows 8 with a Linux install. Unfortunately I immediately ran into a very strange driver(?) issue where, on boot, the computer would default to the absolute lowest screen brightness level. This meant that I would need to manually adjust the screen brightness up just to see the login screen. Thankfully after some help from the excellent people over on the Ubuntu Forums I managed to find a very easy work around.

1) As root open up /etc/default/grub

I did this by simply issuing the following command:

sudo nano /etc/default/grub

2) Find the line that says GRUB_CMDLINE_LINUX= and add “acpi_backlight=vendor” to the list of options.

3) From a terminal run this command to update GRUB

sudo update-grub

4) Reboot!

That’s pretty much it. My computer now boots with the correct screen brightness as one would expect.

I am currently running a variety of distributions, primarily Linux Mint 17.
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).
Check out my profile for more information.

Open source project hosting options

September 8th, 2013 2 comments

So you want to host an open source project using one of the many free services available but can’t decide which one to use? If only someone would put together a quick summary of each of the major offerings…

Hosting providers covered in this post:

  • Bitbucket
  • CodePlex
  • GitHub
  • Gitorious
  • Google Code
  • Launchpad
  • SourceForge


Bitbucket is a hosting site for the distributed version control systems (DVCS) Git and Mercurial. The service offering includes an issue tracker and wiki, as well as integration with a number of popular services such as Basecamp, Flowdock, and Twitter.


  • Supports both Git and Mercurial
  • Allows private repositories for free, up to 5 users
  • Unlimited repositories
  • Has JIRA integration for issue tracking
  • Has its own REST API


  • Only allows up to 5 users for free (a user defined as someone with read or write access)


CodePlex is Microsoft’s free open source project hosting site. You can create projects to share with the world, collaborate with others on their projects, and download open source software.


  • Supports both Git & Mercurial
  • Integrated Wiki that allows to add rich documentation and nice looking pages
  • Bug Tracker and Discussion Forums included


  • Often times feels more like a code publishing platform than a collaboration site
  • Primarily geared toward .NET projects


Build software better, together. Powerful collaboration, code review, and code management for open source and private projects.


  • Supports Git
  • Powerful and easy to use graphical tools
  • Easy team management
  • Integrated wiki, issue tracker and code review


  • Only supports Git
  • Quite a few ‘dead’ projects on the site


The Git hosting software that you can install yourself. provides free hosting for open source projects that use Git.


  • Supports Git
  • Free project hosting
  • Integrated wiki
  • Can download the software and install it on your own server


  • Only supports Git

Google Code

Project Hosting on Google Code provides a free collaborative development environment for open source projects.


  • Supports Subversion, Mercurial Git
  • Integrated wiki


  • Not very pretty


Launchpad is a software collaboration platform.


  • Supports Bazaar
  • Integrated bug tracking and code reviews
  • Ubuntu package building and hosting
  • Mailing lists


  • Only supports Bazaar
  • Geared toward Ubuntu (which can be a downside depending on your project)


Find, Create, and Publish Open Source software for free.


  • Supports Git, Mercurial, Subversion
  • Integrated issue tracking, wiki, discussion forums
  • Stat tracking


  • Ads
  • A lot of ‘dead’ projects


Now obviously I’ve missed some things and glossed over others but my goal here was to provide a quick ‘at a glance’ summary of each. Check the individual websites for more. Thanks to the people over at Stack Exchange for doing a lot of the legwork.

I am currently running a variety of distributions, primarily Linux Mint 17.
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).
Check out my profile for more information.