Search Results: "cas"

19 July 2006

Steve Kemp: So hot, so cold, so far so out of control

The cron patch I posted previously attempted to discard any crontab file which contained non-ASCII characters was a flawed approach. Lots of people told me that this would break scripts with foreign character sets, and that was something I’d not considered. A real solution would be to read each line and test for : Looking at the code for cron is hard because it is written in a “strange” style, so I’m not even going to attempt it this level of validation. However I have produced an updated patch which should work on ASCII + foreign character sets equally well. Instead of testing for the presense of non-ASCII characts it looks for NULL characters (’\0′). Binary files should contain at least one NULL character - as a string terminator, for example - and text-files should never contain them. So I think this simple test will work for 99% of cases.
Regardless of whether this patch, or another like it, is accepted and applied I do believe strongly that whilst being liberal in what you accept is a good thing being too liberal is asking for trouble.

18 July 2006

Jordi Mallach: Seventy years of the Spanish Civil War and the Spanish Revolution

A few months ago I wrote about the 75th anniversary of the proclamation of the Second Spanish Republic which was celebrated throughout the state. That weekend I visited a fantastic exposition of Republican and Revolutionary war propaganda posters, in Segorbe.

Today, Spain remembers the beginning of the end. During the evening of the 17th of July and morning of the 18th, a group of generals of the Spanish regular army raised against the democratically elected left-wing government of the Republic. History says that the murdering of Calvo-Sotelo, a right-wing leader, was what finally provoked the conflict. It was no secret that the same right-wing and some elements in the army had been conspiring for weeks about an uprise. The only question was when, but the government was fooled by general Mola and didn't take really effective measures to prevent it.


Warning from sanitary authorities against venereal diseases Mola and Sanjurjo planned to start taking over official buildings and army quarters and quickly seize control of the major cities. During the first hours of their rebelion, they managed to take over most of the southern regions in Andalusia, Extremadura and parts of the Northwest, plus most of the islands and the Moroccan protectorate area. Meanwhile, the Republic did not manage to react quickly due to the weakness of the government, and in the first days of the crisis, the government changed a few times. Finally, the Republican parties decided that to defend the state they should give arms to the unions, and soon after many militia groups were getting organised in the cities, and columns sent off to liberate other towns.


Solidarity of Catalunya to the Basque front The insurrection was suffocated in Barcelona after some heavy fighting against the military in the Montju c castle; the Anarchists of the CNT grew strong in Catalunya and Arag n, and offered good resistance in those fronts. After the first days of the coupe d'etat, it was clear neither the legitimate government or the rebels calculated how things would go after the first days. The government was confident in being able to end the rebelion as they did four years before; the fascists thought they would have quickly brought down the government with a successful coup. But after the first week, the country was divided in two halves, and both sides of the conflict were keen on fighting, due to the big social fracture during the last months of the government. The Republic asked for help to the League of Nations, but the United Kingdom and France decided not to intervene, scared about the conflict trespassing the Spanish borders and becoming another bloody war in European fields. The only official external aid came from the USSR and the International Brigades, formed by volunteers of more than 50 nations. Some well-known personalities like Ernest Hemingway or George Orwell came to aid as well. Orwell wrote about his life-changing experience in a Barcelona immerse in the social revolution, where he joined the anti-stalinist socialist party POUM. Badly wounded in the neck, he left the front and went back to Barcelona, and witnessed the assault of the Telef nica by the communists against the anarchists, during the fets de maig, after which the POUM was declared illegal. Orwell captured his experiences in the frontline and Barcelona in his book Homage to Catalonia.


To defend Madrid is to defend Catalunya Franco and Mola, aided by the Northafrican troops and soon after by their fascist allies of Italy and Germany, didn't have big problems seizing the Basque Country and Asturies in the North, but not before making the town of Gernika disappear below the nazi Condor Legion bombing, in what would be a test for the massive aereal bombings of Word War II. The battle for Madrid was fierce, and the city wasn't occupied until the very last days of the war. The long defence of the capital made was immortalised in the famous phrase No pasar n.


Madrid's No pasar n During the war, anarchist groups controlling fields and towns in Arag n and Catalunya managed to bring a Social Revolution to the area. The people collectivised the land and industries, administered by local assemblies. This experience is regarded as the time when Libertarian Communism has been successful. The experience ended dramatically when the anarchists were treasoned and blocked by the communists, and eventually defeated by Franco at the front.


Each bullet for a target After the first and a half years, the fronts had stabilised in Madrid and the East of Andalusia, until early in 1939, Barcelona fell in Franco's hands, after the bloody Batalla de l'Ebre, being followed by Girona and the rest of Catalunya. The fate of the democratic state was clear. Two months later, Madrid fell and Val ncia and the small area still under Republican control surrended.


Robert Capa's Muerte de un miliciano Franco declared a totalitarian regime to, according to the fascists, reconcile the two Spains. In the first five years of the regime, up to 100.000 were executed in the franquist repression, including the Catalan president, Llu s Companys and many intellectuals. The dictatorship continued executing people until two months before Franco's death, 36 years later. Hundreds of thousands also had to exile in M xico, France and other destinations, leaving Spain in ashes, road gutters full of scattered bodies and the population facing famine. The cultural elite left the country, making the state's clock go back at least a decade. Their reconciliation really meant humiliation and repression. Many people were also murdered during the war behind republican and rebel lines, but the genocide of the aftermath had was unmatchable.


The Republic promoted education among the troups It is a bit late to restore the dignity of the victims, but not too late. Some associations have been fighting since the end of Franco's regime to get some kind of public recognition for their suffering, for their priceless fight for the legal and democratically elected Republic, for the people who didn't make it.


Excellent anarchist poster rejecting the politisation
of children by any of the three loyal groups Other people reject these efforts banning them of "revisionism". Not too surprisingly, these are the sons or grandsons of the people who won the war. The current government is about to pass a Historic Memory law which aims to give recognition to all these people who gave their lives for an ideal and freedom. Unfortunately, due to pressures from the right, it is probable that the text will be ammended to make it more acceptable by them. I fear it will end up not pleasing the victims at all. I have a passion for Spanish Civil War related matters, and in the last years I tried to use any opportunity to listen to my Catalan grandmother talk about war affairs in Barcelona, and my grandfather, from a town in the middle of the Republican side of the Teruel front, but born in a very catholic family, about how the war went on in Vall and the nearby mountains.


From the defensive No pasar n to the encouraging Pasaremos! I know my grandfather only told me the less compromising stories, like how he was sent to dig refuges until he was 16 and apt to fight in the Front, or how he was put in charge of hiding the church's valuable relics in a few barns. He never told me about how life was after the war in the small town. It is dramatic to see that all the people who were old enough to have a sense of what was going on at the time are so old that these unvaluable memories and stories will be mostly gone in ten years. (Most of the pictures are taken from the Sociedad Ben fica de Historiadores Aficionados y Creadores' website, which has a huge documented catalog)

John Goerzen: Multipath is working

Yesterday, we got multipath working with our HP MSA1500cs SAN. We have a fully redundant setup with redundant controllers, fibre channel switches, and two FC controllers per host.

We had been having a lot of trouble getting things to work right with active/passive controllers. We could get failover to work in some cases, but getting everything to communicate correctly in the event of a failure was difficult, since every machine would have to flip over to the passive controller simultaneously.

With a firmware upgrade, the MSA 1500cs can support active/active controllers. With the dual-active setup, both controllers are active simultaneously and both are valid paths.

Despite HP support's indications to the contrary, HP does have information on using built-in multipathd in Linux instead of their proprietary multipath solution. It's document c00635587, part AA-RW8RA-TE.

We've configured multipathd.conf like this:


path_grouping_policy multibus
path_checker tur
failback immediate
no_path_retry 60
path_selector "round-robin 0"


Just put that in your default block and it should work.

Martin-Éric Racine: USB mass storage support in Linux sucks!

After an extremely frustrating afternoon of seeing the Linux UHCI driver repeatedly shut itself down, following several successive I/O errors while accessing USB mass storage (a 512Mb Compact Flash connected via a USB card reader, in one case, and a 512Mb USB stick, in the other), I spent an even more frustrating evening surfing the Internet for a solution. Conclusion: USB mass storage support in Linux sucks! Several mailing lists and user forums report similar failures using USB 2.0 devices on Linux UHCI or EHCI drivers, down to the exact same error messages that I get. Some even report the whole USB subsystem going down, leaving the user without any keyboard or mouse on USB-only systems (this matches my findings on one particular hardware platform that happens to be at the core of a project I'm working on). The suspected cause, in all cases, apparently boils down to either or all these:
  • The SCSI subsystem upon which USB (and Firewire) mass storage is built is utter crap that would need a complete rewrite. The issue has been known for ages, it's even a proverbial elephant in the corner that nobody wants to see, but rewriting the subsystem for a standard that barely has any real-life application left means opening a big can of worms.
  • None of the Linux kernel's HCI are capable of anticipating the quirks present in some implementations of the USB hardware specifications, so they simply panic and commit suicide in syslog-flooding glory.
  • There is apparently a hard-coded limit of 1000 units (blocks?) that, when exceeded, will make the mass storage driver reset itself! Doesn't sound like Willliam Gates the Third's often-mentioned "Nobody needs more than 640k" now, does it?
I can feel for the average user who is just trying to extract a few pictures off a USB stick and who simply ends up reinstalling $commercial_os in frustration. Wasting a couple of days trying to debug support for what is supposedly a well-documented industry standard should never happen. There is no excuse for a broken USB mass storage on Linux. Let's fix it!

Martin F. Krafft: XFS -barriers +write-cache considered harmful

If you have an XFS filesystem on hardware without barriers (or with broken barriers as was the case on my X40's Hitachi drive) and with write-caching enabled, disable the latter NOW (the following will work for PATA drives, and SATA if you have a [rd]ecent kernel):
apt-get install hdparm
df -T   egrep ' xfs '   sed -rne 's,(/dev/[sh]d[[:alpha:]]).*,\1,p' \
    sort -u   while read disk; do cat <<_eof
$disk  
  write_cache = off
 
_eof
done >> /etc/hdparm.conf
/etc/init.d/hdparm start
Also see http://oss.sgi.com/projects/xfs/faq.html#wcache . Anyway, damage mitigated. xfs_repair -d /dev/md1 feels funny when /dev/md1 is the root partition of your laptop and you're about to move to Ireland for six weeks, fully dependent on that machine. But yeah, XFS on a laptop is asking for trouble anyway. Call me masochist.

Enrico Zini: Fifth day in Addis

Setting up a mail server
Background Some terminology:
MTA
Mail Transport Agent
MUA
Mail User Agent
MDA
Mail Delivery Agent
SMTP
Simple Mail Transfer Protocol
MX
Mail eXchange
POP
Post Office Protocol
IMAP
Internet Message Access Protocol
With SMTP you connect to a server and send two things: envelope and message. The envelope looks like this:
MAIL FROM: <enrico@enricozini.org>
RCPT TO: <rms@fsf.org>
RCPT TO: <linus@linux.org>
The message looks like this:
From: <enrico@enricozini.org>
To: <rms@fsf.org>
Cc: <linus@linux.org>
Message-ID: <1234567@enricozini.org>
Subject: Test mail
Hi Richard,
this is a test mail.  I'm also writing
Linus to show how to send to more people.
Cheers,
Enrico
There is no authentication. There is no encryption. Two usual types of access control:
  1. Outbound e-mail is normally only accepted from an internal network
  2. Inbound e-mail is normally accepted from anywhere
The DNS is used to find the SMTP server to use to send a message:
$ host -t MX yahoo.com
yahoo.com MX 10 smtp1.yahoo.com
yahoo.com MX 20 smtp2.yahoo.com
yahoo.com MX 20 smtp3.yahoo.com
The process of sending an E-Mail:
  1. Enrico writes an E-Mail:

    From: Enrico Zini <enrico@enricozini.org>
    To: Richard Stallman <rms@fsf.org>
    Subject: Hello from Addis
    Hi Richard,
    Addis is a wonderful city, even if
    it rains a lot.
    Bye,  Enrico
    
  2. Enrico's MUA connects to the SMTP server (for example, port 25 of smtp.aau.edu.et):

    HELO enricozini.org
    200 OK Hello enricozini.org
    MAIL FROM: <enrico@enricozini.org>
    200 OK Mail from enrico@enricozini.org
    RCPT TO: <rms@fsf.org>
    
    Here, the SMTP server performs relay control: "do we relay mail to rms@fsf.org?":
    • Outbound e-mail is normally only accepted from an internal network
    • Inbound e-mail is normally accepted from anywhere
    A target address could be refused:
    413 ERR I don't relay for rms@fsf.org
    
    In this case, the destination is not local but the recipient is accepted because I'm inside the local network:
    200 OK Destination rms@fsf.org
    DATA
    200 OK Please send message body
    From: Enrico Zini <enrico@enricozini.org>
    To: Richard Stallman <rms@fsf.org>
    Subject: Hello from Addis
    Date: Mon, 17 Jul 2006 09:49:45 +0300
    Message-ID: <124372643@enricozini.org>
    Hi Richard,
    Addis is a wonderful city, even if
    it rains a lot.
    Bye,  Enrico
    .
    200 OK Message accepted
    QUIT
    200 OK Bye.
    
  3. The SMTP server needs to find out where to send the message, using the DNS:

    $ host -t MX fsf.org
    fsf.org MX 10 mail.fsf.org
    fsf.org MX 20 mail.gnu.org
    
  4. So the SMTP server tries the first one and connects to port 25 of mail.fsf.org:

    HELO smtp.aau.edu.et
    200 OK Hello smtp.aau.edu.et
    MAIL FROM: <enrico@enricozini.org>
    200 OK Mail from enrico@enricozini.org
    RCPT TO: <rms@fsf.org>
    
    The destination is accepted because it's for a local user:
    200 OK Destination rms@fsf.org
    DATA
    200 OK Please send message body
    From: Enrico Zini <enrico@enricozini.org>
    To: Richard Stallman <rms@fsf.org>
    Subject: Hello from Addis
    Date: Mon, 17 Jul 2006 09:49:45 +0300
    Message-ID: <124372643@enricozini.org>
    Received: by mail.aau.edu.et
      on Mon, 17 Jul 2006 09:55:53 +0300
      from 10.4.15.158
    Hi Richard,
    Addis is a wonderful city, even if
    it rains a lot.
    Bye,  Enrico
    .
    200 OK Message accepted
    QUIT
    200 OK Bye.
    
  5. Now, mail.fsf.org will invoke a MDA to write the mail in Richard Stallman's mailbox.

Example of problems with mail handling:
  • Accepting inbound connections:
    • Malicious input:
      • logic errors
      • buffer overflows
      • DoS (Denial Of Service) attacks
      • Connection floods
  • Performing outbound connections:
    • Programming errors:
      • Flooding of connections
  • Performing routing:
    • Unauthorised relays
    • Mail loops
  • Writing to the local hard drive:
    • Filling up the hard drive
    • Writing to the wrong files
  • Writing to the local hard drive as root:
    • In case of error or attack, any file in the system can potentially be compromised
RFC-822 is the original standard for E-mail. RFCs are standard Internet documents. Have a look at RFC documents released the 1st of April.
postfix Common setup: "Internet site with smarthost". More difficult to maintain: "Internet site". A smarthost is a machine that will relay e-mail for you. Questions asked with "Internet site with smarthost":
  • Mail name: aau.edu.et (name used to publicly identify the mail server)
  • Smarthost name: smtp.telecom.net.et (SMTP server that will relay our e-mail)
To test a mail server:
$ telnet localhost 25
HELO me
MAIL FROM: <a@b.c>
RCPT TO: <mail@of.a.local.user>
DATA
hi
.
QUIT
By default, you find locally delivered mail in /var/mail/username. Postfix configuration files:
/etc/postfix/master.cf
configures how all the postfix components run together (man 5 master)
/etc/postfix/main.cf
Main postfix configuration (man 5 postconf)
To rewrite addresses:
  1. In /etc/postfix/main.cf:

    canonical_maps = hash:/etc/postfix/canonical
    
  2. Then in /etc/postfix/canonical you can add the rewrite rules, like:

    enrico   enrico@enricozini.org
    
  3. When /etc/postfix/canonical is modified you need to regenerate the index:

    sudo postmap canonical
    
    (same is when you change the alias file: sudo postalias /etc/aliases)
(see file:///usr/share/doc/postfix/html/ADDRESS_REWRITING_README.html) Manipulating the message queue:
mailq - List the mail queue.
Example:
mailq
postqueue - Postfix queue control
Examples:
# Like mailq
postqueue -p
# Tries to send every message in the queue
postqueue -f
# Tries to send every message in the queue for that site
postqueue -s site
postsuper - Postfix superintendent
Examples:
# Deletes one message
sudo postsuper -d 7C4D2EC0F5D
# Deletes all messages held in the queue for later delivery
sudo postsuper -d ALL deferred
Different mail queues in postfix:
incoming
mail who just entered the system
active
mail to be delivered
deferred
mail to be delivered later because there were problems
hold
mail that should not be delivered until released from hold
Mail logs are in:
/var/log/mail.log
/var/log/mail.err
/var/log/mail.info
/var/log/mail.warn
Mail delivery Mailbox formats:
  • mbox: single file, mail separated by "From " lines
  • maildir: one directory per folder, one file per mail
  • mh: similar to maildir, but not really used
Alternate MDA: procmail: allows to filter mail automatically into different folders. Mail forwarding with ~/.forward: allows to redirect mail to a different address: just put the address you want to send to in the file ~/.forward.
POP or IMAP server Installation:
apt-get install dovecot
Configuration is in:
/etc/dovecot/dovecot.conf
The main thing that is needed is to enable the mail protocols you want:
protocols = imaps
Server monitoring To make all sorts of graphs:
apt-get install munin munin-node
Example: http://munin.ping.uio.no To compute more statistics:
  • anteater
  • isoqlog
  • mailgraph
Monitor system logs: logcheck:
  • sends you mail with abnormal log lines
  • It's important to customize what is normal and you do it with regular expressions
Filtering viruses and spam clamav - Virus scanner Virus scanning:
  • Postfix gives the mail to clamav that scans it and gives it back if it's clean.
  • Strategies for infected mail:
    • silently delete it
    • refuse the mail and send a notification to the sender
    • refuse the mail and send a notification to the receiver
    • quarantine the e-mail
    • refuse delivery with a SMTP error
    • deliver with an extra header that says that it's a virus
spamassassin - Spam filter Spam scanning:
  • Postfix gives the mail to spamd that scans it and gives it back with some spam information.
  • Strategies for spam mail:
    • silently delete it
    • refuse the mail and send a notification to the sender
    • refuse the mail and send a notification to the receiver
    • quarantine the e-mail
    • refuse delivery with a SMTP error
    • deliver with an extra header that says that it's spam
  • New techniques:
    • greylisting: when you receive a mail from a host you've never seen before, refuse it with a temporary error, and accept it the second time (after some time delay). Spammers normally don't retry, and implementing retry would increase their cost of sending e-mail.
    • crossassassin: if more than some amount of your users receive a mail with the same message ID, throw it away. Sending mails with different headers would increase the cost of sending e-mail.
Man pages and sections Man pages are divided in sections:
  • man man shows all the sections of the manpages
  • man 5 postconf shows the postconf manpage in the "configuration file" section
  • Normally manpages are referred as manpage(section) (e.g. postconf(5) )

Enrico Zini: Third day in Addis

Believe it or not, a network that fails often is the best thing to have when you are teaching network troubleshooting. Various tools useful for networking:
  • ifconfig - configure a network interface

  • dnsmasq - Simple DNS and DHCP server

  • host - DNS lookup utility

  • route - show / manipulate the IP routing table

  • arping - send ARP REQUEST to a neighbour host

  • mii-tool - view, manipulate media-independent interface status (IOW, see if the cable works)

  • nmap - Network exploration tool and security / port scanner Examples:

    # Look at what machines are active in the local network:
    nmap -sP 10.5.15.0/24
    # Look at what ports are open in a machine:
    nmap 10.5.15.26
    
  • tcpdump - dump traffic on a network It can be used to see if there is traffic, and to detect traffic that shouldn't be there.

Useful tip:
# Convert a unix timestamp to a readable date
date -d @1152841341
What happens when you browse a web page:
  1. type the address www.google.com in the browser
  2. the browser needs the IP address of the web server:
  1. look for the DNS address in /etc/resolv.conf (/etc/resolv.conf is created automatically by the DHCP client)
  2. try all the DNS servers in /etc/resolv.conf until one gives you the IP address of www.google.com
  3. take the first address that comes from the DNS (in our case was 64.233.167.104)
  1. figure out how to connect to 64.233.167.104:
  1. consult the routing table to see if it's in the local network:
  1. if it's in the local network, then look for the MAC address (using ARP - Address Resolution Protocol)
  2. if it'd not in the local network, then send through the gateway (again using ARP to find the MAC address of the gateway)
  1. Send out the HTTP request to the local web server or through the gateway, using the Ethernet physical protocol, and the MAC address to refer to the other machine.
Troubleshooting network problems:
  1. See if the network driver works:
  1. With ifconfig, see if you see the HWaddr:. If you do not see it, then the linux driver for the network card is not working. Unfortunately there's no exact way to say that it works perfectly
  1. See if you have an IP address with ifconfig. If you find out that you need to rerun DHCP (for example, if the network cable was disconnected when the system started), then you can do it either by deactivating/reactivating the Ethernet interface using System/Administration/Networking or, on a terminal, running:

    # ifdown eth0
    # ifup eth0
    
    If you don't get an IP, try to see if the DHCP server is reachable by running:
    $ arping -D [address of DHCP server]
    
  2. See if the local physical network works:

  1. With sudo mii-tool, see if the cable link is ok. If it's not, then it's a problem in the cable or the plugs, or simply the device at the other end of the cable is turned off.
  2. Try arping or ping -n on a machine in the local network (like the gateway) to see if the local network works.
  1. See if the DNS works:
  1. Find out the DNS address:

    cat /etc/resolv.conf
    
  2. If it's local, arping it

  3. If it's not local, ping -n it

  4. Try to resolve a famous name using that DNS:

    $ host [name] [IP address of the DNS]
    
  5. Try to resolve the name of the machine you're trying to connect. If you can resolve a famous name but not the name you need, then it's likely a problem with their DNS.

  1. If you use a proxy, see if the proxy is reachable: check if the proxy name resolves to an IP, if you can ping it, if you can telnet to the proxy address and port:

    $ telnet [proxy address] [proxy port]
    
    you quit telnet with ^]quit.
  2. If you can connect directly to the web server, try to see if it answers:

    $ telnet [address] 80
    
    If you are connected, you can confirm that it's a web server:
    GET / HTTP/1.0 (then Enter twice)
    
    If it's a web server, it should give you something like a webpage or an HTTP redirect.
When you try to setup a service and it doesn't work:
  1. check that it's running:

    $ ps aux   grep dnsmasq
    
  2. check that it's listening on the right port:

    $ sudo netstat -lp
    
  3. check that it's listening from the outside:

    $ nmap [hostname]
    
  4. check for messages in /var/log/daemon.log or /var/log/syslog

  5. check that the configuration is correct and reload or restart the server to make sure it's running with the right configuration:

    # /etc/init.d/dnsmasq restart
    
dnsmasq:
By default: works as a DNS server that serves the data in /etc/hosts. By default: uses /etc/resolv.conf to find addresses of other DNS to use when a name is not found in /etc/hosts. To enable the DHCP server, uncomment:
dhcp-range=192.168.0.50,192.168.0.150,12h
in /etc/dnsmasq.conf and set it to the range of addresses you want to serve. Pay attention to never put two DHCP servers on the same local network, or they will interfere with each others. To test if the DHCP server is working, use dhcping (not installed by default on Ubuntu). To communicate other information like DNS, gateway and netmask to the clients, use this piece of dnsmasq.conf:
# For reference, the common options are:
# subnet mask - 1
# default router - 3
# DNS server - 6
# broadcast address - 28
dhcp-option=1,255.255.255.0
dhcp-option=3,192.168.0.1
dhcp-option=6,192.168.0.1
dhcp-option=28,192.168.0.255
Problems found today:
  • changing the name of the local machine in /etc/hosts breaks sudo, and without sudo it's impossible to edit the file. The only way to fix this is a reboot in recovery mode.
  • dhclient -n -w is different than dhclient -nw
Quick start examples with tar:
# Create an archive
tar zcvf nmap.tar.gz *.deb
# Extract an archive
tar zxvf nmap.tar.gz
# Look at the contents of an archive
tar ztvf nmap.tar.gz
Quick & dirty way to send a file between two computers without web server, e-mail, shared disk space or any other infrastructure:
# To send
nc -l -p 12345 -q 1 < nmap.tar.gz
# To receive
nc 10.5.15.123 12345 > nmap.tar.gz
# To repeat the send command 20 times
for i in  seq 1 20 ; do nc -l -p 12345 -q 1 < nmap.tar.gz ; done

John Goerzen: Reactions to Israel and Lebanon

I was surprised by the reactions to my story Saturday on Israel and Lebanon. Several pro-Israel posters are apparently in complete denial about what the Israeli military forces are doing.

Today, the American network ABC reported that Israel had bombed a Kleenex manufacturer, numerous farms, and all the major roads out of Lebanon. And they showed pictures of all of these during their evening newscast.

I find it highly unlikely that ABC is making this up.

One person asked, essentially, "do you really think a democracy could do this?" Yes. It's happened many times before. The United States and Britain did this sort of thing when they destroyed tens of thousands of homes and killed over 25,000 people, most of them civilians, in the bombing of Dresden. The United States also was responsible for the nuclear bombs dropped over japan, killing 140,000 people instantly and countless more due to the effects of the atomic weapon.

Being a democracy is no guarantee against extremism. Some Israel supporters need to take a hard look at what their military is doing.

As I explained, none of this is to defend the attacks against Israel, which of course are also terrible.

But I think Israel's strategy is going to wind up costing them -- they are creating huge numbers of angry Lebanese, that perhaps didn't have the motivation to attack Israel before, but now do. (Of course, the same error could be attributed to their enemy)

And both sides are catching innocent civilians more than military targets.

It's very sad.

Erich Schubert: Flow oriented programming?

I've been preparing on my exam on programming and modeling languages. The usual classification of imperative, functional, oop and logic programming is kind of inconsequent, since there are e.g. functional oop languages. To me, oop is more of a software engineering thing, usually applied to imperative programming with a load of syntactic sugar. The usual OOP examples suck. They're so basic that all the OOP and modeling stuff is just a complete waste of time. So I was considering more complex examples, and ended up at common design patterns. A couple of design patterns in OOP seem like workarounds to me; a new language (well, maybe C# has addressed some of these, I don't know) could probably add some more syntactic sugar to ease their use. I hate UML diagrams. To me they just emphasize all the obvious stuff, while they quickly get too complex to be of use for "seeing" the important things. Even UML activity diagrams in my opinion don't properly depict the flow of information/data in the program, which is what I really care about. Activity diagrams basically show you a sequence of methods are being called. But often you'll have a method being called thousands of times, with the actual relevant information being in the parameters passed. And some stuff might be done asynchronously, too. For certain problems (well, not for stuff like e.g. the train door used in OOP examples), it could be much more useful to abstract away from the involved classes - which are often just wrappers for data, "records", "datagrams", tcp packets - and instead model flows of data. Think of drawing conveyor belts transporting data, filtering it, duplicating it, ... The gstreamer framework seems to employ such a model for audio and video processing. You build pipelines by placing e.g. sources and sinks there. But you can interpret dozens of code examples with this model. SAX transform a stream of charaters into a stream of XML nodes. UI mainloops are basically a stream of UI events. Network data obviously is easy to model as a data flow; the "obvious" mapping into "packet objects" however often useless. Even when doing a select on a database, the result has an obvious representation as a data flow (a flow of records in this case). You probably only need a couple of "primitives". Sources and sinks, obviously. Filters, Y and Tee modules. Queues and Caches could be interesting, too. Note that data flows can work in two ways: push and pull. Maybe sometimes the same code could be used for pull and push operations, too. When push and pull driven flows meet you often need threads to connect. For example, a SAX parser usually will pull character data from a stream and push a stream of XML nodes as output. One way to get a pull-able output stream out of this (I'm ignoring e.g. the existing XMLpull API for this example) is to use a cache (which will eventuall contain the whole document as Nodes), another is to use two threads and just block the SAX thread until the other pulling thread has requested another node. Of course you can do all this in existing languages (you know, this doesn't give you anything new beyond turing completeness) - just like you could do OOP in assembler. You can, but it would be nice if the compilers offer you an easier syntax. Also it would be nice if I wouldn't have to write different code for pull-driven and push-driven operation. Also note that push type operation is rather typical for imperative programming languages - for i in range(0,10): print i - whereas pull type operations are typical for "lazy" functional languages - take 3 (repeat 'a').

15 July 2006

Carlos Villegas: Automatic update for the LSB compliance list (SoC 2006)

We have published a list for LSB-compliance in here. The script to create it was now modified to be easily updated automatically considering changes in the initscript files and new reported bugs. It will also consider special cases like with the scripts bootlogd and hostname.sh that wouldn't normally be considered as LSB compliant. The scripts are available under the GNU license at the project repository.

Simon Richter: AOL users on the lazyweb

Joining Sesse, I am also on the lookout for notebook tips. Since I'm mostly asking on behalf of my girlfriend, who is an aspiring meteorologist, having an option to choose between really long battery life (because she might be in the outback) and acceptable computing performance (for the biweekly number crunching are strong requirements, just as a tough case and at #4, screen resolution.
I'm especially wary of "unified memory" graphics, as several people have told me that a high-res display will consume a large part of your memory bandwidth, which is the bottleneck for dealing with large matrices anyway.

Erich Schubert: JSP-like C++ webpages

TNTnet, just uploaded to Debian, looks interesting. Basically it offers JSP-/PHP-like embedding of C++ code into web pages (or the other way round). Well, if you want to be precise, the syntax is actually much closer to HTML::Mason, a perl-based web application framework I've used some years ago. You can bet that these pages, compiled into native code, are hard to beat speed-wise... Think of compiling your website into your webserver. It's obviously not suited for wide audiences - you can have your users upload PHP files, but you probably won't allow them to upload C++ code - but more for high-performance sites with specialized applications. I have, however, one major gripe with it: The syntax is not XML. I wish they would have picked true XML as data format, instead on basically using string processing. I hate how many people treat webpages as mere character strings with some special characters instead of structured data serialized in some way or another. I don't want to be stuck using a line-based editor for structured data forever. I'm still using vim, and I'll probably continue for a while, but for XML I'm actually just waiting for an editor with a true understanding of XML and the power and speed-of-use of vim... KID remains my favourite way of generating web pages. It's templating transparently embedded in a XHTML file using a separate XML namespace. And it's actually compiling the templates into python modules. P.S. if your ever need the Dummy 16 and Dummy17 functions, get them from microsoft (excel) now! No need to write them yourself anymore! (Dummy 1-15 are apparently discontinued.) P.P.S. I just wanted to point out, that I'm convinced that embedding much code into a layout file is a bad idea (one of the reasons why I despise PHP). Keep logics and layout separate. KID for example is quite good at that. In my DNSoupdate tool for example, all the template contains is loop constructs and simple case disinctions. This also brings me to my biggest gripe with KID: it depends on python. I don't see a way of using the same template with a different language. So maybe I'll actually go back to some TAL solution or so that is a bit more portable templating-wise (and still perfectly reuseable XML).

13 July 2006

MJ Ray: World Cup Media

Apparently the World Cup final viewing figures were 17m BBC and 3.5m itv. Mark Beasley reads this as "Advertising is dead, long live advertising" but I think it's because itv's picture quality was absurdly inferior to BBC, as discussed at length on uk.tech.digital-tv. We noticed the difference during the group stage when no matches were on both channels, so we had to switch. In fact, itv's pictures had so many blobbies that I watched foreign broadcasters for some matches instead.

Jonathan McDowell: HDTV's not quite there yet.

I need a new TV. I've have my current one for 6 years now and it was secondhand when I bought it. Plus it gets this little green patch now and then (which it's been doing for a couple of years). Not hugely annoying, but everything helps in justifying a new one. My current TV is a normal 25" 4:3 set. I've worked out that if I go widescreen I need a 31" set to get the same height, which seems perfectly doable. The tricky bit comes in that I'd like HD, as hopefully the new TV will last me at least as long as the old one has. HD's only recently been launched in the UK - Sky brought out their HD service just in time for the World Cup (though I understand lots of people who'd pre-ordered didn't receive their upgrades in time). Telewest also have a recent HD service. Of course NTL, who I have, don't yet (despite them having merged with Telewest) and the Freeview DVB-T trials are only in Central London. Anyway, I won't have HD signal for a while, but I want to be ready when for when I do (and I'll be hooking a media PC up to the screen anyway, so will be able to take advantage of it via that method). Sky appear to have decided on using 2 HD formats; 720i (1280x720, progressive) and 1080i (1920x1080, interlaced). So having support for those would be nice. In addition I'd like 1080p (1920x1080, progressive), for things like the media box and in case content becomes available in that format (HD-DVD/BluRay?). This doesn't seem like a huge request. Lots of TVs in the UK are marketed as HD Ready. What does that mean? Essentially it specifies that the minimum native resolution of the screen is 720 lines and that there is a digital (DVI or HDMI) input that can support 720p and 1080i input and copy protection (HDCP). There is no minimum width; the set is allowed to scale the image to fit whatever it has. I've seen HD Ready sets that have a 1024x1080i native resolution - not wide enough for a native 720p image let alone 1080i. However most HD Ready sets seem to do 1366x768 as the native res, so fine for 720p but not 1080i/p. sigh I managed to find a TV from Philips, the 37PF9830/10, which does native 1920x1080p. Amazon even sell it, though for an eye watering £2,248.28. What does this get you? Integrated Freeview decoder? No. MPEG2/4 playing of movies from flash media? No, just image viewing. A nice big monitor for your computer? No, Philips' website only lists 1024x768 as the max computer res and I've seen reports in forums that 1366x768 is possible, but no higher. There's a 42PF9830/10 (42") that adds movie playing and ethernet, which sounds good but adds who knows how much to the price (I couldn't easily find a UK price). Plus it's probably too large for me even if it was affordable. My naive hope is that with the Sky push lots of people will have got sorted for the World Cup, or will go HD for Christmas. Meaning that come the new year I might have a better available choice of proper HDTVs and the pricing might be sane. I can dream, right?

Steve Kemp: And if I push too far don t wait up for me

Everybody probably knows this already, but in case you missed it - gluck.debian.org was compromised. We even made Slashdot. Ugh.

John Goerzen: Announcing hpodder

Today I'm finally announcing hpodder.

I've been trying different podcatchers in Linux, and have been generally unhappy. ipodder looked nice at first, but turned out to be horribly buggy.

bashpodder/podracer looked like a nice idea. However, it didn't have enough flexibility for me, its XML parser has some well-known failures (it's not a real XML parser, after all), etc.

So I wrote hpodder. hpodder is a command-line podcast downloader for Linux. It features:



You can download a source tarball, or apt-get install hpodder if you run Debian sid.

hpodder is written in Haskell, and calls the curl and id3v2 binaries. It uses the Sqlite3 library and my HDBC database interface for Haskell.

But you'd never need to know or care about that unless you're a programmer.

In future hpodder versions, I intend to improve the download status display, add last-seen date tracking, and add multithreaded downloading.

12 July 2006

Jonathan McDowell: Nothing impressive about Coke Zero

I tried Coke Zero for the first (and probably last) time this evening. While the first mouthful actually tasted not bad, the familiar and unpleasant taste of artificial sweetener soon hit. Oh well. Much better than Diet Coke, but not something I'd buy again. Not that I'm that fussed. I don't drink a lot of soft drinks - we buy pure juice for the house and although I occasionally drink Coke (or preferably Pepsi) when I'm out, it's only if I'm not drinking. I prefer ice cold water but it's usually ridiculously expensive and doesn't come in pints (tap water will sometimes do, but often isn't cold enough). Nice try Coke, but count me out.

Adam Rosi-Kessel: Homophobic Airplanes in Boston

Airplanes pulling anti-gay marriage banners have been circling my building much of today, apparently in an attempt to sway public (or legislative) opinion during today’s constitutional convention (liveblog here). The banners don’t cast the organizers as the brightest bulbs. Two of the banners are opaque references to the Chief Justice of the Massachusetts Supreme Judicial Court, Margaret Marshall — the messages were “Marshall’s Courts Are A Disaster” and “Marshall Incompetent Says Judge Sosman.” Unless you are already a rabid member of the anti-Goodridge crowd, these aren’t going to mean a whole lot to you. The other one is printed too small to read, although after twelve or thirteen time circling past my window, I could make out that it said something like “let the people vote on marriage,” which at least is a little clearer on the message (if not the font). All three had a URL that was too small to read, at least from my vantage point. I finally pieced together that the banners were referring to massnews.com (I hesitate to link to the site and boost its PageRank, but ultimately I think the contents are so poorly written and reasoned that it probably advances the cause of gay marriage more than anything). The articles on that site really make these guys look like loonies. A great example is this article. Although apparently written by an attorney, the article demonstrates near total ignorance of how legal reasoning and constitutional principles. E.g.:
When Justice Sosman discussed who else could be applying for marriage after May if the decision is allowed to stand, she had to include the “buzz” words that Marshall and other judges and lawyers use to intimidate everyone else — even including most lawyers who know nothing about this arcane language.
The “arcane” language the article refers to are the standard terms of art in equal protection law: suspect classification, scrict scrutiny, rational basis, etc.. (See this wikipedia article). Any first year law student should be quite familiar with this sort of discourse. (See my class notes from my first year constitutional law course and search for strict scrutiny or suspect classification). “Most lawyers” know nothing about this “arcane” language? Similarly — the following apparently forms the basis of the writer’s claim that Justice Marshall does not have the intelligence necessary to be the Chief Justice of the state’s Supreme Judicial Court:
Justice Marshall was incapable of answering Justice Sosman. She felt it necessary to insert an unusual footnote to say she was unable to understand or to answer Sosman’s erudite critique. “In any event, we fail to understand why the separate opinion [of Justice Sosman] chastises us for adopting the constitutional test (rational basis) …”
“Failing to understand” in a court opinion (or brief) does not mean “we’re just not smart enough to get it.” It is a standard idiom used to criticize another position as lacking support. It is far from unusual to make that sort of statement in a footnote. It is generally a sign that the point being criticized is so weak that it does not merit full treatment in the main text of the decision. In any event, I’m happy to see the anti-gay marriage movement leadership so totally marginalized. In a few years, I expect we will wonder what all the fuss was about.

Joey Hess: moreutils article

Here's an article on linux.com about moreutils. Whee!
Linux has the benefit of a steady barrage of new applications, utilities, software suites and tools -- as any casual perusal of freshmeat and SourceForge shows. One new bundle of software, the moreutils package by Debian developer Joey Hess, stands out from the rest. Moreutils is a collection of small, general-purpose tools that Hess says "nobody thought to write 30 years ago."

11 July 2006

Matthew Palmer: User Interfaces as Slideshows

Backstory: I recently found a new game. It's called Oolite, and is (probably unsurprisingly) a clone of that great old spacefaring game, Elite (for BBC Micro and C64, amongst others). This game (unlike the original!) uses OpenGL and hardware rendering, so it was a good motivation to get accelerated rendering going on my laptop (never bothered before; it's unlikely that DRI is going to make an Xterm run any faster, after all). The problem with DRI under Ubuntu Breezy on my laptop is that it makes the machine unstable. Every couple of hours, my screen would freeze, and I'd get a lovely collection of randomly-coloured 80x25 text-mode characters on my screen, flashing madly at me. That's the signal for "game over", apparently, and I'd have to reboot. Incidentally, this used to happen, but very rarely, before I turned DRI on, so it's not really DRI-specific, but it went from occasional irritation to regular irritation. End backstory.
So it was time to upgrade. "Dapper's Out", thought I. "May as well see what all of the fuss is about". I think the phrase "oops" correctly describes the result. For reasons which I have not fully determined yet, my system is now Dog Slow. (That's the technical term, anyway; I've got a few more colourful phrases for it that I'm using privately). What was, previously, a nice quick Xterm launch is now a slowly progressing set of concentric rectangles culminating in the eventual, lacklustre, appearance of a terminal window. Oolite, my new obsession, is like playing Quake3 (the last OpenGL game I really got into, many years ago) on a P-II 300 with no 3d graphics card -- here a frame, there a frame, oh, by the way, you died a couple of minutes ago. (And yes, before you ask, glxinfo says "direct rendering: Yes".) This isn't an old machine -- it's a Thinkpad T43, with gobs of RAM and a 1.7GHz processor. It ran Breezy like a charm. Now, my machine looks like a powerpoint presentation. I've got to put something onto my wife's "new" (P-III 700) laptop -- lord only knows what it'll think of Dapper. Other strangenesses I've noticed so far include: Ultimately, I think that the cause of my problem may be closely related to that last point. I need to find out what's chewing my machine's CPU and kill it dead. Oh won't that be fun. Well, enough moaning. Time to find the cause(s) of these problems and nail it/them to the floor.

Next.

Previous.