Search Results: "xam"

5 June 2008

Russell Coker: SE Linux Support in GPG

In May 2002 I had an idea for securing access to GNUPG [1]. What I did was to write SE Linux policy to only permit the gpg program to access the secret key (and other files in ~/.gnupg). This meant that the most trivial ways of stealing the secret key would be prevented. However an attacker could still use gpg to encrypt it’s secret key and write the data to some place that is accessible, for example the command “gpg -c --output /tmp/foo.gpg ~/.gnupg/secring.gpg“. So what we needed was for gpg to either refuse to encrypt such files, or to spawn a child process for accessing such files (which could be granted different access to the filesystem). I filed the Debian bug report 146345 [2] requesting this feature. In March upstream added this feature, the Debian package is currently not built with --enable-selinux-support so this feature isn’t enabled yet, but hopefully it will be soon. Incidentally the feature as currently implemented is not really SE Linux specific, it seems to me that there are many potential situations where it could be useful without SE Linux. For example if you were using one of the path-name based MAC systems (which I dislike - see what my friend Joshua Brindle wrote about them for an explanation [3]) then you could gain some benefits from this. A situation where there is even smaller potential for benefit is in the case of an automated system which runs gpg which could allow an attacker to pass bogus commands to it. When exploiting a shell script it might be easier to specify the wrong file to encrypt than to perform more sophisticated attacks. When the feature in question is enabled the command “gpg -c --output /tmp/foo.gpg ~/.gnupg/secring.gpg” will abort with the following error:
gpg: can’t open /root/.gnupg/secring.gpg’: Operation not permitted
gpg: symmetric encryption of /root/.gnupg/secring.gpg’ failed: file open error Of course the command “gpg --export-secret-keys” will abort with the following error:
gpg: exporting secret keys not allowed
gpg: WARNING: nothing exported Now we need to determine the correct way of exporting secret keys and modifying the GPG configuration. It might be best to allow exporting the secret keys when not running SE Linux (or other supported MAC systems), or when running in permissive mode (as in those situations merely copying the files will work). Although we could have an option in gpg.conf for this for the case where we want to prevent shell-script quoting hacks. For editing the gpg.conf file and exporting the secret keys we could have a program similar in concept to crontab(1) which has PAM support to determine when it should perform it’s actions. Also it seems to me that crontab(1) could do with PAM support (I’ve filed Debian bug report 484743 [4] requesting this). Finally one thing that should be noted is that the targeted policy for SE Linux does not restrict GPG (which runs in the unconfined_t domain). Thus most people who use SE Linux at the moment aren’t getting any benefits from such things. This will change eventually.

William Pitcock: Maybe I m wrong, but Python s OO seems to be broken

So, I’ve been trying to figure out inheritance in Python. In Lisp (and even C++ and Java), derived objects will have the cons of their parent called. For example, look at the following C++ snippet:
#include <iostream>
using namespace std;
class B  
public:
	B()  
		cout << __PRETTY_FUNCTION__ << endl;
	 
 ;
class A : public B  
public:
	A()  
		cout << __PRETTY_FUNCTION__ << endl;
	 
 ;
int
main(int argc, const char **argv)
 
	A *foo = new A();
	delete foo;
	return 0;
 
This outputs the following:
B::B()
A::A()
As you can tell, the parent object’s constructor is called and then your derived object’s constructor is called. But, in this Python code, the parent object’s constructor is not:
class B:
    def __init__(self):
        print "B.__init__(self)"
class A(B):
    def __init__(self):
        print "A.__init__(self)"
A()
This outputs:
A.__init__(self)
Instead you have to do:
class B:
    def __init__(self):
        print "B.__init__(self)"
class A(B):
    def __init__(self):
	B.__init__(self)
        print "A.__init__(self)"
A()
To get the right output:
B.__init__(self)
A.__init__(self)
This seems broken to me. But maybe I’m not understanding something. The way I got bit by this was by trying to design a new replacement to debian/rules which used subclassing. (More on this later.) Oh, and I intend to try to keep my blog updated more often.

Marc 'Zugschlus' Haber: Serial Console Server for the Poor II

This is the second installment of my article about the Serial Console Server for the Poor. First installment here. The last part of the article having covered the hardware and the udev part creating the device nodes, this part addresses the part of the software that connects the user to the device node. The idea of the software side is to allow users access only to certain serial ports without giving out a shell account on the server itself. Communication between user and the console server should be encrypted (which certainly means ssh), and users should be able to authenticate both with a key and with a password. Serial parameters (baud rate, parity, stop bits etc) should be configured on the console server to keep this possible error source away from the users. For years, I have been thinking about using UUCP’s cu to access the serial port. This time, it’s not going to be used because it offers a shell escape which cannot be turned off. That would give a user shell to the users indirectly, which is not what I want. Minicom seems still to be the most-used application to access a serial port. I have never understood the sense of using a terminal emulator inside a terminal emulator, especially if one has to break the terminal emulator’s habit of trying to initialize a non-existent modem. So I settled on the application that I usually use to access a serial port: ser2net. This is a Linux implementation of Cisco’s “reverse telnet” feature which “connects” a TCP port to a serial port with a given set of parameters. For example,
4016:telnet:600:/dev/USBserial6:38400 8DATABITS NONE 1STOPBIT banner
connects TCP port 4016 with /dev/USBserial6 with an 38400 8n1 parameter set. If you telnet to localhost 4016, you’ll find yourself talking to the device connected to the appropriate serial port. This moves the security risk to the telnet client, which - unfortunately - offers a shell escape function from the telnet command line reachable with the escape character. The only way to remove this is to use the -E command line option, which turns off the escape function completely. This unfortunately excludes the user from cleanly quitting the telnet session, so the only way to get out of a telnet -E is to have the remote side close the serial port (which ain’t happening on a serial console) or to kill the telnet process, for example by closing the carrying ssh session. That’s a turn-off, but one that one can live with. Now, the only challenge left is to have the appropriate telnet client started automatically for the user. I decided on connecting this to the account being connected to, so that ssh USBserial4@hostname will automatically do the right thing. Since password authentication needs to work (optionally), this precludes the use of the command modifier in an authorized_keys file. Another possibility to force a command being executed on login is to set it as the users’ login shell in /etc/passwd. One drawback: The command must not have any parameters, so one needs to pass needed parameters to the program some other way. Additionally, the program must be listed in /etc/shells or it will be silently ignored. My /etc/passwd entries look like
USBserial2:x:1002:1002:USBserial2,,,:/home/USBserial2:/usr/local/sbin/serialconnect-shell
with /usr/local/sbin/serialconnect-shell looking like
#!/bin/bash
set -eu
case “$(id --user --name)” in
  USBserial1) PORT=“2011”;; 
  USBserial2) PORT=“2012”;;
  USBserial3) PORT=“6013”;;
  USBserial4) PORT=“6014”;;
  USBserial5) PORT=“2015”;;
  USBserial6) PORT=“2016”;;
  USBserial7) PORT=“6017”;;
  *) echo “called from unknown account, terminating.”; exit 1;;
esac
telnet -E localhost $PORT
Just for reference, here are the appropriate entries in /etc/ser2net.conf:
2011:telnet:600:/dev/USBserial1:9600 8DATABITS NONE 1STOPBIT banner
2012:telnet:600:/dev/USBserial2:9600 8DATABITS NONE 1STOPBIT banner
6013:telnet:600:/dev/USBserial3:115200 8DATABITS NONE 1STOPBIT banner
6014:telnet:600:/dev/USBserial4:115200 8DATABITS NONE 1STOPBIT banner
2015:telnet:600:/dev/USBserial5:9600 8DATABITS NONE 1STOPBIT banner
2016:telnet:600:/dev/USBserial6:9600 8DATABITS NONE 1STOPBIT banner
6017:telnet:600:/dev/USBserial7:115200 8DATABITS NONE 1STOPBIT banner
If one wants to authenticate for a given serial port with an ssh key, all you need to do is put the appropriate key into the authorized_keys file of the appropriate account, and you’re all set. I do sincerely hope that I didn’t put any blatant security goofs into this setup, but if I did, you’ll tell me in the comments, right? Just one more challenge for my valued readers: The port numbers in my ser2net.conf have a system. Can you explain it to me?

4 June 2008

Juan Luis Belmonte: update-nsswitch issues to fix. never things are as quick as we think they will


Yesterday, excited, I’ve packed up libnss-ldap with the tool and a “quick & dirty” postinst script. I’ve packaged it not as a final version, even I’m not brave enough to check it with Linitan :) , But It doesn’t really matter, now I’m not worrying about the correction of the package. This is just a quick solution to test how the tool update-nsswitch works in a real environment. well… dpkg -i libpam-libnss-260.deb YEAH, It doesn’t work!!! Why? some Troubles have been found on our update-nsswitch.pl
  • - Cannot recognize and manage, when you try to use a DB that it doesn’t exist in the local nsswitch.conf
passwd: compat
group: compat
shadow: compat
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
Here is a really common nsswitch.conf. If you use the tool calling it for updating the database (e.g sendmailvars) with the source (ldap) in the last position. The database doesn’t exist as seen above. Finish with non result without errors.
  • When using an “after” or “before” source to determine the position of our new source, the pattern “match too much”. What’s that? If we have two sources with the pattern as part of its name, we have a trouble.
This is just an example, files3 and filesauth, are not a valid or real sources
hosts: files dns files3 filesauth
If we try to update the hosts database positioning ldap before files
update-nsswitch –database=hosts –before=files –add ldap
The result is.
hosts: ldap files dns ldap files3 ldap filesauth
  • If we use an “after” or “before” source that it doesn’t exist at the line, it doesn’t do anything.
This condition will include that source in a default action that will be to be the last source on the line. After this propably the tool will be 99.9% working. Except if any of my fixes make something buggy, this afternoon will be finished and tested, into the package we were talking about before. Probably some issues have to be fixed with the other tool update-pam.d but now the work is to have a polite nsswitch updater and good postinst scripts.

3 June 2008

MJ Ray: BBC website, TV and Technology

[Dish]
(How I get TV) The British Broadcasting Corporation, the largest UK public service broadcaster, is seen as a slow lumbering beast and a bit clueless about technology, as you can see from the comment when I wrote about Click: Free=beer and facebook-flaming recently. I think that's a pretty typical view. For example, the BBC has recently helped to launch Freesat which is good in some ways (free-to-air and maybe more standards-based than Sky) but still publishes half-truths like

"Installing a satellite dish is a job for professionals"
(On balance, it's no harder than installing most TV aerials, in my opinion, but remember you get no warranty on DIY.) It's pretty much the same situation online, which is why stories like The BBC and innovation [DavePress] and Good news for websites - BBC told to link out more! continue to be news, nearly 12 years after the BBC's website launched. (Source) One of the few areas where BBC triumphs is probably news-gathering, picking up stories that are unpopular with both business and government, like BBC NEWS: Towns triumph in broadband tests which follows the Experts Say Ofcom Wrong About Rural Broadband storm online. I recently helped The Doon of May team look into internet connectivity and I was surprised how bad it was in their location: a bit of attention from BBC News is most welcome. If you'd like to try receiving the BBC - or some other national broadcasters in Europe - by satellite, I'm currently taking Questions About Cycling on Satellite over on my Cycling Fans blog.

2 June 2008

Juan Luis Belmonte: My project, my mentor & me


The program has officially started on May 26th, i was reading some documentation before starting i would like to start before, but i was working in a company. My project will be for Debian and is called PamNssInstaller. Oh yeah great but.. What is it;
Well lets talk about files involved in this mess :)
nsswitch.conf This file is in charge of how and where to look for the needed information, is divided in two columns, first “what information are we looking for” passwd, hosts, shadow, bootparams, ethers… And the second colums says how and where to look. lets see an example of this file.
passwd: compat
group: compat
shadow: compat hosts: files dns # fhere looks first in /etc/hosts, and if not found lookup DNS
networks: nis [NOTFOUND=return] files # if somethin doesn’t goes ok with nis look in files
…
This way we can see how to set up some kind of chains of looking up the required information.(man nsswitch.conf for more information) pam.d/common-* Files
In pam.d directory we find some files, in a clean base installed system there are 4 conffiles common-passwd, common-auth, common-account and common-session. After installing other things such gdm, samba, sudo, they create their own config files to set up their applications, but we will work on common-* that its aim is global and required for the system and its functionalities. In these files the information is about, how to interact with the different auth modules, and in which order or situations. See an example of a common-account file
account [success=1 default=ignore] pam_unix.so
account required pam_ldap.so
account required pam_permit.so
This is just an example of wht the README.debian of libpam-ldap say that you have to set up in your account file. The aim of the post is not to explain all about pam system. For further information you can look at pam documentation. Due to the policy, these conffiles cannot be modified directly by the packages or their installation. The way to do this is to implement some tools which are capable to do it, and use them by maintainer scripts. So that is the goal of the project, implement that tools, suit them into the source deb packages pack them in libnss and libpam, and work on the package system to do it properly. In this way there are things to specify but the is the main Idea. The common-account example i’ve shown is what libpam tell you to do by hand. In a future when our job is finished, the maintainer script will ask if the user wants to activate, and if it yes, the tools of update-pam will be used to do it. And when a libnss installed the update-nsswitch will be used. Well this was a little explanation of what is what i have to do. At the google summer of code, all applicants as me, have a mentor acting as a tutor on the project, who tells you what to do and what not. It also a partner of you to work with, and is the link between you and the organization, in my case is Debian. My mentor is Fabio Tranchitella also known as kobold. Is Italian and is one of the debian developer who is participating and sponsoring a quite big amount of packages (Overview), and also involved at the zope project. I think his skills are great and i can learn a lot in this project mentored by him. Let me say thanks to him for mentoring me.

MJ Ray: Please Tell Me How To Do It

[Meeting Room]
(Guess I arrived early.) Dear Reader, I'd like to read any opinions on these three:- 1. when I get new information about a story I've already written about, should I make it a new blog post and/or add it to the old post or something else? For example, I've got new links about the Yahoo's good anti-spam actions which is sort-of linked to last week's spammer registrar post. 2. what should I do with links to sites where I've commented? Should I make a new feed like my bookmarks feed, silently ignore them, or something else? Last time I did a link post, mildly irritated comments followed on one of the planets. 3. Tonight is my first full Kewstoke village council meeting. Main (non-routine) topics include Sand Road Lay-by, Crookes Lane Memorial Seat, the newsletter, replacing the gazebo on the village green, coopting more councillors, completing the Crookes Lane Footpath, the 2007-08 accounts and reviewing the Sand Bay Management Plan. Any comments on any of those?

1 June 2008

Enrico Zini: Playing with a Holux M-241

Playing with a Holux M-241 Here is how to download tracks from the Holux M-241:
gpsbabel -t -r -w -i m241 -f /dev/ttyUSB0 -o gpx -F  date +'%Y-%m-%d-%H%M%S' .gpx

It might work also via bluetooth, but I have not tried yet. Now, until M-241 support will be released in a stable version of gpsbabel, here is how to compile the version from CVS. Get the sources:
cvs -d:pserver:anonymous@gpsbabel.cvs.sourceforge.net:/cvsroot/gpsbabel login
cvs -z3 -d:pserver:anonymous@gpsbabel.cvs.sourceforge.net:/cvsroot/gpsbabel co -P gpsbabel

Untar this to debianise the sources. If it does to compile because of some errors in lmx.c, apply this patch. Then you can install the resulting package and (hopefully) be happy. Note, after downloading the logs, gpsbabel currently turns on logging. Here is a patch to disable that behaviour. Finally, if you want to hack around a little on the unit, you can play with mtkbabel: the source code is simple, and most of the MTK protocol is implemented, so you can easily feed your own commands to the MTK. Documentation about the commands can be found here: The links are taken from a post in the GPSPasSion forum. For a source of ideas of what commands you can send, you can look into the source code of BT747. For example, to set the M-241 to 2Hz fix, you can add this to mtkbabel:
packet_send('PMTK300,500,0,0,0.0,0.0');
$ret = packet_wait('PMTK001,300,3');

And if you want to set the MTK to an insane 5Hz fix rate, to take really fine grained gpx traces with your laptop, you can use this:
packet_send('PMTK300,200,0,0,0.0,0.0');
$ret = packet_wait('PMTK001,300,3');

James Morrison: Pet Peeves of the web

Two things have been bothering me for a while:
1) Titles that are links. For example my stupid canvassers post has the title linking to the same page. This is especially annoying on link filled news pages since the title should be the only thing to click on to get focus into the browser windows.
2) Pages that refresh themselves. This annoys me because it forces me to stop reading an article as I am trying to read it. It is also annoying since any embedded youtube videos stop downloading, stop playing, and lose my place in the video.

31 May 2008

Kyle McMartin: it s like a party in my compiler, and i wasn t invited

I’ve spent more or less the last few days of spare time trying to figure out why gcc-4.3 built kernels were so unhappy on parisc. Basically the symptom was that any IPv4 networking operation would only complete once and a while, for example, ping would drop 90% of packets. This turned out to be a really troublesome bug to track down, and the fix was only 7 characters long. gcc-4.2 wasn’t problematic, so that provided an interesting base. A bit of thinking ruled out some obvious parts of the kernel that would likely not be an issue. For instance, ARP appeared to be fine, so it likely wasn’t an issue at the network driver level. So rebuilding net/built-in.o on gcc-4.2, copying it to the gcc-4.3 tree, and rebuilding the tree using it resulted in a working kernel. Ok, excellent, we know it’s likely an issue in net/, what else can we rule out, and what do we know? ICMP is affected, so it’s probably not a TCP problem… Rebuilding the kernel with IPv6 enabled, and testing ping6? Ok, works. So it looks like an IPv4 issue. Test that assertion… yup, net/ipv4/built-in.o compiled with gcc-4.2 works. Ok, peachy. What now? Bisecting the contents of the directory results in ip_output.c being the problematic file… Not all that helpfully, the differences between the code generated by 4.2 and 4.3 are extensive. Well, ok, let’s try turning off a variety of the added compiler options… nope, no luck, but the file works when compiled at -O0. Next, I bisected the file until I found the problematic function (unfortunately for me starting in the middle, it ended up being the first function in the file.) Which was in a chain of inline functions, eventually calling some architecture specific inline assembly for ip_fast_csum. Ok, that looks like our canary in the coal mine… Look it up… SIGH. The routine touches memory, but didn’t have “memory” in the list of clobbers. Adding the clobber and everything magically works again. Wasn’t that a party? [ Of course, this makes things sound almost easy, except that at around 10 minutes to boot a test kernel, reboot, and boot a working kernel, this gets extremely tedious. I also didn't bother to talk about how many hours I probably wasted twiddling compiler flags trying to figure out which optimization pass might be broken... ]

30 May 2008

Russell Coker: Links May 2008

The Daily WTF has published an interesting essay on why retaining staff is not always a good thing [1]. The main point is that good people get bored and want to move on while mediocre people want to stay, but there are other points and it’s worth reading. Following the links from that article led me to an article comparing managing IT departments to managing professional sports teams [2]. They chose US football (a sport I know little about and have no interest in) so I probably missed some of the content. But they have some good points. John Goerzen gave a good presentation to the idea of increasing petrol taxes and decreasing other taxes to have a revenue neutral result while also discouraging petrol use [3]. I credit him with presenting the idea not inventing it because I have heard similar ideas several times before (but not nearly as well written and not written from a right-wing perspective). Hopefully some people who read his presentation will be more receptive than they were to the other versions of the same idea. Craig Venter spoke at TED about his work in creating artificial life [4]. He spent some time talking about the possibilities of creating artificial organisms to produce fuels directly from CO2 and sunlight. Nick Bostrom published a paper explaining why he hopes that the SETI projects find nothing [5]. His theory is that the fact that our solar system has not been colonised and that we have seen no immediate evidence of extra-terrestrial life indicates that there is a “Great Filter” which is a stage of evolution for which it is most unlikely that any species will pass. If the Great Filter is in our past (he cites the evolution of multi-celled life as one of the possibilities, and the evolution of prokaryotes into eukaryotes as another) then it means that our future might be more successful than if the Great Filter was something that tended to happen to advanced societies. Jared Diamond (the author of Collapse), has written an interesting article about vengeance [6]. He focuses on an example in New Guinea and uses it to explain why personal vendettas tend to run wildly out of control and how society is best served by having the state punish criminals.

Russell Coker: CPU Capacity for Virtualisation

Today a client asked me to advise him on how to dramatically reduce the number of servers for his business. He needs to go from 18 active servers to 4. Some of the machines in the network are redundant servers. By reducing some of the redundancy I can remove four servers, so now it’s a need to go from 14 to 4. To determine the hardware requirements I analyzed the sar output from all machines. The last 10 days of data were available, so I took the highest daily average numbers from each machine for user and system CPU load and added them up, the result was 221%. So for the average daily CPU use three servers would have enough power to run the entire network. Then I looked at the highest 5 minute averages for user and system CPU load from each machine which add up to 582%. So if all machines were to have their peak usage times simultaneously (which doesn’t happen) then the CPU power of six machines would be needed. I conclude that the CPU power requirements are somewhere between 3 and 6 machines, so 4 machines may do an OK job. The next issue is IO capacity. The current network has 2G of RAM in each machine and I plan to run it all on 4G Xen servers, so it’s a total of 16G of RAM instead of 36G. While some machines currently have unused memory I expect that the end result of this decrease in total RAM will be more cache misses and more swapping so the total IO capacity use will increase slightly. Now four of the servers (which will eventually become Xen Dom0’s) have significant IO capacity (large RAIDs - they appear to have 10*72G disks in a RAID-5) and the rest have a smaller IO capacity (they appear to have 4*72G disks in a RAID-10). The other 14 machines have the highest daily averages for iowait adding up to 9% and the highest 5 minute averages adding up to 105%. I hope that spreading that 105% of the IO capacity of a 4 DISK RAID-10 across four sets of 10 disk RAID-5’s won’t give overly bad performance. I am concerned that there may be some flaw in the methodology that I am using to estimate capacity. One issue is that I’m very doubtful about the utility of measuring iowait, one issue is that iowait is the amount of IDLE CPU time when there are processes blocked on IO. So if for example you have 100% CPU time being used then iowait will be zero regardless of how much disk IO is in progress! One check that I performed was to add the maximum CPU time used, the maximum iowait, and the minimum IDLE time. Most machines gave totals that were very close to 100% when those columns were added, so it seems that if the maximum iowait for a 5 minute period plus the maximum CPU use plus the minimum idle time add up to 100% and the minimum idle time was not very low then it seems unlikely that there was any significant overlap between disk IO and CPU use to hide iowait. One machine had a total of 147% for those fields in the 5 minute average which suggests that the IO load may be higher than the 66% iowait number may indicate. But if I put that in a DomU on the machine with the most unused IO capacity then it should be OK. I will be interested to read any suggestions for how to proceed with this. But unfortunately it will probably be impossible to consider any suggestion which involves extra hardware or abandoning the plan due to excessive risk… I will write about the results.

28 May 2008

Russell Coker: Hosting a Xen Server

Yesterday I wrote about my search for a hosting provider for a Xen DomU [1]. One response was the suggestion to run a Dom0 and sell DomU’s to other people [2], it was pointed out that Steve Kemp’s Xen-Hosting.org project is an example of how to do this well [3]. Unfortunately Steve’s service is full and he is not planning to expand. I would be open to the idea of renting a physical machine and running the Xen server myself, but that might be a plan for some other time (of course if a bunch of people want to sign up to such a thing and start hassling me I might change my mind). But at the moment I need to get some services online soon and I don’t want to spend any significant amount of money (I want to keep what I spend on net access below my Adsense revenue). Also if someone else in the free software community wants to follow Steve’s example then I would be interested in hosting my stuff with them.

Joey Hess: strftime fractional seconds

strftime's time format does not support fractional seconds, but a lot of people want to do that, based on a google search. It's been implemented as an extension to several programs. Each implementation I found uses a different conversion specification, and in each case the character chosen was already used by something else in the standard strftime. The only unused letters are: %f, %i %J %K %L %q %Q %w (and perhaps some punctuation). Of these, "%f" has a good mnemonic for fractional seconds. But I hestiate to poach from such a small space. Looking at glibc's extensions to the strftime format suggested a different approach. I suggest using "%.S" for fractional seconds. There's a good mnemoic and this seems unlikely to be used for anything else. This could be extended to include an optional precision ("%.4S"). It would also be nice to have a standard way of showing microseconds, nanoseconds, and milliseconds too. "%uS", "%nS", and "%mS" would be nice to use; unfortunatly, "%u", "%n", and "%m" are already used in strftime (so are "%U, "%N", and "%M"). I don't have a solution for these, but they're probably generally less useful than fractional seconds anyway.
Update: I neglected to mention the possibility of using the O modifier. Dirk Eddelbuettel points out that R uses "%OS" for fractional seconds. As compromises go, R has chosen a pretty good one. But SuSv3 actually defines the O modifier as causing the locale's alternative numeric symbols to be used, with an example of Roman Numerals. So fractional seconds is probably not quite what "%OS" is intended to do, unless you're in the locale for very fast living people. :-) In current versions of glibc, the alt_digits field used by the O modifier is only present for a few locales: fa_IR, ja_JP, and or_IN. Still, there are plenty of other numeral systems out there, so I still favor making up a new modifier like "%.S", rather than trading off localisation for precision.

Ingo Juergensmann: Xen Hosting to lower costs

Russel Coker is looking for a Xen domU to rent for a new project he's going to start.
Using shared Xen hosting to lower costs is quite common these days. Steve Kemp does it and so do I (german). Prices are not that high that you can make a business out of this or earn your living from that, IMHO. At least not with a major investment beforehand. So, shared Xen hosting is mostly used to lower costs by sharing them amongst friends.

Just order a dedicated server, for example a dual AMD64, 4 GB RAM, 2x 400 GB harddisks, a /29 net and umlimited traffic (1 TB free at 100 Mbps, after that the bandwidth is reduced to 10 Mbps) for 59.- and go for it. Get as much memory as you can get. I've found 2 GB RAM a little bit undersized, whereas I still have approx. 2 GB RAM unused/free for other domUs with 4 GB RAM, so there's some room for other domUs.
Currently I'm running 4 domUs:

  1. 1 GB RAM: central services host (PostgreSQL, MySQL, Mailserver, IMAP/POP3)

  2. 512 MB RAM: Apache

  3. 128 MB RAM: providing shells for irc, Jabber, ...

  4. 256 MB RAM: a VPN gateway for a local freifunk club



Anyway, when someone would consider sharing a dedicated server with some friends, go for it! It's better for the environment as well, when some people will share the servers instead each of them getting their own one.

26 May 2008

Chris Lawrence: The use and abuse of technology in the classroom

Michelle’s post‡ today on laptops in the classroom (in a similar vein to this article I read last month on the suggestion of Glenn Reynolds) reminded me that I had a few items from the past few weeks still in my Google Reader queue of “things to blog about” related to Margaret Soltan’s continuing crusade against the use of PowerPoint* and its ilk, and specifically Timothy Burke’s partial rebuttal:
What’s the difference between bad usage of PowerPoint in lectures and bad lectures that involve hand-outs, overhead transparencies and writing on the chalkboard? Are we just complaining about old wine in new bottles here? Is the real culprit professorial droning at classrooms of 200+ students followed by recite-repeat-and-forget examinations? I think it’s at least plausible that the technology is just giving us a new reason to pay attention to a pedagogy whose effectiveness has been suspect for two generations.
I dare say I’m among the last doctoral students who was “trained”—and I use that word loosely—to teach prior to the widespread use of PowerPoint. Four years of full-time in-classroom experience, mostly with small lectures and seminars, has brought me basically to agreement with Burke on this point—complaints about PowerPoint essentially boil down to complaints about either instructional laziness or the whole nature of lecturing, or as a Burke commenter puts it, ”[e]xactly how does one teach even 80† students at once without succumbing to passive data transfer?” The non-use of PowerPoint or some other form of instructional technology seems to me to be a luxury confined to those who only teach small seminars and graduate students, and while my personal career aspirations lean in that direction the reality is that I’m several years away (in terms of research productivity) from being there—if I ever get there. Burke in his comments hits the nail on the head, I think, when it comes to any sort of visual presentation in class:
It seems to me that the absolutely key thing is to avoid speaking the slides literally. They’re best as definitions, key concepts, images: the kind of thing you’d stop your flow of lecturing to write on the chalkboard. They’re not the lecture itself.
I think there are three useful aspects to a lecture: what you put on the board (or slides), what you say, and the general outline. If you’re preparing a handout or something to stick on Blackboard for students, the outline or outline-plus-slides is what they need, along with space to fill in the gaps. An alternative approach is to make the slides/board material the outline; several of the more effective teachers I had (my high school history teacher and a political science professor at Rose-Hulman) took that approach. But you can’t shovel your script into PowerPoint and expect that to work well, any more than you’d expect that writing it up on the board, or for that matter reading a paper verbatim at a conference would be a good presentation, to work. All this discussion leaves aside the question of teaching anything that involves symbols (chemistry, mathematics, statistics) which I think requires a different approach than bullet-points. In class, mathematics and statistics (and, by extension, social science research methods courses) lend themselves to a combination of “passive” PowerPoint-style presentation and more spontaneous problem-solving and brainstorming; for example, one of my early activities is to have the class try to operationalize (define in terms of a measurable quantity or quality) a concept like “globalization,” which you can’t really do with a static slideshow even though you can define terms like “operationalization” that way. Similarly, while you can step through the process of solving a problem in a slideshow I think it’s more effective to demonstrate how to step through the process on the board. Unfortunately, many classrooms aren’t set up to allow you to present and use a board simultaneously; some of TAMIU‘s lecture halls have a nice design where the projection screen is above the board, so you can write on the board without having to do anything special with the slideshow, but rooms most places are designed for “either-or” which can be a real pain—fiddle with the control system to blank the screen, raise the screen, write on the board, then lower the screen, switch the screen back on. After a few iterations of that in a single class, you’ll never do it again. I freely admit I haven’t figured everything out yet; my current methods slides are pretty good lecture notes but pretty rotten for projection. One of my projects for this summer (postponed from last summer after I learned I wouldn’t be teaching any methods courses this year) is to work on my research methods lectures to incorporate advice from Andrew Gelman’s book so I can lay the groundwork for my plot to take over the world effort to produce a workable, but rigorous, methods curriculum at both the undergraduate and master’s levels for political science, sociology, and (at the grad level) public administration. More on this theme from Laura at 11D, who takes note of some of the more positive technological developments associated with academe. And, another of Burke’s commenters links this hilarious example of what not to do with your slides.

* I use “PowerPoint” as shorthand for the use of a computer-projector based slideshow-style sequential presentation of items associated with a lecture, a technique obviously made famous by the Microsoft software package but also available with many other software packages such as Apple’s Keynote, OpenOffice.org Impress, and several PDF viewers including Adobe Reader, xpdf, and GNOME‘s Evince.
† I’d put the cutoff significantly lower, at around 30–40 students. Beyond that point, one might as well just blow the cap off the class.
‡ By the way, it’s nice to see Michelle’s blog back from haïtus! (Where else would I keep up with current Mexican politics?)

Romain Francoise: In passing: on web security

The folks at the Caja project have compiled a great list of known attack vectors against Javascript engines and browsers, complete with detailed descriptions and examples.

If you're interested in web security, this paper on Caja is a great read (and the project is worth keeping an eye on).

Manoj Srivastava: Manoj: Theming Emacs


Update Added screenshots
I spend a lot of time working in front of a screen (many hours in a dimly lit room) and eye fatigue is an issue. A consistent color scheme, especially one which is easy on the eyes, is important and it also helps to have way of doing that where the directives are not all scattered all over my Emacs-lisp setup. Enter Emacs Color Themes, available as the Debian package emacs-goodies. Aided with a HSL color picker, I set around trying to create a dark color theme for Emacs. It does not help that I am blue-green color blind, so subtle variations are often lost on me. I do want to use color contrast to increase productivity, but I also want to avoid the jarring angry fruit salad look, and so I am in the process of crafting a logical color scheme that is high contrast enough for me, without being too unpleasing. Gnus Groups In circumstances where there a lot of related faces that can be viewed, for example, the Gnus group buffer, consistent and logical color choices are the only sane option. Gnus groups can be news (bluish) or mail (greenish), have states (large number of unread messages, normal, and empty). The large number unread groups have highest luminosity (appear brighter), and the empty one have lower luminosity (appear greyer), but have the same hue and saturation. Sub states and group priorities are rendered using a color series which has constant luminosity and saturation, and vary in hue by a constant separation so all the related groups have the same brightness ( mail,news / unread,normal,empty ), and a graded selection of foreground colors. It sounds more complicated that it looks. The eye is drawn naturally to the unread groups, and first to the mail, then USENET groups (which is my preference). Gnus Groups Similar color variations occur for individual messages in a group; high scoring messages bubble to the top, and have a higher luminosity. This color schema has made me slightly faster at reading mail/USENET. In the message itself, quoted mail messages from different people are color coordinated, with high contrast between citations that are close to each other in the hierarchy, so it is less likely that one misunderstands who said what in a long conversation. The resulting scheme covers programming languages, Gnus, Erc, mail, org-mode, CUA-mode, apt-utils, bbdb, compilation buffers, changelog mode, diff and ediff, eshell, and more. This has allowed me to consolidate all my color directives into a single file, and is in a format that might be usable by others. See the wiki page for details about how to use and switch color themes in Emacs. Enjoy.

25 May 2008

Andrea De Iacovo: WordPress git repos


Just to be sure you all know: we have two git repos for wordpress in git.debian.org. Here you’ll find every change I make in wordpress: at the moment, for example, there are 3 security patches for the etch version of wordpress (I’m preparing a new security release) wich are not yet “officially” in Debian. Here you are the two repos links: git://git.debian.org/git/collab-maint/wordpress-etch.git
git://git.debian.org/git/collab-maint/wordpress.git

Andrew Pollock: [life] Prague to Zurich, and driving in Europe in general

We got back to Zurich late last night (not quite as late as we got into Prague though, thankfully). We stopped off in Deggendorf on the way through Germany to visit our friend Christine from the Bilbys, who has moved back to Germany, along with her Australian boyfriend, who is now furiously learning German (we're talking a year-long immersion program). Deggendorf was a gorgeous little town, with cobblestone streets and more Churches than you can shake a stick at. Unfortunately we could only stay for a few hours, so we had a barbecue lunch and a quick wander around, and headed off on our way again. This morning we dropped the rental car back at the airport, had one of our typical misadventures on the train (went the wrong way at first) and then caught a tram back to the apartment. Everything being in German is a bit of a challenge. Parts of it you can make out, parts of it are totally unintelligible. There seems to be a general tendency to concatenate words, for example, our apartment is on what would translate to "Rehalp Street", but in the local vernacular, is expressed as "Rehalpstrasse". So when you're looking around and trying to follow directions, the names don't seem quite so ludicrously long and intimidating if you just drop the "strasse" or the "br cke" (bridge). The car that we rented from the Zurich airport developed some kind of non-critical fault on the way to Prague, and Sarah exchanged it for another one in Prague, as Hertz seemed unable to fix it. (It had the "check engine" and "check vehicle stability control" lights on). So we drove to Prague in a petrol Toyota Auris, and drove back in a diesel Audi A3. We both preferred the Auris over the A3, as the A3 seemed easier to stall, and harder to recover from a stall. Putting it in reverse was totally unintuitive as well. Speaking of fuel, it sure is expensive over here. We paid about 60 euros in Germany somewhere to put about three quarters of a tank in the Auris on the way to Prague, and we spent about 100 CHF to refill the A3 in Zurich. I think Sarah said the diesel cost converted to about $9 USD per gallon. So it was a nice novelty value to drive across Europe, but I don't think we'll be doing it again in a hurry. I did enjoy driving on the autobahns though. While I'm writing about driving in Europe, I might as well make a note about the traffic signs. We really should have researched them before hopping behind the wheel, as there were quite a few we didn't understand, and they weren't terribly intuitive (to us anyway). For example, European 'No Entry' sign versus European 'No vehicles' sign versus European 'No stopping' sign The first is the pretty internationally standard "no entry" sign, but when you see the third sign in isolation, it seemed to us at least, that perhaps that meant "no entry", where it actually means "no standing". "No parking" is a variant of "no standing", with just one diagonal line. The middle sign means "no vehicles", which makes no sense at all, unless you've seen (and understood) the other versions of this sign, which have lesser restrictions of "no cars" or "no bicycles" and feature an icon of either inside the circle. Speed limit signs were also a bit interesting. You'd have European speed limit sign, which specifies a speed limit, but then you'd have European end of speed limit sign, which means "End of speed limit". Our question was "well what is the speed limit now?" The answer seems to be "the default national limit for the class of road you're on". The final set of signs we didn't understand until Christine explained them to us when we saw her yesterday, were European priority road sign and European end of priority road sign, which are "priority road" and "end of priority road", respectively. We just didn't know what a priority road was. Turns out it means traffic on the priority road has right of way over traffic on roads intersecting it. I would have thought this was pretty obvious, but apparently on a non-priority road, you have to give way to traffic on the right, regardless of whether you have a stop sign or a yield/give-way sign. So there's some sort of implicit four-way stop thing going on on a non-priority road. Every time I see European traffic signs, particularly the triangular warning signs, it gives me a flash back to my childhood. My Aunty Peggy used to have a huge big bag of mixed Lego pieces, including a bunch of European traffic signs, and some square Lego mats, and when we were kids, and we used to go to her house to play, we'd build little towns out of all of the Lego. This was the first time we've driven a manual left-hand drive car, and it was fine, except your immediate subconscious reaction the first few times is to go reaching for the gear stick with your left hand, and bash it into the door. It was also the first time we've driven on a roundabout on the right hand side of the road. That was interesting, because it added an additional thing to think about: the traffic on the left.

Next.

Previous.