from devilspie to sawfish

Posted in this blog on December 24th, 2009 by blambi

B”H

On my laptop shaggai I like
have a desktop enviorment that is “single windowed”, that is every
application window is maximised and also have it’s border
removed. (There is some small exceptions like dialogues).

To do this I until resently used GNOME + devilspie
to do this.

.devilspie/allbig.ds

(begin
  (if (is "_NET_WM_WINDOW_TYPE_NORMAL" (window_property "_NET_WM_WINDOW_TYPE"))
      (begin
        (undecorate)
        (maximize)
        )))

This acutely does the job excellently, but it was somewhat sluggish
(yea at blasting speeds that are at a between 112Mhz and a maximum
650Mhz it might be quite noticeable). I also wanted to return to one
old friend of mine again, sawfish.

(A quick side note would be that on my other laptop I run window maker another excellent WM.)

My current setup was generated trough sawfish-ui so it is not that
pretty yet (yea will rewrite it, when i get time.. hah).

(custom-set-typed-variable (quote match-window-profile) (quote ((() (maximized . all) (frame-type . none)))) (quote match-window) (quote sawfish.wm.ext.match-window))

I don’t think the best way to uses this is to yank it into
.sawfish/custom but to use sawfish-ui and add it under
matched windows, just the actions: maximized=all,
frame-type=none

Will probably come with updates to this some time later.

Tags:

Sleep Enforcer

Posted in this blog on December 21st, 2009 by blambi

B”H

From time to time I have some sleeping problems, and well that is not
the most fun you can have. And when this happens I sometimes
accidentally makes matters worse by well surfing the web and miss that
tiny moment of tiredness.

Well since that is all my fault in the same way as it is my fault that
I sometimes stay up all to long (past 24) and makes it far more likely
that “Mr I Steal Your Dreams” come by.

So I added this to my system crontab:

1 0 * * * root iptables -A OUTPUT -p tcp -j REJECT --reject-with tcp-reset --dport 80
1 6 * * * root iptables -F OUTPUT

That is at 00:01 in the night bam no more HTTP access from the laptop. This could
probably be better written using -m state --state NEW or
similar.

And then again at 06:01 it trows away all the output rules. I really
don’t filter my output on my laptops so no harm in trowing it all
away.

Some flaws in this are, well I could just flush it my self as root,
but then this was not written to force other people or myself, more
lika a sever reminder that the time for being awake is up.

Not that long after I wrote the original post I stumbled upon the time
extension. And well now we got an even shorter and no need for cron.

iptables -A OUTPUT -m time --timestart 00:01 --timestop 06:01 -p tcp -j REJECT
Tags:

Kakwiki

Posted in this blog on December 16th, 2009 by blambi

B”H

Yesterday I hacked some on kakwiki mostly to
remove some markups that where from the old evil days of TigerWiki,
and look into how hard it would be to completely do clean rewrites any
code that currently is still based on that code.

Sadly I did not fix one of the bugs that still irks me, simply that
the code-blocks for some reason do like to clump together. A good
example currently where this is happening is this article (source).
Hopefully that is just because of some typo in the article.

To do before 2.2.5?
simp-interface should get support for:

  • File management: upload, download(maybe not since that is just silly)
  • Articles: Upload, and read historic versions

So what is the plans/ideas for 2.3.x?
Module/Plugin system for:

  • Authentication (we should move to session cookies instead of the hash thing)
  • Article and file access
  • Going GPLv3+ (currently GPLv2+)

Non version bound plans:

  • New html template
  • Paragraf based instead of newline based (ig: use <p>...</p> and not <br />, and still not certain that this will happen.)
  • Get free from all TigerWiki code

There have also been some discussion about having the new (when it
ever is written) wiki markup similar enough to muse, so one could
write some fun little hack (either elisp or fuse) to access them and
edit visibly inside emacs.

Tags: ,

Zeroinstall isn’t my friend.

Posted in this blog on December 13th, 2009 by blambi

B”H

Sadly this is one of those rants.. please tell me to remove it if its just annoying.

Bad ideas.. they are things that come late at night quite often, like
testing ROX Desktop. Not that ROX lacks its bright points, I guess
what annoy me was the hunt for stuff to remove after the test.

I did notice the use of zeroinstall, something I find well not that
useful, and where do the applications go? Well
~/.cache/0install.net of course… wasn’t really where I
would expect programs to go. Since well its my home folder, sure I
have some applications in a prefix in my home folder but that is
another story. Having software installed like this creates a real
waste of resources on a shared system, having each person installing
their own version of inkscape… well yea that is so.. special.

If you was as unawake as me and allowed it the “installer” to add a
session to GDM/KDM, it is quite easy to remove all its files:

  • /usr/share/xsessions/rox.desktop
  • /usr/local/sbin/rox-session

This negative experience could have been avoided with some kind of
guide or some list of installed files so I did not have to hunt them
down, I think i got most of them.

In short, sadly I was not impressed and that was something I had been
by the look before. Happely it was (probalby) really easy to remove.

Tags:

LD_PRELOAD

Posted in this blog on December 10th, 2009 by blambi

B”H

Just for some fun I tried to write a little shared library. The only
function of this would be to reverse text. I decided to just work with
printf, since well it is the most common and made my life quite
simple.

Well first i had to figure out how to write a function that behaved
like printf. We know that the definition of printf is int
printf( const char* fmt, ... )
, and by reading the info file
for GNU libc (or your man file, or K&R) we find out that we need to
return the number of outputted characters, no biggie.

Well then we have the issue of not knowing how many arguments we
get. But that is quite simple to fix. Since I several times before had
used va_list and the some parts of the va_ family, I used that (not
sure maybe there are other ones?).

So how would our function look?

int printf( const char* fmt, ... )
{
    char* buff;
    char temp;
    int ret, x;

    va_list ap;
    va_start( ap, fmt );

    ret = vasprintf( &buff, fmt, ap );

    va_end( ap );

    /* mirror string code goes here */

    fprintf( stdout, buff );

    free( buff );
    return ret;
}

And well mirroring then? Not hard at all (if we as selected previously
writes an utterly stupid one).

    for( x = 0; x < ret / 2; x++ )
    {
        temp = buff[(ret - x) -1];
        buff[(ret - x) -1] = buff[x];
        buff[x] = temp;
    }

So now you know what the x and temp variables where for.

sadly this code isn’t that effective as I hoped and behaves rather
strange sometimes, not all printfs are mirrored etc, but as a simple
hack it works.

Example of the broken output:


8.0.0v tsobCopyright (C) 2006-2009  Patrik Lembke.
This is free software with ABSOLUTELY NO WARRANTY.

:mahkra
9.0.32.271 :0

So as a conclusion I have to say that it was a fun idea for showing
how dynamic libraries can do some quite interesting things to your
programs. A great example would be tsocks that makes non-SOCKS
aware programs use SOCKS a proxy by overloading certain network
related calls (in a much cleaner way then I did).

Here is the full source code and compile instructions:
ld_printf.c

Tags:

Oh so it got some speed

Posted in this blog on December 7th, 2009 by blambi

B”H

Some days ago I upgraded my phones firmware (Neo Freerunner) from some
android build (v14 something from that I downloaded 30/7) to week 44s
build of android-on-freerunner

I must say that I’m really impressed by the speed up. I guess it is at
a minimum two times faster. And now I got a working calendar, that
plus the OI applications (safe, notepad, countdown, alarm) I really
got all I want for a basic smart phone.

Or let me correct that almost all. Apparently someone did think it was
a smart idea to remove the camera application, something I happens to
understands since what good could that do one a phone without
one.. Well for some reason I cant understand it happens to do most of
the image processing also.. So now only one of my contacts shows an
image of the person calling the other looks as they didn’t have one
and shows one of the defaults. And I cant select a image as a
background that didn’t come with the firmware, well that I can get
over too.

Another point for the better is that GPS now works, now I just have to
find some free app that does more then show my position in long lat
format, speed and distance to another point in the same format. I
would even be happy with only a GPS based compass, the ones I tried
sadly lacks that and tries to talk to an electric compass.

Well now the phone feels like it is running at a really usable and
responsive speed (it sure beat my former phone in that regard now).

For android users that well like freedom I would recommend these
packages:

Tags: ,

Got a name for me?

Posted in this blog on December 7th, 2009 by blambi

B”H

So what should I name this language? basically it is a quite simple
one not really made to be of any greater use, mostly written for the
interest of learning more about tokenization and maybe later output
the token code as ASM for x86. But don’t let us get a head of our
self.

I wont say what the working name of the project is since I don’t want
that to influence you…

Hmm I will just give a code examples and let you think out a name..

print "loop test"
a = 10
label kaka
print "loops left %d", a
a = a - 1
if a > 0
jump kaka
print "done"
Tags:

Jungles? (or I got flock in my keyboard)

Posted in this blog on December 6th, 2009 by blambi

B”H

So what have I done today, well besides being at an discussion session
and eaten etc, I have dedicated some time on one of my many
non-computer related hobbies, wargaming (more specifically warhammer
40k).

It is a hobby I have gotten back into after a nine year break, not
because I found people to play with, but rather that I enjoy the
creativity it requires (especially if your into modding.. which I am).

So what was created today? Well a little jungle piece with magnetized
threes (good for easy access to models and still ensuring that the
threes don’t fall over at the lightest bunch against the table).

A mission objective marker (no photos yet sorry). And some space
marines and chaos space marines where painted (just basic), and two of
them where finished.

Most problems I have had today have been with finding a good basing
material, and the amount of P.V.A glue to use for the different types
of flock.

Yea.. the jungle looks playable and most people would probably miss
the mistakes I did but.. well feels like horrible to know that they
are there, Well got four sets more of palms to base glue, paint, base
so I guess it wasn’t to bad for a first try.

Then if anyone really is interested I have uploaded for some time
pictures of my 40k stuff on DakkaDakka

Tags:

Getting started

Posted in Uncategorized on December 5th, 2009 by blambi

B”H

some requests for a blog and not just the identi.ca thing (well I
mostly just trow updates for my projects etc there), so I set this
thing up..

Some words of warning, this page will be a language mix, well I will
be nice enough to limit the mixing so there will be no mixing in posts
(if its not about languages…)

So mostly it will be about what I am working on, either software or
other hobbies of mine. But I will try not to get in to politics since
well there is enough blogs about that..