Skip navigation.

Missing pieces

Everything you should know about technology, but have been missing out

Posts tagged with "freebsd"

Free high quality ondemand video is here right now with Miro

, , , ...

Have you ever though that TV doesn't have anything interesting on when you want to watch it? There's always Youtube, but video quality is not that great and longer shows would be nice thing. If you haven't tried Miro out yet, your mostly idle Internet connection is going to get some real use.

Miro is program guide, media library, downloader, media search and player all in one. Program guide doesn't show when something is on, as it doesn't matter. Instead of that it has small scrolling list of featured shows (or channels as Miro likes to call them), one example category, popular shows and new shows. Miro likes to call shows channels, but mostly you can subscribe to one show at a time. It's quite rare to have more than one show in one channel. If channels are meant to be similar thing as TV channels, that is.

One additional category is recommended videos (you need to create account to use it though), which recommends new shows based how you rate shows. It's not perfect, as it recommends stuff in foreign language and some shows that based on description won't most likely be that interesting. But it's one additional way of browsing available shows.

Most of that stuff is available as channels too, so it's possible to just subscribe to some category and stop thinking about what show to subscribe to next and just press play and watch shows. Miro doesn't do streaming though, so you have to wait for first show episode to download, but after that you can start watching more or less uninterrupted if your connection can download episodes faster than you can watch them.

That brings us to downloader, which has some nice features. When you subscribe to a show it starts downloading right away. By default it downloads just latest episode of the show and after that all new episodes when they are available. It's possible to change channel settings to download all available episodes too. By default it doesn't download more shows if you have three unwatched episodes, so your disk doesn't fill up immediately. Which will happen soon anyway, even when Miro does pretty job cleaning things up.

Yes, Miro knows how to keep things clean. It deletes videos after you have watched them, so you don't have to delete them by yourself. By default it keeps watched video for five days, but it's possible to tune it from 30 minutes up to a month. You can also save video to prevent automated deletion.

There's also limit for simultaneous downloads, which is great if you want to get start watching downloaded episodes rather sooner than later. It seems to get confused though if you pause and resume shows and starts more downloads than the limit. If that happens, you can try pausing and starting downloads again, which might put downloads back to the queue.

Miro also supports BitTorrent, so actually anybody could start distributing their own shows, without paying high fees for servers. It's quite easy to use for example sites like Legit Torrents for distributing the files, so there's not really anything that prevents distributing your shows in high quality and without any limits on video length. Still more work than using Youtube, but at least possible.

You're not limited to using program guide, as it's possible to add any RSS feed as channel or download any file.

Search is also nice addition. It searches videos from few different services (including Youtube) and it's possible to download search results without any hassle. Only downside is that as Miro doesn't do streaming, as I mentioned already. But you can keep the downloaded videos.

Technology behind Miro is based on standards. Channels are just RSS feeds, so it's possible to use them in other programs if you want. Miro just wraps everything up nice package, it doesn't actually do anything that hasn't been done already. But if Miro encourages getting more RSS feeds out there to subscribe to, it benefits other similar programs too.

What Miro is not suited for, is for using it with remote from your sofa. It's bit limited even with regular keyboard. That kind of interface would make Miro be able to complete with all media center programs out there, with advantage of having huge library of free media.

There's surely some stuff I forgot to mention, but with such full featured program, it's quite hard to remember to cover every feature. Miro has it's flaws, but all the embedded components work together in a way, that wouldn't be possible by using individual programs. Though on the other hand, using full featured media player (embedded player has some limitations on supported video formats for example) instead of the embedded one would be nice, but that would mean that Miro can't know if you stopped the video half way through and continue next time from same place. Also embedding Firefox and programming in Python makes Miro quite resource hungry application. But despite that, it's just hard to justify getting rid of it as everything works so well together.

Linux/Unix command line: part 3 - managing files

, , , ...

Computer is made for copying and processing information. So sometimes you need to make directories (to keep things organized), copy and remove files. Just telling what the commands are is not very efficient, so it's better to try those commands out and maybe learn some things about them along the way.

Let's start by making a directory. But let's first make sure that you're in your home directory:

cd


Let's keep home directory and make a directory for our experiment and move to our new directory:

mkdir experiments
cd experiments


So mkdir is command for making directories. That directory is bit empty, let's create some content.

touch foo


Check if the file is really there:

ls


Curious? Let's look inside.

cat foo


Nothing happened. Don't worry though, the file is empty so there was nothing to display. That's what touch does, creates empty files and that's fine for our experiments. Let's continue by creating another directory:

mkdir bar


Now move previously created file to new directory and enter that directory:

mv foo bar
cd bar


Another command again, mv is for moving files.

Oops, we need that file in it's original location too, let's make a copy:

cp foo ..


Make sure that the file is really there:

ls ..


Were done with this directory, let's move back:

cd ..


Let's make copy of a directory:

cp bar test


Didn't work? I guess we missed something:

cp -r bar test


It works now. You need to tell cp that you want to copy whole directory (and all it's files as a side effect). Let's check if everything is OK:

ls test


We're done now, let's clean up.

cd ..
rm experiments


Same mistake again. Let's fix that:

rm -r experiments


Now you should know how to manage your files. And as always, read the manuals if you wan't to know more about commands, most have all kinds of options that could come handy sooner or later.

Linux/Unix command line. Part 2 - moving on

, , , ...

In some cases you can't avoid command line. Ubuntu for example has good graphical administration utilities, but if you search for instructions or ask for help all you get is cryptic commands. Some think it's frustrating and others like me don't mind. Graphical tools are great when you don't have much time or just don't feel like reading manuals. Why using command line is better is personal thing, but maybe you find your own reasons once you get bit more comfortable with it. But if you're planning to script some common tasks, command line teaches you many useful commands that you can use.

To follow this tutorial, you need access to Unix/Linux system. You can get one for free for example at http://www.ubuntu.com/. Once you burn the CD, just boot from it and you should have working system without messing up your current operating system.

If you have used DOS command line before, there are few important differences. Everything is case sensitive and commands are in lowercase. Environment variables are usually in uppercase, but you can use lowercase names with your own custom environment variables. Also, don't use \ as a directory separator, in Unix it's /. \ is used as a escape character, you need it when you have to use some character that has special meaning, but you need to use it as normal character.

Another peculiarity is that everything is treated as a file, you can all sorts of things with files in /dev directory. Files in there actually represent devices on your system.

Some commands also have different function, for example find is used to find files, not to find strings inside a file. If you need to find strings, use grep. Some commands have the same name, but vowels are removed, for example copy is cp in Unix.

If you didn't understand much about previous paragraphs, don't worry, I'll explain those things later on, so DOS knowledge is not necessary.

Let's assume that you're in graphical environment. You can usually find terminal from menus, but if you can't see it anywhere just find run dialog and type xterm there. There are many different terminal emulators out there, xterm is just one that's usually already installed.

Most basic thing is moving around. It's hard to do anything if you're stuck in your home directory. Default shell prompt depends on shell you're using. Some of them don't show where you are, just on what computer you are. You can see where you are by typing following command:

pwd


If you want to know more about pwd coommand (you can use this for other commands too), type:

man pwd


What you can see on your desktop is actually just small part of the filesystem, it's not even your whole home directory. Here's how Linux filesystem is organized, some distributions have different practices how to use certain directories, but at least it gives good overview what those directories are. If you're using FreeBSD, man hier has good overview of the filesystem hierarchy.

Unix doesn't use drive names like a: or c:, everything is attached to root directory which is called /. Look what is in your root directory by typing:

ls /


Lot's of cryptic directories there, especially if you didn't open that earlier link. Let's try moving to one of those directories. First thing you can do is to move to root directory:

cd /


The you can move to for example var:

cd var


You can also combine those two:

cd /var


If you want to move up in directory hierarchy:

cd ..


Whoops, a mistake. Let's move back to previous directory:

cd -


Now can try some combining again. Let's move up in hierarchy and then to another directory with one command:

cd ../etc


If you're planning on editing your systems configuration files by hand, they're here. But let's not do any damage to your system and move safely back to home. There's no need to write full path to your home directory, all you need to write is:

cd


Home directory has also a special character that you can use. So for example if you want to move to Desktop directory (everything you put there shows up on your desktop) in your home directory, this command works, no matter where you are:

cd ~/Desktop


Now you should know how to move around. You can experiment as much as you want and home is always one command away.

But wait, before you start typing long filenames (or directory names), there's a shortcut. You don't have to write long filenames all by yourself, your shell can help. In most shells you can complete filenames and directories by pressing tab key when you have typed enough characters to find unique filename. Otherwise you'll just get list of possible files. There are some old shells that don't support that, but it's quite likely that you're using Bash. It's usually default on Linux systems, but on other systems it could be something else. You can check what shell you are using with following command:

echo $SHELL


You can display text with echo, it may not seem very useful right now, but it has its uses.

For me it displays:

/usr/local/bin/zsh


So that last word tells that I'm using ZSH.

That's all for now, we'll see what next part brings up. You can't do much just by moving around. As always, please leave a comment if you didn't understand something or have some ideas about what you would like to know.

Linux/Unix commandline. Part 1

, , , ...

Command line in general might look something that's not very useful and it's certainly not pretty. But looks can be deceiving, Unix command line actually has long history and people who developed it certainly believed in it too (though there's sort of Unix version 2 available). I would say it's still relevant for some people including me.

Unix (including Linux, I'll just use Unix from now on) is actually kernel and collection of utilities from various sources. For example yes is an utility that prints y on infinite loop. So next time you see program that asks stupid questions that can be dismissed with just y (or any other letter), yes could be handy. I'm not going to show how to use it right now though (maybe in some later post). And yes, it's included in most Unix-style operating systems.

So you can imagine, that somebody got irritated babysitting program that wanted users to answer yes to questions and developed a utility to do the task for him/her and continued being lazy (as good programmers and sysadmins are). I would imagine too that someone saw that the utility was useful and wanted a copy. And then it gets part of the standard, though I'm not sure if yes is part of the POSIX standard or not. Maybe not, as it's not exactly essential utility for the standard at all.

I'll start with something that's bit more easy to grasp, programs that actually have some kind of user interface. Good thing about these programs is that they don't take up much memory, startup doesn't take long and they don't need that much bandwidth if you use them remotely. Downside is that learning curve is usually bit higher than with usual GUI programs, there are keyboard shortcuts to learn and configuring usually happens by editing configuration files with text editor. And that means you have to first find the examples to work with.

Window manager: Screen

Screen is so versatile that it deserves whole article. In short it's like window manager on command line, windows take up full screen though, so screenshot doesn't make much sense. It keeps running if you log out, so most people use it to keep Irssi running while they are logged out from the remote computer where Irssi runs in, but that's only one of its features. For example you can create new windows, share session with yourself or with other user account.

Chat: Irssi

Irssi is IRC-client done right. No public away messages by default (though you can do that with a script, if you want to do that for some strange reason), support for multiple servers and it's easy enough to use for people that don't use command line much otherwise, or at least with some help from someone who knows how to use it. Only thing it lacks is (always) visible user list (though there are at least one script to fix that). If you have friends that don't use IRC, you can use Bitlbee to connect to various instant message networks.

E-mail: Mutt

Mutt is just a e-mail client, so there's no calendar. But it starts up real fast, and every function has keyboard shortcut. It's not so hard to use once you learn most important keyboard shortcuts. There's some tricks though how to use it effectively.

For example you can delete message matching certain pattern and change folder with new messages with few keypresses. Which folder it suggests depends on their order in config file, so you can check always messages in most important folders first, no matter which folder you have open. But whole feature means you need to put those folders into config file, otherwise you can just browse the folders manually as they are on disk.

Text-editor: Vi...wait...Emacs...whatever

There has been war going on between vi (or vim) and Emacs users since they were developed, but most people don't really understand either one of them. By default vi is on command mode and you can't really write anything until you press the right key. And both of them are not easy to even exit (ctrl-x-c in Emacs. esc and then :q! in vi). Both of them take some time to learn properly and are very efficient editors. And any Unix you use, vi is always available, so learning it has some benefits. But if your time is not worth it, try Nano. Or if you miss that paperclip from MS Office, try Vigor :smile:

WWW-browser: Lynx, Links or Elinks

All three are browsers, but links is actually black sheep here. It actually can display pictures and use the mouse if it's in graphical mode. Still very fast, if you don't mind that most of the pages look bit strange. Great browsers if you want to open browser instantly, even if you're not in graphical mode (in more technical terms, X). You can also use them to debug things from remote computer, for example if you are suspecting that some firewall is blocking your connection to some site. Or save pages from scripts.

News-reader: slrn

If you're into news (I mean Usenet, not just news in general), slrn is great program. Default settings are almost sane (I don't like automatically subscribing to new groups though, but at least I found how to automativally unsubscribe from new groups) and it supports non US-ASCII character sets just fine (I had some problems with TIN). It's also possible to read messages straight from server, which didn't also work so well with TIN. Not that hard to use, but as always, there are some keyboard shortcuts to learn to use it effectively. Help is easily available with ?, so no need to panic if you forget some keyboard shortcut.

Multimedia

Sound is not a problem in command line, you just need a player that doesn't need a gui. At least MPD or XMMS2 should be fine enough and there's even more players available. Both are more userfriendly with some nice frontend. Frontends can be graphical too. Separate backend means that you can quit frontend and music keeps playing.

As for movieplayer, MPlayer is good, if you can't display graphics at all for some reason, you can render the video in textmode. Some SDL based games work also, at least Kobo Deluxe did, others that I have tried didn't. There's also NetHack, which doesn't need graphics mode at all. I'm sure that's there at least one picture viewer, but I have not researched them much yet.

I wrote this article on request (or at least sort of, request was to write about Linux command line), so as always, you can make requests. One of the possible ones would be more in depth look into some of the programs that I mentioned, but that happens much faster if there's clearly demand for one, so please let me know if you want to know more.

PS: Screenshots are taken with terminal with transparent background. All pictures are links, so you can see the picture in original size. They almost fit in this blog, but limit for pictures resolution is just little bit lower that the originals have. And sorry about that last picture is JPG, it got automatically converted and filesize actually grew a bit. PNGs size is bit smaller, but resolution is bigger. Well, at least page layout should be alright in most cases.

UNIX? Operating system? You mean there's more than one?

, , , ...

UNIX is not just an operating system, it's whole bunch of them. There's no single UNIX, just a certain specifications operating system has to pass and fee to pay to use the UNIX trademark. There's whole group operating systems that really can't afford the fee, but are still very similar and actually are derived from the original code.

Whole story is bit complicated, so if you just use computers and are not that interested how it really works, this might be bit too much information for you. But if you're interested in digging bit deeper than Windows 95, UNIX goes much beyond that and has not really gone anywhere, just evolved. Next version is already out there, nobody really uses it though.

UNIX has long history that started 1969, in Bell Laboratories. Culprit was man named Ken Thompson. He had some ideas how to improve Multics, but Bell Laboratories was no longer participating in its development. And he wanted to play Space Travel. It was game that he had written. I wonder if Windows was developed to play Solitaire.

Later Dennis Ritchie joined. Dennis Ritchie is the man behind C programming language that was his improvement to B language (short for BCPL). No, there was no A before that, it was just CPL.

What, you have never heard of C? It was intented to ease the development of UNIX and it's still popular language for developing operating systems and other programs.

Why there's so many of Unix derivatives now? Mother company of Bell (AT&T) didn't have rights to sell an operating systems due monopoly status (or anything that didn't have anything to do with phones), so they sold the source code for universities very cheaply. Universities developed the code further and made their own utilities. They copied source code to anyone who wanted a copy and some of that code found its way to original UNIX. One of those universities was Berkley and its distribution was named BSD, short for Berkely Software Distribution. Distribution was founded by Bill Joy who later left and started Sun Microsystems.

Over time there were quite large number of different versions, some of them commercial. They were not very compatible with each other, so often people had to make some modifications to programs source code to get it working in Unix derivative they were using. In 1985 POSIX (Portable Operating System Interface for uniX) tried to fix things. I guess that's the main reason why you can see so many same programs in Unix derivatives.

Once AT&T got their its monopoly status lifted it started developing its own Unix version and licensing source code for other commercial distributors. There were some trouble ahead for the free Unix version known as BSD.

Company named BSDi was selling operating system that was based on BSDs source code. Which in turn had some source from the original Unix. AT&T wasn't very pleased about that fact and sued BSDi. University of Berkley was also later dragged to court. Consequenses were that some code was removed and AT&T promised not to sue university of Berkley over the matter anymore. Another thing was that student named Linus Torvalds started to build his own own operating system (and no Unix code was used, not then and not after that, even if one company is trying to prove otherwise) for his 386 computer as future of BSD was not very bright and Minix was not accepting any patches. Also NetBSD and FreeBSD experienced some setbacks because they needed to remove some important code.

Actually, FreeBSD and NetBSD were based on 386BSD, which in turn was based on Net/2 that was last version of original BSD. Reason why they forked was that some developers didn't get some patches commited to original 386BSD and they decided to fork.

After that things got much better. Linus started receiving patches for his Linux operating system and FreeBSD and NetBSD added missing pieces and got working versions out. Both FreeBSD and NetBSD were forked again though. OpenBSD was forked from NetBSD because development of NetBSD was happening "behind closed doors" and only snapshots of the source was released now and then. Much later FreeBSD also was forked because of differences of opinnion about how support for multiple processors would be implemented. That fork is know as DragonflyBSD.

So that's it, Unix history crammed in just few paragraphs with some BSD flavor and drop of Linux. There's lot of stuff that I didn't mention, but there's books you can read about these things. For example Eric Raymonds The Art of Unix Programming has some chapters about history of Unix. Glen Moody has also written book called "The Inside Story of Linux and the Open Source Revolution" that has more about Linux. Henrik Ingo has also written quite nice book about open source in general, it's called "Open Life: The Philosophy of Open Source"

Even if Unix is a standard, implementations differ quite a bit. If you have to work with various versions of Unix (with trademark right or not), here's good list what utilities you have to use to do certain things.

PS: here's also good summary of the history, shorter and yet more detailed in some places than mine.
December 2009
M T W T F S S
November 2009January 2010
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31