Our Meeho!™ Blog brings you general news, tech stuff, tips, inspiration and more in relation to the Meeho!™ platform.

Sign up now for free!

Posts from 4-2010

» Unix: master your job control

Posted by Anders Østergaard Jensen on 4/28 2010 at 2:52 PM

I spend a lot of my time in front of my laptop in the terminal. When Terminal.app finally was equipped with tabbed terminals, it suddenly became a lot easier to execute several processes within the same window without reaching out for the mouse. But, drawing on the Unix tradition of Mac OS X, there exists a simpler and faster alternative for switching between applications with the keyboard.

Every basic Unix shell provides a concept called job control which allows for switching back and forth between your applications simultaneously from within a single shell session. This text based multitasking functionality was implemented way back before Microsoft developed the Program Manager for Windows 3.x, and it certainly demonstrates why Unix was invented inherently as a multiuser, multitasking system. Let’s take a quick tour of the basics of job control using my favourite shell zsh (bash might apply as well, but the syntax for C derivatives might be different):

1. Start a zsh session and open a text file with your favourite $EDITOR, e.g. vim:
meeho:[aj] % vim doc1.txt
2. Now vim opens up the file doc1.txt. Now, say you want to briefly look for other files containing a specific pattern without exiting vim or opening a new terminal — what is the trick? Easy as pie: press control-Z, and your current process is put to the background of your shell:
[1]  + 22023 suspended  vim doc1.txt
meeho:[aj] %
[1]  + 22023 suspended  vim doc1.txt
meeho:[aj] %
3. Now you can grep for the relevant content and finally return to your vim session:
meeho:[aj] %  grep -ir ‘important pattern’ *
meeho:[aj] %  fg
4. Now, you are back in vim. ‘fg’ simply means ‘foreground’ and pushes your recently ‘backgrounded’ process of yours into the foreground of the shell session. Now, what if you want to background more than one process in the same shell session? Easy, control-Z out of the shell, open a new vim instance (vim doc2.txt) and background that process with control-Z as well. Now you can list the available jobs with the zsh built-in ‘jobs’ command:
meeho:[aj] % jobs
[1]  - suspended  vim doc1.txt
[2]  + suspended  vim doc2.txt
5. Finally, you can now swap back and forth between the applications using %<ID> (ID being the number in the squared brackets, e.g. %1 for ‘vim doc1.txt’ and %2 for ‘vim doc2.txt’):
meeho:[aj] % %1
The syntax for job control varies a bit from shell to shell, but the concept is basically the same. It is particularly useful if you are working on a remote machine through a slow network SSH connection, or if you simply have no graphical environment (e.g. X11) available.
There are, however, alternatives to the simple, but elegant Unix job control: GNU Screen is one of them. In terms of multitasking it is much more powerful, since it allows you to shuffle back and forth between several terminal sessions (thus, Screen is described as a terminal multiplexer rather than a single shell process). Some people even describe it as a window manager for the console, and it is truly powerful. But for now, I will save that walkthrough for next time.

1. Start a zsh session and open a text file with your favourite $EDITOR, e.g. vim (or the standard editor, ed):

meeho:[aj] % vim doc1.txt

2. Now vim opens up the file doc1.txt. Now, say you want to briefly look for other files containing a specific pattern without exiting vim or opening a new terminal — what is the trick? Easy as pie: press control-Z, and your current process is suspended to the background of your shell (process suspension also implies that the process execution is paused):

[1]  + 22023 suspended  vim doc1.txt
meeho:[aj] %

3. Now you can grep for the relevant content and finally return to your vim session:

meeho:[aj] %  grep -ir 'important pattern' *
meeho:[aj] %  fg

4. Now, you are back in vim. ‘fg’ simply means ‘foreground’ and pushes your recently ‘backgrounded’ process of yours into the foreground of the shell session. Now, what if you want to background more than one process in the same shell session? Easy, control-Z out of the shell, open a new vim instance (vim doc2.txt) and background that process with control-Z as well. Now you can list the available jobs with the zsh built-in ‘jobs’ command:

meeho:[aj] % jobs
[1]  - suspended  vim doc1.txt
[2]  + suspended  vim doc2.txt

5. Finally, you can now swap back and forth between the applications using %<ID> (ID being the number in the squared brackets, e.g. %1 for ‘vim doc1.txt’ and %2 for ‘vim doc2.txt’):

meeho:[aj] % %1

The syntax for job control varies a bit from shell to shell, but the concept is basically the same. It is particularly useful if you are working on a remote machine through a slow network SSH connection, or if you simply have no graphical environment (e.g. X11) available.

There are, however, alternatives to the simple, but elegant Unix job control: GNU Screen is one of them. In terms of multitasking it is much more powerful, since it allows you to shuffle back and forth between several terminal sessions (thus, Screen is described as a terminal multiplexer rather than a single shell process). Some people even describe it as a window manager for the console, and it is truly powerful. But for now, I will save that walkthrough for next time.

» The pixlr Editor

Posted by Kasper Tidemann on 4/21 2010 at 5:38 PM

Today, we stumbled upon the pixlr Editor, an online tool for editing images that reminds a whole lot of PhotoShop, it’s just web-based. It’s made in Flash, and we think it’s really cool! Check out the screenshot below or visit the pixlr Editor web site.

Screenshot of the pixlr Editor - how cool is that!

Screenshot of the pixlr Editor - how cool is that!

» Cool HTML5 canvas magic – blowing up video

Posted by Kasper Tidemann on 4/20 2010 at 10:27 PM

The good folks over at Craftymind have created a cool example of some of the capabilities of the HTML5 canvas tag. They’ve created an explosive effect in an HTML5 video using the Canvas.drawImage() call. Have a look here: http://www.craftymind.com/2010/04/20/blowing-up-html5-video-and-mapping-it-into-3d-space/

» In other musical words: India Calling

Posted by Kasper Tidemann on 4/20 2010 at 9:56 PM

While we work hard on Meeho!™ version 1.4.3, sporting a whole new contact log that’s gonna be smashing, we listen to a mixtape by DJ UMB named “India Calling: Dubstep Yaar”. It’s one of the best mixtapes we’ve heard in a while, and you can go get it here: http://maddecent.com/blog/india-calling

DJ UMB - India Calling: Dubstep Yaar

DJ UMB - India Calling: Dubstep Yaar