Department of Chemistry

...California State University Stanislaus

  • Increase font size
  • Default font size
  • Decrease font size
Home News Feeds Planet Ubuntu
Newsfeeds
Planet Ubuntu
Planet Ubuntu - http://planet.ubuntu.com/

  • Aurélien Gâteau: Extensive Source Comments or Extensive Commit Messages?

    If you consider yourself as a serious developer, you know writing good commit messages is important. You don't want to be that guy:

    XKCD #1296: Git Commit

    XKCD #1296

    This applies to source comments as well: good comments save time, bad comments can be worse than no comments.

    For a long time, I usually favored source comments over commit messages: whenever I was about to commit a change which needed some explanations, I would often start to write a long commit message, then pause, go back to the code, write my long explanation as a comment and then commit the changes with a short message. After all, we are told we should not repeat ourselves.

    Recently I was listening to Thom Parkin talking about rebasing on Git Minutes #33 (Git Minutes is a great podcast BTW, highly recommended) and he said this: "Commits tell a story". That made me realize one thing: we developers read code a lot, but we also read a lot of commit histories, either when tracking a bug or when reviewing a patchset. Reading code and reading history can be perceived as two different views of a project, and we should strive to make sure both views are readable. Our readers (which often are our future selves...) will thank us. It may require duplicating information from time to time, but that is a reasonable trade-off in my opinion.

    So, "Write extensive source comments or extensive commit messages?" I'd say: "Do both".

    Flattr this



  • Nekhelesh Ramananthan: BQ Phone Insiders Edition

    Canonical hosted the insider's Ubuntu Phone Launch Event on February 6th where they handed over BQ devices to the people who were invited to the event. I was invited to the event but couldn't make it unfortunately due to personal reasons. A few days back I got around to emailing Canonical with the necessary details to get it shipped to my house. I received the package by post the next day!

    In the past few years, we have seen the rise of Android and iOS amongst other mobile OSes like Symbian, Blackberry, Windows Phone etc. They have all been around for some time to become what they are today. Do note that they all started small. Hell the first release of iOS didn't even support 3rd party apps until 6 months later! Even Android acquired by Google in 2005, was shipped by HTC only in 2008. Keeping that in mind, Ubuntu Touch 1.0 is a great release!

    I am honoured to have been a part of Ubuntu Touch from the beginning by being the clock app developer. It has been a long journey, but things are only going to get better from here on.

    As such I was really excited to receive the phone and also see the package, enclosed letter all having distinct suru styles that I have come to like on the phone UI.

    I have attached a few screenshots below showing the packaging,

    BQ Pic 1 BQ Pic 2 BQ Pic 3

    It is really nice to see Canonical put this amount of polish and attention to detail for the Insiders event. A few years down the line, I will still remember my experience with the world's first Ubuntu Phone.

    BQ Pic 5 BQ Pic 4 BQ Pic 6 BQ Pic 7

    I have added my day-to-day SIM and intend on using the Ubuntu Phone as my daily device. Sure I will miss Whatsapp, but I have a secondary phone just for that purpose. Otherwise, Ubuntu Touch covers pretty much all my use cases.



  • Stuart Langridge: Why I Play The Lottery

    There is a persistent meme that lotteries are a tax on people who can’t do maths and are stupid. I don’t think I’m stupid1 and I’m OK2 at maths, and I play the lottery. This is why.

    Basically, my desire for money is not linear, because I’m not homo economicus.3 My laws of desire for money are more Einsteinian than Newtonian: linear desire for money works at small amounts, but as they get higher it gets weird. I might desire £4 twice as much as £2, true enough; small amounts, Newton’s sensible laws. But I don’t desire £2 million twice as much as £1 million, because having a million would be enough and what would I do with the second million? I desire a million quite a lot more than a hundred times as much as £10,000, because a million quid is amazing and ten grand is a new car. The lottery gives me, for a negligible outlay, an outside chance of having a million quid, which would be radically life-changing (because I’d never have to work again).

    There’s no other way I’ll get a million pounds. Sure, my chances of winning the lottery are at pretty adverse odds (roughly, 1 in 14 million chance of winning; when I win I get somewhere in between 2 and 6 million pounds). But having a million quid is a goal I’d like to hit. I can attempt that with almost no work.

    Imagine that I wanted a million, and I started with a pound. Perhaps I should play roulette instead, which has a much more favourable edge than the lottery (although it’s still unfavourable; 5 5/19% for the bank and against me). So I stick my quid on black 17, and it comes up; a chance of 1/38, and I get £36 back for a total of £37. I let that £37 ride, and black 17 comes up again, so I now have £1369. Ride again4 for £50653, and again for £1.8 million, which is retirement money and so I stop. The chances of that happening; 1 in 2 million or so. So playing roulette is very roughly equivalent to playing the lottery (chances of getting a million quid: one in some millions). And the lottery is a lot easier to do; you don’t have to put on a dinner jacket and walk to the casino, and you can play for a pound.5

    This is the point. I won’t miss the money, it’s very easy to do, and it might end up changing my life, so why not do it? If I were actually good at maths, maybe I’d plot a graph of some sort of quotient made up of “amount spent” vs “effort required” vs “amount won”. I bet the lottery looks quite a lot better than “working for a living”, on that graph.

    I should note here that the second part of the meme which is often quoted alongside it is that lotteries are a tax on the poor; that is, people who will miss that hundred pounds a year. This is completely correct. I would not notice the half-a-pint a week that the lottery costs me; this is not the case for others, and lotteries being a tax on the poor is entirely correct.

    1. not all the time, anyway
    2. ish
    3. People aren’t identical and spherical, either
    4. ignore table limits here
    5. there are casinos which will let you put a quid on a roulette wheel spin, but good luck finding a table which allows wagering a quid and allows wagering fifty grand


  • Nicholas Skaggs: Testing Vivid Vervet final images
    Ubuntu 15.04, otherwise known as the vivid vervet, is nearing release. We are now in the final week before the release on April 23rd. That means it's time to test some images!

    Everyone can help!
    For the final images, I'd like to extend the call for testing beyond those brave souls willing to run alpha and beta software. I encourage everyone to make a backup (as always!) and upgrade / install vivid. Then report your results on the tracker. Positive results are extremely helpful for this milestone, so please report those too. As a bonus, you can enjoy vivid a few days before the rest of the world (there's no need to re-install the final image), and avoid the upgrade rush after release.

    How can I help?
    To help test, visit the iso tracker milestone page for the final milestone.  The goal is to verify the images in preparation for the release. The information at the top of the page will help you if you need help reporting a bug or understanding how to test. 

    Isotracker? 
    There's a first time for everything! Check out the handy links on top of the isotracker page detailing how to perform an image test, as well as a little about how the qatracker itself works. If you still aren't sure or get stuck, feel free to contact the qa community or myself for help.

    Thanks and happy testing everyone!


  • Marcin Juszkiewicz: Running VMs on Fedora/AArch64

    There are moments when more than one machine would be handy. But AArch64 computers are not yet available in shop around a corner we have to go for other options. So this time let check how to get virtual machines working.

    Requirements

    For this I would use Fedora 22 on APM Mustang (other systems will be fine too). What else will be needed:

    • libvirtd running
    • virt-manager 1.1.0-7 (or higher) installed on AArch64 machine
    • UEFI for AArch64 from Gerd’s Hoffmann firmware repository
    • Fedora or Debian installation iso (Ubuntu does not provide such)
    • computer with X11 working (to control virt-manager)

    Is KVM working?

    First we need to get KVM working — run “dmesg|grep -i kvm” after system boot. It should look like this:

    hrw@pinkiepie-f22:~$ dmesg|grep -i kvm
    [    0.261904] kvm [1]: interrupt-controller@780c0000 IRQ5
    [    0.262011] kvm [1]: timer IRQ3
    [    0.262026] kvm [1]: Hyp mode initialized successfully
    

    But you can also get this:

    [    0.343796] kvm [1]: GICV size 0x2000 not a multiple of page size 0x10000
    [    0.343802] kvm [1]: error: no compatible GIC info found
    [    0.343909] kvm [1]: error initializing Hyp mode: -6
    

    In such case fixed DeviceTree blob from bug #1165290 would be needed. Fetch attached DTB, store as “/boot/mustang.dtb” and then edit “/etc/grub2-efi.cfg” file so kernel entry will look like this:

    menuentry 'Fedora (4.0.0-0.rc5.git4.1.fc22.aarch64) 22 (Twenty Two)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.0.0-0.rc5.git2.4.1.fc22.aarch64-advanced-13e42c65-e2eb-4986-abf9-262e287842e4' {
            load_video
            insmod gzio
            insmod part_gpt
            insmod ext2
            set root='hd1,gpt32'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt32 --hint-efi=hd1,gpt32 --hint-baremetal=ahci1,gpt32  13e42c65-e2eb-4986-abf9-262e287842e4
            else
              search --no-floppy --fs-uuid --set=root 13e42c65-e2eb-4986-abf9-262e287842e4
            fi
            linux /boot/vmlinuz-4.0.0-0.rc5.git4.1.fc22.aarch64 root=UUID=13e42c65-e2eb-4986-abf9-262e287842e4 ro  LANG=en_GB.UTF-8
            initrd /boot/initramfs-4.0.0-0.rc5.git4.1.fc22.aarch64.img
            devicetree /boot/mustang.dtb
    }
    

    After reboot KVM should work.

    Software installation

    Next step is installing VM software: “dnf install libvirt-daemon* virt-manager” will handle that. But to run Virt Manager we also need a way to see it. X11 forwarding over ssh to the rescue ;D After ssh connection I usually cheat with “sudo ln -sf ~hrw/.Xauthority /root/.Xauthority” to be able to run UI apps as root user.

    UEFI firmware

    Next phase is UEFI which allows us to boot virtual machine with ISO installation images (compared to kernel/initrd combo when there is no firmware/bootloader possibility). We will install one from repository provided by Gerd Hoffmann:

    hrw@pinkiepie-f22:~$ sudo -s
    root@pinkiepie-f22:hrw$ cd /etc/yum.repos.d/
    root@pinkiepie-f22:yum.repos.d$ wget https://www.kraxel.org/repos/firmware.repo
    root@pinkiepie-f22:yum.repos.d$ dnf install edk2.git-aarch64
    

    Then libvirtd config change to give path for just installed firmware. Edit “/etc/libvirt/qemu.conf” file and at the end of file add this:

    nvram = [
       "/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw"
    ]
    

    Restart libvirtd via “systemctl restart libvirtd“.

    Running Virtual Machine Manager

    Now we can connect via “ssh -X” and run “sudo virt-manager“:

    vm1

    Next step is connection to libvirtd:

    vm2vm3

    Now we are ready for creating VMs. After pressing “Create a new VM” button we should see this:

    vm4

    And then creation of VM goes nearly like on x86 machines as there is no graphics only serial console.

    But if you forgot to setup UEFI firmware then you will get this:

    vm5

    In such case get back to UEFI firmware step.

    Installing Fedora 22 in VM

    So let’s test how it works. Fedora 22 is in Beta phase now so why not test it?

    vm6

    vm10

    vm11

    2GB ram and 3 cpu cores should be more than enough ;D

    vm12

    And 10GB for minimal system:

    vm13

    vm14

    But when it went to serial console it did not look good :(

    vm15

    I realized that I forgot to install fonts, but quick “dnf install dejavu*fonts” sorted that out:

    vm16

    Go for VNC controller installation.

    After installation finish system runs just fine:

    vm17

    Summary

    As you can see Fedora 22 has everything in place to get VM running on AArch64. UEFI firmware is the only thing out of distribution but that’s due to some license stuff on vfat implementation or something like that. I was running virtual machines with Debian ‘jessie’ and Fedora 22. Wanted to check Ubuntu but all I found was kernel/initrd combo (which is one of ways to boot in virt-manager) but it did not booted in VM.


    All rights reserved © Marcin Juszkiewicz
    Running VMs on Fedora/AArch64 was originally posted on Marcin Juszkiewicz website