• Home
  • About Me

ukstokes.com

tech stuff from a tech bloke

Feed
  • Living with a Mac

    Feb 27th 2012

    By: ben

    No comments

    So, a few months ago I dumped my Windows PC and replaced it with a Macbook Air. Here is a brain dump of my thoughts, emotions, loves and hates with converting a long-time PC user to Mac OS Lion. This is not a review of the Macbook Air - there are plenty of those around the internet already. This is about my transition from Windows and Linux desktops to Mac.

    Design, specs, performance
    I've got the 13" MacBooc Air. I'm not going to go on about this too much, but I really love the hardware. It's really exceptionally designed and constucted and feels very solid while only being a tad heavier than my netbook. I do occasionally get static electric shocks from it which can't be too good ... however this is nothing compared to my neighbour in the office who is constantly shocked by his Macbook Pro (at least 4 times a day, much to my amusement). As laptops go the Air quite a thing of beauty, the thinness of it is quite incredible. On a few occasions I have had to go back to my old laptop or netbook for something, and the hardware felt like a pile of crap. Apple did an amazing job with the design and build here - end of story.

    Internally it has a 120Gb SSD, 4Gb of RAM and an Intel core i5 1.7Ghz CPU. It boots extremely fast - around 10 seconds from cold to being at my desktop. Apps open instantly when launched and things all move around the screen very quickly and smoothly. Generally I'm very pleased with the performance. It is light years ahead of the old Windows 7 machine it replaced. Battery life is pretty good, about 6 hours if I am not running VMware Parallels. Running a VM will knock off a few hours of battery life. I am not really sure where the fans are on this thing. On a few occasions I've heard them ramp up to cope with CPU going crazy. But in day to day use it is almost completely silent.

    On Windows and on Linux, sleep (suspend/resume) has always been a bit hit and miss on laptops, particularly the combination of sleep - undock - wake, or sleep - dock - wake, used to be pretty painful on Windows. On the Mac it works perfectly every time and extremely quickly. The suspend literally takes about 2 seconds, and about the same to wake up. It's nice to put the lid down and have confidence it will always resume properly when you turn it back on.

    Keyboard
    The keyboard on the MBA feels nice and I enjoy typing on it. I love having backlit keys and dedicated buttons for controlling the bightness of the keyboard and screen backlight. I do have some criticisms about the keyboard layout though.

    Apple sacrificed a lot of keys for the laptop keyboard, the most important ones being hash (#) and delete (yes really, there is no delete key), end, home, page up, page down. There doesn't seem to be any way at all to delete text without moving the cursor to the end and then using backspace. Some people on the Interwebz suggested cmd+backspace is a shortcut to delete, but this seems to do something different in every application I've tried it in, and it usually does nothing. I'll come back to the inconsistency of the keyboard shortcuts later. On all laptops I've owned there are a lot of dual purpose keys, but there aren't really any on the Mac aside from the usual selection on the number keys.

    I found the missing # key to be the most upsetting though, I spend a lot of time in shell scripts where # is used for commenting code, and pressing alt+3 to get a # is frankly a hassle I don't want. Luckily I did find a solution to that, someone has remapped the totally useless '§' key at the top left to draw a '#' instead, and published the keyboard layout file anyone to download and use. I have never, and never will needed to draw either of these symbols:


    Figure 1: Useless key

    Inconsistent shortcut keys
    On the full size usb keyboard you do get page up and page down, and next to them in the usual home/end position you get a keys with diagonal up/down arrows ... which I assumed were home/end. I'm still not sure what these really are intended to be used for since they map to different functions in different applications. For example in iTerm, they do map to home/end, but in Skype they do a page up/down thing and move your position in a conversation to top or bottom. In Outlook for Mac, these keys just make a system beep, and you have to use cmd+left or cmd+right to replicate home/end,yet in iTerm, Sublime (and other apps) cmd+left/right key combos either do nothing or do something entirely unexpepected. Blah blah etc etc, so basically, forget about home/end keys, unless you want to learn a special key combination for every application. Also forget about delete unless you want to buy the USB keyboard for £50, on and also forget about using ctrl for anything, since the cmd key has replaced it for almost everything.

    Apple did helpfully publish a guide to this kind of stuff, but unfortuntely it is just totally wrong and should not be read by anyone.

    With Apple's reputation for focus on user experience, I'm surprised by how scatty this is. The shortcut keys should be managed at OS level, not at the application level.

    close,minimise,maximise
    I also have some things to say about these buttons.


    Figure 2: Traffic lights

    It doesn't bother me at all that these buttons are in the wrong order and at the left side (the wrong side) of the window. I adapted the new locations pretty easily. What does bother me is the behaviour of the buttons. Close and Minimise seem to do exactly the same thing, ie. Close doesn't actually close the running application, it just closes the window leaving the task running in the background. To really exit an application you have to use cmd+q, otherwise it will just 'live' on the dock in some kind of semi-open state. Minimise seems to do exactly the same thing, only with an animation which shows it shrinking into the dock. One of these buttons could surely be removed.

    In Windows I used alt+tab a lot to cycle through all open windows. In Mac OS you use cmd+tab and it cycles through running programs, rather than open windows (much like the new behaviour in Unity and Gnome 3). However, if you have minimised a program, when you cmd+tab and select it, nothing happens. I can't really fathom this out, the cmd+tab seems to be a bit pointless to me - if you select it but not activate it with cmd+tab, it should just be removed as an option in the list. Apple have given you some other ways of viewing and managing open tasks though, through the 'expose' view (4 fingers up on the trackpad), and Mission Control which shows you all open Windows for the application currently in focus (4 fingers down on the trackpad). There are also shortcut keys for these on the full size USB keyboard.

    Maximise doesn't really maximise windows either, sometimes it will make your window full screen but usually it will only maximise vertically and not sideways, which is really annoying (I'm not the only one who is bugged by this behaviour). In Lion there is a 'full screen' button in the top right of every window, but this is a bit different from Maximise as it really does take your entire screen, making the dock and top menu bar and window controls disappear. Also if you have a second monitor attached, the app becomes full screened on your primary screen, and your secondary monitor becomes useless as it can only show the desktop wallpaper. When you press the maximise button in iTunes, something very unexpected happens that isn't what I wanted when I was watching a video:


    Figure 3:
    iTunes when maximised

    From what I've seen, my complaints about the window buttons are fairly common grumbles from Windows users migrating to Mac. I'll just have to get used to it. Full screen mode is crap until I can use my second monitor for something else.

    Software
    As a Linux user (and Android) I am used to having a repository full of free software at my fingertips. I kind of had an expectation that the App Store might have a lot of free software in it too. Unfortunately this is not the case. Almost nothing is free. Compared to Windows it can actually be quite hard to find free software for Mac. You will have to hunt around in places like sourceforge to get things that should be free - like VNC clients, simple image editors, etc.

    In general I wold say I really enjoy using the OS, but some of the software is not as good as the Windows counterparts. Skype for Windows is better for example. Google Chrome is identical, but often freezes up and requires a 'force quit' after a reboot. Flash plugin sucks and crashes frequently. Outlook for Mac sucks on many levels...  Most of the basic functionality is there, but many key things are missing, like being able to manage mailbox rules, auto archive, book meeting rooms, browse the global address list.

    Some apps can be awesome though, Twitter for Mac being one example. A really stylish app which has a nice visual flair.

    Time to wrap-up
    How could I summarise my transition to a Mac? It really wasn't very hard to migrate. The laptop itself is great. One thing I didn't touch on above is the touchpad, the multi touch gestures you can do on it really enhance the experience, and again, going back to a normal laptop afterwards makes you realise that.

    Is a Mac worth the money? I don't know about that. I really like the slim form factor. I would probably be just as happy with a Windows ultrabook. But I am a bit surprised by how much I like Mac OS. Its very pleasant to use despite the criticisms. It's a coherent experience and everything works well, although in a few places the interface is simplified a little too much ... one example being wireless networking. If I could get something more detailed than 'network timeout' when I can't connect to a wireless network it would really improve it, since the Macbook Air doesn't have an ethernet port and debugging broken wireless is critical to getting the laptop working properly.

    What about comparison to Linux desktop environments? Well, in my opinion Linux is in kind of a dodgy state at the moment. Compared to Mac OS, both Gnome 3 and Unity are newcomers lacking polish and do not feel refined. Gnome 3 still feels experimental to me, and it seems little thought has gone into the design of it. They seem to have focused more on re-engineering the way you work rather than making it look really nice - the stock themes feel chunky and childish, and the system settings are sparse. I can't really comment on KDE since I was never a massive KDE user, but each time I tried it I never found it very reliable. Mac OS seems to win in a desktop war if I was to pit them against each other in their current forms.

    I guess I would be a bit gutted if I had to hand back my Macbook Air now. There are few odd quirks but mostly it was a great exchange. And working from a Unix based platform does make me a little bit happier than using Windows 7.

    Mac

  • Improving Skype notifications on Linux

    Oct 23rd 2011

    By: ben

    1 comment

    Continuing from the preview blog post on Gmail notifications, I wondered if there was a way to link Skype into libnotify. Skype uses its own notification system by default which doesn't fit with the Gnome / Unity desktop, and looks kind of crappy. I could start a rant about Skype now, and the fact the Linux client never gets updated, seems to silently crash when open for longer than an hour, and is generally a shoddy counterpart to the Windows and Mac versions ... then again since it's been acquired by Microsoft I can't see that this situation is going to ever improve now. Anyway, in the Options, under Notifications, if you select an event and then click Advanced, you can then clear the box that says "send a notification", and select to run a script instead.

    Advanced notification options
    Advanced notification options

    Using the 'Contact came online' event as an example, if you run the following as your 'script', inserting the name of a contact using the %sname variable, it looks like this:

    notify-send "%sname is now online" -i skype

    And for messages, you can use %smessage to insert the Skype message into a notification popup.

    notify-send "%sname" "%smessage" -i skype

    Skype message received
    Skype message received

    Much better!

    A list of available variables is here.

    Desktop Linux

    libnotify, skype, Ubuntu

  • Pretty Gmail notifications for Ubuntu

    Oct 22nd 2011

    By: ben

    2 comments

    I've recently gone back to Ubuntu (10.11), and in my new installation wondered if there was an app I could install which gave me Gmail notifications via the default notification system (libnotify). I was a bit surprised to find that there wasn't, so I wrote a script in bash that does it:

    gmalpopupgmailpopup 

    My script also stores your password hashed (unlike some of the alternatives in Software Centre), in a hidden file in your /home.

    Installation

    To install, run the following:

    sudo apt-get install curl gnome-gmail
    wget -q -O ~/gmailpopup http://ukstokes.com/scripts/gmailpopup
    chmod +x ~/gmailpopup
    sudo cp ~/gmailpopup /usr/bin
    

    To configure it just type gmailpopup in a terminal and enter your Gmail address (GApps domains also supported) and password. If you have accidentally fat fingered the password and get an error, you can start again with gmailpopup --reconfigure. On subsequent runs you won't get a popup unless your unread email is different from last time.

    This doesn't seem to run if inserted into the crontab. But it works fine if this is added as a startup application:

    while true; do ~/bin/gmailpopup && sleep 1m; done &
    

    Of course, this doesn't just work on Ubuntu. Any distro which uses libnotify will do. By the way the gnome-gmail package is just required for the Gmail icon. There is probably a better way of doing that, which I'll have a think about, but installing gnome-gmail has the added advantage of making Gmail your default mail client for mailto links etc. If that is not what you want, go to the "Default Applications" in "System Info" to set it back.

    Thats it. Leave me a comment and let me know what you think!

    Desktop Linux, Scripting

    gmail, libnotify, Ubuntu

  • Living with Gnome 3

    Jul 19th 2011

    By: ben

    1 comment

    Here are some tips on how to make Gnome 3 behave a bit more like Gnome 2, to help you transition into this new and unfamiliar territory. Most of them are from this thread on Fedora Forums.

    Tip 1: Maximise and Minimise

    If you thought Ubuntu were naughty moving the buttons to the left, you aint seen nothing. Gnome completely removed the maximise and minimise buttons. To get them back run the following (as you, not using sudo or su):

    gconftool-2 -s -t string /desktop/gnome/shell/windows/button_layout ":minimize,maximize,close"

    To see the changes press ALT+F2, press 'r', and hit enter. Your shell will reload without closing any apps and the extensions will be applied.

    Tip 2: Remove the accessibility icon from the top panel

    This is done by installing the following Gnome 3 extension:

    su -c 'yum install gnome-shell-extension-remove-accessibility-icon'

    Tip 3: Enable 'Power off' in the status menu

    Usually you have to hold ALT to see this, which is frankly bullshit. Luckily this is also easily remedied by installing an extension.

    su -c 'yum install gnome-shell-extensions-alternative-status-menu'

    Tip 4: Better window management

    I don't really like the 'dock' for managing background applications which appears inside the activities area. My advice is to install Docky. Other docks are available such as avant window manager, but I think Docky is the best.

    su -c 'yum install docky'

    Edit: Docky crashes A LOT for me, on both F15 machines. I am going to try an alternative.

    Tip 5: Add programs to 'startup applications'

    The dialog box was removed from the settings screen. You can access it by pressing ALT+F2 and typing gnome-session-properties into the box.

    Tip 6: Enable desktop icons/shortcuts

    Another classic, you can't create shortcuts ANYWHERE in Gnome 3. WTF. But, there is a nifty program in the yum repos called gnome-tweak-tool that can fix that. Install it and then launch 'Tweak Advanced Settings' from the apps menu, then switch 'Have file manager manage the desktop' to ON.

    su -c 'yum install gnome-tweak-tool'

    Tip 7: Add icons

    You might want to add icons for missing things like the gnome-session-properties tool. If you yum install 'alacarte' you get a menu editor (straight from Gnome 2) to create your missing shortcut items.

    Tip 8: Change the ALT+TAB behaviour

    Alt+Tab changed slightly in Gnome 3. If you have multiple windows of the same type open, for example 2 terminal windows, when you alt tab you only see one of them. Then when you hover over the item in Alt+Tab, the multiple instances are shown. I am indifferent about this but if you want to restore Window based, rather than Application based Alt+Tab, there is another extension to install:

    su -c 'yum install gnome-shell-extensions-alternate-tab'

    Edit: This extension causes my shell to crash. I wouldn't recommend it.

    Desktop Linux

    Desktop Linux, Fedora, Linux

  • HTC, you fail.

    Jun 15th 2011

    By: ben

    1 comment

    I'm the owner of a popular Android phone from yesteryear, the HTC Desire. It's been out for almost exactly one year from today and originally shipped with Eclair (Android 2.1), and was later updated to Froyo (2.2).

    HTC Desire

    HTC just announced via facebook that they will not be updating the HTC Desire any longer. Apparently it doesn't have enough storage space for Android 2.3 (Gingerbread) + HTC Sense 3.0. There are a few angry ways that users could react to this.

    First of all, there is the argument that HTC are only refusing to upgrade the Desire because they want users to upgrade to new handsets. Extending the lifetime of their old phones doesn't make them any money. This is at the cost of customer satisfaction though, and it's sad because most users will have 2 year contracts, and like me, had hoped that updates would at least carry on for the length of your contract since this was one of HTC's flagship phones. I've owned my phone for a whole year already, but I would be pretty pissed off if I had bought it recently to then discover HTC had abandoned it. What version of Android will be out one year from now, and what will the resale value of your Desire be if the Android version is 18 months out of date?

    Secondly, the Nexus One, which is basically a Desire in a different shell with a trackball, is quite capable of running Android 2.3. Google pushed it out a few months ago.  So it seems to be clear that the problem is HTC Sense, it has become too bloated and no longer fits on the small storage of the Desire. In an ideal world they should give us the upgrade option of Android 2.3 without Sense.

    Thirdly, there are TONS of Android 2.3 roms that include HTC Sense on XDA. The fact that these exist and work perfectly well as a daily rom helps to argue the point that HTC's reasons for abandoning the Desire are a load of crap. Whether you root or not, you can see that this phone is capable of running Gingerbread.

    Finally, there are the rooters. They don't care; they have been running Android 2.3 on the Desire for 6 months already. But it's been a tough journey - HTC went out of their way to lock the bootloader and the nand (storage), to make flashing custom roms difficult. Without groups like AlphaRev we would not have freedom to install whatever we like on our Desires and we would be chained to Froyo for the lifetime of our phones. It's sad because shouldn't have to be this way. Normal users will not hack their phones to run CyanogenMod. They will be stuck on Froyo for the remaining lifetime of their phones. They won't get any of the new features of Android, bug fixes, or security updates, and to me that just seems wrong.

    Update: Apparently HTC will bring Gingerbread to the Desire after all. We'll see.

    Android, Rants

    Android, desire, htc, Rant

  • Unity (Ubuntu 11.04)

    Jun 8th 2011

    By: ben

    No comments

    I am writing this post using Ubuntu 11.04 using the new ‘Unity Desktop’. In the interest of fairness and because I really don’t want to say goodbye to Ubuntu, I have been giving it a try for a while to see if I can adapt.

    Let me start with the criticism. There seem to be a lot of things which don’t make any sense to me. For example, why:

    • the system settings are accessed by pressing the ‘power on/off’ icon
    • when I press the ‘menu’ button (the ubuntu button in the top left), my entire screen fills up with massive icons - my eyesight is actually fine and I’m using a laptop, not a tablet or touchscreen device.
    • on said Ubuntu menu, there is an icon called ‘more apps’ within the shortcuts.
    • if I click on ‘bin’ in the panel, I get ‘wastebasket’. They should be called the same thing. Why can't any Linux distros get this right!?
    • other than clicking the Home button, I cant see any way to open a file manager. I am also not able to rename my Home button to ‘File Manager’.

     

    Additionally, I don’t seem to be able to customise this launcher at all other than by ‘pinning’ things to it. I can’t remove it and use something else. In fact if I go to the ‘system settings’ (ignoring the fact it then opens something called Control Centre, should be called ’System Settings’?), and then click on ‘Main Menu’, I get a dialog box for configuring the old Gnome menu, not the new Unity one. To me this seems to be a bit of a mess. I can't right click anywhere in the launcher. I don't see any method of editing the 'shortcuts' that appear.

    The performance of Unity is pretty sluggish on my netbook (Samsung NC210). Full screen video is really choppy unless I run in a mode which has desktop compositing turned off.

    What nice things can I say about it?

    The global menu actually works quite well and gives me some more space back on my tiny netbook screen (I still go to the top right for my close button though). The menu options for a maximised program are now found on the top panel, like on a Mac.

    Stability wise I have not had any application or system crashes. It’s been very stable.

    The rest of the Ubuntu system is good. Installing software is really nice in the software centre. Getting audio codecs was easy during the install. The actual install itself was a piece of cake, too. But I think a 'What's new' screen and tour of Unity would have been helpful.

    So, in summary I’ve got a user interface I don’t really like and can’t customise, which has worse graphical performance than on Gnome 2.x.

    I feel quite sad to see the end of Gnome 2.x. It was a refined desktop that worked really well (particually the implementation from Ubuntu) and I’ve grown comfortable with it. Yes I know there is a 'classic mode' in Ubuntu which gives you Gnome 2, but Canonical have already said that option will not be there in 11.10. Sadly, I have not found Gnome 3 any better than Unity (which is the subject for another blog post perhaps). Xfce seems like a viable option, or even perhaps KDE4.

    Desktop Linux, Opinion

    Linux, opinion, Rant, Ubuntu, unity

  • A cunning problem with for loops

    Mar 18th 2011

    By: ben

    No comments

    I came across a cunning little problem with for loops where the values being parsed contain spaces, and can offer a couple of solutions to it. I'll explain what I mean with some code.

    If you md5sum a bunch of files, you get this kind of output:

    [ben@minitron ~]$ md5sum *.txt
    d41d8cd98f00b204e9800998ecf8427e  myfile.txt
    cdbd2b665e14f8803d6bddc80bff1402  omg.txt
    6353f9b2e7c47f73b48eef4544968bcd  otherfile.txt

    I wanted to iterate through a list of files and their md5sums using a for loop, run a test and then take some action based on the result. But my script kept throwing unexpected output. I realised the for loop was parsing each word, rather than each line because of the spaces.

    [ben@minitron ~]$ for line in $(md5sum *.txt); do
    echo $line; done
    d41d8cd98f00b204e9800998ecf8427e
    myfile.txt
    cdbd2b665e14f8803d6bddc80bff1402
    omg.txt
    6353f9b2e7c47f73b48eef4544968bcd
    otherfile.txt

    Sometimes putting spaces around variables can help bash to resolve values in the right way, but here it caused all line breaks to be removed:

    [ben@minitron ~]$ for line in "$(md5sum *.txt)"; do echo $line; done
    d41d8cd98f00b204e9800998ecf8427e myfile.txt cdbd2b665e14f8803d6bddc80bff1402 omg.txt 6353f9b2e7c47f73b48eef4544968bcd otherfile.txt

    I needed to preserve the original line breaks in order for my script to make sense of which md5sum matched up to which file. There are a couple of ways to do this. One possible solution is to use tr to translate the spaces into a different character:

    [ben@minitron ~]$ for line in $(md5sum *.txt | tr " " :); do
    echo $line; done
    d41d8cd98f00b204e9800998ecf8427e::myfile.txt
    cdbd2b665e14f8803d6bddc80bff1402::omg.txt
    6353f9b2e7c47f73b48eef4544968bcd::otherfile.txt

    But for some reason md5sum uses 2 spaces for a field separator, if you wanted just one character between the md5sum and the filename, you could go a little more advanced:

    [ben@minitron ~]$ for file in *.txt; do
    echo -n "$file:";md5sum $file | cut -d " " -f1 ; done
    myfile.txt:d41d8cd98f00b204e9800998ecf8427e
    omg.txt:cdbd2b665e14f8803d6bddc80bff1402
    otherfile.txt:6353f9b2e7c47f73b48eef4544968bcd

    This does give the output in the other way round but was good enough for me to make my script work.

    Desktop Linux, Enterprise Linux, Scripting

    bash, Bash scripting, Linux

  • Fedora 14 on a Samsung N210 netbook

    Mar 9th 2011

    By: ben

    2 comments

    Here are some musings on getting Fedora 14 working on a Samsung N210 netbook.

    Why Samsung N210?

    Samsung N210

    It's undeniable the Next Big Thing is tablets. I love new tech and I kind of want an Android Honeycomb tab, but they are still waaaay over priced. I considered getting an iPad as Android tabs are still only just coming of age, but in the end I could not really justify double the cost of a netbook just for an alternate form factor and interface ... in my head I weighed up the following benefits of a netbook:

    • More storage. The Samsung N210 has a 250Gb hard drive, big enough to fit all of my music and movies and still have extra room for iPlayer downloads - in fact it acts as backup for my desktop machine.
    • Better for typing. For example, writing this blog post.
    • Better for hacking. I guess this is debatable, since Android is a hackable platform.
    • A more practical on call companion. I can install work tools and vpn client and use it to rdp to my desktop. This can also be done from a tablet OS, but controling a mouse-driven desktop with fingers is tricky. Plus on a tablet when you bring up the keyboard, half of your screen is obscured.
    • Price. Netbooks are half the cost.

    There are possibly a few reasons why a tablet would be better.

    • More convenient during rush hour commuting. You can stand up and pull it from your bag to read or watch a movie.
    • Battery life. I get about 6 hours from my netbook.  iPad  and competitors can go for about 9 hours I think.
    • Better interface. Another debatable one, most would agree that new tablet interfaces are pretty slick though.
    • More fun / better for gaming. But I don't really play games that much.
    • Portability. A tablet is marginally smaller and lighter.

    I think I am just not 100% sold on the tablet form factor yet, perhaps I will change my mind when tablets are more affordable.

    So back to the N210 - by current netbook standards it pretty much falls into line with an Atom 1.6Ghz hyper threaded processor and 1Gb of RAM (I also purchased the 2Gb DIMM option from Amazon for £30). It only really sets itself apart from other similar netbooks by having a matt screen rather than glossy, which makes it more readable and less reflective in sunlight. I am averaging just over 6 hours of battery life between charges, this is with wireless and bluetooth always on, and usually with music streaming to bluetooth headphones or with video playing at full screen. The battery life is just below advertised but I am pleased with it. Amazon were selling it for just over £200 a few months ago because the Samsung were about to launch the successor to the N210 (which is pretty similar in specs but has a dual-core Atom chip).

    Why Fedora?

    Fedora LogoIn my early days with Linux I hopped between distros a lot, but I had settled on Ubuntu and been a Ubuntu user until recently. But when I gave Ubuntu netbook remix (UNR) a test drive for a week I absolutely hated it. The UNR desktop called 'Unity' is a watered down experience for a power user, I couldn't even add an icon to the launcher bar and was frustrated that things like the file manager were difficult to access.

    I don't resist change if there is good reason for it but I am getting annoyed by Ubuntu's deviation from standard conventions ... moving the close/maximise/minimise buttons to the left for no reason was their first bizarre move, and now moving the desktop experience to Unity on all Ubuntu installations has pretty much ended my interest in them.

    A second reason, is since I use CentOS at work I thought I might get some technology previews by using it's upstream contributor - Fedora. I'll be able to get familiar with things like SystemD before they trickle down to Red Hat and derivatives.

    I've also decided to use the traditional Gnome desktop rather than a netbook optimised environment, accepting that it will have a slightly bigger memory footprint than others - since this shoudn't be an issue for me with the 2b RAM upgrade.

    Configuration

    Like most netbooks the N210 doesn't have a CD tray, so I used Unetbootin to make a Fedora 14 USB stick and booted from that. And I was surprised to find almost everything worked from a fresh install! Desktop Linux has really come a long way since I first got my feet wet in 2005 ...

    I noticed the Fn keys did not work, but the Fn volume control started working after I had updated all packages. The Fn controls for screen brightness were the only ones still not working, that was fixed by following instructions here and rebooting. The only major failure was the WiFi card which was not detected. The N210 uses a Realtek RTL8192E which is in the staging tree of the Fedora kernel, however rather than recompiling the kernel I chose to compile the driver from source as it seemed like less effort. The driver source can be found here - installing is straightforward:

    su -
    tar fzxv rtl8192e_linux_2.6.0014.0401.2010.tar.gz
    cd rtl8192e_linux_2.6.0014.0401.2010
    make
    make install
    reboot
    

    Note: WiFI drivers will break if the kernel is updated. Just return to your source directory and rebuild again (make && make install) and it will be fixed. Or select to skip updates to the kernel package.

    I was surprised to learn the touchpad on most Samsung netbooks are multitouch capable and let you use 2 fingered gestures for scrolling. To enable that in Fedora add the following to a file, make it executable and then set it as a startup application in the gnome preferences menu:

    synclient VertTwoFingerScroll=1
    synclient HorizTwoFingerScroll=1
    synclient EmulateTwoFingerMinW=5
    synclient EmulateTwoFingerMinZ=48
    

    Credit goes to here for that discovery. Failing that, just enable the "edge scrolling" feature in Gnome, which lets you scroll up and down using the right-hand edge of the touchpad.

    Sounds good to me

    I use Nokia BH-905 stereo bluetooth headphones paired with the netbook for music and video. This actually works out of the box, but A2DP is not enabled by default. After pairing your headset you have to open the Sound preferences dialog, on the Hardware tab choose A2DP, and on the Output tab you should then see you can select Stereo next to the headset. This is then remembered the next time you reboot.

    Nokia BH-905

    Nokia BH-905

    With all the hardware problems sorted, the biggest problem in Fedora is with missing codecs for my movie files, I guess I should have known what I was getting into there with Fedora ... There isn't a package in the Fedora repos (like ubuntu-restricted-extras)  that sorts out codecs in one big hit. The bundled "Movie Player" causes selinux security failures if you try to let it find codecs automatically, and if you disable selinux and try again you will just get a Unable to find codecs message which links you to the fedora FAQ (it basically says go and use Google, you're on your own).

    So a bit of a FAIL by Fedora there, the codec discovery feature from "Movie Player" is basically completely broken and may as well not even be there. Oh well.

    Making it look pretty

    The standard Gnome desktop on Fedora is plain and simple and doesn't look very spectacular. I was looking for netbook optimised GTK themes and came across the faenza icons set (and the bokeh effect wallpaper from the same page), and Equinox GTK theme for Gnome which look great. I also scrapped the bottom panel and replaced it with Docky for window switching and app launching.

    My Desktop
    My Desktop

    I use VLC as my media player for Video as it plays any file format without separate codec packages to be installed. I found a dark theme for VLC on their site that goes with my desktop theme.

    The Plymouth boot screen was defaulting to an ugly failsafe mode. I just needed to rebuild my initrd and it looked good after that. I installed the Fedora Spinfinity theme which looks pretty good.

    Wrap up
    Time to wrap up as this is already getting a bit waffly. I'm pleased with my Samsung N210. It's no powerhouse but with F14 installed it certainly runs faster than it did with the factory installed Windows 7 image. With a bit of tweaking everything in Fedora 14 is supported, and I think it's worth the effort. If you get stuck there is loads of support available. And with the regular releases you can ensure you're running the latest and greatest of everything, if like me, you're into that sort of thing.

    Desktop Linux

    Fedora

  • Cycle London, with Android

    Feb 18th 2011

    By: ben

    No comments

    A few weeks ago I started using the London cycle hire scheme, aka 'Boris Bikes'. My journey to work previously included a 15 minute journey underground from Victoria to Embankment, but now I do it overground on a bike which is considerably more enjoyable (provided you don't mind cycling in heavy traffic) as well as having some health benefits. The bikes are freaking heavy and only have 3 gears so you can't exactly go supersonic, but it's a cheap and more convenient alternative than bringing in a folding bike on the train. At the time of writing this, there are 4 location aware apps in the Market that can help you find nearby bike hire locations and see how many bikes and docks are available. Clearly this can save some wasted trips to docks with no bikes, or no slots to park your bike. I've been test driving these apps and here is my take on them.

    1. Cycle Hire Widget - Market Link

    This is quite a cool little app, despite the name there is more to it than just a widget. The widget hides under a homescreen icon of an Android riding a bike. When tapped, it reveals the directions of the 3 nearest docks, colour coded, the colours showing whether you can get a bike or a slot at the locations. This is very handy if you know your way around and can know which 3 docks it's pointing to.

    View of home screen widget Map view List view
    Home screen widget, map view, and list view

    You can also view the docks in a list view, which is a relief as waiting for a) the map to build and b) the location/gps lock can be a bit tedious. I also discovered you can add docks to a list of favorites, if you pay for the premium version. I will probably do this as I am quite a fan. In terms of looks and usability, it rates quite high. The interface is obvious and easy to use. The dock data also seems to be accurate and up to date.

    2. SpotCycle - Market Link

    I quite like SpotCycle, this is the one I've ended up using the most over the last few weeks, mostly because of the favorite docks lists. I guess most people in the cycle scheme are like me and visit the same docks every day. I've found going to a list of these is always going to be quicker than opening a map view, waiting for the map data to load, waiting for location and GPS lock, etc. I have to admit though, I had to spend some time to figure out how to create the groups for storing favorites. Those options are hidden away in a place where you don't expect.

    Favorites Map view
    SpotCycle: Favorites and Map views

    The map view is pretty decent, it shows you circles of varying sizes and shades of red, to denote availability of bikes or docks. The data has always been up to date with this app, I've never turned up and been completely surprised at how wrong it was. A few criticisms: sometimes it stays on the splash screen for an unacceptable long time. Not sure what it's busy doing, maybe getting location data or refreshing the lists, but it's quite annoying. It also frequently says "Can't get cities list, make sure you are connected to the Internet" - well, it's a smartphone, I am always connected to the Internet! Another annoyance is it throws errors into the notification area when it can't update the dock data, to be honest I don't really want to see those. I would prefer it if could just try again later and keep quiet about it. Over all I like it though, it's very configurable and despite annoyances it's reliable, and offers a lot of features. Being able to keep lists of favorites is a big win.

    3. London Cycle Hire Live - Market Link

    Your mileage may vary, but I didn't really have success with this app. It only has 2 stars in the Market which I guess is a fairly accurate measure of it's quality. It worked sometimes, but usually crashed with the error in the screenshot below. I have had apps Force Close on me before, but never seen anything like this.

    Aw .. snap!
    Holy crap.

    This may be worth coming back to if the dev is still working on it, I didn't spend much more time checking it out though.

    4. Boris Bikes Live - Market Link

    I like the eye-catching icon of our beloved Mayor of London riding the bike, but sadly you don't get a good first impression when you open this app. The landing screen is ugly as hell, the icons are lousy. Putting its initial appearance to one side though, the functionality should be pretty good. It basically offers a map, a list of docks ordered by proximity, list of favorites, and a timer (which is not yet implemented) so you can keep an eye on your journey times (because journeys that take less than 30 minutes are free). The presentation in the rest of the app is fine, and from the list views you can select a dock and get directions to it.

    List view Map view
    Boris Bikes Live. It's got a nice icon.

    With those functions it should really tick the boxes, but I seem to have issues with the bike data being out of date. The last thing you need to to turn up to dock your bike and unexpectedly find all the slots are taken. The update interval is not configurable so I don't think there's much that can be done about it. For that reason and because of the lack of aesthetics, I kept falling back to SpotCycle.

    5. London Cycle Hire - Market Link

    This is a paid for app. It's only £1.50 but to be honest is not really worth it. Although it's quite well presented, it really just consists of a map with the docks overlayed over the top, but they aren't colour coded or anything like that so at a glance you really can't see any helpful data apart from the location. Clicking on the dock locations then shows you the live data and a button which plots a route there from your current location.

    Another app
    More of the same, but more expensive.

    I emailed the dev and they said they are actively working on this app and they intend to release an updated version which has user maintained lists. Until then I guess I will use something else.

    Conclusion

    My testing is by no means exhaustive, but so far I reckon SpotCycle and Cycle Hire Widget are the best. Cycle Hire Widget probably has an easier to use interface, but once you have SpotCycle set up with your favorite groups, you will rarely need to use anything else.

    Android

    Android, Cycling, Fitness, London

  • Monitor AJP threads on multiple Tomcat servers

    Feb 4th 2011

    By: ben

    1 comment

    Here's a script to gather AJP thread usage from a farm of tomcat servers, in my case I needed to query 120 tomcat instances spread over 30 servers. It uses a freely avaiable JMX command line client to query the currentThreadsBusy of the JVM. There are perhaps more elegant solutions to do this, I needed a quick solution.

    Notes
    One thing I have noticed with command line Java utilities, is they always output to stdErr. So if you want to grep or awk the output of the commands you have to redirect that to stdIn first, hence the "2>&1".

    • Replace user:pass with the JMX username and password set in jmx.properties
    • Replace server with the first part of your server name
    • Replace the port numbers with the JMX ports your servers are using.
    • Finally you'll need to change the paths to the log file and the JMX client.
    • The variables "one","three", "five" and "seven" can be changed to anything you want. It makes sense to call them this in my environment.
    #!/bin/bash
    while true; do
    
     export now=$(date +%Y-%m-%d)
     export log=/path/to/ajp_all_tomcat_${now}.log
      if [ ! -f $log ]; then
       echo -n "Start AJP thread count log
    Time" > $log;
       for s in $(seq -w 1 30); do for i in 1 3 5 7; do echo -n ",server${s}tc0${i}" >> $log; done; done
       echo >> $log
      fi
    
     echo -n $(date +%H:%M:%S) >> $log
     for s in $(seq -w 1 30); do
      export one=$(/usr/bin/java -jar /path/to/cmdline-jmxclient-0.10.3.jar user:pass server${s}:7601 "Catalina:type=ThreadPool,name=ajp-7501" currentThreadsBusy 2>&1 | awk '{print $6}')
      export three=$(/usr/bin/java -jar /path/to/cmdline-jmxclient-0.10.3.jar user:pass server${s}:7603 "Catalina:type=ThreadPool,name=ajp-7503" currentThreadsBusy 2>&1 | awk '{print $6}')
      export five=$(/usr/bin/java -jar /path/to/cmdline-jmxclient-0.10.3.jar user:pass server${s}:7605 "Catalina:type=ThreadPool,name=ajp-7505" currentThreadsBusy 2>&1 | awk '{print $6}')
      export seven=$(/usr/bin/java -jar /path/to/cmdline-jmxclient-0.10.3.jar user:pass server${s}:7607 "Catalina:type=ThreadPool,name=ajp-7507" currentThreadsBusy 2>&1 | awk '{print $6}')
      echo -n ",$one,$three,$five,$seven" >> $log
     done
     echo >> $log
    
    done
    

    Enterprise Linux

    bash, monitoring, Scripting, tomcat

    • 1
    • 2
    • 3
    • ...
    • 11
    • >
  • Subscribe

  • Recent Posts

    • Living with a Mac
    • Improving Skype notifications on Linux
    • Pretty Gmail notifications for Ubuntu
    • Living with Gnome 3
    • HTC, you fail.
  • Spam Blocked

    49,591 spam comments blocked by
    Akismet
  • Recent Comments

    • Lenny212 on D-Link DWA-131 and Ubuntu
    • ben on D-Link DWA-131 and Ubuntu
    • Lenny212 on D-Link DWA-131 and Ubuntu
    • Chloe on Monitor AJP threads on multiple Tomcat servers
    • Von Swartzendrube on HTC, you fail.
  • Categories

    • Android
    • Blackberry
    • Blogging
    • Desktop Linux
    • Enterprise Linux
    • Exchange
    • Mac
    • Messaging
    • Mobile
    • News
    • Nintendo
    • OCS
    • Opinion
    • Random stuff
    • Rants
    • Scripting
    • Technology
    • VMware
    • Windows Servers
    • Windows Vista
  • Tags

    Active Directory Android bash Bash scripting BES Blackberry Bugzilla Cacti CentOS Citrix Desktop Linux DivX Dr DivX Enterprise Linux Fedora Google iptables K2 Wordpress 2.5 kickstart libnotify Linux Logical Volumes LVM Messaging Mobile N95 netfilter Open Source Performance Putty Random Rant Red Hat Red Hat Summit RHEL routing Scripting SSH thin client Ubuntu VBScript Video Encoding VMware Windows Windows Vista
  • Sponsored links

    Hosting a website isn't free. By clicking on these links you are helping to support my site!






    If you can't see the links you are using an adblocker in your browser.

© Copyright ukstokes.com. All rights reserved.

Theme designed by Nischal Maniar