All PFTS
On the east bank of the River Spree, something strange is happening - the German government is renovating a section of the Berlin wall. This is by far the biggest remainder of the so-called anti-fascist protection barrier that divided....some of what you'd expect, but I am not sure I agree with all this, I wonder if I can get back to their blog and comment in time.
The dark shadow of history has always loomed over Stephen Poliakoff’s dramas. But Glorious 39, set on the eve of war, is bleaker than ever. Also talks about his complete filmography. I should see some of these, wonder if Sue's seen'em or would like them.
Margaret Deriaz, Head of Film Distribution at the BFI, explains her film choices for commemorating the 20th anniversary of the fall of the Wall, also a link to the November Program, what's left of it, this season though continues to December.
DaveLevy: Waiting for the train at Waterloo. This time it was a large Chinese meal that delayed me.

One of my (many) pet peeves are shell scripts that fail to delete any temporary files they use. Included in this pet peeve are shell scripts that create more temporary files than they absolutely need, in most cases the number is 0 but there are a few cases where you really do need a temporary file but if it is temproary make sure you always delete the file.

The trick here is to use the EXIT trap handler to delete the file. That way if your script is killed (unless it is kill with SIGKILL) it will still clean up. Since you will be using mktemp(1) to create your temporary file and you want to minimize any race condition where the file could be left around you need to do (korn shell):

trap '${TMPFILE:+rm ${TMPFILE}}' EXIT

TMPFILE=$(mktemp /tmp/$0.temp.XXXXXX)

if further down the script you delete or rename the file all you have to do is unset TMPFILE eg:

mv $TMPFILE /etc/foo && unset TMPFILE
DaveLevy: RT @wrwalke: What Google is used for... http://is.gd/527Kg
From photo dump, "Many a true word is said in jest".
As noted here, I have been reading two books for a couple of months and not made much progress in recent times. My progress through books under consideration tend to be directly proportional to the amount of time spent traveling on trains or plains and I have not been doing that much of either for the last few month, hence the slow progress. A bit more focus and a train trip means I finished one of them last week.

Beautiful Security is a collection of 16 chapters written by 16 different people(s) with 16 different perspectives on 16 different aspects of security. This means there is no common thread other than it is about computer security. In my view this is no bad thing.

I think my favorite chapter was "The evolution of PGP's web of trust" by Phil Zimmermann and Jon Callas. The history and insight into the design decisions was really interesting. I also enjoyed the 1st chapter by Peiter Zatko on "Psychological Security Traps".

My interest in Computer Security got triggered about 6 months ago when I got cornered into helping 2 farmers run their PC and laptop. The virus and malware problems were just stunning. Work also had a few triggers (if you work for Sun ask me about the "find" incident) and this book has been very good at giving a informed view on 16 different areas of computer security.

After a couple of months off races, I am really looking forward to the Cardington Cracker in a couple of weeks.

from Webware - CNET
The digital economy bill is misnamed. A more honest title for the legislation, recently introduced in the Lords, would be the copyright protection and punishment bill. It is less about creating the digital businesses of the 21st century than protecting the particular 20th century business models used in music and film.
DaveLevy: @tom_watson why ORG and not Liberty, where are Liberty on this, I'd feel better if they were on board and noisy
DaveLevy: RT @tom_watson: Reading "Mandelson, ethics, culture, commerce and copyright law" http://bit.ly/88tXWd, someone's thought very hard
DaveLevy: I have uninstalled wordpress from http://test.davelevy.info, it now has my google translation pages there
DaveLevy: Just signed http://petitions.number10.gov.uk/dontdisconnectus/, it needs some more #threestrikes #uk
This is a truely awesome page, detailing where to get and how to use these profiling tools.
DaveLevy: RT @jimkillock: RT @doctorow: UK plan to create "Pirate Finder General" , form militias, write laws http://tinyurl.com/yfbh9l2 #no3strikes
using a VB VM to learn about OpenSolaris, this is a page at wikis.sun.com
WX2, a shared nothing database
DaveLevy: @c0t0d0s0 if you look for your blog using google & your name it offers an auto complete, somewhere through your surname. Kudos.
DaveLevy: @ChrisGerhard they don't need a sign for that, it's normal service
DaveLevy: @andymurray01 at LOSUG meeting in the city and planning some drinkies in 'vinos later if you give up on getting home
Gregynog is a Country house near Newtown which was left to the University of Wales. For the last 13 years it has hosted a weekend of interview skills for 2nd Year Computer Science students from Aberystwyth University, of which I have managed to miss 2.

This year Paul Humphreys and myself ran objective setting sessions. A bit like life coaching, but without the 100 quid an hour overhead.

So good luck to those who's objectives included

  • Propose to his girl friends (maybe I should have pointed him to the Kepner Tregoe process for decision analysis)
  • Eat a baby dolphin
  • Stop smoking (not sure what, best not to ask)
  • Get an industrial year which involves Android
  • Finish their assignment by an appropriate date
  • Write code to do xxxxx in C,C++, Haskal, Perl, Python, etc and put to on their blog.

it takes all sorts to make a world. Many of the outcomes could have been tighter and better clarified, but it was an exercise in "How"

Both Paul and I also set out our list of 10 each, so I am off to finish my 2 books I have been reading since March and Paul will have dug manure into his allotment if it ever stops raining.

DaveLevy: RT @Openrightsgroup - #threestrikes is coming to the UK - phone your MP today http://bit.ly/phoneyourmp

The current episode of the German HELDENFunk podcast features an interview with Chris Gerhard about one of his favourite subjects: DTrace (in English, beginning at 14:58):

After the interview, we hear a guy called "Konteener Kalle" express his love (in German) for DTrace by playing a prank on his boss: Whenever he presses the Windows key (on an OpenSolaris system, mind you), he's punished by watching the XScreensaver BSOD hack (of course not knowing that it's just a screensaver).

That little joke challenged me to actually implement this prank. Here's how to do it.

The Idea

The idea of this prank is to start the XScreensaver Blue-Screen-of-Death screensaver (which simulates a Windows crash experience) on an OpenSolaris system whenever the user presses a certain key a certain number of times. This could be the Windows-Key (which doesn't have any real use on an OpenSolaris machine) or any other key. We count the number of key presses and only execute the BSOD after a certain number of key presses in order to make the prank less obvious.

Step 1: Identify the Windows (or any other) Key

If you have a Windows-Keyboard, this is easy: Run xev and press the Windows-Key. Take note of the keycode displayed in the xev output. Of course you can use any other key as well to play this prank. In this case, I'm using the left Control-Key, because I don't have a Windows-Key on the system I'm working on. The Control key has the keycode 37.

Step 2: Configure XScreensaver for BSOD

XScreensaver comes with a great collection of "hacks" that do interesting stuff on the screen when the screensaver activates. Check out the /usr/lib/xscreensaver/hacks directory. Each hack can be run individually, but then it will only execute inside a new window. For the BSOD illusion to be realistic, we want to execute the BSOD hack in full-screen.

This can be achieved by telling XScreensaver to demo the BSOD hack for us. It will then create a full-screen window and execute the BSOD hack inside the new window. The following command will tell XScreensaver to run a hack for us:

xscreensaver-command -demo <number>

The <number> part is a little complicated: XScreensaver looks at its config file ~/.xscreensaver where it stores a list of programs and arguments after the keyword "programs:". <number> simply refers to the number of the hack on that list. Therefore, we must create an entry in our admin user's .xscreensaver file that starts bsod(6) with the right parameters and that gives us a known number to call xscreensaver-command with.

Let's put our entry at the top of the list so we can simply use the number "1" to execute the BSOD screensaver. Somewhere in our .xscreensaver, the programs section should look like this:

  ...
  textFile:       /etc/motd
  textProgram:    date
  textURL:        http://blogs.sun.com/roller/rss

  programs:                                                                     \
  -               "BSOD Windoze"  bsod -root -only nt         \n\
  -                "Qix (solid)"  qix -root -solid -segments 100              \n\
  -          "Qix (transparent)"  qix -root -count 4 -solid -transparent      \n\
  ...

You can test this by running xscreensaver-command -demo 1.

Step 3: Write a DTrace Script That Sets Up the Trap

Now it gets more interesting. How do we use DTrace to find out when a user presses a certain key? All we know is that the Xorg server processes the keystrokes for us. So let's start by watching Xorg in action. The following DTrace command will trace all function calls within Xorg:

pfexec dtrace -n pid`pgrep Xorg`:::entry'{ @func[probefunc] = count(); }'

Let's start it, press the desired key 10 times, then stop it with CTRL-C. You'll see a long list of Xorg functions, sorted by the number of times they've been called. Since we pressed the key 10 times, it's a good idea to look for functions that have been called ca. 10 times. And here, we seem to be lucky:

  ...
  miUnionO                                                          8
  DeviceFocusInEvents                                               9
  CommonAncestor                                                   10
  ComputeFreezes                                                   10
  CoreLeaveNotifies                                                10
  key_is_down                                                      11
  FreeScratchPixmapHeader                                          12
  GetScratchPixmapHeader                                           12
  LookupIDByType                                                   12
  ProcShmDispatch                                                  12
  ProcShmPutImage                                                  12
  ...

The key_is_down function looks like exactly the function we're looking for! In fact, some googling tells us that this function's 2nd argument is the keycode of the key that is down when the function is called.

Why do we see "11" and not "10" function calls to key_is_down? Because it also counted my pressing of the Ctrl-Key when I stopped the DTrace script through Ctrl-C :).

This gives us enough knowledge to create the following DTrace script:

  #!/usr/sbin/dtrace -s

  /*
   * BSODKey.d
   */

  /*
   * This D script will monitor a certain key in the system. When this key is
   * pressed, a shell script will be executed that simulates a BSOD.
   *
   * The script needs the process id of the Xorg server to tap into as its
   * first argument.
   *
   * One example of using this script is to punish a user pressing the
   * Windows key on an OpenSolaris system by launching the BSOD screen saver.
   */

  #pragma D option quiet
  #pragma D option destructive

  BEGIN
  {
          ctrlcount = 0;
          keycode=37
  }

  pid$1::key_is_down:entry
  /arg1 == keycode/
  {
          ctrlcount ++;
  }

  pid$1::key_is_down:return
  /ctrlcount == 10/
  {
          ctrlcount = 0;
          system("/usr/bin/xscreensaver-command -demo 1");
  }

First, we need to enable DTrace's destructive mode (ever heard of a "constructive prank"?) otherwise we can't call the system-command at the end. The script uses the pid provider to tap into Xorg. Therefore, we need to give it the PID of the Xorg server as an argument:

pfexec ./BSODKey.d `pgrep Xorg`

It then sets up a probe that fires whenever key_is_down is called with our keycode and counts the key presses. At the end of the key_is_down function call, it checks whether we reached 10 keypresses, then executes the BSOD screen saver and resets the counter. You may need to make sure that the DISPLAY variable is set correctly for the BSOD program to show up on the victim's screen when starting this script.

After hitting the Control-Key 10 times, we're rewarded with our beloved BSOD:

Conclusion

That wasn't too difficult, was it? Yes, one could have done the same thing by writing a regular script that taps into /dev/kbd or something similar. But the beauty of DTrace lies in the simplicity of this script (Tap into the right function while it's running) and in the fact that it now can be modified very easily to fire BSODs at any kind of event, including the user hitting a certain area of the screen with his mouse or selecting a particular text or whatever you choose it to be.

So, have fun with this script and let me know in the comments what kind of pranks (or helpful actions) you can imagine with DTrace!

the offering of a peer to peer, co-operative storage cloud, could be great for freemium business models not sure how more traditional and privacy consious people will live with this, especially if using virtual file systems.
from - Worldwide electric plugs - Gizmodo, with a nice colour map as well
They say "Cool t-shirts from the web's best t shirts emporium"
DaveLevy: @JamesVinzer how'd you lose such a unique name?

If you share a file system using the CIFS server (not SAMBA) and create a file in that file system using Windows XP the file ends up with these strange permissions and an ACL like this:

: pearson FSS 12 $; ls -vd Bad
d---------+  2 cjg      staff          2 Nov 13 17:11 Bad
     0:user:cjg:list_directory/read_data/add_file/write_data/add_subdirectory
         /append_data/read_xattr/write_xattr/execute/delete_child
         /read_attributes/write_attributes/delete/read_acl/write_acl
         /write_owner/synchronize:allow
     1:group:2147483648:list_directory/read_data/add_file/write_data

         /add_subdirectory/append_data/read_xattr/write_xattr/execute

         /delete_child/read_attributes/write_attributes/delete/read_acl

         /write_acl/write_owner/synchronize:allow

: pearson FSS 13 $; 


The first thing that riles UNIX some users is the lack of any file permissions, although things seem to work fine. The strange group ACL is for the local WINDOWS SYSTEM group. However the odd thing is for me it renders iTunes on the Windows system unable to see the files that it has created.

The solution is to add a default ACL to the root of the file system (well to every object in the file system if the file system is not new) that looks like this:

A+owner@:full_set:fd:allow,everyone@:read_set/execute:fd:allow

So this has the rather pleasant side effect of setting the UNIX permissions to something more recognisable:

: pearson FSS 20 $; ls -vd Good
drwxr-xr-x+  2 cjg      staff          2 Nov 13 18:16 Good
     0:owner@:list_directory/read_data/add_file/write_data/add_subdirectory
         /append_data/read_xattr/write_xattr/execute/delete_child
         /read_attributes/write_attributes/delete/read_acl/write_acl
         /write_owner/synchronize:file_inherit/dir_inherit/inherited:allow
     1:everyone@:list_directory/read_data/read_xattr/execute/read_attributes
         /read_acl:file_inherit/dir_inherit/inherited:allow
: pearson FSS 21 $; 

and the even more pleasant side effect of making iTunes works again!

DaveLevy: Any ideas for a funny or thought provoking play or show in London in December? lazyweb