Posts Tagged ‘Humble Indie Bundle’

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

My software stack revisited – (Multi)media and entertainment

Thursday, December 23rd, 2010

I am probably abusing the English language with this use of the word multimedia, but I just couldn’t find any better way of describing audio, video and images in a word… sorry :P

Video

For playback I mostly use mplayer, but for some reason or other, keep VLC around, although I can’t really explain why.

I’ve successfully used k9copy to make backups of my DVD-collection, works great :)

Audio

Ok, so you know I like living on the command line, right? So it won’t come as a surprise to you when I say that I used to use cplay? I still keep it around, it really is quite nifty, but the lack of an easy (and documented) way of interacting with it externally (say, through keyboard shortcuts) made me finally look elsewhere (having to jump to a tag in order to pause the music when the phone rings isn’t fun).

So when I discovered moc (Music On Console) I was pleased. I could script it to my heart’s delight. Even better: it doesn’t need its curses-based UI to function, so I only bring it up if I want to edit the playlist, hit q when I’m done, and kill the terminal, and the music keeps flowing.

And for converting videos or audio between formats (or extracting the audio from a video) ffmpeg is the tool to do the job.

For finer editing of audio files, I use Audacity.

Images

For image viewing, I use eog and geeqie, which does a good job of complementing each other.

And although not a regular activity of mine, for a small project I was doing in my spare time recently I got the chance to use both Gimp and Imagemagick.

I’ll see to it tonight that I’ve used Inkscape more than three times so that I can honestly put it on the list as well, it deserves to be there.

Entertainment

I find astronomy quite fascinating, and although that is on a very amateurish (to the point that I haven’t bought a telescope or anything yet) level, Stellarium is a superb software.

festival, a text-to-speech synthesiser, might not at first glance seem all that entertaining, but it can indeed be, not to mention I actually got use for the accompanying package text2wave when setting up notifications for my instant messenger (audible hints that specific people have come online).

No list outlining entertainment would be complete without a mention about games and since I do, from time to time, need to get my mind off things, games provide the perfect distraction.

The bsd-games package contains a couple of CLI apps, both semi-useful stuff, and some games. Wump is my favorite game from that package, mostly due to fond memories from ITU.

Games are otherwise still one of the big problems for GNU/Linux although indie-developers like the ones who come together in the Humble Indie Bundle, are making good progress in making gaming platform-independent.

Finally I find programming quite entertaining, but that will be the topic for the next post, so I’ll end things here.

:wq