mercredi 19 juin 2013

DELL 4500s from the forest - chapter 4 : the giveaway

Having toyed enough with this machine I started to look for potential collectors. There's not a lot of such enterprises nearby but I found one email. It took them 7 days to answer me negatively. So I was wrong, twice, for thinking they were out of business and for thinking this machine had any value at all. Yesterday, my father caught a neighbor saying she had issues installing a computer her grandchild gave her so she can learn to surf the web. On her living room floor lies an ATX mid-tower, a big SONY vaio desktop from 2002~ I guess. Problem .. it's booting quite randomly (1 on 10 on average). After an hour trying to unsuccessfully isolate the problem I tell her about my encounter with the DELL. She agrees to try it. I also proposed to sell her my ThinkPad x61 for $150. But she didn't want to spend money so .. she'll take the old Pentium 4.

Last time she had to use a computer was long ago at work. I didn't understand that it was already twenty years since she retired, she's actually 82~. At that time I'm not even sure she was given a graphical interface. Probably some complex mainframe terminal system. And so I didn't mind blindly throwing her this instrument of torture called a mouse. Suddenly explaining her things looks a lot longer then I thought. Classic first encounter with a mouse. Even the basic web conventions (pages, clickable [blue] text as links, searching,...) is heavier than it seems. She's completely unsaavy regarding contemporary usage, and doesn't look very fond of the digital world but she's kinda witty, I'm sure she'll manage.

samedi 15 juin 2013

jonesforth #0

Trying to learn how to write small Forth interpreter (1), I find a very detailed tutorial (thanks web.archive.org again)(2). It's literal documented assembly you should be able to run through gcc to get native code. Except it doesn't. But someone uploaded it on github (3), so maybe this issue has been documented or fixed. No luck but there's an old blog post with comment mentionning problems close to mine. They're solution actually work (although I don't know gcc options enough to really understand why)(5).

1. http://lambda-the-ultimate.org/node/2452
2. http://web.archive.org/web/20090209003017/http://www.annexia.org/_file/jonesforth.s.txt
3. https://github.com/chengchangwu/jonesforth/
4. http://rwmj.wordpress.com/2010/08/07/jonesforth-git-repository/#comment-6591
5. you will need to recompile without the “-Wl,-Ttext,0″ option to GCC

lundi 3 juin 2013

yet another fat archlinux update (with added dangerous migration juicy bits)




For once I had the reflex to check archlinux.org for additional informations. There was a filesystem structure change that needed some care.

# update of the day

luser@x60s_GPT ~ (master*) $ pacman -Qu
apache 2.2.24-1
bash 4.2.045-1
bluez 4.101-1
bridge-utils 1.5-1
cdrkit 1.1.11-2
coreutils 8.21-1
cryptsetup 1.6.1-1
dash 0.5.7-3
device-mapper 2.02.98-3
dhcpcd 5.6.8-1
e2fsprogs 1.42.7-1
ecryptfs-utils 103-1
ed 1.8-1
filesystem 2013.03-2
fuse 2.9.2-1
gconf 3.2.6-1
glibc 2.17-5
inetutils 1.9.1-5
iproute2 3.9.0-1
iptables 1.4.18-2
iptraf-ng 1.1.3.1-1
kmod 13-1
libatasmart 0.19-1
libsasl 2.1.26-3
lsof 4.87-1
lvm2 2.02.98-3
net-tools 1.60.20120804git-2
openresolv 3.5.4-2
pm-utils 1.4.1-5
ppp 2.4.5-5
rtmpdump 20121203-1
sed 4.2.2-2
shadow 4.1.5.1-5
systemd 204-2
systemd-sysvcompat 204-2
sysvinit-tools 2.88-10
tar 1.26-3
udisks2 2.1.0-2
usbmuxd 1.0.8-1
util-linux 2.23.1-1
v4l-utils 0.9.5-1
wpa_actiond 1.4-1
wpa_supplicant 2.0-3
zsh 5.0.2-1

# had to remove these alien packages because of the filesystem upgrade

luser@x60s_GPT ~ (master*) $ pacman -Qqo /bin /sbin /usr/sbin | pacman -Qm -
brightd 0.4.1-2
consolekit 0.4.6-4
ddcxinfo-arch 0.8-2
hwd 5.5.2-1
localepurge 0.6.2+nmu2-3
pmtools 20101124-2

samedi 1 juin 2013

xmobar idiocy : do not poll for constant values periodically (or at least do it very slowly)

Out of curiosity, I wanted to see if I needed to `sudo htop` to be
 able to strace a process from within. I picked the most mundane one,
 my second instance of xmobar.

 There's an awful lot of things happening (signals, clock, syscalls..), so I decide to run strace externally to keep only easy to follow syscalls like `read`, `open`:

    $ strace -p `pgrep xmobar | tail -n1` -e read 2>&1 | less

 now inside less you type `&/read` and enjoy the input received by
 xmobar to populate the string template you'll see on screen. Cool.

 Still an awful lot happening

 read(7, "dummy\n", 8096)                = 6
 read(7, "dummy\n", 8096)                = 6
 read(7, "dummy\n", 8096)                = 6
 read(7, "dummy\n", 8096)                = 6
 read(7, "dummy\n", 8096)                = 6
 read(7, "dummy\n", 8096)                = 6
 read(7, "dummy\n", 8096)                = 6
 ...
 read(7, "CK:2728 :: LK:3620", 8096)     = 18 (yes, that's a
 narcissistic reddit karma probe)


 And then I realize that my configuration is absurdly periodically
 polling for constants like `uname` or `whoami`.

 Indeed, here's the haskell code :

 , Run Com "uname" ["-s","-r"] "os" 0
 , Run Com "whoami" [] "who" 0
 , Run Com "/home/dummy/bin/reddit.sh" [] "reddit" 600
 , Run Com "/home/dummy/bin/hackernews" [] "hackernews" 600


So I change the frequency to a large value

 , Run Com "uname" ["-s","-r"] "os" 6000
 , Run Com "whoami" [] "who" 6000
 , Run Com "/home/dummy/bin/reddit.sh" [] "reddit" 600
 , Run Com "/home/dummy/bin/hackernews" [] "hackernews" 600


And, now nothing (almost) happens.

 read(7, "dummy\n", 8096)                = 6
 read(7, "CK:2728 :: LK:3620", 8096)     = 18
 read(7, "", 8096)                       = 0
 read(7, "[0|up to date]\n", 8096)       = 15
 read(7, "[0|up to date]\n", 8096)       = 15
 read(7, "Linux 3.9.4-1-ARCH\n", 8096)   = 19
 # 5 minutes pause
 read(7, "dummy\n", 8096)                = 6
 read(7, "CK:2728 :: LK:3620", 8096)     = 18
 read(7, "", 8096)                       = 0
 read(7, "[0|up to date]\n", 8096)       = 15
 read(7, "[0|up to date]\n", 8096)       = 15
 read(7, "Linux 3.9.4-1-ARCH\n", 8096)   = 19


 It might be unrelated, but for the first time since I used
 xmonad/xmobar I now witness CPU usage below 2% stable, even 0% for
 small period of time. (three times along writing this paragraph)

 <idiot/>

update: 04-10-2013

I just did a little RTFM/Googling to find if xmobar supported a run-once option, and indeed jaort added a way to instruct xmobar to do so. Just use Run Com with a frequency of 0 and it won't run the process again. I re-installed archlinux and for a reason I cannot attach strace to xmobar, but htop can and doesn't show the same amount of activity as before. There's two dozen of waitpid, that are probably a polling policy of xmobar to wait for the process output.. but nothing incoherent. That said, my cpu doesn't reach the 0% of activity as much. <idiot><lost/></idiot>