Entries posted in October 2008

Well, are you sure you're using that thing correctly?

Friday, 31 October 2008

In response to the comments left on my previous entry about executable configuration files I've changed the way that tscreen works.

There is still support for using an arbitrary shell script or binary as a configuration file, but you must be explicit to enable it:

#
#  Load the dynamic section, if it exists.
#
if -x ~/.tscreen.dynamic  'source ~/.tscreen.dynamic|'

The change here is the trailing "|" on the argument to the source command:

source ~/foo/bar

Opens ~/foo/bar and parses the contents. (Assuming it exists.)

source ~/bin/blah|

Executes ~/bin/blah and parses the output. (Assuming it exists)

I still see no security risk with the previous setup, but I'm happy to apply a little misdirection if that makes people feel better.

ObFilm: Ghostbusters

| 4 comments.

 

Because I don't think you're worthy of human blood

Tuesday, 28 October 2008

I could argue and make reasonable points - but instead I'm going to be childish/annoying/ignorant/confrontational/blunt:

SELinux sucks.

If I wanted a rational debate I'd approach the topic differently - this is a clue that you shouldn't attempt to convert me.

I got distracted during the "Should selinux be standard? thread, so I will optimistically assume it will not be. Why? Because SELinux is annoying to configure if you understand it, and pointless if you don't.

ObFilm: From Dusk Til Dawn

| 4 comments.

 

Bring me everyone.

Monday, 27 October 2008

Recently I've been hacking around on GNU screen. I've fixed a few bugs and added a few new features. One of the earliest features I added was the ability to source every file in a directory. One of the later additions was to add simple conditionals to the dotfile, via the new if primitive.

Today I had an epiphany moment. Rather than adding either of these two features I should have altered the behaviour in the far simpler manner.

If we allow ~/.tscreenrc to be an executable we immediately gain lots of things for free.

Consider this ~/.tscreenrc file:

#!/bin/sh

for i in ~/.tscreen/*; do
    if [ -e $i ];
       echo "source $i"
    fi
done

That gives us the effect of a "source directory/" primitive. Similarly I can do complex tests without the need for an if primitive if I were to write this:

#!/bin/sh

# common config
cat ~/.tscreenrc.common

# per host config?
file=~/.tscreenrc.$(hostname --fqdn)
if [ -e "$file" ]; then
   cat $file
fi

# if we have lynx define an alias for it + map it to a key
if [ -x /usr/bin/lynx ]; then
   cat <<EOF

# Surf the web with <Ctrl-a f>
alias web screen -F -t web /usr/bin/lynx
bind w web
EOF
fi

So as of v0.4.7 tscreen allows you to have your configuration file be:

A normal file:

In which case it is parsed as you'd expect.

An executable file:

In which case it is executed and the output is parsed.

The code change is trivial, just an extra stat call and the use of popen vs. fopen, but the payoff is significant.

ObFilm: Léon

| 7 comments.

 

Please tell me what you're feeling.

Friday, 24 October 2008

Twice, recently, people have commented on my post titles. I keep a real journal elsewhere where entries are either untitled, or are titled by quotations. In the past I used to keep a running total of who had guessed the source of the quote, but these days that game gets ignored.

Titles here used to be song lyrics, but these days they are film quotes.

When I started I intended to be a little interesting, and make "happy posts" contain quotes from films I enjoyed watching, and "ironic" or "ranty" posts contain quotes from films I disliked. But that didn't last for long, and I suspect nobody noticed anyway. (Why would they?!)

Regardless that's the only explaination I'll give.

Once or twice I've had people "complain" :

Your titles have no relationship to your posts.

I don't know if your post is a serious one I should read, or a trivial one I should ignore.

To those comments I have several potential response:

  • Either I believe the posts are serious, or I believe they are not. My opinion might coincide with yours, but frankly I have no expectation either way.
  • Read the body, ignore the title. Consider it an ironic commentry on the importance of fashion, where appearance is more important than content.
  • It quickly gets old making titles of the form "Hey, asql released. Again.".
  • I find your ideas intruiging and wish to subscribe to your newsletter.

In short, if you (dis)like what I have to say I'm sure that the title of the post you disagree with is the least important part of that. I'm sure I could say more either way, but since the recent reminder I figured I should write something.

I've almost done so several times but I find it hard to be specific. Regardless the summary is:

"I'll keep this up, whether you like it or not, until I get bored. Regardless of how much I might respect you, and your opinion."

PS. tscreen released. Again.

ObFilm: Star Trek #2 - Wrath of Khan

| 7 comments.

 

May you live forever.

Monday, 20 October 2008

This will be my last post on the topic of tscreen for at least a couple of days. People who want to follow tscreen work know where to get it.

Anyway this release exposes the notion of layouts - they allow you to save and restore window positions. i.e. If you split your window, detach and then reattach it will be back in the layout you had before!

Simply add "layout new default" to your ~/.tscreenrc file, and have fun.

The layout primitive allows:

  • layout [attach|autosave|next|new|number|prev|remove|save|select|show|title]"

Experimentation is fun, people!

I've added a couple of patches from other people which I found on the screen-devel mailing list:

Anyway sources and Debian packages for Etch, Lenny, & Sid are available in both i386 and AMD64 flavours.

Update: Fixed links to patches, and added if primitive.

ObFilm: 300.

| No comments

 

Well, personally, I'm here because I need a job.

Saturday, 18 October 2008

A busy few hours last night hacking at tscreen, and again today.

I'm now very pleased with the functional aliases:

#
#  Caption toggle
#
alias caption_off  eval "caption splitonly"
alias caption_on   eval "caption always"

#
#  Status toggle
#
alias status_off   eval "hardstatus ignore"
alias status_on    eval "hardstatus alwayslastline"

#
#  Disable both caption and status, and show a message.
#
alias fullscreen   eval "status_off" "caption_off" "echo 'fullscreen'"
alias captioned    eval "status_on"  "caption_on"  "echo 'captioned' "

#
#  Bind these functions to keys
#
bind f eval fullscreen
bind F eval captioned

I've made binary & source packages of a slightly earlier version of the code available for Etch and Sid - both AMD64 - and I'll release another update once I can drop the need for that eval usage in the "bind" and add TAB completion for aliases.

ObQuote: Passage To India

| 10 comments.

 

Take a portable terminal, go out there and patch in manually.

Saturday, 18 October 2008

I might regret this later, but until I recant:

This features several changes already, and a few more are pending.

ObFilm: Aliens

| 8 comments.

 

Dirty. Dangerous. Your kind of people.

Thursday, 16 October 2008

Screen Fork?

There are times when I think of forking. Mostly sanity returns very quickly, though

Still GNU Screen is one program that I use almost constantly, and it seems to work at a glacial pace.

The Debian package has a lot of open bugs against it. Some trivial, some annoying, and some with patches.

Making the program GNU/Linux only would simplify a lot of things. But then again would that be a legitimate reason to fork it?

Me? I'd just like to see some additional primitives.

More QPSMTPD

I've come up with a nice simple qpsmtpd plugin to do spamgourmet-like setup.

This means I can have email addresses:

  • steve.3.count@steve.org.uk
    • Allows only three mails to this address.
  • steve.date.20-10-2008@steve.org.uk
    • Allows only mail to be sent here prior to Oct 20th.

Plugin code will be in the usual place in the next day or two..

ObFilm: xXx

| 9 comments.

 

Then don't knock it, it's got it's own key.

Monday, 13 October 2008

ObRandom:

Any blog post, comment thread, question, or email which starts "Hi guys" is bad, wrong, and probably not worth reading.

ObTitle: Dawn of the dead - the original and best version - 1978

| 4 comments.

 

I think I did pretty well under the circumstances

Monday, 13 October 2008

Procmail

This will be the last time I talk about this, but here's my anti-rubbish procmail filter.

It correctly copes with:

  • Foreign character sets that I can't read.
  • Bounces from joe-jobs.
  • Malformed emails.

Obviously edit to suit your tastes. Especially with regard to character sets - it is a wide brush which is tarring a group unfairly. That said in practise it works for me.

If you want real antispam filtering then you should probably be looking at externalising it, or having a layered approach.

ObQuote: Citizen Kane

| 1 comment.

 

So cunning you could brush your teeth with it.

Wednesday, 8 October 2008

Lets take a look at a new tool available to Lenny & Sid:

apt-get source acon
int main(int argc,char **argv)
{
        int i,tty,useunicode=0;
        char *fontf=0,*translationf=0,*keymapf=0;

        get_ids();
        set_user_id();

        /*Read configure file if no input options*/
        if(argc<2)
        {
                char *env;
                FILE *fp;
                char font[300],translation[300],keymap[300];
                char tmp[300];

                font[0]=translation[0]=keymap[0]=0;
                if((env=getenv("HOME")))
                        sprintf(tmp,"%s/.acon.conf",env);
                else
                        strcpy(tmp,"/etc/acon.conf");

Hmmm. Nice use of the environment there. I wonder what permissions the binary has:

skx@gold:~$ ls -l /usr/bin/acon
-rwsr-xr-x 1 root root 48672 2008-06-09 10:50 /usr/bin/acon

setuid(0) - just say no.

ObTitle: Blackadder II

| 13 comments.

 

Recent Posts

Recent Tags