Search Results: "ron"

11 December 2006

David Moreno Garza: Augusto Pinochet dies

(Translated from my same post in Spanish) A few days ago, McDonald published a cartoon on the end of the dictator Pinochet.
FINOCHET (fin meaning “end”). Damn heart, it had to be on the left.
Yesterday, fascist dictator Augusto Pinochet died in the Military Hospital in Santiago, after heart and lung diseases, being 91 years old. Now, current president Michelle Bachelet, a moderate socialist, in case Pinochet is given State memorials, could be attending the ceremony (in a predominantly conservative country as Chile), even after she was tortured and persecuted under the dictatorship and his father was murdered under the regimen, after serving Salvador Allende‘ government. Shitty life, huh? Viva Chile!, just as the ironman stated.

Amaya Rodrigo: Frustrating toys

I work at the Ministerio de Administraciones P blicas, the MAP. My main task there is to administer an email cluster for something between 8.000 and 10.000 users, based on free software (LDAP, Postfix, Amavis...) which has been pretty fulfilling so far.

The problem they have is a lot of consultants from external companies that come for big or small projects and they know of no easy way of being able to grant enough permissions to achieve certain tasks without giving away the root password and having to change it every other day. I am one of these external consultants, only I am there for a long term project. I have been there for more than a year and a half now, and our contract was just renovated for two more years. This basically means I am doing my job pretty well.

But a couple of months ago, the company I work for, Alanta, agreed with the MAP on me giving a 12h a training session on sudo. After spending 100 hours in preparing my slides on a sudo workshop (spanish only, sorry), starting from file permissions to ssh public-private key pairs, and ending with sudo, a high amount of stress, as I had to work full time as I prepared this in paralel, I bitterly complained to my boss. (That s when the cleaning started, BTW).

So we had a nice lunch in which I was given a 200 EUR 2GB 2nd Generation Silver Ipod Nano. Which is nice, but taking into account that when I worked for IBM as a certified trainer I made something between 24-60 EUR per hour, depending on the subject, and all the material (slides, exercises, TOC and Trainer material) was already done for me, so I just had to prepare and give my lessons, I felt patronized and a bit insulted, even if I did not expect any compensation for this extra effort that really damaged my (mental) health. Getting presents in exchange for hard work doesn t make sense for me, specially when I can hardly make it to the end of the month, constantly being in (small, to be honest) debt.

But you could be making more money, couldn t you? Yes, sure. But at what price? I like the relaxed work environment and the lack of sexism in my current project. I have plenty of spare time, and my life quality is overall great, I can walk home from work, I am not juiced and then disposed of, despite the punctual stressful periods everyone gets every once in a while (which are rare here, at MAP).

And this thing will never run IpodLinux or Rockbox. I feel like I want to throw it out the window. It lacks support for my favourite music file formats, UTF-8 and hangs up more than MS Windows 95.

Edd Dumbill: Afraid of the POX?

The other day I had was tinkering with that cute little poster child of Web 2.0, Flickr. Looking for a lightweight way to incorporate some photos into a web site, I headed to their feeds page to find some XML to use.Before you read on, don't forget that the XTech 2007 call for participation ends this week. The result was interesting. Flickr have a variety of outputs in RSS dialects, but you just can't get at the raw data using XML. The bookmarking service del.icio.us is another case in point. My friend Matt Biddulph recently had to resort to screenscraping in order to write his tag stemmer, until some kind soul pointed out there's a JSON feed.Both of these services support XML output, but only with the semantics crammed awkwardly into RSS or Atom. Neither have plain XML for public consumption (some is available behind a registration protected API), but do support serialization via other formats. We don't really have "XML on the Web". We have RSS on the web, plus a bunch of mostly JSON and YAML for those who didn't care for pointy brackets.Did we as supporters of XML get it wrong somehow? I think we did. The success of the XML project and the W3C as a unifying forum was seductive, and we felt more bound to the edicts of the W3C than we thought. Our justified love of open standards inadvertently promoted a straitjacketed approach to using XML. XML was felt to need a schema language.What we missed was that settling on schemas for data serialization represented much more of an up-front commitment than most developers could really make. The rise of agile programming techniques further emphasizes the hazards of prematurely freezing a design.Schemas never really came with great evolution or migration strategies.
And of course it didn't help that both DTDs and W3C XML Schema are pretty darn obscure. Somehow we never got the word out, despite the "standalone" XML declaration, that it's OK to spread schema-less XML around.We had of course the Simple XML movement, but it came to little. Other voices pointed the way forward. Walter Perry notably promoted an agenda that required little a priori agreement between communicators, but it gained little ground in common thought. Ironically it took James Clark to push the agenda of developer convenience, with the RELAX NG compact syntax giving us all permission not to think in angle brackets.Meanwhile, busy developers with work to do on the web have created non-XML syntaxes such as JSON and YAML. Though I deliberately closeted myself in XML for a long time, I have come to appreciate the utility of these syntaxes.One of the more intriguing developments is that the Semantic Web crowd, while still very much W3C oriented, have really proved themselves more flexible in their attitude than the XML world at large. RDF/XML is hardly the only acceptable way to approach the throne of Tim, and the man himself threw out XML syntax pretty early on with the development of the N3 scribble format. More recently, the work on GRDDL to scrape semantics from HTML has shown the semweb folks' amenability to outside initiatives such as microformats.Maybe it's not such a bad world, as making an XML mapping of YAML, JSON and friends isn't really very hard. I'd just like to get the message out to web application developers that Plain Old XML is fine by me. I live in hope yet that the rise of REST will hit this home.So while markup has most definitely won on the web, it's a shame XML hasn't yet achieved as much as it could. It's not too late for an injection of pragmatism and a little less constraint.

Joachim Breitner: DeCaf taking on form

A few month ago, I blogged a way to spread Free Software effectively, especially in developing countries: By deploying Free Software in internet caf s, where most people learn their way around computers. Most of them (and there are a lot, much more than in Europe) have a buisness plan that relies on software for free, but currently they achieve that through pirating Windows and software like Cybercafe Pro. Back than, I wrote this more or less theoretically, but it happend that I ended up having some time to actually start working on it.While Free Software, especially Debian, provides a very good base to build internet caf s from, one key component is more or less missing: Software to hand out these codes ( timecodes ) to the customer, to let them log in and surf for the time they bought. Very recently, Zybacafe was released, but I did not really like it, nor felt like maintaining a Pascal/Lazarus based Debian package. So I went ahead and implemented my own ideas.The Idea is to keep it very simple, very modularized and integrate deeply with normal unix ideas. So what we have now is a PostgreSQL database (one table so far), and all communication just goes via this table, so we don t have to design or implement complicated protocols. A python gtk application for the front desk generates the timecodes that are then, on paper, passed to the customer. The workstations greet the user with standard GDM, but our pam modules authenticates the timecode instead of a username/password pair. While using the system, a small floating window informs the user about the remaining time. If he does not log out voluntarily, a system daemon will kill all his processes eventually.The long term mission is to form that into a Custom Debian Distribution that will install the server hassle-less, and besides being pre-configured for the internet caf s needs, also immediately serves as an automated installation server for the workstations (think FAI), all useing stock Debian packages, as far as possible. Another pam module could, upon login, mount the homedirectory as a copy-on-write overlay of a template user s home directory, and through away the changes afterwards. The goal is to offer easier installation, less maintenance, better robustness and more flexibility than the current common non-free systems.But, of course, this project needs help. First of all: Users! If you have any use for time-limited logins (Internet caf , school surf terminaly, parents with otherwise not to bed going kids), you can be an earliy adaptor. Developers are very welcome as well, and due to the modular structure, cooperation should be quite smooth.The development happens on alioth, where we have the subversion repositry, as well as on the Debian wiki page. Alpha packages for these components can be found on the alioth group s webspace. We do not have a mailing list yet, but feel free to e-mail me. We will set up a mailing list once there is a need for it. Thank s to the KACE for supporting this.

Erich Schubert: Spammers listen for your blog pings

From time to time, I use technorati to monitor for links to my blog. I intentionally do not allow comments or trackbacks, but often people send me replies in their own blogs. In technorati, I noticed a link to my blog that wasa quite surprising. Spammers have been around for some time, that take part of your blog posting and add their random shite to it. This was somewhat different. This spammer quoted an old version of a blog posting. When I wrote that blog positing, I noticed like 10-20 minutes later that I had a fact wrong, so I changed that, even renaming the blog postings title. This spammer still had the old title, that only live for some 20 minutes at most. So either this spammer was very lucky in crawling my blog exactly at that time - or they've received a ping for it. I'm usually pinging different services using the ping-o-matic. I'm convinced at least one of these services allows you to subscribe to all blog posts that contain certain keywords (I've seen political web sites linking to posts favourable for their candidate within minutes!), and I have the impression some spammers are doing this. They're probably sending trackbacks to my site then, hoping that I'll add a link back to them automatically, or that they'll at least go up in the Google rankings. Update: I've found out that Google blog search still has that incorrect version of my blog posting; the spammers site heavily links back to Google blog search; the search terms were "computer science"... so apparently they are not indirectly subscribed to my pings, but they're just polling Google blogsearch every five minutes.

9 December 2006

Julien Blache: ATI drivers suck

I am still trying to get the ATI drivers to work properly with my X1600 Mobility card. And things are only getting worse. I still cannot get the crt1 output to work, although the driver detects the VGA monitor connected to it. Enabling both lvds and crt1 doesn’t cut it. No, really, it doesn’t fucking work. No signal, no nothing. But now I am getting segfaults every time I try to use a multimedia player, be it vlc or xine, even when explicitely using a good old x11 video output (ie, no XVideo), and the machine won’t resume anymore after a suspend to ram when fglrx is loaded. Gee, instead of releasing such crappy drivers, can’t you just release the specs ? Moreover they won’t accept bug reports from me because the machine is a laptop. Morons.

8 December 2006

Russell Coker: SE Linux on Debian in 5 minutes

Following from my 5 minute OSDC talk yesterday on 5 security improvements needed in Linux distributions I gave a 5 minute talk on installing SE Linux on Debian etch. To display the notes I formatted them such that they were in 24 line pages and used less at a virtual console to display them. The ultra-light laptop I was using has only 64M of RAM which isn't enough for a modern X environment and I couldn't be bothered getting something like Familiar going on it.

After base install you install the policy and the selinux-basics package:

# apt-get install selinux-basics selinux-policy-refpolicy-targeted
The following extra packages will be installed:
checkpolicy libsemanage1 mime-support policycoreutils python python-minimal
python-selinux python-semanage python-support python2.4 python2.4-minimal
selinux-utils
Suggested packages:
python-doc python-tk python-profiler python2.4-doc logcheck syslog-summary
The following NEW packages will be installed:
checkpolicy libsemanage1 mime-support policycoreutils python python-minimal
python-selinux python-semanage python-support python2.4 python2.4-minimal
selinux-basics selinux-policy-refpolicy-targeted selinux-utils
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 6362kB of archives.
After unpacking 41.5MB of additional disk space will be used.
Do you want to continue [Y/n]?

The package install process also configures the policy for the machine. The next step is to label the filesystems, this took 26 seconds on my Celeron 500MHz laptop with 20,000 files on an old IDE disk. The time is in proportion to number of files, often bottlenecked on CPU. A more common install might have 5* as many files with a 5* faster CPU so 30 seconds is probably common for labelling. See the following:

# fixfiles relabel

Files in the /tmp directory may be labeled incorrectly, this command
can remove all files in /tmp. If you choose to remove files from /tmp,
a reboot will be required after completion.

Do you wish to clean out the /tmp directory [N]? y
Cleaning out /tmp
/sbin/setfiles: labeling files under /
matchpathcon_filespec_eval: hash table stats: 14599 elements, 14245/65536 buckets used, longest chain length 2
/sbin/setfiles: labeling files under /boot
matchpathcon_filespec_eval: hash table stats: 19 elements, 19/65536 buckets used, longest chain length 1
/sbin/setfiles: Done.

The next step is to edit /boot/grub/menu.list to enable SE Linux, auditing, and put it in enforcing mode:

title   Debian GNU/Linux, kernel 2.6.17-2-686
root (hd0,1)
kernel /vmlinuz-2.6.17-2-686 root=/dev/x selinux=1 audit=1 ro enforcing=1
initrd /initrd.img-2.6.17-2-686

Then reboot.

After rebooting view the context of your shell, note that the login shell will have a domain of unconfined_t when the targeted policy is used:
# id -Z
system_u:system_r:unconfined_t

Now let's view all processes that are confined:
# ps axZ  grep -v unconfined_t grep -v kernel_t grep -v initrc_t
LABEL PID TTY STAT TIME COMMAND
system_u:system_r:init_t 1 ? Ss 0:02 init [2]
system_u:system_r:udev_t 1999 ? S.s 0:01 udevd --daemon
system_u:system_r:syslogd_t 3306 ? Ss 0:00 /sbin/syslogd
system_u:system_r:klogd_t 3312 ? Ss 0:00 /sbin/klogd -x
system_u:system_r:apmd_t 3372 ? Ss 0:00 /usr/sbin/acpid -c /etc
system_u:system_r:gpm_t 3376 ? Ss 0:00 /usr/sbin/gpm -m /dev/i
system_u:system_r:crond_t 3402 ? Ss 0:00 /usr/sbin/cron
system_u:system_r:local_login_t 3423 tty1 Ss 0:00 /bin/login --
system_u:system_r:local_login_t 3424 tty2 Ss 0:00 /bin/login --
system_u:system_r:getty_t 3425 tty3 Ss+ 0:00 /sbin/getty 38400 tty3
system_u:system_r:getty_t 3426 tty4 Ss+ 0:00 /sbin/getty 38400 tty4
system_u:system_r:getty_t 3429 tty5 Ss+ 0:00 /sbin/getty 38400 tty5
system_u:system_r:getty_t 3430 tty6 Ss+ 0:00 /sbin/getty 38400 tty6
system_u:system_r:dhcpc_t 3672 ? S.s 0:00 dhclient3 -pf /var/run/
The initial install of policy inserts modules to match installed software, if you install new software then you need to add new modules with the semodule command:

# semodule -i /usr/share/selinux/refpolicy-targeted/apache.pp
security: 3 users, 7 roles, 824 types, 67 bools
security: 58 classes, 11813 rules
audit(1165532434.664:21): policy loaded auid=4294967295
# semodule -i /usr/share/selinux/refpolicy-targeted/bind.pp
security: 3 users, 7 roles, 836 types, 68 bools
security: 58 classes, 12240 rules
audit(1165532467.874:22): policy loaded auid=4294967295

Note that the security and audit messages come from the kernel via printk, it is displayed on console login but you need to view the system log if logged in via ssh or running an xterm. Now you have to relabel the files that are related to the new policy:

# restorecon -R -v /etc /usr/sbin /var/run /var/log
restorecon reset /etc/bind context system_u:object_r:etc_t->system_u:object_r:named_zone_t
restorecon reset /etc/bind/named.conf context system_u:object_r:etc_t->system_u:object_r:named_conf_t
[...]
restorecon reset /etc/apache2 context system_u:object_r:etc_t->system_u:object_r:httpd_config_t
restorecon reset /etc/apache2/httpd.conf context system_u:object_r:etc_runtime_t->system_u:object_r:httpd_config_t
[...]
restorecon reset /usr/sbin/named context system_u:object_r:sbin_t->system_u:object_r:named_exec_t
restorecon reset /usr/sbin/apache2 context system_u:object_r:sbin_t->system_u:object_r:httpd_exec_t
restorecon reset /usr/sbin/rndc context system_u:object_r:sbin_t->system_u:object_r:ndc_exec_t
restorecon reset /usr/sbin/named-checkconf context system_u:object_r:sbin_t->system_u:object_r:named_checkconf_exec_t
[...]
restorecon reset /var/run/bind context system_u:object_r:var_run_t->system_u:object_r:named_var_run_t
restorecon reset /var/run/bind/run context system_u:object_r:var_run_t->system_u:object_r:named_var_run_t
restorecon reset /var/run/bind/run/named.pid context system_u:object_r:initrc_var_run_t->system_u:object_r:named_var_run_t
restorecon reset /var/run/motd context system_u:object_r:initrc_var_run_t->system_u:object_r:var_run_t
restorecon reset /var/run/apache2 context system_u:object_r:var_run_t->system_u:object_r:httpd_var_run_t
restorecon reset /var/run/apache2/cgisock.3558 context system_u:object_r:var_run_t->system_u:object_r:httpd_var_run_t
restorecon reset /var/run/apache2.pid context system_u:object_r:initrc_var_run_t->system_u:object_r:httpd_var_run_t
restorecon reset /var/log/apache2 context system_u:object_r:var_log_t->system_u:object_r:httpd_log_t
restorecon reset /var/log/apache2/error.log context system_u:object_r:var_log_t->system_u:object_r:httpd_log_t
restorecon reset /var/log/apache2/access.log context system_u:object_r:var_log_t->system_u:object_r:httpd_log_t

The -v option to restorecon causes it to give verbose output concerning it's operations. Often you won't do it in real use, but it's good to illustrate the use.

Now you have to restart the daemons:

# killall -9 apache2
# /etc/init.d/apache2 start
Starting web server (apache2)....
# /etc/init.d/bind9 restart
Stopping domain name service...: bind.
Starting domain name service...: bind.

Apache and BIND now run in confined domains, see the following ps output:

system_u:system_r:httpd_t   3833 ?     Ss     0:00 /usr/sbin/apache2 -k start
system_u:system_r:httpd_t 3834 ? S 0:00 /usr/sbin/apache2 -k start
system_u:system_r:httpd_t 3839 ? Sl 0:00 /usr/sbin/apache2 -k start
system_u:system_r:httpd_t 3841 ? Sl 0:00 /usr/sbin/apache2 -k start
system_u:system_r:named_t 3917 ? Ssl 0:00 /usr/sbin/named -u bind

It's not particularly difficult. I covered the actual install of SE Linux in about 1.5 minutes. I had considered just ending my talk there on a note of "it's so easy I don't need 5 minutes to talk about it" but decided that it was best to cover something that you need to do once it's installed.

If you want to know more about SE Linux then ask on the mailing list (see http://www.nsa.gov/selinux for subscription details), or ask on #selinux on freenode.

Jeff Bailey

I can't really guess at how many social networking sites I've signed up to over the years. I was thinking about this a bit as I noticed some more LinkedIn mail. It's a site that seemed interesting, until I realised that I don't need to pay another company for the privilege of asking friends to introduce me to their friends. But I was thinking through the bits of electronic interaction that I have, and thinking back to my days at Hollinger where we actively spent time thinking about what content we could provide that would keep the user moving from one of our sites to another of our sites, always looking at our ads.

With this lens on, I was thinking about where I would take Google next if I were in a similar position there. I think that Google's future probably relies primarily on their crappiest product: Orkut. What places like MySpace do well is provide what I think of as the old CompuServe experience. You go, and in one spot you have different forums, chat, and downloads.

But what if Google were to make Orkut not suck? They've already started integrating Talk into it (although it still doesn't work with Apps for Your Domain), and I can only imagine that we'll soon see your account only a short while from where your Orkut page shows your public blog entries, as well as allows you to post to your own blog, or a community one. The relationships there are rich enough with Friends Groups and a gradient of friendship that the community FOAF bits could be represented easily. Picassa and their page builder things would allow people to setup myspace-like places for themselves without ever leaving the familiar framework of Orkut. Business could use all of these tools for internal corporate things, marking certain items as publish while the integrated checkout functionality let them to business quickly and efficiently.

But what other interactions then? Could we book a doctor's appointment by looking at their Calendar through their corporate page? Easily book venues for the band with the same? Use the presence notification in Talk figure out if there's someone I can deal with right now to finalise the plans for the upcoming gig?

And the cool part is that from what Google's done so far, they'll cheerfully let you integrate your own product into theirs through some sort of open standard.

Sam Hocevar: Oh, the nullity

Erich Schubert writes:
[A rather erroneous rebuttal of Anderson s new tool]
Please. If you are going to use maths to refute a paper, at least read the paper, not the BBC news article. In fact, dividing by zero can be useful in calculus. What the guy did is design a consistent system (I trust him at least on this) that resembles the IEEE floating point algebra, except that in his system = while NaN NaN. Such a distinction makes it possible to write and solve equations where may be involved. Of course the final result may yield but the important part is that it is consistent, proven, and remains valid whatever the input values. What should be really questioned is:

Alexander Sack: noteworthy things from the firefox & linux front

mconnor (Mozilla Corp) and caillon (Red Hat) give hope that mozillas attitude finally starts to change (in the right direction): That’s all good news, but even better … “Red Hat and Novell are both going to commit some effort into maintaining the Firefox 1.5.0.x line past the current EOL date this spring” ... thank $GOD for that ;-)

Erich Schubert: British now divide by zero?

British now divide by zero. Either this "Dr James Anderson, from the University of Reading's computer science department" is a crappy computer scientist (not to speak of his mathematical skills), or this is a case of really bad journalism. Apart from having some facts wrong (infinity and -infinity aren't numbers, they're symbols outside of the numbers), he basically defines "0/0 = Nullity". Well, some of us might prefer the name "NaN" for this. "Not a Number". In floating point calculations, 0/0 may (if you've disabled exceptions) return NaN. So it is nothing new. And it's not particularly useful either, because all it solves is not having to raise an exception, but being able to continue your calculations (which will continue to return NaN) and handle the error at the end. With modern languages designed around exception handling, this of course is rarely ever used anymore. Some simple calculations you might find convincing: 2 * Nullity = 2 * (0/0) = (2*0)/0 = 0/0 = Nullity Nullity + 1 = (0/0) + (1/1) = (0*1 + 1*0)/(0*1) = 0/0 = Nullity Nullity / Nullity = (0/0) / (0/0) = (0/0) * (0/0) = (0*0)/(0*0) = (0/0) = Nullity So if you ever have Nullity anywhere in your equation the whole equation equals nullity. There is no way to remove Nullity from your results, since even Nullity/Nullity is Nullity. So you could just call it "I divided by zero, so the result is invalid". Thats probably not as pretty as "Nullity", but as useful. Some simple calculation, why you must not be allowed to divide by zero (independently from any nullity or whatever):
1*0 = 0 = 2*0     (This equation is right, isn't it?)
1 = 2             (I divided by 0 on both sides, removing the *0 factor)
This works for any number, not only for 1 or 2. So: if you divide by zero, all your numbers are equal (if you keep standard calculus rules such as associativity, distributivity etc. used in above equations). If that is okay for you, then you can divide by zero. I do prefer having 1 life to 0 life. And if 1 = 1000000, can you give me $1000000, I'll give you $1 back tomorrow... But: Maybe it's just a bad piece of journalism. He's a computer science guy. Maybe he knows about NaN. Maybe he's just trying to teach kids to use NaN when calculating, instead of teaching them to never divide by zero. There might be didactic benefits from this approach. The 1200 year old problem (Pythagoras, cited in the article lived 2500 years ago, I have no idea how they made up this number) IS easy to solve, if the result is called "invalid" instead of just having no valid result... That won't make your airplane land better, if it notices it's current height is Nullity... and what if his heart pacemaker obtains a result of "nullity", what is it supposed to do (as opposed to noticing it miscalculated?) [Update: he has published papers on this, too. Unbelievable... So above theory that it maybe is good for educational purposes is incorrect. Anyway, journalists shouldn't have reported on this without talking to some serious mathematicians...] [Update: Zoy, thats why I wrote "if you keep standard calculus rules such as associativity, distributivity, etc. - and I find these exceptionally useful. The last example is not using his rules, but standard math, but treats zero like all other numbers, to show that a canonical extension will just not give useful results. My whole point is NOT that you can't define 0/0=Nullity, but that it's not compatible with the standard calculus we're used to and relying on.]

7 December 2006

John Goerzen: Saving Power with CPU Frequency Scaling

Yesterday I wrote about the climate crisis. Today, let's start doing something about it.

Electricity, especially in the United States and China, turns out to be a pretty dirty energy source. Most of our electricity is generated using coal, which despite promises of "clean coal" to come, burns dirty. Not only does it contribute to global warming, but it also has been shown to have an adverse impact on health.

So let's start simple: reduce the amount of electricity our computers consume. Even for an individual person, this can add up to quite a bit of energy (and money) savings in a year. When you think about multiplying this over companies, server rooms, etc., it adds up fast. This works on desktops, servers, laptops, whatever.

The easiest way to save power is with CPU frequency scaling. This is a technology that lets you adjust how fast a running CPU runs, while it's running. When CPUs run at slower speeds, they consume less power. Most CPUs are set to their maximum speed all the time, even when the system isn't using them. Linux has support for keeping the CPU at maximum speed unless it is idle. By turning on this feature, we can save power at virtually no cost to performance. The Linux feature to handle CPU frequency scaling is called cpufreq.

Set up modules

Let's start by checking to see whether cpufreq support is already enabled in your kernel. These commands will need to be run as root.

# cd /sys/devices/system/cpu/cpu0
# ls -l


If you see an entry called cpufreq, you are good and can skip to the governor selection below.

If not, you'll need to load cpufreq support into your kernel. Let's get a list of available drivers:

# ls /lib/modules/ uname -r /kernel/arch/*/kernel/cpu/cpufreq

Now it's guess time. It doesn't really hurt if you guess wrong; you'll just get a harmless error message. One hint, though: try acpi-cpufreq last; it's the option of last resort.

On my system, I see:

acpi-cpufreq.ko     longrun.ko      powernow-k8.ko         speedstep-smi.ko
cpufreq-nforce2.ko  p4-clockmod.ko  speedstep-centrino.ko
gx-suspmod.ko       powernow-k6.ko  speedstep-ich.ko
longhaul.ko         powernow-k7.ko  speedstep-lib.ko


For each guess, you'll run modprobe with the driver name. I have an Athlon64, which is a K8 machine, so I run:

#modprobe powernow-k8

Note that you leave off the ".ko" bit. If you don't get any error message, it worked.

Once you find a working module, edit /etc/modules and add the module name there (again without the ".ko") so it will be loaded for you on boot.

Governor Selection

Next, we need to load the driver that tells the kernel what governor to use. The governor is the thing that monitors the system and adjusts the speed accordingly.

I'm going to suggest the ondemand governor. This governor keeps the system's speed at maximum unless it is pretty sure that the system is idle. So this will be the one that will let you save power with the least performance impact.

Let's load the module now:

# modprobe cpufreq_ondemand

You should also edit /etc/modules and add a line that says simply cpufreq_ondemand to the end of the file so that the ondemand governor loads at next boot.

Turning It On

Now, back under /sys/devices/system/cpu/cpu0, you should see a cpufreq directory. cd into it.

To turn on the ondemand governor, run this:

# echo echo ondemand > scaling_governor

That's it, your governor is enabled. You can see what it's doing like this:

# cat cpuinfo_min_freq
800000
# cat cpuinfo_max_freq
2200000
# cat cpuinfo_cur_freq
800000


That shows that my CPU can go as low as 800MHz, as high as 2.2GHz, and that at the present moment, it's running at 800MHz presently.

Now, check your scaling governor settings:

# cat scaling_min_freq
800000
# cat scaling_max_freq
800000


This is showing that the system is constraining the governor to only ever operate on an 800MHz to 800MHz range. That's not what I want; I want it to scale over the entire range of the CPU. Since my cpuinfo_max_freq was 2200000, I want to write that out to scaling_max_freq as well:

echo 2200000 > scaling_max_freq

Making This The Default

The last step is to make this happen on each boot. Open up your /etc/sysfs.conf file. If you don't have one, you will want to run a command such as apt-get install sysfsutils (or the appropriate one for your distribution).

Add a line like this:

devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand
devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 2200000


Remember to replace the 2200000 with your own cpu_max_freq value.

IMPORTANT NOTE: If you have a dual-core CPU, or more than one CPU, you'll need to add a line for each CPU. For instance:

devices/system/cpu/cpu1/cpufreq/scaling_governor = ondemand
devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 2200000


You can see what all CPU devices you have with ls /sys/devices/system/cpu.

Now, save this file, and you'll have CPU frequency scaling saving you money, and helping the environment, every time you boot. And with the ondemand governor, chances are you'll never notice any performance loss.

This article showed you how to save power using CPU frequency scaling on Linux. I have no idea if it's possible to do the same on Windows, Mac, or the various BSDs, but it would be great if someone would leave comments with links to resources for doing that if so.

Updated: added scaling_max_freq info

Benjamin Mako Hill: Dev House Boston

I am excited to see that a number of local hackers have organized the first Dev House Boston for this coming Saturday. There are many projects I'm interested in but I might try to take the opportunity to work on my iRony Rockbox Installer because it's likely that there will be many people there with different types of iPods. If you're going, I look forward to seeing you there, although I might not show up until a little later in the afternoon.

6 December 2006

Joachim Breitner: No more Obroni Computer Club

Yesterday I was planning and prepared to hold the last session of the Obroni Computer Club that I ran at the SOS Hermann Gmeiner College. Very disappointingly, nobody showed up. Well, not entirely true: The computer lab was crammed full, as ususal around that time, but nobody was there for the club.It might have been because there were no club sessions the last two weeks because of exams, and the students forgot that I told them that there will be another session after that in a mail back then. It might have been because the IG2 class (10th grade), which presumedly make up the largest part of the club, had a meeting at that time. Or it might just be that I did not mange to awaken the student s interest and nobody cared.I have put all material for the club, together with various other documents from my SOSHGIC time, on the Ghana contents section of my now (mostly) bi-lingual and very slightly redesigned homepage.

Gustavo Franco: FLOSS in Brazil turns out to be a joke

Well, forget anything you've heard about how well developed is Brazil in terms of FLOSS. The gov't loves FLOSS, the NGOs and even a lot of companies too, right? Wrong!

With just a few exceptions (and i think i work in one of them and i'm glad), the FLOSS hype in Brazil is a marketing thing. Even the most proprietary software defender needs to agree that FLOSS and every aspect of it, has appeal where there's not enough money or where the money isn't being distributed in a fair manner.

The point is that a lot of gov't institutions, NGOs and companies are using the FLOSS appeal and its arguments with the masses to do what a brazilian does best (after playing soccer): Corruption. The recipe is simple: Tell as much people as possible that you're developing the FLOSS 'foo' and ask for funding - even companies do that here and when they don't, they join a gov't institution. You know, when you haven't compromises with results and the law and have contacts it isn't that hard get some money here and there for your 'foo' project.

Many times nobody out of the project office (when there's a real one) ever see the source code of that and in a lot of times it will be delayed forever or it will suck - but when it sucks they blame the 'community' (they don't know the difference between user and developer community). Wait, but where's all that money? The money is in the same places where part of the 3 trillions of dollars (no, i'm not wrong) that were used by less developed countries during the past years from the north-american and european banks. Go figure...

My hint for these FLOSS advocates in Brazil and those with some money for funding projects here: Hire somebody that have a vague idea what a user community, developer community, software licenses and source code are in the next time.

Adrian von Bidder: We Know Who Takes the Blame!

Sam Hocevar is wrong when he says:
Suppose for instance that you stopped contributing to Debian months ago [...] You are obviously not only directly responsible for Etch being late due to your lack of involvement, ...
“You” are not responsible for Etch being late. The Debian project has picked an official scapegoat for Etch being late and for everything else in Debian that just doesn't work how it should. So everybody can now relax: no Debian developer is personally responsible for anything. It's really convenient if some people group together and do something that other people don't like and then give it a name. You can blame the new thing for everything you don't want to do or don't like, without actually having to name the people behind it or thinking about constructive ways to improve matters. It's always “them”. Yes, I'm pissed by the attitude of some very vocal people. Dunc Tank is not an official Debian project, so I still fail to see how it's different from Canonical, Progeny, Credativ etc. hiring people. Dunc Tank even pays people to work directly on Debian, it doesn't pay them to do Debian-related work that might eventually benefit Debian, too. As a private employer, Dunc Tank is free to pick who to employ and who not to employ. Yes, Dunc Tank and some Debian project roles do overlap, but stuff like this can't be avoided, especially in time consuming volunteer projects doing stuff that can also be done for money. Debian is not a charity, but a project competing directly with commercial products, so its members shouldn't be surprised when the question of money comes up every now and then. (And just to make it clear: I'm not arguing against Sam, who blogged about a totally different topic. The part I quoted just got me started.)

Daniel Burrows: Things I miss about being an Undergrad.

So, it's been about 4.5 years since I got my ScB, 1.5 years since I got my MSc, and 1 year since I started working at Satori. Seems like an ideal time to look back on the halcyon simplicity of college, right? Here are a few things that I really wish I had appreciated more in 2000.

(1) Getting enough sleep.

I was just about the only well-rested student I knew in college. When other people (who stayed up past midnight regularly) would complain that they seemed to spend lots of time working withotu getting anything done, I occasionally suggested that they try getting more sleep. Hah.

So, in grad school I developed some bad, bad habits -- staying up past midnight, sleeping in erratically, etc. (I like to blame my girlfriend, who refused to get up before 9-10am when she was a student ;-) ) I started to sort of get a handle on that, and then I got a full-time job.

The problem here is this: you know how they say that to figure out how much sleep you need, you should sleep until you wake up naturally and feel rested? If I go to bed at 9PM, I wake up naturally at 7-8AM or so. That's -- count it -- 10-11 HOURS OF SLEEP. As a student, I had the luxury of sleeping 11 hours straight (since I had no social life). As a working drone with an hour-plus commute, that would leave me with 3-4 hours to fit in all my non-work activities (like, say, eating; personal hygeine; etc). The fact that I tend to get heartburn if I lie down within 2-3 hours of a meal, and that I usually have to cook my meal before I can eat it ... well, this just isn't gonna work.

So, to get enough time to actually live a bit outside work, I end up curtailing my sleep schedule to "only" about 7-8 hours. I know that's enough for some people. I wish I was one of them. The result for me, though, is that I go through most days feeling dazed, tired, sleepy, and with an on-and-off headache. I can generally hold it together well enough to get through the work day (although yesterday I collapsed on the couch halfway through), but once I get home I lack the energy to do anything but feed myself and idly browse the Web. Trying to do anything intellectually challenging (hence interesting), like say learn Cantonese or category theory, is right out. (I can just about say I want to eat, and I got as far as power categories before getting horribly tired and confused)


(2) Breaks.

One great feature of college is that you get time off of it. In addition to some random vacations during the semester, you usually break for several whole weeks between semesters, and then break again in the summer. Even if you have a summer job, this is a great way to recharge the batteries.

In the working world, I get exactly 1 day off per month -- if I want a decent-sized break, I have to go several months with no days off at all (except the paid holiday day every other month or so that the company gives us in its beneficience).


(3) The cafeteria.

College students like to make fun of cafeteria food. They don't know how good they have it. You get three hot meals a day, plus you don't have to do ANY cooking or cleaning up? Sign me up!

When I get home at 6:30 PM and I'm starving, the first thing I have to do is get out the raw ingredients for my dinner and toss them in a pot, then gnaw on some cheese or something to take away the hunger pains until they're done. By 7:30, I might have some food in me, hopefully. I'm thinking about switching to a frozen-food diet (ew), although that doesn't help clean the dishes.


(4) There's no commute in college.

To get to work, I have to walk 10 minutes, ride the bus for about 30-40 minutes, then walk another 20 minutes or so. In the evening I have to do the reverse. That's 2-3 hours of my life sucked up by just getting to work and back. If my brain wasn't too fried to study any of the interesting books I've optimistically purchased (see (1) and (2)), it might be bearable...but when I just want to get some food and rest, it really sucks. And it sucks especially when I have no good alternative (living in Seattle is EXPENSIVE, and it would give Kate an even worse commute in the other direction).

(5) Having the time and energy to study topics or write software just for the heck of it.

This really incorporates all of the above. It seems like all these factors conspire to suck my time up, then suck up the energy I have in the little time left to me. Meh. For instance, right now (at 9PM) I am getting very sleepy and should get to bed, yet I've done nothing since I finished eating (at 7:30PM) but skim Lambda the Ultimate and a few linked articles sites (slowly) and write this blog post. Blah.




Lest I give the impression that I completely hate work, let me add that there is one very, very important thing that I enjoy about it relative to my student, free-software-hacking days.

(1) NOT BEING FLAT BROKE.

I believe this one is self-explanatory; and so far it still makes up for the rest (I wonder how long this will continue). It's too bad I can't get paid to just sit around doing whatever I feel like and then giving it away, but then it's also too bad I can't wave a magic wand to get a pony and a few dozen acres to keep it on.

John Goerzen: Insurance

I was visiting with our homeowners insurance company the other day (very good folks). Because we weren't living in our house during renovation, we had to get a more expensive type of policy. The agent that sold it do is is no longer with the company, so the new person handling our account asked me, "Why did he want you to get this policy?"

"Well, he said it was because we weren't living there." Then I suddenly remembered the rest of what he said, and couldn't help cracking up. "Plus, he said that if something like a fire happened, people might not notice."

What can I say. Psychic insurance salesman.

On that note, I was having a discussion with someone about large windows on a house. That person was saying that "everyone" always puts their large windows on the front (or back of their house, I forget which) so that potential burglers are easier to spot. He was concerned about where we were putting windows on our house.

This had never occured to me.

But I pointed out that our yard was on fire and nobody noticed for hours. What difference would it make where our windows are?

"Ah, good point," he said.

On that note, you ought to check out rush hour in the country. Truly this is a lot of traffic for roads around here.

5 December 2006

Axel Beckert: Gaia resurrection

On Thursday, 24th of November 2006 evening (about one and a half week ago) we got an anonymous Symlink submission about gaia 0.1.0, a simple, but free (GPL‘ed) client for Google Earth, solely based on reverse engineering. Liked the idea of a really free client for such a popular service, so I posted it as Symlink article (German) quite shortly after noticing the submisson. Since it’s under GPL and uses only libraries already being in Debian (OpenGL, SCons, cURL, SDL, libjpeg, libpng, libgps and Doxygen), I really would like to see it in Debian. But since I have never programmed with most of them, I did not try to compile gaia but instead took the easy way for myself and filed an RFP bug for it in Debian. The next day in office, Gürkan, a coworker of mine and currently in NM, told me that he tries to package gaia for Debian and that it doesn’t compile on Sarge. So I gave him access to my Sid chroot and asked him if he has read about the RFP at debian-devel or debian-wnpp. To my surprise he answered that he didn’t read about it on Debian lists at all but on Symlink and therefore didn’t knew about the RFP at all. So I pointed him to the RFP just to notice, that it wasn’t an RFP anymore but already an ITP. Strangely I didn’t get any mail notice about this change although the retitling happend only shortly after the initial RFP… Of couse, Gürkan wasn’t very happy about this, since he planned to maintain gaia himself, but at least he provided his working proof of concept package for Sid to Jordà Polo who intends to maintain an official Debian package of gaia. We then also met Jordà on the #debian-games channel in OFTC. He told us, that he’ll check some more licensing issues before uploading a package of gaia. Well, since I had a working gaia package installed in my Sid chroot, you can probably imagine what I did half the evening? Right: Surfing around the earth with gaia and visiting my favourite places on earth. While virtually visiting places here and there, I listened to Venty’s first podcasts and seem to have downloaded 444 MB of Google Earth images (at least according to du -sh ~/.gaia). Goddamned addiction! ;-) During the night from Friday to Saturday, I got a mail that the RFP/ITP has been closed and that Jordà was right with his suspiciousness: Google has sent a cease and desist letter to the gaia developers and they removed the downloads from their site. (So how was that Google motto? “Don’t be evil”? Well, good joke! Yet again the monopolist clearly shows that it doesn’t really mean what it says.) Since the gaia developers were allowed to post the mail from Google on their website, you can read parts of it there. I really wonder what was written in the left out parts of the mails. Job offers? ;-) But it’s interesting to see that until one week ago gaia 0.1.0 already made it into the FreeBSD ports as well as into the ArchLinux User Repository. Both noticed, too, that gaia version 0.1.0 has been withdrawn by the authors. Today in the morning Gürkan noticed that there’s a new version (0.1.1) of gaia at SourceForge using free NASA WorldWind / OnEarth imagery. Although the imagery is far away from the detailedness of the Google Earth imagery, this has one big advantage: There wasn’t really a X port for the windows-only client from NASA until now. (No real wonder, since they use proprietary and operating specific libraries such as .NET and DirectX…) And now we have gaia, a free client for free imagery on free operating systems. That made my day! I hope that this will revive the packaging of gaia, at least Gürkan has already built a new proof of concept package of 0.1.1 for Sid. (Today in the afternoon, they released 0.1.2.) And if everything goes fine and Dunc-Bank manages to delay Etch until gaia has been 10 days in Unstable without bugs, we’ll have it even in Etch. ;-)

John Goerzen: Review of VPSLink

Back in June, I wrote about my switch to VPSLink for my virtual private server (VPS) host.

Now it's 6 months later, my initial contract is up, and it's time to consider whether to renew it.

Overall, VPSLink has worked out reasonably well. I have their Link-4 plan, which provides 512MB RAM, 20GB of disk storage, and 500GB of bandwidth for $40/mo (or down to $33/mo if you pay for 12 months in advance).

Reliability and Uptime

VPSLink has been reasonably reliable. I wouldn't say that they have been exceptionally reliable, though.

Some outages:



They have generally responded to support requests in a reasonable amount of time, and support has been approximately as helpful as I'd expect.

Overall, there've been a few issues but, aside from that 8-hour outage in July, nothing especially remarkable.

Automated Tools

VPSLink has a "control panel" where you can reboot, start, or stop your virtual machine. You can see how much bandwidth you've used in a month, your IPs, and billing information.

You can also create support requests and view the status of support requests there. You can also view all correspondence on a given ticket, and add new correspondence to it -- a nice touch that's useful if your email is down because your VPS is down.

The reboot/start/stop facility didn't work during one outage, though.

Resources

The 20GB of disk space is nice to have, though I never used it all. No complaints there.

But the memory setup is rather strange. This may be because VPSLink is using OpenVZ instead of its more popular (and featureful) commercial counterpart Virtuozzo, or something such as Xen.

Those that have used OpenVZ/Virtuozzo know there is a /proc/user_beancounters file in the virtual environment that reports on the limits of resources allocated to your virtual server. VZ lets the server admins regulate the amount of resident RAM, swap, inodes, pending IP connections, amount of virtual RAM, etc, etc. About 3 dozen items in total.

Unlike some companies like JohnCompanies, VPSLink was not willing to make any adjustments to this file for me. For instance, my mail server may need more simultaneous open files than they have by default, but they wouldn't work with me to make reasonable adjustments.

But the larger problem was with regard to RAM. This was particularly annoying. VPSLink does not permit any access to swap, so the 512MB is what you get. But tools like top show the entire memory allocation on the host, and are mostly useless in tracking down your own usage.

You can look at the privvmpages entry in /proc/user_beancounters to get an idea of your current usage, but that's it. There is a script on their wiki that will turn this into a more useful number, but again, it's not the most helpful.

The minute you try to allocate anything past 512MB, your processes start getting killed. According to /proc/user_beancounters, even though my system normally hovers around 70% of that 512MB allocated, I've had 290,567 instances where a process has been refused its request to allocate memory since the last reboot. Such instances usually cause a process to crash.

Other Virtuozzo companies like JohnCompanies will give you "burstable RAM", so if others aren't using their full RAM allocation at the moment that your machine goes over your regular limit, you can go over it to a certain extent. That was very effective at preventing crashes during times of higher than usual memory usage, and I never had trouble with this at JohnCompanies.

I've had a lot of trouble with VPSLink because of these hard, no-exceptions limits. Getting hit by the Google bot at the same time as the MSN bot could raise memory usage enough that processes would start getting killed. Depending on which process it is, it could take down cron, apache, the mail server, whatever. And there is no log of which processes die because of this.

In normal circumstances, this wouldn't pose even a noticeable impact to a server; inactive bits could be swapped out, etc.

I am also suspicious of exactly how OpenVZ calculates memory usage. Since moving to a physical Linux box, my memory usage seems to be much lower than the privvmpages would seem to indicate, even though it's running the exact same code.

So I had some outages on my server that were caused by OpenVZ memory limits, which didn't get listed in the overall outages above.

This problem is the #1 reason I'm leaving VPSLink.

Performance

Overall performance has been acceptable. The CPU speed appears to be reasonable and about as expected.

The disk performance has been more problematic, however. It tends to be rather slow. There have been times when I can type "ls" in a directory with about 10 files and it takes 5-10 seconds to respond. And I wasn't even using "-l".

Now that sort of thing is certainly the exception. But it makes databases -- and websites that rely on databases -- very slow.

The performance measurements over at RealMetrics also show VPSLink as being at the bottom of the pack for disk performance.

Overall

VPSLink is a reasonable value, and if monthly cost is important to you, probably a good choice. Don't expect it to be spotless, though. I would call the overall experience pretty average. Nothing too spectacular in either direction in any respect.

Next.

Previous.