_      _            _
         _ __ ___ (_) ___| | __  _ __ | |
        | '_ ` _ \| |/ _ \ |/ / | '_ \| |
        | | | | | | |  __/   < _| | | | |
        |_| |_| |_| |\___|_|\_(_)_| |_|_|
                  | |
                  |_|       Thoughts on (technical) stuff...
You're from: 107.22.127.92
Feb 27 2013

Persistent Synaptic Touchpad settings in Ubuntu 12.10+

Posted in linux; by Miek Gieben; comments: 1

I was wondering how to make my touchpad settings permanent in Ubuntu. I could find a few pointers on the net, like:

  • http://tombuntu.com/index.php/2011/11/06/persistent-touchpad-configuration-in-ubuntu-11-10/

  • http://ubuntuforums.org/archive/index.php/t-1538147.html

But sometimes it makes sense to look at your own system's documentation:

% cd /usr/share/X11/xorg.conf.d
% head 50-synaptics.conf
# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
#   Option "OptionName" "value"
#
Section "InputClass"

Which seems pretty obvious to me. I added

Option "TabButton2" "3"
Option "TabButton3" "2"

as my personal configuration.


Feb 05 2013

New Dutch Teletext Script

Posted in perl; by Miek Gieben; comments: 0

Last week, the Dutch public broadcaster (NOS) decided to "fix" their online teletext offering, there breaking an old script I had laying around. Their new web interface (displaying gifs) can be found here.

After @bdekruijff discovered their newly, hidden text feed, I decided to adapt the old script to this new situation. Thanks to this page I was able to (partially) reconstruct the feed. Most escape sequences are working, I'm still fiddling with finding Unicode chars for the "Contiguous Graphics Set".

The code can be found at github and is written in Perl. Or download a local version.

Usage is the same: tt 101 lists a page. It works best on a dark background. If you want to fix that, be my guest.

SCREENSHOT! (aka the ACID test page 702):


Jan 30 2013

Make me a sandwich, MAKE me a sandwich

Posted in zsh; by Miek Gieben; comments: 2

We all know this comic:

And now in zsh!

With the following snippet all commands that are started with an uppercase word will be prefixed with sudo and then executed.

So MAKE me a sandwich, becomes sudo make me a sandwich.

accept-line() {
    local B
    B=(${=BUFFER})
    if [[ "$B[1]" != [A-Z]* ]]; then
        zle .accept-line
        return
    fi
    if [[ $B[1] != "" && $B[1] == $B[1]:u ]]; then
        BUFFER="sudo $B[1]:l $B[2,-1]"
    fi
    zle .accept-line
}

And activate with:

zle -N accept-line

The avoid clashing with commands that are uppercase already (for instance GET and POST), it can be disabled by using a backslash. So using GET becomes \GET. (The same trick can be used to avoid expanding an alias).

Repo

Any code changes will be done in this Git repo.


Jan 22 2013

Pandoc2rfc and xml2rfc

Posted in pandoc, linux; by Miek Gieben; comments: 1

Thanks to the help of Marc Petit-Huguenin I have been able to create (and upload) debian packages (install fine on Ubuntu) for Pandoc2rfc and xml2rfc. For Pandoc2rfc I choose to add a little shell script that calls pandoc and xml2rfc for you. So creating an I-D is as simple as:

pandoc2rfc *.mkd    # or a few other extensions

The shell script depends on transform.xsl to be installed in /usr/lib/pandoc2rfc/, allthough this can be overridden with a flag. When pandoc2rfc is installed you don't have carry the supports scripts inside your I-D's source repo. My pandoc2rfc I-D source directory now only has: template.xml, abstract.pdc, back.pdc, middle.pdc and a bib/ directory with references.

Debian packages

As said there are now debian packages, see below on the setup. If you are finished you can install the pandoc2rfc and xml2rfc combo with:

sudo apt-get install python-xml2rfc pandoc2rfc

I'm still learning this create-deb-and-upload stuff, so some breakage might be expected....

With the help of Marc Petit-Huguenin I have access to a debian infra structure over at pandoc2rfc.implementers.org

Here's what you should probably put in your: /etc/apt/sources.list.d/pandoc2rfc.list:

deb http://pandoc2rfc.implementers.org/ testing/$(ARCH)/
deb http://pandoc2rfc.implementers.org/ testing/all/
deb http://pandoc2rfc.implementers.org/ stable/$(ARCH)/
deb http://pandoc2rfc.implementers.org/ stable/all/
deb-src http://pandoc2rfc.implementers.org/ testing/source/
deb-src http://pandoc2rfc.implementers.org/ stable/source/

Note that if the apt-transport-https package is installed then I recommend to use https instead:

deb https://pandoc2rfc.implementers.org/ testing/$(ARCH)/
deb https://pandoc2rfc.implementers.org/ testing/all/
deb https://pandoc2rfc.implementers.org/ stable/$(ARCH)/
deb https://pandoc2rfc.implementers.org/ stable/all/
deb-src https://pandoc2rfc.implementers.org/ testing/source/
deb-src https://pandoc2rfc.implementers.org/ stable/source/

All the packages are automatically signed, you can install the public key like this:

wget https://pandoc2rfc.implementers.org/config/key.asc
sudo apt-key add key.asc

The fingerprint of the key is as follow:

CDB3 BC52 DFDC 8A58 35F1 714D 0309 943D 9AD0 8F3F

Jan 20 2013

Google

Posted in life; by Miek Gieben; comments: 4

As I tweeted, I will be going to work for Google UK. The 18th of March 2013 will be my first work day. This also means we will be living in London starting somewhere in May 2013.

As of now, I'm finishing my remaining work at SIDN.

Needless to say, we are very much looking forward to start a new chapter in our lives :-) .


Jan 20 2013

rdup 1.1.14

Posted in rdup; by Miek Gieben; comments: 0

I've released rdup 1.1.14 in which some new features are added and a few minor bugs are squashed.

See the project page for more information.


Jan 19 2013

Vim as MANPAGER

Posted in vim; by Miek Gieben; comments: 0

I like Vim, so I try to use it at many places. Like in my shell (set -o vi), and when writing and coding.

After some Googling I found that Vim can also be used as a MANPAGER. But there is one nagging issue. To quit viewing the manual page you have to type ':q', which is one keystroke more then when using less as your MANPAGER... Needless to say: this is unacceptable.

Save this script in a file named manpager:

col -b | view -c 'set ft=man nomod nolist' \
-c 'map q <ESC>:quit!<CR>' -

Make it executable and then:

export MANPAGER=/home/miekg/bin/manpager