RSS Feed

Posts Tagged ‘ubuntu’

  1. Why I didn’t use a framework for ubui

    June 2, 2012 by Dave

    Why didn’t you use a framework for ubui’s core?

    Good question buddy! So here’s the answer;

    When I was thinking about how I should build ubui I had loads of ideas (and most of them were pretty zaney!) so I prototyped most of them and left it a few days so I could come back with fresh eyes and really assess the best option.

    I prototyped with JavaScript MVC, Spine, bare JS (Using named JSON objects) and modular (kind of OOP but not quite there)

    After much deliberation and toying with the most basic part of the ubui core I settled on a mixture of named JSON objects and modular JS, and here’s why:

    I knew ubui’s core would be small and light and from the get go I didn’t want it to be big or hard to work with for extending. Once I’d sorted the auto loading of the framework and modules/dependancies I’d settled on a very small, very fast, very easy to understand structure where most of the modules are JSON objects assigned to module.exports and named in an index file for the ubuim’s (the modules are called ubuim’s) so they stay named and obvious to understand (always reference to the modules in the index file) and the framework models are generally assigned as anonymous functions to pre-process cli arguments before performing a selected action.

    Take a look at the below example of the users module to understand more about why I’d use both styles (I promise it makes sense)

    this.exec({
    	"command": command,
    	"success": function (a) {
    		console.log('success');
    		console.log(a);
    	},
    	"error": function (a, b) {
    		console.log('error');
    		console.log(a);
    	}
    }).run();

    in the above example, exec is a framework model which is an anonymous function rather than a JSON object containing functions. Its an anonymous function so I can pass it arguments to set internally without the need for another method in-between exec and run which speeds up the loading and running of commands since we’re already going to be waiting for the shell to respond to us as well as checking we’re not running anything naughty.

    The model will also return itself so its a circular reference thus making it both assignable and chain-able, you can also dump out the entire object for debugging (which was super handy)

    I know a lot of people say frameworks standardise the structure of an application but that, in my eyes, doesn’t apply here since its such a simple structure and so simple to extend I have no plans to move over to any kind of framework either as there is no need to complicate or bloat the app.

    And that my friend is why I didn’t use a framework for ubui’s core.


  2. Slow internet Ubuntu 11.10 Wireless

    December 19, 2011 by Dave

    So this issue seems to be a new one in the latest versions of Ubuntu, a slow internet connection is a real pain in the ass but after relentless network testing and checking I have every update installed and yada yada I never thought to check the MTU (maximum transmission unit) which of course was set too high, this means that for wireless networking any packets larger than the default MTU (1492) will get lost in the network. Bad times, LUCKILY you can set this yourself!

    its recommended that you test from 1499 down, I got to 1464 before my network seemed ok.

    Run this command and keep lowering the value until you stop getting the message “Frag needed and DF set”

    Run the below in your terminal:

    sudo ifconfig eth0 mtu 1464
    ifconfig | grep MTU

    This lowers the maximum packet size and it sped my network speed up from around the 20kbps mark to my Windows 7 speed which is around 4mbps.

    EDIT:

    So mine started to slow down again, which really sucks and this is a reportedĀ KernelĀ 3 bug, BUT if you set your wireless router to NOT send a wireless N signal it will speed up brilliantly!


  3. Intel GMA4500 Ubuntu backlight fix

    December 4, 2011 by Dave

    I love Ubuntu, I really do but sometimes its just a pain. I bought a Packard Bell Easynote TK37 which has a notoriously poorly supported Intel graphics card, the Intel GMA4500.

    There are several ways to get around the no backlight issue in ubuntu depending on how urgently you need it but I’ve found a fix which seems to be largely undocumented online.

    Use a torch to view your display and run the below in a terminal window and it will turn on your backlight again.

    sudo setpci -s 00:02.0 F4.B=7F

    You can add this as a bootscript to fix it for good, that’s what I did, but this seems to have fixed all my issues. Good luck with any you have!

    Note: You can also edit grub on boot but you will not have any resolution beyond 1024×768, all you have to do is add nomodeset and you will have a bootable Ubuntu.

    Enjoy..