Stuxnet motives

•September 27, 2010 • Leave a Comment

Which motives could there be for the Stuxnet virus’ behavior? This is more of a list to remember, in case more evidence of the behavior surfaces later. Note that there’s no mention of which motives I think are likely – I don’t know enough about Stuxnet or the people behind it for that.

Direct motives (possible perpetrators):

  • Plain sabotage. They simply don’t like the Iranian leadership (US, Israel, Iranian political group) the idea of an Iranian nuclear plant or nuclear enrichment program (US, Israel, environmentalist group), that particular plant (local interest group), or the nuclear plant administrative or technological leadership (disgruntled workers).
  • Creating a new Chernobyl (doomsday sects).

Indirect motives:

  • Demonstrate the possibility of disabling a nuclear plant (black/grey hats, environmentalist group).
  • Increase tension between Iran and its political opponents (Iran, US, Israel).
  • Demonstrate skill, to get hired by a government agency (highly gifted person or small group).
  • Discredit Siemens software (competitor companies like Realtek).
  • Scare people / governments into supporting more strict Internet legislation (US, UK, Iran).
  • Scare governments into investing more in “cyberwar” agencies.
  • Harvesting of secret information (US, Israel, any nation that wants nukes).
  • Other misdirection: The obvious political motive could be a cover for what is happening in Indonesia or elsewhere.

WordPress.com blog daily backup

•September 23, 2010 • 2 Comments

WordPress.com Blog Export, The Next Generation is now on GitHub! Please go there for any future updates (and more export/backup scripts).

Based on the following documents:

Office super-tool: pdftk

•August 30, 2010 • Leave a Comment

If you scan or print a lot of documents, you have probably used PDF files. They are very nice, but it can be tricky to modify and otherwise handle them. Enter pdftk: great (but small), free (but valuable) and powerful (but simple). It’s also open source, which means you can learn it now, and use it the same way in five, ten, or twenty years.

I was recently sending out 28 temp job applications with six attachments each. I printed out the motivation letter for each job and 28 copies of each attachment, so I ended up with seven piles of paper which I then had to mix by hand to make 28 applications. Tedious work, and I could have smacked myself when I realized that it would have been much easier to put all the attachments in a single document, and printing that 28 times: Two piles instead of seven. This is really simple with pdftk – Just start up a shell (In Windows: Start → Run → cmd, in Ubuntu: Applications → Accessories → Terminal), and replace the file names in the following command with your own to produce a new file with all the documents in sequence:
pdftk cv.pdf "reference letter 1.pdf" [and so on] cat output new.pdf.

cat is the magic word: Concatenate all the files before it. pdftk can also do other useful stuff, like rotating pages (if they were scanned the wrong way around), splitting, watermarking, digital signatures and much more (see examples).

Drakensang on Ubuntu 10.04

•August 28, 2010 • Leave a Comment

Goal: Run Drakensang Gold Edition (AFAIK, version 1.2) German on Ubuntu 10.04 with 5.1 surround sound and nice graphics. As always, YMMV and RTFM apply.

Howto:

  1. Install Wine: sudo apt-get install wine
  2. Run setup: wine /media/cdrom0/setup.exe (could be in a different CD-ROM on your system)
  3. Click through the installation wizard without changing anything. The DirectX installation could take a long time.
  4. Get winetricks: wget http://www.kegel.com/wine/winetricks
  5. Install some Windows stuff: sh winetricks d3dx9 vcrun2003 xact (I’m not sure if vcrun2003 is really necessary)
  6. Run winecfg
  7. Under the Graphics tab, enable Emulate a virtual desktop
  8. Under the Audio tab, Set DirectSound Hardware Acceleration to Emulation.
  9. Start the game: wine ~/.wine/drive_c/Program\ Files/Drakensang/drakensang.exe -fullscreen -novideo

Based on WineHQ instructions, some dead ends and lots of swearing.

SVG example code

•August 4, 2010 • Leave a Comment

While trying to reduce the size of the CERN Central Library bookmark and getting away from the messy Inkscape SVG, I’ll post the resulting parts separately.

Library bookmark redesign

•July 27, 2010 • 1 Comment

Here’s a little hobby project that I’ve been working on at the CERN Central Library. Instead of the familiar blue bookmark with only a title, the idea is to add anything that can be useful to library guests (and even strangers) that will fit inside the space of the bookmark. Hopefully it can give more people an idea of what we can do for them, what they can do on their own, how to find us and provide a simple way to send feedback.

References:

Work overview (italicized items are unfinished or undecided):

  • Title
    • Replace “CERN” with the official logo? Doesn’t look very good, and we wouldn’t be respecting the 25% margin rule.
  • Logos:
    • CERN
    • Library?
  • Due date, style:
    • Date stamp
      • Pros: Very fast to mark, usually good readability
      • Cons: Need to get one :)
    • Circle month + date
      • Pros: Fast to mark, medium readability
      • Cons: Computer science-y?
    • Text boxes
      • Pros: Easy to distinguish month from day
      • Cons: Legibility depends on the writer, slow, visual noise
    • Open space
      • Pros: Clean design with open space
      • Cons: Legibility depends on the writer, slow, could be too close to other text
  • Location code 52 1-052
  • Main web page
  • Email address
    • Desk
    • ILL?
  • Phone
  • Fax
  • Opening hours
  • Staffed hours
  • Other links:
  • CERN map:
    • Buildings
    • Main roads
    • Landmarks
      • Logos where possible, text elsewhere
      • Library
      • Restaurants
      • Reception
      • Entrances
      • P1
      • ATLAS
      • Globe
      • Hostels
    • Walking directions inside buildings
    • North arrow
  • Library map:
    • Both floors
    • Desk
    • Shop
    • Computers
      • Mark OS with logos
    • News shelf
    • Number ranges for shelves
    • Outdoor area
    • A/V equipment
    • Theses drawers
    • Reference section
    • Paper cutter
    • Printers
    • Copy machines
    • Return / delivery box
  • Feedback form
  • CC-BY license

cvs2git2svn

•July 26, 2010 • 2 Comments

After discovering Ohloh, cleaning up and publishing repositories of yore seemed like a good idea. One of them was established back in the CVS newbie days, and contained lots of external binaries – Not the kind of thing you want to version control. Having used CVS, Subversion and Git (in that order), there was only one choice: Interactive rebase with Git. Also, the software was created while at CERN, so it should continue to be hosted there. And they had started a Subversion service in the meantime, so it was time to upgrade as well.

These instructions should fit for any CERN project, and can easily be modified to fit any repository. The usual warnings apply: YMMV and RTFM.

  1. Set some variables to avoid typing: svn_repo=Repository_name
    svn_user=User_with_edit_access
  2. Install the tools: sudo apt-get install cvs2svn git-core git-svn
  3. Create the cvs2git working directory: cvs2git_wd=$(mktemp -dt cvs2git.XXXXXXXXXX)
  4. Copy the contents of the repository (not a working copy) to the working directory: scp -r $svn_user@lxplus.cern.ch:/afs/cern.ch/project/svn/reps/${svn_repo}/* $cvs2git_wd. Don’t worry if /hooks is not copied – You don’t need it. If you don’t have filesystem access to the repository, you can try cvssuck. Be warned: It's really slow.
  5. Set cvs2git global options:
    1. zcat /usr/share/doc/cvs2svn/examples/cvs2git-example.options.gz > $cvs2git_wd/cvs2git.options
    2. Modify at least ctx.username and author_transforms in $cvs2git_wd/cvs2git.options.
  6. Make the new Git repository: git_wd=$(mktemp -dt git.XXXXXXXXXX) && git init $git_wd
  7. Convert to Git (repeat for each module):
    1. Modify run_options.set_project in $cvs2git_wd/cvs2git.options
    2. Create Git import files: cd $cvs2git_wd && cvs2git --options=cvs2git.options. If you get any warnings or errors you might have to change the options again.
    3. Import to Git: cd $git_wd && cat $cvs2git_wd/cvs2svn-tmp/git-blob.dat $cvs2git_wd/cvs2svn-tmp/git-dump.dat | git fast-import
  8. Make a backup in case the rest goes hairy.
  9. If you need to (which was kind of the point of this exercise), do an interactive rebase from the first commit: git rebase -i $(git log --format=%H | tail -1).
  10. git-svn needs at least one commit to be in the Subversion repository: svn_wd=$(mktemp -dt svn.XXXXXXXXXX) && svn co --username $svn_user svn+ssh://${svn_user}@svn.cern.ch/reps/${svn_repo} $svn_wd && cd $svn_wd && touch .temp && svn add .temp && svn ci -m "git-svn dummy commit"
  11. Convert to Subversion:
    1. Prepare git-svn repository: git2svn_wd=$(mktemp -dt git2svn.XXXXXXXXXX) && git svn clone --username $svn_user svn+ssh://${svn_user}@svn.cern.ch/reps/${svn_repo} $git2svn_wd && cd $git2svn_wd
    2. Get Git commits: git fetch $git_wd
    3. Apply Git commits as master branch: git branch tmp $(cut -b-40 .git/FETCH_HEAD) && git tag -am "Last fetch" last tmp && first_commit=$(git log --format=%H | tail -1) && git checkout $first_commit . && git commit -C $first_commit
    4. Apply Git commits: git rebase master tmp && git branch -M tmp master
    5. Check if this works : git svn dcommit --rmdir --find-copies-harder --dry-run
    6. If it does, you're good to go: git svn dcommit --rmdir --find-copies-harder

If the last step fails, the easiest way to continue is just to remove all commits from the Subversion repository, fix the Git repository, and restart at step 10.

 
Follow

Get every new post delivered to your Inbox.