Posts for Thursday, October 29, 2009

Arduino and Windows 7 Problems

Since I’ve been fooling around with an Arduino in Windows 7 (64-bit if it matters), I figured I would share some tips to help get the compiler to work properly and the drivers to work.

First off, download Arduino .0017. If you run it, you will notice that it works properly, but graphical glitches exist in it. To get rid of these, download the latest JRE in 32-bit (even if you run 64-bit). Copy the Java folder from Program Files. Then, delete the Java folder in the Arduino folder and replace it with the one from your Program Files. This will fix it. (it’s possible that just deleting the Java folder from the Arduino folder will work; so long as java.exe is in your PATH variable)

Another thing you may encounter is that either the drivers don’t work properly or your computer hard crashes (e.g. no bluescreen, just a total freeze; can’t even move the mouse) after you upload a few times to your Arduino. To fix this, download the drivers from this page and install them:
http://www.ftdichip.com/Drivers/VCP.htm

There, I saved you the time I took to figure these idiosyncrasies out (e.g. the time I spent on Google). :-/

Posts for Tuesday, October 27, 2009

avatar

gentoo-it logs available online

My irc bot, SlopperH, keeps logging the channel #gentoo-it on freenode. Since I’ve accidentaly deleted all its logs last week, I decided to make all the logs available online.

The logs can be found here.

Username: #gentoo-it-user Password: exg!s0ld

Guidelines for the channel can be found here.

Paludis 0.42.0 Released


Paludis 0.42.0 has been released:

  • Qualudis has been removed.
  • Various cached values are now forcibly discarded when they’re not going to be used any more, leading to paludis –owner and reconcilio using considerably less RAM.
  • Various bug, style and performance fixes related to updates (package moves etc). By default updates will still only be displayed but not carried out; consult the FAQ for details.
Posted in paludis releases Tagged: paludis

Installing RubyGems on Centos 5

This should apply to RHEL5 as well, but I haven’t verified yet.

The easiest solution I’ve found is to simply install Ruby and it’s dependencies and then install RubyGems from source.

I’ve written a small script which installs Ruby and it’s dependencies.  It then grabs the RubyGems source tarball and installs Gems from source.  As I wrote this to get a working Chef install, it also adds an opscode gems source.

You can get the script here.

Posts for Monday, October 26, 2009

Off on Holiday!

Well, after all that happened with work and the recent and very successful business trip, I think I deserve one :D

So it's off to the  Costa Del Sol for 2 glorious weeks!

To appease the masses, dhcpcd-5.1.3 was released which will hopefully find its way into NetBSD-5.1. Try not to find any new bugs whilst I'm away ;)

new feeds

I've been having a slew of issues running Apache on my Linode VPS, which I'm still trying to pin down, so in an attempt to offload some of the usage, I'm now going to use Feedburner to provide the RSS feed for Planet Larry.

I know I've played with Feedburner in the past, and kind of flip-flopped on whether to use it or not, but this time I'm sure I'm gonna stick with it.  It's better for users, since they will always have a feed available (whether I have issues or not), and it's better for me since I can offload that part of the network traffic, which is actually quite a lot.

I've already updated the feeds and my apache config to do a permanent redirect, but if you want the feed URLs directly, here they are:

Sorry for the inconvenience.  It seems like everytime I post about Planet it's bad news or maintenance.  Believe me when I say that it aggravates me far more than it does you.

Specifically, the issues I'm having is that Apache is sucking up all the available RAM, of which I only have 360 megs on my account.  It's then rolling over to using all the swap space as well, which only slows things down even more.  I've just started playing with tweaking the MPM configuration a bit, and I'm still trying to find a reasonable solution for my configuration.

In the past, the Linode had been seizing up occassionally, and I'd normally just reboot it and get on with my life.  Recently, I installed monit (an awesome app), and pinpointed that the issue seems to always be with apache.  Now, I'm just trying to narrow it down even  more from there, but offloading the RSS feeds seems like a good step to take anyway ... I get gigabytes of traffic per month just on that, believe it or not.

I'm toying with the idea of setting up lighthttpd instead, but I really prefer apache, and would rather set it up to behave in a low memory environment instead.  So, for any downtime in the near future, chances are it's just me tweaking something.  At least now, thanks to monit, I have a much better idea of when something goes wrong.

Oh, one other tweak I've made is that the planet script itself is more robust as well.  That thing used to run out of control, but I've made some changes that will ensure that if it runs away, at least it won't bring down the system.  I also started playing around with the idea of writing my own feed parser to replace the Planet software completely, and it looks like it's going to be much simpler than I imagine.  I haven't actually started down that path yet, since I have bigger projects to complete, but I'm actually enthusiastic that it'd be far, far simpler than I imagined.

ATI M22 – Mobility Radeon X300 and external monitors


t43 radeon x300Switching on external monitors works now. Most of the time with success (except some VGA monitors when using the wrong x and y dimensions or wrong Hz. It stopped working lately – now I found out why (I bought a dock which enables the use of DVI)!

The Radeon X300 seems to have ‘two crtc‘ interfaces only. And one is always used when the LVDS (laptop builtin display) is enabled (in use). So one is left. Since i use DVI-0 on one workplace and VGA-0 on the other i usually was forced to reset X to make things work, since i wasn’t aware of the resource limitation. The error which came up was:

% xrandr –auto –output VGA-0 –mode 1024×768
xrandr: cannot find crtc for output VGA-0

The solution is easy. Just disable (in this case) DVI-0 output. Next enable VGA-0 output again.

xrandr –output DVI-0 –off
xrandr –auto –output VGA-0 –mode 1280×1024 –right-of LVDS

Usability wise this problem is a result of a missing resource counter (maybe it exists) but still the interface ‘xrandr’ was not very helpful in diagnosing the issue. I would have expected an error message as:

xrandr: no free crct for output VGA-0 left. you can only enable two devices at a time, maybe disable one to enable the other.

lspci shows:

  • 00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
  • 01:00.0 VGA compatible controller: ATI Technologies Inc M22 [Mobility Radeon X300]
  • 00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)

Thanks to:

http://lists.freedesktop.org/archives/xorg/2007-August/027490.html

avatar

Google Wave Review

I have a Google Wave account. I’ve had it for a couple weeks now and have had time to familiarise myself with it enough to write a review.

In a nutshell, Google Wave is a pimped combination of email, instant messaging, and live document collaboration. It tries to combine these three functions into an interface that is easily accessible on the web. I think it’s best to split my review into these respective parts.

First I will talk about its function as email. If there’s something I’m really against, it’s unnecessary function duplication. I would like to stress my use of the word “unnecessary” here, because function duplication as an innovation strategy is actually incredibly good. Google wave is the perfect example of “unnecessary” function duplication for its use as email. It provides no extra benefit at the moment. It is simply what GMail is except inside a smaller window and formatted like a chatlog. But is it so bad? Now there are still a very limited number of bots you can use (small extensions that allow you to insert interactive “widgets” or manipulate the conversation in some way) but as time passes, I predict the number of bots will increase, and thus really make Google Wave’s use in email very, very different. One example is the “yes, no” widget, which allows anybody in the conversation to place themselves in the “yes”, “no” or “maybe” category – useful when organising an event.

Am I willing as a customer to give up my email for Wave? No. In the future? Maybe.

Instant messaging – it’s absolutely terrible. I’ve seen the Windows Live Messenger program do better. Inconvenient, clunky, extremely distracting (real time typing!), and gets confusing real fast. With shortcuts it’s barely manageable, but without, it’s a lost cause. Once you get more than 10 people in a single conversation (even with 5 people it’s absolutely terrible) you’d wish IRC were more mainstream.

Live document collaboration – admittedly I haven’t tested this as extensively as the previous ones but personally I wouldn’t go near Wave’s “live collaboration” with a 10 foot pole. Allow me to use an analogy here – let’s say you were a designer. A digital graphics designer. I can guarantee you that anybody doing this as a profession will not touch the computer unless they have a superbly clear idea of what they want in their head. Even if this were the case, I can again guarantee that discussions with other designers about their ideas in any collaborative environment or even with themselves would be done with their hands, a writing utensil and something to make marks on. Like “paper and pencil”, you know? It’s this process that Google is trying to digitize. Admittedly sometimes technology helps – but for things like these nothing beats face to face, or at least a good conversation over the phone.

Ok – but what about the application itself? It’s quite stable on my Firefox 3.5.something on Gentoo amd64. QtWebkit doesn’t display it properly (KHTML? Not a chance). It’s speedy up until I try to use the playback feature on a conversation, and I’ve been in a Wave with over 100 people with … well, yes, a lot of lag, but it displays and still can be used if you’re a very patient person. Google Wave seems to be crossing the uncanny valley in a way I haven’t seen before – there is a form of “window management”, including docking, minimising, maximising and restoring. There are very many desktop-like effects, such as their interesting implementation of a scrollbar (think touchscreen device) – and many toolbars littered here and there, but overall it puts me off more than attracts.

However an important point to notice is that Google Wave is still not much more than a poorly implemented clone of what the desktop world has refined over the years. The web was designed as a standardised freeform canvas to present information, which is why websites are not desktop applications and desktop applications are websites. Scrollbars? Drag and drop? Right click? I’m sorry – when was the last time you used a proper application? Admittedly Google Wave is composed of three main areas as introduced through their loooooong video – one of them is to do with an API. This obviously means that there’s nothing preventing a future implementation of a Wave Client, but until then, Google Wave shall continue to receive my polite disgust.

Related posts:

  1. Planning to surf the Wave?
  2. Beware of Google.
  3. The Google Operating System – Chrome.

Posts for Sunday, October 25, 2009

What's missing in Btrfs

So, after being completely betrayed[1] by Ext4 not once, but twice, I decided to evaluate my FS options for /home .
  • FAT* are not an option, neither is NTFS.
  • Ext2 is primitive and HFS/HFS+ is just not Linux.
  • JFS is nice, but (atleast parted) doesn't support grow/shrink.
  • I've used XFS before, and found it to be more reliable than Ext4. However, deleting dirs with thousands of small files is too slow (a common operation when compiling)
  • ZFS would've been an option if my earlier experiences with ZFS-FUSE weren't so horrid.
  • Did not even consider NILFS. It's too new, and I don't know much about it.

It ended up being a choice between the reliable Ext3, or the new-fangled Btrfs. Why Btrfs? Because I've been using it as my Gentoo Distfiles and Portage tmpdir since v0.16, and found it to be the /most/ resilient to power failures of all my partitions.

I ended up selecting Ext3 for /home, but let's see why.

What's missing in Btrfs:

  1. Growing the filesystem to the "left" of the partition. The error message when you try this is cryptic (common in btrfs-progs). However, since for other FSes this essentially involves "move to left and grow to right", I suppose the "move" part is what's missing in btrfsctl.
  2. Pathetic ENOSPC handling. It either throws an ENOSPC at around 75% or when the metadata space fills up. Not sure which, but it's supposedly fixed for 2.6.32.
  3. Volumes once created cannot be deleted. Again, fixed in 2.6.32.
  4. Parted doesn't support editing/creating Btrfs partitions. Support for detecting it was proposed recently; but, I still don't see it in either "master" or "next". This is not a Btrfs problem, but certainly affects whether I'd use it.
  5. There were other minor irritants (with btrfs-progs, mostly), but those will go away with time

Ext3 might have bad performance (especially w.r.t fsync), but atleast it's more reliable. In conclusion, I'll use Ext3 in data=ordered mode for /home till 2.6.33 is out; and then I'll convert my Ext3 partition to Btrfs and forever be happy :}

1. betrayed == sending everything into /lost+found after a forced fsck due to an earlier fsck after a power failure

Time to pay the Windows tax

Now that Windows 7 is out, it's only a matter of time before I'm forced to buy it. I don't want it. I won't use it. But as a programmer, it's nearly impossible to survive without owning a copy of the latest and greatest latest version of Windows.

Why? Because if you want a job, unless you're one of the fortunate few who get to pick your development platform AND dictate the platform for all of your users, you need to know Windows. You need to know how to navigate around it when you're forced to use it on your work computer. You need to know how to troubleshoot (to some degree) your users' Windowsy problems as they try to install and use your program. If you want to communicate with people in the world, inevitably they're going to send you a bunch of MS Word documents and nothing is ever going to read them properly 100% of the time except MS Word itself.

I have a copy of Vista Business on my laptop which I am deeply ashamed for having bought, but at the same time it helped me land a very nice work contract. Without being able to VPN into the company's network (via some MS proprietary VPN software that I tried VERY hard and failed to get to work in Linux) I wouldn't have been able to complete the job on time, and I might be living in a cardboard box under a bridge right now.

For this contract I actually developed the app at home entirely in Linux. I used only Linux-centric tools (Vim, Gimp, Firefox, Ruby etc.). Thank God most of those tools have Windows versions, because deploying it to Windows land at work and working on it there when necessary was (mostly) trivial. But I still needed Windows to finish the job. And all the users of this app were Windows users. The specs for the app were sent to me in Word and Excel documents. The website frontend is being viewed in IE much of the time in spite of my pleadings to the contrary, so I have to support it.

Such is the life of a programmer. I'll probably buy Windows 7 eventually but it'll sting. It'll rankle.

NetworkManager


network management on linux differs from distro to distro. trying various of these i liked what SuSE did over the year. they included a network manager like applet ‘knetwork’ with kde 3 which even included isdn (ppp) links.

gentoo has it’s own network configuration which is quite static using /etc/conf.d/net. i use this for static setups but i’ve written my own scripts for my laptop (aka desktop) machine. just one example:

wpa_supplicant_generic_dhcp_ath0
#!/bin/bash -v
echo “sh /root/config/wpa_supplicant_generic_dhcp_ath0″ > /root/last-lan.sh
if [ -f /var/run/dhcpcd-ath0.pid ]; then
rm /var/run/dhcpcd-ath0.pid
fi
killall dhcpcd
killall wpa_supplicant
killall vpnc
ifconfig br0 down
ifconfig ath0 down
ifconfig eth0 down
brctl delif br0 ath0
brctl delif br0 eth0
brctl delbr br0

rmmod ath5k
modprobe ath5k
#iw reg set EU #does not work
sleep 1
ifconfig ath0 up
wpa_supplicant -B -dd -D wext -i ath0 -c /etc/wpa_supplicant.conf
route del default
#dhcpcd ath0
iptables -t nat -A POSTROUTING -o ath0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

ethtool -s eth0 speed 100
dhcpcd ath0
#dhclient ath0

cp /etc/resolv.conf /etc/resolv.conf.dnsmasq
echo “nameserver 127.0.0.1″ > /etc/resolv.conf
ifconfig eth0 10.0.0.1/24 up
dhcpd eth0

although my scripts work very well (even when i restart my computer the last script is automatically run from /etc/init.d/local) this setup has it drawbacks in usability.

benefits:

  • starts a dhcpd instance, so my  laptop acts as a dhcp server (not included)
  • my local dnsmasq installation can be accessed from the eth0 subnet
  • setup for eth0 is automatically made & routing is enabled by default
  • i can adapt to new networks quite fast with yet another config file instantiation
  • once bridging is working for eth0|ath0 i can increase usability since i can transparently use either wireless lan or ethernet, say for backups the later might be much faster without having to kill all connections. (not included)

drawbacks:

  • although networks using none|wpa1|wpa2 it tends to have problems with vpn (i wrote another script)
  • it lacks usability, no monitoring what happens (in case of an issue i run it on a shell)
  • on bad connections with wifi the dhcp step fails quite some times, running the script again will result in (loss of time)
  • it reloads the wireless lan driver (helpful when i was using kismet for finding new networks), still this might not be necessary all the time (loss of time)
  • bad in regards to hot plugging (and therefore automation) after inserting a wireless lan usb stick (or similar)
  • my scripts require a static interface naming scheme, gentoo provides this by default:
    /etc/udev/rules.d/70-persistent-net.rules

i considered NetworkManager (NM). i like most of it’s technology as for instance the DBUS interface it uses is probably the best way one could implement something like NM. i also like the integration into gentoo but this came pretty late (ubuntu was the first distro which had quite acceptable NM support).

but NM does a very bad job if things don’t work. there is no debugging possible. example:

  • NM using WPA2 needs to create a wpa_supplicant.conf on the fly before executing wpa_supplicant. i did not find any way to see this file anywhere
  • NM won’t help me to see wpa_supplicant errors
  • NM will show the signal power if i’m connected to a certain network. this is limited to one interface in general. what about several wifi cards? what about bluetooth links?
  • NM lacks a graphical interface (or any interface at all) for debugging what is going on

this made me think about network and interface usage in general. i’m using many tools for years now as:

  • ip – for ipv4/ipv6 interface configuration & routing
  • dhcpcd/dhclient (managing dhcp address automation)
  • wpa_supplicant (wpa|wpa2|EAP)
  • vpnc (instead of cisco vpn)
  • dns (resolv.conf / dnsmasq) (openresolv is on the agenda, didn’t have time yet)

but these tools although relying on each other are monolithic and static software monsters. if one wants to understand what networks are all about it is one thing: dynamics in every aspect

the next graph shows a ‘network grammar’ which describes the possible dependencies or how one can stack various programs:

network grammer

but on ‘run time‘ you will end up in a ‘state graph‘ with every application somehow connected to others in various ways. states are also triggered on timeouts (for example when the ‘dhcp serverwasn’t accessible by the local dhclient one is forced to take action). now let’s look how the grammar applies on ‘run time’:

network state graph

the two previous graphics also demonstrate the stacking capabilities. looking at the grammar makes this obvious. (the grammar and the flow graph are far from complete but illustrate the basic concept).

  • if someone types ‘ip l set eth0 down‘ all connections regarding eth0 as source or target are removed as well es default or specialized routes over (through) that interfaces are dropped without being restored on ‘ip l set eth0 up’.
    example
    # ip l set eth0 up
    # tcpdump -i eth0 &
    [1] 5866
    listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
    # ip l set eth0 down
    tcpdump: pcap_loop: recvfrom: Network is down
    0 packets captured
    0 packets received by filter
    0 packets dropped by kernel
    [1]  + exit 1     tcpdump -i eth0
    HINT: dhclient for instance keeps running if the interface goes down
    HINT: ssh only detaches the eth0 interface from being used and on up reattaches it
    SOURCE: equery b ip -> sys-apps/iproute2-2.6.28 (/sbin/ip)
    iproute2-2.6.28::iplink.c shows:
    } else if (strcmp(*argv, “down”) == 0) {
    req->i.ifi_change |= IFF_UP;
    req->i.ifi_flags &= ~IFF_UP;

    this triggers the kernel in some way which then signals the change to every process using this interface.

  • in a state graph every object can perform an action considered best suited by the affected object. this helps to delegate some jobs to daemons (for example dhcpd) but every object affects the ‘state machine
  • the protocol for interaction is DBUS (there is a wpa_supplicant dbus interface, as well as one for dhcpclient usage)

maybe this idea inspires someone to rewrite NM with usability (in the sense of automation and debugging feedback) in mind. i think NM is on the right track already.

NM should:

  • show the connection state: either layer1 connection/layer2 connection/layer 3 connection
  • link quality per interface (wlan/bluetooth)network-meter
  • have a debug console which can be triggered
  • should have a ‘in detail’ network information dialog
    network information
  • should generate a wpa_supplicant.conf which can be viewed (so that one can see what the on-the-fly config file generator has created)
  • should pipe the output of all involved processes to a debug line, so that one can sort output per process with a global time line
  • regarding the ‘grammar’ above one can think of a ‘pyramid of services‘. if one of the services in the middle fails all above have to be restarted (or at least signaled on change). say vpnc fails, we need to reconnect it with all the things one has to do -> removing the current route, reset a new one (probably the same) and prior to that we have to reconnect as soon as the service is known to fail. vpnc for example fails quite some times since.
    this ‘pyramid of services’ should be visible to the user and a user ‘must have’ the possibility to see the status of every ‘floor’ in this pyramid. if layer 3 connection is working, l3 must light up. if a user wants to restart all services above layer 3 there must be a ‘restart all services above’ button. currently in NM one has to do all the steps from bottom up.

Posts for Saturday, October 24, 2009

Chromium Rocks

I just compiled Chromium, and it rocks. The download manager is better than Firefox, the design is cleaner, the JavaScript performance is a 4 times better, and overall it just seems more solid. The web works better in it. My only complaints so far are some weird font rendering issues and a lack of extensions (adblock, customize google, gmail notifier, live http headers, modify headers, open in browser, right-click-link, skipscreen, useragent switcher…). I’ll stick with Firefox until there is good extension support for Chromium.

I did a JS performance test of QtWebKit, KHTML, Gecko, and V8, and here are the results:
Sunspider Benchmark

Evidently KHTML has a lot of catching up to do, per usual.

Posts for Friday, October 23, 2009

avatar

Is there such thing as a good monopoly?

The technology world is no doubt aware of Google’s seemingly unstoppable leap into existing markets. On my previous Google rants to beware of Google and their evil, and perhaps their latest and greatest (is it?) innovation Google Wave, I have kept my polite contempt at their progress unconcealed. Today before I release my upcoming post on a review of Google Wave I want to question if there is such a thing as a good monopoly?

Google isn’t seen as a bad company. Its motto is “don’t be evil” and their offices seem to be the envy of the labour market. They seem to have a fun approach to developing and see themselves as engineers with an itch to scratch. A recent slashdot article suggested that Google was attempting to take on iTunes with an upcoming “Google Audio” product – and that made me think whether or not what they’re doing would be seen in a good or bad light.

The perfectly “economically” rational consumer will simply pick the one with better value for money given their income and financial priorities. However assuming the extreme that every single market in the world had the same single company as its monopoly – how would you as a consumer react?

It’s quite interesting as Google is in the technology industry right now – the resources used here are quite mobile between markets and there’s plenty of expertise to be shared. Google as a monopoly could offer us much in terms of economies of scale. Given their well ingrained corporate culture the internal diseconomies of scale would be kept to a minimum and services still be a personable as ever. There is nothing stopping them from branching out in the market with these good qualities and will (this is all assumption) be able to provide appropriate services for all kinds of needs, save for the most extreme of niche markets. So given all this, if everything about their service is great, just that they have huge power over every market (assuming they use that influence responsibly and ethically) – what will consumers do?

If I happened to belong in one of those extreme niche markets, I’d continue using my own service providers without a care in the world. If I did however conflict with a service that Google provided, would I purposely roll my own solution despite the higher complexity and cost or would I go with the crowd? If the service depended on integrating with others, assuming that Google didn’t abuse their monopolist position there should be no problem – so you can safely disregard integration as a barrier. I personally would go roll my own solution.

But we aren’t simple minded people who are content with just what we need – no, the question I’m really asking is whether or not this’ll spark a consumer rebellion?

No related posts.

Java timestamp (in)equality

user> (let [milli (.getTime (.getTime (java.util.Calendar/getInstance)))
            ts (java.sql.Timestamp. milli)
            d  (java.util.Date. milli)]
        [(= (.getTime d) (.getTime ts))
         (= ts d)
         (= d ts)])
[true false true]

Really, Java? Really? Come on now.

Documenting it doesn't make it any better either:

Note: This type is a composite of a java.util.Date and a separate nanoseconds value. Only integral seconds are stored in the java.util.Date component. The fractional seconds - the nanos - are separate. The Timestamp.equals(Object) method never returns true when passed an object that isn't an instance of java.sql.Timestamp, because the nanos component of a date is unknown. As a result, the Timestamp.equals(Object) method is not symmetric with respect to the java.util.Date.equals(Object) method. Also, the hashcode method uses the underlying java.util.Date implementation and therefore does not include nanos in its computation.

The internet is strewn with the wreckage of people being gnawed upon by this bug.

Blog source code updated

I updated the source code of my blog on github. I'm too tired to write much about it at the moment.

Suffice it to say I rewrote it all from scratch for the purpose of sharing, because lots of people were asking for it. It uses Tokyo Cabinet instead of mysql now, which is nice. I gutted the codebase so it's about 700 lines now (down from 1500, not bad). I plan to write up some posts later exploring various parts of it, for those who are interested.

Hope someone gets something out of it. Use at your own risk.

Posts for Thursday, October 22, 2009

Xen 3.4.1 on RHEL/CentOS 5.4

I’m happy to report that the updated Gitco Xen 3.4.1 repo is working well on CentOS 5.4.

If you are doing link bonding and bridging in accordance with my previous post “Xen 3.3 in RHEL/CentOS 5 and more Link Aggregation Fun“, you no longer need to patch the network scripts as RedHat fixed the initscripts package in RHEL 5.4.

Upgrade procedure for CentOS 5.3 to 5.4:

yum clean all
yum update glibc\*
yum update yum\* rpm\* python\*
yum clean all
yum upgrade
reboot

Updated Xen Install Guide From My Previous Article:

Head over to http://www.gitco.de/repo/ and grab the repo for your arch.  (Most likely wget http://www.gitco.de/repo/CentOS5-GITCO_x86_64.repo in /etc/yum.repos.d/ for the uninitiated).

If you already have Xen installed, you may need to remove and readd it.

yum groupremove Virtualization
yum groupinstall Virtualization

You’ll also get some updated tools like Virtual Machine Monitor 0.7.0 that make it easier to install newer guests such as Fedora 11 or Ubuntu.  Sweet!

Double check /etc/sysconfig/kernel.  It should be set to kernel-xen.  Likewise, check /boot/grub.conf and make sure that the Xen kernel is the default if the aforementioned was not done beforehand.

Reboot!

Share and Enjoy: Digg del.icio.us Slashdot Facebook Reddit StumbleUpon Google Bookmarks FSDaily Twitter email Print PDF

Related posts:

  1. Xen 3.3 in RHEL/CentOS 5 and more Link Aggregation Fun RHEL 5 includes the now ancient Xen 3.0 hypervisior.  A...
  2. Link Bonding Craziness in RHEL/Centos 5 I just went through hell in a handbasket trying to...
  3. Mirroring Fedora Introduction This post details setting up your own private mirror...

Linus and Windows 7

Linus Torvalds posing with Windows 7

This is awesome.

Share and Enjoy: Digg del.icio.us Slashdot Facebook Reddit StumbleUpon Google Bookmarks FSDaily Twitter email Print PDF

No related posts.

Windows 7

Why on earth would I spend $109.00 on a new operating system when I could buy a friggin'  1.5 TERABYTE HARD DRIVE FOR THE SAME PRICE!?!?!?  (and that's the cheap version of Windows 7 - you know, the one you'll regret buying even if you do buy in to all this Microsoft crap.  The version that'll make you regret purchasing Windows the least costs $189.99.  Sheesh... I could almost build an entire computer for that price.)

Man... The more I use Linux, the more Windows doesn't make any sense at all.
avatar

Syncing Bash History Between Shells


Ever closed and opened a shell because you needed to refresh the history to pull up a command you used before? Nevermore! Read this excellent post on briancarper.net to make your terminal life much easier.

Posts for Wednesday, October 21, 2009

avatar

Making the most out of the Windows Mobile Experience

If you so happen to own a Windows Mobile phone or played with one before, there are likely to be many things that you find rather terrible about it. What with the iPhone, Android and Palm, it’s no surprise that Windows Mobile deserves to be shunned to a shameful corner in the market. However what most people don’t know is that the Windows Mobile team seems to be getting their gear together and is doing some major upgrades for the next iteration of their platform – Windows Mobile 7. Though it still lacks in many ways, it’s definitely a move forward.

Many people on the Windows Mobile platform are not making the most of it – they aren’t using a smartphone as a smartphone. Through this article I hope to touch up on some of the ways your phone could be used.

Improve the overall experience

Before you start trying to use your phone for tasks, you might want to make your phone more usable first. Windows Mobile was designed for a stylus and envisioned as a minature desktop – something that really makes it a terrible OS to use. Windows seems to have made touch-friendliness its main target for improvement and these upgrades are available for all users, without having to buy a whole new phone. However you’d have to search quite a bit, (I recommend the XDA community) to find something that really clicks – meanwhile this introductory article should help.

Flash a newer ROM

This is the equivalent of upgrading your operating system. I wrote a review of it here but developing has already progressed much further than those screenshots display. Windows Mobile seems to aim to challenge the likes of the iPhone with its WM7 version coming apparently in Q4 of 2010. With this aim and the rapid ongoing development it’s hard not to expect greater things in the future. Even though it’s not out yet learning how to flash a ROM will grant you access to the ongoing development – and of course making your experience a lot, lot better. I would go so far to say that even 6.5 on my aging Dopod’s hardware (popular name HTC Hermes) is fast, and really makes the device a joy to use (yes, quite shockingly the newer ones are less resource hungry!).

Theme it properly

Whether you have flashed a recent ROM or preferred to keep your old one (I recommend flashing), a theme will do wonders. There are already themes for WM6.5 and can really sharpen up the phone in no time. A good wallpaper, colourscheme and not to forget icons too can spice things up. If you are using shells or widgets then finding matching skins for those will help give your system an integrated feel.

Use a Shell/Widget/Plugin for the Today screen

For those already with WM6.5, it comes with Titanium and that is a huge improvement from the today screen, giving you quick access to pretty much all of the phones functions outside individual applications right on the front screen. However many other interfaces are available (most are crap) and some are really quite something, such as SPB Mobile Shell (pictured), TouchFlo/Manilla (2D or 3D), Home2, and various today plugins.

Ensure the basics exist

Make sure that you’ve got the basic set of applications – Windows (Live) Messenger, Windows Media Player, Office Mobile (including OneNote?), and … wait for it … Windows Marketplace and Microsoft MyPhone. This basic set of application should come with every phone and if you didn’t get it, you should hunt it down. Windows Marketplace is Microsoft’s attempt at the iPhone’s App store and Google’s Android Market. It was quite recently released (and even more recently cracked and available for free on XDA) and though I’ve only seen very few applications available on it (and even fewer free ones) it’s been a joy to browse and no doubt has a lot of potential once more developers add their stuff. Microsoft MyPhone is a new service to bridge mobile and web synchronisation. It’s quite nifty allowing two-way synchronising for SMSes, contacts, calendars and todos – all accessible through a web interface. It also allows synchronisation with social networks (though Microsoft’s Facebook application is very good) as well as synchronisation between several devices. Some of it’s “pro account” features involve phone tracking and remote phone lockdowns,

In my next post on this topic I will start going through specific uses and my recommended applications for that use. But taking those first easy steps can really make a difference.

Related posts:

  1. Windows Mobile 6.5 Review
  2. Just flashed Windows Mobile build 23053 – it’s miles better than 6.5.
  3. Windows 7 Review

Chromium: Use Gmail as Default Email Client (KDE 4)


During my two day test with Chromium I forgot to add how to use Gmail as your default email client in Chromium. I usually use my ISP provided email and Kmail, but I got an old Gmail account that I still get emails on.

Open System Settings and in Default Applications select ‘Use a different email client’ and enter:

chromium-browser https://mail.google.com/mail/#compose

Sort a Clojure map by two or more keys

Note to self. Given this:

user> (def x [{:foo 2 :bar 11}
              {:bar 99 :foo 1}
              {:bar 55 :foo 2}
              {:foo 1 :bar 77}])

#'user/x

How do you sort by :foo, and where :foo is equal, sort by :bar?

Obviously not like this:

user> (sort x)
; Evaluation aborted.
;; java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.lang.Comparable

Also not like this:

user> (sort-by #(map % [:foo :bar]) x)
; Evaluation aborted.
;; java.lang.RuntimeException: java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.Comparable

What's a guy got to do to find something Comparable? Well, vectors are Comparable, so we can do this:

user> (sort-by #(vec (map % [:foo :bar])) x)
({:foo 1, :bar 77} {:bar 99, :foo 1} {:foo 2, :bar 11} {:bar 55, :foo 2})

The add_source script

One thing that I haven’t covered so far, is how I add an entire batch of source transcripts in one go. It would be very time-consuming to add every single entry in eg. a confirmant list one by one via the browser UI. So, I once whipped up a Perl script, of which the following is the latest incarnation:

#! /usr/bin/perl

# add_source.pl - add source nodes from standard input
# example: cat my.txt | add_source.pl 46528
# this script utilizes the 'API' add_source() function,
# which infers sort order and source date from the text.

#(C) leifbk 2009

use strict;
use DBI;

my $parent = shift;
if ((!$parent) || !($parent =~ /^\d+$/)) {
    print "Bad or missing parameter $parent\n";
    exit;
}
my $dbh = DBI->connect("dbi:Pg:dbname=pgslekt", '', '',
                {AutoCommit => 1}) or die $DBI::errstr;
my $sth = $dbh->prepare("SELECT add_source(?, ?)");
while (my $text = <STDIN>) {
    chomp($text);
    $sth->execute($parent, $text);
    my $node = $sth->fetch()->[0];
    if ($node < 0) {
        $node = abs($node);
        print "Duplicate of node $node, not added.\n";
    }
    else {
        print "Node $node added.\n";
    }
}
$sth->finish;
$dbh->disconnect;

The ‘API’ add_source() function which is referred to in the header is a simple overload of the big Pl/PgSQL add_source() that I’ve described earlier, which takes only two parameters: The parent node and the text, and fills in the rest with defaults.

So, to enter a batch of source transcripts, I just write them down in a plain text file and store it as say, temp.txt:

#718 15.03.1760 (1): Gullich Halvorsen Kaasen.
#719 15.03.1760 (2): Hans Christensen Wibeto.
#720 15.03.1760 (3): Even Halvorsen Huvet.
#721 15.03.1760 (4): Peder Gundersen Rommenes.
#722 15.03.1760 (5): Jon Andersen Huve.
#723 15.03.1760 (6): Jens Jonsen Gruen.
#724 15.03.1760 (7): Tarje Olsen Schordal.
#725 15.03.1760 (8): Niels Johannissen Heisholt.

Then I run a command line from a terminal like:

leif@balapapa ~ $ cat /tmp/temp.txt | add_source 56492

And presto! a bunch of entries are loaded into the «source tree». It’s certainly not rocket science, but it’s such an integral part of my project that I had to mention it.

Origami rocks, admit it.

Why am I writing about origami here? Partly because I'm excited. I bought some methyl cellulose for the first time, and it's like some kind of wonder potion. You dissolve it in water and smear it all over some paper and when it dries, the paper has gained magical origami powers. Suddenly it's stronger, it's crisper, and it holds a fold better. What a wonderful chemical. It cost $25 for a tiny bag of the stuff, but that bag will probably last me a decade, so it's all good.

The other reason I want to write about origami at the moment is because I feel it's my duty to spread the joys of origami to fellow geek-kind.

Origami is a geek hobby if ever there was one. There's more science behind it than most people realize. Designing a model has close ties to circle packing. There's math involved (PDF) that I just barely understand.

It's is deeply satisfying in exactly the same way computer programming is satisfying. It's the satisfaction of taking a set of very simple rules and ideas, manipulating them in novel ways and coming up with something cool.

Origami actually has a lot of similarities to programming. There are primitives: mountain fold, valley fold. They are combined into something like procedures: reverse folds, sink folds, pleats and crimps. And those procedures are combined into more complex maneuvers, and when you combine them enough you get a finished model.

There are "bases" that are essentially design patterns: certain combinations of folds that are used over and over in different models. All of these things can be put together in novel ways (recursively!). A book of origami diagrams is essentially a book of algorithms.

At the same time there are constraints: use a square, don't cut the paper, etc. The size of the paper is a constraint. The kind of paper you use is a constraint: some kinds of paper fold better than others. In the same way people get a kick out of making impressive videos in a few kilobytes of RAM, there's a great satisfaction in making a model with a dozen flaps out of something that started with four corners. The constraints define a universe of rules that's small enough to understand and master, yet large enough to leave a lot of possibilities. The same square can be folded into a spider or an elephant or a race car or a man on a horse.

But origami is different from programming because (obviously) it's 3D. There's a lot of thinking involved, but there's also a bit of manual dexterity. It's a good feeling to shape matter with your hands. And when you're done you end up with something tangible in a way that a program isn't. You can stick it on the shelf or give it away as a present.

Most people don't understand how complex origami can get. Check out the websites of Brian Chan, KAMIYA Satoshi, Robert Lang, and Gilad Aharoni. It's all (usually) from a single uncut square. It still amazes me what people can create.

Posts for Tuesday, October 20, 2009

Falcon 0.9.4.4 released


A new version of the Falcon programming language has been released. They’re up to version 0.9.4.4. There is of course at least one new feature despite the fact this is considered a bug fix release. I don’t have a Gentoo repo but I do have an Exherbo repo. So please test it for me while I still don’t have a Linux PC :( .

Enjoy the Penguins!

Planet Larry is not officially affiliated with Gentoo Linux. Original artwork and logos copyright Gentoo Foundation. Yadda, yadda, yadda.