Fumigation MkII

"Do not use in spaces of volume smaller than 5 cubic metres."

This is a statement on the side of the Mortein pest control bomb spray cans. I wonder what's significant about that figure. I know the gas is flammable -- if used in smaller spaces does it spontaneously combust? Does it become potent enough to knock out an elephant? Hopefully I don't get to find out.

I guesstimate that my car has an internal volume of 2-3 cubic metres and there are three cans underneath that tarpaulin. One is inside the car, one is underneath the bonnet and one is underneath the rear. This gives you an idea how serious I am about removing the spider infestation thoroughly this time.

For those who missed it the first attempt was a single bomb inside the car. That killed a few and I've seen minimal evidence of spiders inside the car since then. Unfortunately those under the bonnet and at the back of the car survived. It was a definite improvement but recently I would still see half a dozen spiders on the outside of my car at night-time. They just sit on the paint, work on their webs or hide underneath the door handles. It's not good enough.

So this time I bought a tarpaulin so I can hit the entire car at once. I don't actually expect the concentration to be dangerous -- that tarpaulin will be anything but airtight, but it should keep up a nasty concentration for a couple of hours, which will do the job nicely.

Tomorrow I air it out and give it a good wash and vacuum. Woo.

The NBN: Tasmania

Today I was lucky enough to attend a forum in Hobart run by the Australian Computing Society with the leaders of the three state parties as the panelists. The theme of the forum was the National Broadband Network (NBN), which is a rollout of fibre-to-the-node for most of Tasmania and good wireless access in other areas. This was an opportunity for the leaders of our state to say what they wanted to do with this magnificent investment.

I was a little disappointed and I had the feeling that some of the industry players in the room were too. There was a lot of feel-good fluff about how important ICT is in the Tasmanian economy and a lot of dedication to creating a new ministerial position to oversee ICT in the state. What was missing was specific detail about what they would like to see the technology actually do.

Premier David Bartlett's explanation for this was that he doesn't want to get too narrow-minded and would prefer to engage with the industry to see what they want to do. This is at the same time as today announcing $4.85M of investment in various aspects of the industry. It would be nice if he had a detailed plan for what he wants this money to achieve before he throws it at people.

Nonetheless he has some goals in mind and that is commendable: fifteen thousand jobs created within four years, wifi available at tourist towns and CBDs, investing in online delivery of health services and development of the so-called "smart grid", which is the use of distributed generators to supply and sell power efficiently. He is also putting money into tourism, agriculture and small business with the idea that they will use the money to develop cool uses for the NBN. Well, all sectors can use money. I hope they use it in a way that will give the state a return on its investment.

Will Hodgman, leader of the Liberals, managed to talk quite a lot without actually saying very much. I was amused by his statement that he is sure that health and human services and education can be assisted by the NBN in ways we haven't even contemplated yet. I may be in favour of the NBN but I at least have some definite applications in mind when I think, "Yes, this isn't such a bad way to spend a buttload of money."

About twenty minutes of his speaking can be summarised by:

  • The ICT industry is important.
  • A Liberal government will do everything possible to remove roadblocks for both small and big business trying to operate in Tasmania and communicate with the Government. (What those roadblocks are I still don't know.)
  • They will set up an apolitical committee to choose the state's direction for technology.
  • They will have an ICT minister supported by two officer underlings.
  • They will invest heavily in education and health ICT services. Lots of investment.

He didn't even sound that excited about it. There's nothing more to say really; as far as I could see he didn't have anything to offer that Bartlett didn't.

Nick McKim, leader of the Greens, was fairly refreshing in that he wasn't as boring as the other two speakers. Full disclosure -- I vote Green -- but I think he approached today's forum with the most interesting information of any of the three speakers. That's orthogonal to the quality of the policy, by the way, but I learnt the most from him.

McKim spoke about having better e-commerce opportunities for business, better booking systems and making more available from our loungerooms, a point which Bartlett later seized. He would like to create a Broadband Innovation Centre in partnership with UTAS, similar to one in Melbourne, which would work with academia and other stakeholders and also work to identify the required skills for workers in the industry and ensure that suitable training is being offered. He spoke of the aging population in Tasmania as an opportunity to develop some excellent ICT technology to help elderly people live at home for longer, a theme which appears to be similar to Labor. He also recognises the importance of public access wifi, working to set it up on buses in Launceston.

More than the other two speakers I had some idea of what practical outcomes McKim wanted ordinary Tasmanians to get from the NBN. Possibly being a minority party means he doesn't get to say so much about investment, but his description was fairly limited on exactly how these things would be funded and managed.

Despite all the above I still don't think we have a clear political vision for what the NBN is going to achieve in this state. This was made abundantly clear by the first question from the floor. In far more words, it was essentially: "What are you actually going to do after the election?" As all three speakers had already wandered as close to answering that question as they were going to, it was taken as a statement and given no response.

I for one would like to know how the Minister for ICT (or whatever its title is, depending on the responsible party) will be chosen. I would also like our leaders to communicate with the industry and find out some exciting applications for the NBN before they start giving it money.

Here are a few other random ideas I have which I personally think would be valuable:

  • Development of local high definition audiovisual streaming services which will be in high demand once the bandwidth is available
  • Programmes to help old-school small businesses move to computerised and online accounting systems to reduce administrative overheads
  • Making as much as possible from Service Tasmania and Centrelink available online
  • Improving bandwidth in and out of state to make it more attractive for IT businesses to locate themselves here
  • Use of the NBN unfettered by an ill-thought national ISP-level filter

I can't say I'm excited yet. At least my software updates will download really fast.

Streams of Data

I've written before about my thoughts on social networking websites and the data you want to give them. What I basically said is that they can do whatever the hell they like with the data provided that I'm keeping a careful watch on what data I give them. If I consciously approve it, it should be fine, right?

I've found that there are two major flaws with this approach when it comes to Facebook.

  1. Other users can add factoids about you by tagging you in photos, status updates and notes.
  2. Facebook is increasing the amount of information which is consolidated from friends-of-friends rather than people you have directly befriended (and implicitly assigned some level of trust).

These two points combine to give a rather nasty flow of information--people can tag you in a photo and this is by default broadcast to all of your friends--even friends who don't know the person who took the photo or tagged you.

The permissions for the Photos application are fairly coarse-grained: either it can publish to your stream or it cannot. Since it's not very useful if you upload an album and it doesn't appear in your stream this option will be turned on for the vast majority of users.

This is another case of Facebook having poor privacy control options and hoping to annoy us into sacrificing our privacy further.

The data which you have to be comfortable having available publicly on Facebook include not only those which you personally approve but everything which Facebook allows your friends to make known about you. Your friends are probably a trustworthy lot, but it's all relative. When most people you know are marked as Facebook friends, including work colleagues, possibly you don't want your mates' photos of you being drunk scrolling past.

It's just setting you up to be embarrassed, really. To create controversy. This is what Facebook wants--more gossip, more excitement in your social world.

Yet the thing which is still weighing on me most heavily is that my entire list of friends is completely publicly available. I said in an earlier post that we still don't know what the consequences are of having that information readily available and easily able to be harvested by robots.

The fact is that I want it both ways. I don't want to have to hide with whom I associate, but I don't want it to be consolidated and made readily available for robots to be able to pick through social networks and work out significant links. It's kinda creepy and possibly useful for marketers, somewhere, or stalkers or spies.

Facebook is actively working against giving us better control over our privacy. They know fully well that most users won't even care. Of the few who do, like me, fewer still will actually cease using the free and completely voluntary service.

Still I wonder whether I'd be better off ditching Facebook. Again. In reality the damage has been done, but the information about me already in the system and on the Internet at large will become redundant faster the sooner I stop the supply.

I may be okay with that information being out there. Just not broadcast to everyone that quickly and easily, please.

Tracking ipv4/ipv6 usage

I discovered earlier today that through my trial ipv6 access I am using mostly ipv6 to access Google services. This made me wonder: just how much of my home network's communication with the outside world is through ipv6 compared with ipv4?

I don't have any results yet, but this is how I'm measuring it using Debian Linux.

Network traffic in the Linux kernel is managed through the tool iptables. Conveniently there are completely separate tables for ipv4 and ipv6 so I don't have to do anything to separate those. There are several chains which packets traverse depending on where they came from, where they're going and whether or not they're being routed on behalf another computer.

The chains of interest are INPUT, FORWARD and OUTPUT on the default table. INPUT receives all packets destined for this particular computer, FORWARD receives all packets which are being ferried on behalf of other computers (in my case, sharing Internet access with NAT) and OUTPUT receives all packets being sent from this particular computer, not on behalf of anyone else. By default all of these will simply allow the packets to pass unmolested.

What I've done is create four custom chains: ipv4_input_ppp0, ipv4_forward_in, ipv4_forward_out and ipv4_output_ppp0. They don't actually do anything, which permits the packets to continue onward, but iptables will keep track of how much traffic travels through each rule, both as a number of packets and in bytes.

Here is some output from "iptables -x -n -v -L" with these chains set up:

Chain INPUT (policy ACCEPT 617 packets, 92499 bytes)
pkts      bytes target     prot opt in     out     source               destination
41     5511 ipv4_input_ppp0  all  --  ppp0   *       0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy ACCEPT 46173 packets, 28090499 bytes)
pkts      bytes target     prot opt in     out     source               destination
21742 10919366 ipv4_forward_out  all  --  *      ppp0    0.0.0.0/0            0.0.0.0/0
24431 17171133 ipv4_forward_in  all  --  *      eth0    0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy ACCEPT 487 packets, 113453 bytes)
pkts      bytes target     prot opt in     out     source               destination
61     4783 ipv4_output_ppp0  all  --  *      ppp0    0.0.0.0/0            0.0.0.0/0

The rules are set up to use iptables' built in filtering capability. The ipv4_input_ppp0 rule will only collect packets which have an "in" interface of "ppp0". This means that packets from me sshing to my router from my LAN will not be counted. ipv4_output_ppp0 is handled the same way.

Similarly the destination interface is used to differentiate between incoming and outgoing traffic which is being forwarded by my router doing its router job, leading to counts in ipv4_forward_in and ipv4_forward_out.

This means we have direct byte counts which we can pull out of iptables and add together to get total incoming and outgoing ipv4 traffic. To make the information easier to process the counts can be zeroed at any time by running "iptables -Z".

The ipv6 setup is exactly the same except you use the tool ip6tables instead.

Here's my configuration for datalogging. I use the following in my firewall script which is run on boot to set up the chains and rules:


iptables -F
iptables -X

iptables -N ipv4_input_ppp0
iptables -N ipv4_forward_in
iptables -N ipv4_forward_out
iptables -N ipv4_output_ppp0

iptables -A INPUT -i ppp0 -j ipv4_input_ppp0
iptables -A FORWARD -o ppp0 -j ipv4_forward_out
iptables -A FORWARD -o eth0 -j ipv4_forward_in
iptables -A OUTPUT -o ppp0 -j ipv4_output_ppp0

iptables -Z

ip6tables -F
ip6tables -X

ip6tables -N ipv6_input_ppp0
ip6tables -N ipv6_forward_out
ip6tables -N ipv6_forward_in
ip6tables -N ipv6_output_ppp0

ip6tables -A INPUT -i ppp0 -j ipv6_input_ppp0
ip6tables -A FORWARD -o eth0 -j ipv6_forward_in
ip6tables -A FORWARD -o ppp0 -j ipv6_forward_out
ip6tables -A OUTPUT -o ppp0 -j ipv6_output_ppp0

ip6tables -Z

Then I run this script every day at midnight from root's crontab:


#!/bin/bash

ipv4_input_ppp0=`iptables -x -n -v -L | grep 'ipv4_input_ppp0' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv4_forward_in=`iptables -x -n -v -L | grep 'ipv4_forward_in' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv4_forward_out=`iptables -x -n -v -L | grep 'ipv4_forward_out' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv4_output_ppp0=`iptables -x -n -v -L | grep 'ipv4_output_ppp0' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`

iptables -Z

ipv6_input_ppp0=`ip6tables -x -n -v -L | grep 'ipv6_input_ppp0' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv6_forward_in=`ip6tables -x -n -v -L | grep 'ipv6_forward_in' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv6_forward_out=`ip6tables -x -n -v -L | grep 'ipv6_forward_out' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv6_output_ppp0=`ip6tables -x -n -v -L | grep 'ipv6_output_ppp0' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`

ip6tables -Z

ipv4_in=`echo "$ipv4_input_ppp0 + $ipv4_forward_in" | bc`
ipv4_out=`echo "$ipv4_forward_out + $ipv4_output_ppp0" | bc`
ipv6_in=`echo "$ipv6_input_ppp0 + $ipv6_forward_in" | bc`
ipv6_out=`echo "$ipv6_forward_out + $ipv6_output_ppp0" | bc`

echo "$ipv4_in $ipv4_out $ipv6_in $ipv6_out" >> /var/log/traffic/ip

Effective Anti-Filter Protest

Currently the protest against Senator Conroy's Internet filter is happening in a vacuum. This vacuum is occupied by thousands upon thousands of outraged Internet-savvy computer users. Unfortunately these people constitute only a small percentage of the overall voting population of Australia, and not all of them are prepared to vote based only on an Internet filtering policy. Where I live, the newspaper does not even cover the Internet filtering as a news item.

It has been shown clearly that appealing directly to the politicians responsible for the poor policy is not effective. We need to engage more with the general public, not only to raise awareness, but to make them realise how the filter could potentially affect them and show how futile it ultimately will be.

Enough Twitter. More Facebook? More real life, person-to-person interaction about this issue. "Hey, did you hear about that Internet filter? Dumb idea, huh? Hah, no, it won't help block child pornography..." You get the idea.

Protestors have succumbed to another problem -- factual inaccuracy. Nothing kills you faster in politics. In this article which Stephen Conroy wrote for Crikey he correctly blasts inaccurate reporting.

Keep up, people, we're no longer facing a heuristic filter which will cause massive slowdowns. Yes, the blacklist filter has only been trialed against 8 Mbit/s instead of 100 Mbit/s fibre, but pattern matching against 10000 URLs is not a large technological hurdle. ISPs can and will do that quickly in order to retain their competitive low-latency advantage.

It took them a couple of days, but nocleanfeed.com have updated their information page to reflect the most recent announcements, so that should be a good source of information. Furthermore, to encourage my own less technical friends to understand the issue I have developed my own more concise guide, The Australian Internet Filter And You, which I hope to use convince people that this filter is a bad idea. Please let me know if there are any factual errors in it; I would like to keep it up-to-date for as long as is required for this debate.

Go forth and spread the word amongst the people who wouldn't normally care! Goodness knows the media isn't doing it for us.

Twitter vs Me

Twitter has hated me for the last few days. I was getting consistent errors about exceeding my API rate limit when I haven't even been running any clients. Just in case I changed my password and now I'm getting inconsistent errors telling me that my account has been locked from excessive bad logins. Again, not running any clients.

Either I've recently become a Twitter celebrity without becoming aware of it and somebody somewhere is trying to crack my account, or Twitter hates me. Yeah, I'm going with the hate option. Never assume malice where stupidity will suffice.

So what's my response to all this? Shall I jump up and down and complain that the (free) Twitter service is not working and that I desperately need my constant intravenous flow of tweets to operate? It doesn't sound particularly elegant. Shall I make a declaration that Twitter fails in general and ragequit and try to delete my account? Tempting, but not incredibly rational or practical.

Instead, ironically, I've announced on Facebook that I won't be reading Twitter for a while. And that gives me a little bit of leeway to experiment. For Twitter has become a reasonably large time sink.

When you first deal with Twitter it's easy to fall into a naïve mindset that to prevent your list of tweets being full of crud you don't care about you just have to be careful who you follow. Unfortunately the reality is that perfectly nice and normal people, such as my friends and me, when given an environment like Twitter will fill it with all kinds of garbage. Alongside all the useful stuff you actually care about hearing from your friends. The signal to noise ratio is just bad because community expectations for usefulness of tweet content are not high.

The concept of flirting with the idea of not using Twitter for a while seems a little strange given that we all got along perfectly fine without it. All the same, it forms an inlet and an outlet in your brain which were nowhere near as active before -- an inlet for "I wonder what's been happening in my friends' lives lately" and an outlet for "heh, I just found/thought this thing which is kind of cool/annoying/I feel like sharing".

Previously those outlets had less opportunity to be exercised but they were invigorated by Twitter. When you stop using the service the outlets remain for a while. When I first started having difficulty with my API rate limiting my first desire was to post about it on Twitter. It gets into your BRAIN.

In hindsight I think those outlets were doing just fine before. I shouldn't have to think about what my friends -- or at least those connected to the Internet all day -- are doing at every hour, and I certainly shouldn't be sharing my random thoughts at a rate of several per day. Because they just ain't that good. If there's one thing the Internet is good at, it's showing you just how unoriginal you truly are.

Heck, I haven't even been reading Twitter properly lately. There's just too much crud. I'd never get anything done if I was notified every time a new tweet comes in, and it's something like a chore to read through the backlog a couple of times a day. It's not that the tweets aren't relevant to me or even that they aren't interesting -- they just aren't relevant or interesting enough. We have to draw a line, folks.

So is the correct response to not read Twitter at all? Beats me, but the Twitter website's failure to let me log in seems as good a reason as any to find out. I could go and play with identi.ca but I'd probably end up in a similar problem one day.

I just don't like micro-blogging in principle. I like using big words when they mean precisely what I want to express. The amount of time it takes me to fit what I want to say into 140 characters is significant, as is the amount of semantic intent I have to lose in the process.

Yet Twitter is fun. But it's not, lately. And now it's not working for me. So it can bugger off for a while.

Did I mention I like email? I like getting email from real people. Also phone calls. Just not at 4:20AM like the most recent phone call I got, please.

SLIP and slattach

After some experimenting I've managed to get a semi-permanent 115kb/s SLIP connection between my main Debian server and a 486 running BSD. By semi-permanent, I mean as soon as there's a power cycle I'm going to have to run out with a laptop with DHCP server, a crossover cable and some patience to make it work again.

Here's a bit of odd behaviour from the BSD machine shown from /var/log/messages:

Nov 20 03:08:33 cogline slattach[644]: SIGHUP on /dev/ttyd0 (sl-1); exiting

This occurs when I run slattach -s 115200 /dev/ttyd0 with nothing attached to the port, or when the other computer is connected and has been running slattach for "a while" (a minute or two?). Debian slattach has no difficulty running with the serial port in any condition, and if it's started reasonably soon before the BSD slattach, everything is fine.

Unfortunately this kind of problem makes it difficult to set up computers that will automatically negotiate a SLIP connection when they first turn on. I configured the BSD system to run slattach and the required ifconfig command on boot and it never works.

Normally SIGHUP is used to indicate that the carrier has dropped and a redial is necessary. The BSD slattach code reveals that the above message is simply what the SIGHUP handler does when no redial command is set, presumably before the interface has finished initialising because the "unit" is still "sl-1" instead of "sl0". I'm using a null modem cable so it makes sense that the carrier will go down when nothing is attached, but that doesn't explain the failure when both are running for a while.

Curious. Stay tuned, I might learn something.

Native PPP IPv6 in Debian

My ISP has been doing a lot of work in the IPv6 department recently and amongst all their IPv6 offerings they have just started a trial for ADSL customers to run a dual IPv4/IPv6 PPP connection. They also run a broker to provide an IPv6 tunnel over IPv4, but this native solution is much neater.

Here's how I've set it up on my home Debian server so that it will provide IPv6 addresses to my home network:

  1. Add +ipv6 to /etc/ppp/peers/dsl-provider
  2. I had to change the username in dsl-provider and in /etc/ppp/chap-secrets to use a different hostname, as this is how Internode knows you want to connect to the IPv6 trial server.
  3. Start the DSL connection with "pon dsl-provider", resulting in a connection ppp0 which has both an IPv4 internet address, and a local fe80:: IPv6 address
  4. Ensure eth0 has a local IPv6 address too, using ifconfig. I was messing about and lost it, and got it back by resetting with ifdown eth0; ifup eth0
  5. Now to get a real IPv6 prefix you need an IPv6 DHCP client. At Internode's suggestion I installed the WIDE client (package wide-dhcpv6-client in Debian). The given working configuration for a PPP connection ppp0 and local ethernet connection eth0 is placed in /etc/wide-dhcpv6/dhcp6c.conf as follows:
    interface ppp0 {
    send ia-pd 0;
    script "/etc/wide-dhcpv6/dhcp6c-script";
    };

    id-assoc pd {
    prefix-interface eth0 {
    sla-id 0;
    sla-len 4;
    };
    };
  6. When you install the WIDE DHCPv6 client it starts automatically, with an non-useful config. Restart it with invoke-rc.d wide-dhcpv6-client restart. Hopefully now an "ifconfig" will show that you have successfully attached a 2001:: prefix address to your eth0 interface.
  7. Add a default route -- this doesn't happen automatically. Run the command:
    route --inet6 add default dev ppp0
    This will add a default route through the gateway on your PPP connection.
  8. At this point there is working IPv6 connectivity on the local machine. It can be tested with "ping6 ipv6.google.com":
    # ping6 ipv6.google.com
    PING ipv6.google.com(tx-in-x68.1e100.net) 56 data bytes
    64 bytes from tx-in-x68.1e100.net: icmp_seq=1 ttl=56 time=171 ms
    64 bytes from tx-in-x68.1e100.net: icmp_seq=2 ttl=56 time=172 ms
  9. To set up advertising of addresses and routing I referred to Martin Krafft's excellent IPv6 with Debian documentation. In summary, the configuration I had to do was to set /proc/sys/net/ipv6/conf/all/forwarding to 1, which can be made permanent by setting it in /etc/sysctl.conf, and to set up radvd.
  10. radvd (which is also the name of the package) will provide IPv6 addresses from the allocated /64 prefix to hosts on the local network. Install the package. I set my /etc/radvd.conf to the following, which uses the prefix I was allocated, as found from ifconfig:
    interface eth0
    {
    AdvSendAdvert on;
    AdvLinkMTU 1280;
    prefix 2001:44b8:7c90:be0::/64
    {
    AdvOnLink on;
    AdvAutonomous on;
    };
    };
  11. Now other machines with IPv6 support which are connected via the eth0 interface should be allocated an address and will be able to access the IPv6 Internet too.

I have a fun ISP who gives me toys to play with. :)

More Pun Theory

I have a hypothesis regarding the comparison of the ability of punning folk.

Amongst those who pun actively, everybody is able to produce bad puns to a similar level of ability. It becomes instinctive enough to search for puns that you can come up with poor (often self-referential) puns virtually on demand.

This means that if you are to compare two people by how bad their puns are, the only observable criterion is the point of equilibrium each person chooses between high frequency of jokes and having any friends. The people who seem to not say the bad puns are just restraining themselves more effectively.

Truly good puns do require some level of skill in my opinion. Unfortunately I don't think of them very often.

Function Plotting in Inkscape

Today I found myself needing to draw both a sine wave and a triangle wave accurately for a diagram in Inkscape. It turns out that all the required functionality is included, but you have to do a little work yourself. Here are my findings...

The tool is called Function Plotter and can be found under Effects | Render | Function Plotter...

Sine Wave

The sinusoid is easy to do.

Sine Wave Function Plotter configuration

  • Draw a rectangle with the rectangle tool, select it, then open the Function Plotter.
  • Check the "Multiply x-range by 2*pi" box so the end x-value represents how many periods you want.
  • Adjust the y values of the top and bottom of your rectangle---if your sine wave has a peak value of 1 and you want it to take up the whole box, use +/- 1 here.
  • Make sure that "use polar coordinates" is unchecked.
  • Choose enough sample points to get a good looking sine wave. It evaluates your function at various points and makes an interpolating path. In this case I got a reasonable looking sine-wave with only 8 samples.
  • Put "sin(x)" into the Function area and click Apply.

Your rectangle will turn into a sine wave, like this:

Sine WaveTriangle Wave

You can't make a triangle wave directly, but it can be built up from simpler functions.

Triangle Wave Function Plotter configuration

  • Draw a rectangle which will contain the triangle wave.
  • Set the end x-value to the total number of peaks you want.
  • Set the bottom y-value to 0.0 and the top y-value to 1.0.
  • Choose a large-ish number of samples. You'll probably want at least 25 per peak. This is necessary to get tight corners on your triangle wave because Inkscape tries to smooth out lines between your points.
  • Make sure that both the "multiply by 2*pi" and "use polar coordinates" options are unchecked.
  • Put "-2*fabs(fmod(x,1)-0.5)+1" into the Function area and click Apply.

Your rectangle will become a triangle wave like this one:

Triangle WaveConclusion

Inkscape's function plotter is very powerful for drawing paths conforming to shapes which you can define mathematically. The "Functions" tab in the Function Plotter gives a list of the available functions. Have a play with it.