Posts Tagged ‘Free Software’

2011w46

Sunday, November 20th, 2011

First of all: this is really disturbing.


Commands and flags

I think I’ve already mentioned watch, and how that could be useful at time (e.g. $ watch -n 10 -d 'ls -l')

I just found out about a value which can optionally be appended to the -d flag: -d=cumulative

It has its own flag as well --cumulative, and quoting the man-page it makes highlighting “sticky”, presenting a running display of all positions that have ever changed.

Also, this week I learnt about sdiff, which seems neat if you’re on a system which doesn’t have vim (and thus vimdiff) installed.

Anoter nice flag I just found for grep is -m <int> which tells grep to stop looking after the INT first matches.

Scripting Vim

Ok, so I’ve been running into this problem where I am using my own .vimrc configuration in other places, in systems where the vim version isn’t the same as the one I use myself.

This has proven problematic as some of the configuration options I use (most notably set cul (which gives me a better indication about which line the cursor is on)) doesn’t exist in … say a vim version less than 7.

Which meant that if I loaded the same .vimrc config on a system running a vim version earlier than 7, I’d get a warning at startup, which I’d have to press enter to pass by. Irritating.

As luck would have it, it isn’t all that difficult to make a little conditional to check which version is currently loading the config and just ignore the settings which won’t work for that version, such as:

if v:version >= 700
    set cul
endif

Links

Finally, at this years FSCONS I was introduced to the site renderfarm.fi where people can go to either contribute CPU-cycles, or get CPU-cycles, (or both) to help speed up rendering.

:wq

2011w39

Sunday, October 2nd, 2011

Stupid shell tricks

A friend of mine asked me this week how one would go about repeating the same command X number of times in a shell.

My first idea was of course a for-loop, along the lines of:

X=15; for i in $(seq 1 ${X?}); do echo "foo bar baz"; done

But his reply to that suggestion was that seems a bit much if all I want is to repeat the command twice…

Ok, so it wasn’t for X equalling any number, it was for X equalling two… sometimes I get the feeling that he is perhaps over-generalizing his questions to me ;D

Anyway, my second answer, given this new input, was: What? You’re too lazy to execute it, push up-arrow and enter?

But of course, his question had already caused me to fork a background process intent on finding a solution.

First I thought about the history command, and I ultimately came up with a solution through reading man history.

echo "foo bar baz"; !#

Note: That semicolon there is frakking important!

“!” when issued as the first char of a new word, should be interpreted as we’re going to do something with the history of this shell.

“#” in turn could roughly be interpreted as On this current line, do again whatever has been done from the start of this line, to where this history command is called

The result is echo “foo bar baz”; echo “foo bar baz”;

I have no idea what he needed that for, it seems pretty limited to me, but either way it’s pretty cool that it worked.

Now guess what echo "foo bar baz"; !# !# does.

How to get into Free Software

A buddy from work and I spoke about open source and free software the other day, and he had a basic grasp about it, but what he felt he lacked were knowledge of useful sites, etc. I.e. perhaps not how to become more involved, he’d already submitted patches to some specific projects, but more along the lines of where likeminded “hang out”?

That’s a poor description as well, and isn’t all that important. It did however get me thinking about it.

There is identi.ca instead of twitter, joindiaspora.com instead of facebook or google+. There is fsf.org, gnu.org and fsfe.org as well as the local (Swedish) ffkp.se for information about the ideology behind free software, but also for information about how to get involved and the types of activism they engage in.

I don’t really know how to categorize ohloh.net, but I guess it could be a fun place to hang out and either get recognition for your own contributions, or recognize the projects you use yourself.

Then I guess there is the part of the FOSS ecosystem which ?doesn’t exist at all? in the proprietary world (I am sure there are some exceptions to this) such as public code repository sites (savannah.{,non}gnu.org, gitorious as well as github and bitbucket).

I have accounts on all four, although I make a conscious effort to prefer the first two services over the latter two.

And then of course there are conferences which one could attend, FSCONS (yes, being biased, I put the one I’m co-organizing first) and FOSDEM springing immediately to mind.

Links

Another Humble Indie Bundle in the making. This game looks like it would be precisely my type of thing. Maybe ;)

This Erlang “hello, world!” tutorial has definitively earned itself some linklove.

:wq

Nu är Gnutiken på gång

Saturday, March 7th, 2009

Bara för att det är ett speciellt tillfälle (och jag har utsetts till den bäst lämpade att framföra budskapet på Svenska) så blir detta en post just på Svenska. Igårkväll (Fredag) runt 18-tiden bildades styrelsen för “Gnutiken ekonomisk förening”. Målet är att främja fri programvara, grön IT och hållbar teknologisk utveckling.

Det finns ännu en del detaljer att reda ut, men klart är att en fysisk butik skall upprättas, i vilken vi avser sälja modulära paketlösningar av fri programvara, support och utbildning.

Jag väljer att avsluta såhär, lite kryptiskt, men frukta inte, mer information kommer att följa vid senare tillfälle.

Who knew?

Thursday, October 2nd, 2008

As you may, or may not, know I am taking a course called Advanced Free Software Tools (pdf) held at the IT University in Göteborg, which basically boils down learning about and how to use the tools commonly used in Free Software projects, and as a part of this course the students are encouraged to either take part in an existing project, or to create a project of their own.

I opted to create a new project. I figure there are pros and cons with each approach (if you join an existing project there will (possibly) be a lot of code to get the hang of before you can start contributing, which is bad, but at the same time, it is also good that you get exposed to other peoples code. The inverse for these pros and cons are the pros and cons of creating a project of your own)

One thing that I don’t believe I would have gotten any actual “real-world” training in, had I joined an existing project, is in writing change logs and the more project administrative-posied tasks, and I have to say, I am finding it rather enjoyable, not the administrative tasks in themselves, but researching syntaxes, finding the ones which are conforming to the overall environment in which my project will coexist etc.

For instance, the project I have chosen to work on, is a web-based voting system, implemented as a Django application. It should be some sort of free software in order to follow course-requirements, so a free software license had to be chosen. Then a coding standard. Django is programmed in Python, following the Python coding standard, so my application should follow this as well. The Django team doesn’t appear to have any official changelog document, which would have overridden most other considerations, but instead I fall back to the GNU ChangeLog format.

Who knew all this “administrative work” could actually be this fun?