I do what I can

Random thoughts from Mauricio Teixeira…

Posts Tagged ‘linux

My home streaming solution with MediaTomb + Popcorn Hour + BubbleUPnP

with 4 comments

For a few years now I have been extremely satisfied with my Popcorn Hour (which I will from now on call PCH, for short): I can stream any kind of media from my Fedora desktop to my TV (I don’t have one of those smart TVs yet), it serves as a nice torrent server, and never gave me any headaches. A few days ago I decided it was time to “revamp” my setup, and try something new, so I came up with today’s solution.

I can use my Android phone not only to stream audio and video from my desktop, but also to control what is currently being played on my PCH.

Actually this all started when I decided it was time to use UPnP to play my music files, instead of direct NFS mounting (like I have been doing on the PCH since the beginning). NFS has been working just fine, but for music it’s incomplete: you can only see music the way the files are lay down on the hard drive. Using UPnP you can browse by artist, albuns, genres, etc. It’s a whole new experience.

Since I recently gave up on using Rhythmbox (which has an internal UPnP server) in favor of Banshee (which doesn’t), I had to use an alternative solution. After some quick consideration, given past experiences, I decided going with MediaTomb. Honestly I bet whatever I describe here applies to any UPnP server, but this is what I am using now.

During the course of setting up MediaTomb, I was tired of walking back and forth to the PCH (they’re not on the same room), so I decided to try an Android UPnP client. I didn’t browse the market for too long, and just installed whatever seemed reasonable. So far I’m satisfied with what BubbleUPnP does. Like with the UPnP server, I guess most (not all) of the UPnP clients will do what I describe here.

I set up MediaTomb by just reading pieces and bits of the documentation. Should not be too hard, but if comments in this post requests, I can write a small tutorial.

I like to say that UPnP is some kind magic protocol that make stuff work without hassle. So once MediaTomb was finally correctly configured I could see it from my Android phone, and I was able to play some music.

Then I notice something interesting: BubbleUPnP allows me to select a library (where the data comes from) and a renderer (where the data is “played”). When I saw the list of available libraries and renderers I notice the magic: I could select MediaTomb as library, and PCH as rendered. “Oh, what does it do?”

MAGIC. Now I can select files on my phone, hit play, and it will start playing on the PCH connected to my big TV and a great sound system (actually a 2.1, but it does sound great). The nicest thing about all of that is being able to browse through my files directly from my phone, then select what I want and play. It fixes one of the biggest PCH’s shortcomings while playing music: you can’t browse your library during playback.

Now you can think: if I have access to the remote control, why going through all this hassle? Actually it not only helps with the media selection problem I described before, but also I can select the next music from anywhere I am while walking around in my apartment. Also it totally integrates all my media players: I can see all files I have stored on the desktop, phone, PCH, PlayStation, whatever. It’s so fun.

Before you ask: I do intend to have a NAS at some point, and concentrate all my media files in one place. However there are some files that need to live separately on either one of my devices due to how they’re stored or what do with them. I won’t bother you with the details.

Next: I’m going to try to stream my music over internet (no music services, just plain old dynamic DNS + ssh).

Oh, please let me know about your home streaming solutions. I’m curious about how you guys do it. Just remember: no Mac or Windows. 🙂

Well, anyway, this is fun, so let me go back and play. 😀

Written by netmask

dezembro 27, 2011 at 19:43

Publicado em Uncategorized

Tagged with , , , ,

MeeGo / Qt – Alive and Kicking

with one comment

“What’s going on around MeeGo now? Nokia goes for MicroSoft, and Intel does what? Signals are fairly mixed for all of us working on MeeGo, and even more for the people following the development from the distance. ”
“The arguments about MeeGo being not mature are not true, these things are all over already. All pieces are in place, and the integrated next release of MeeGo 1.2. will give very solid basis for the products now.”
“To summarize, MeeGo and Qt are strongly alive, gaining momentum to move to the next phase.”

Read the full blog post.

Written by netmask

fevereiro 24, 2011 at 23:31

Publicado em Uncategorized

Tagged with , ,

RHCDS: Done!

with 2 comments

Oh yeah! I just received my RH436 exam results, and I passed!

So, after passing RH401 and RH423, I am now RHCDS (Red Hat Certified Datacenter Specialist)!

Two more for RHCA. Stay tuned. 🙂

Written by netmask

janeiro 18, 2011 at 01:25

Publicado em Uncategorized

Tagged with , , , ,

Email to SMS gateway in Linux

with 17 comments

Updated on Jul/03 — Works on Fedora 13, a fix minor inconsistencies.

This is another one of my “quick and dirty” tutorials. This time I will show you how to build an email to SMS gateway.

Before we continue, bare in mind that I didn’t care to document details on system security (specially in what regards to spam filtering or SELinux configuration). The idea here is to show an overview on what needs to be done to have it working. I also won’t explain how to configure an MX entry in DNS, or how to make this integrate to your current email system. The details should be polished by whoever is going to implement, depending on their environment.

Tools I have used here:

  1. A regular PC
  2. Nokia phone running Symbian OS, connected to the USB port in “PC Suite” mode
  3. Fedora 13, with Postfix (personally, I don’t like Sendmail)
  4. SMS Server Tools 3 (installed from Fedora repository, using yum)

First thing I did was installing the SMS Server Tools application, Postfix and disabling Sendmail. I did that because I think Postfix is easier to configure and maintain. If you want to do this using Sendmail, and you find your way into it, please paste the necessary configuration lines on the comments below.

# service sendmail stop
# chkconfig sendmail off
# yum install smstools postfix

The package in Fedora 13 already adds a private user for the sms system, creates the necessary directories and sets the permissions. So we just go with what we get.

Now we need to configure smstools with the minimum parameters necessary for it to run.

# vi /etc/smsd.conf
+ devices = ACM0
+ loglevel = 5
+ group = dialout
+ infofile = /var/spool/sms/smsd.running
+ [ACM0]
+ device = /dev/ttyACM0
+ incoming = no

Important notes here. The device ttyACM0 exists because when I connected the Nokia I selected the “PC Suite” mode. If you select anything different, it will create a different device, but none of them work for sending messages. If you are doing this on a different distribution other than Fedora, check which group is the owner of this device, and set it on the smstools config file, otherwise the application won’t be able to write to the device.

Great. Now we can start the application, and run a basic test. Remember the accepted phone number format: XXYY99999999, where XX is the country code, YY is the region code, and the rest is the real phone number.

# chkconfig smsd on
# service smsd start
# su smstools -c "smssend 551199999999 'This is a short test.'"
# su smstools -c "echo -e 'To: 551199999999\n\nThis is a long test.\nWith multiple lines.\n' > /var/spool/sms/outgoing/test"

At this point, you should have received two messages. If you don’t, read back and double check your settings (or look at the logs). If all works, keep reading.

The final part is to make Postfix receive the messages, and route via smstools. The script that converts from email to SMS is this:

# cp /usr/share/doc/smstools-*/email2sms /usr/local/bin/
# chmod +x /usr/local/bin/email2sms

And here is how we make Postfix deliver to the script:

# vi /etc/postfix/main.cf
+ inet_interfaces = all
+ mailbox_transport = smstools
# vi /etc/postfix/master.cf
+ smstools  unix  -       n       n       -       -       pipe
+  flags=DORhu user=smstools argv=/usr/local/bin/email2sms
# chkconfig postfix on
# service postfix start

If you don’t set the inet_interfaces option, Postfix will only accept connections from localhost. If you need it to receive messages from anywhere in your network, better put something meaningful there.

Now we need to make Postfix understand what is considered to be a valid user on the server. For that, we keep the old /etc/aliases, and add our users:

# vi /etc/aliases
+ 551199999999: netmask
+ 551188888888: badnetmask
# newlaliases

Remember: for every SMS recipient there must be an entry in /etc/aliases. The name after the colon is mandatory because of the file format, but will make no difference to the delivery system, so just use something that will identify the user of that address.

At last, test it:

$ telnet smsgateway.example.com 25
Connected to smsgateway.example.com (
Escape character is '^]'.
220 smsgateway.example.com ESMTP Postfix
helo netmask.example.com
250 smsgateway.example.com
mail from: netmask@example.com
250 2.1.0 Ok
rcpt to: 551199999999@smsgateway.example.com
250 2.1.5 Ok
354 End data with .
To: 551199999999@smsgateway.example.com
Subject: Test subject
Hello world!
250 2.0.0 Ok: queued as C52E620236

That’s it!

I hope this is useful for you. If you find any mistakes or you wish to suggest any different setup to our next readers, please feel free to comment below.

Have fun! 🙂

Written by netmask

março 11, 2010 at 11:48

Publicado em Uncategorized

Tagged with , , , ,

Convert from VirtualBox to KVM

with 7 comments

Quickest and dirtiest way to convert your VirtualBox machine into a KVM machine.

First of all, make sure you have enough space. If you have created a dynamically growth disk, the virtual disk has been defined as 20GB in size, but is only currently using 8GB, you will need 28GB extra (8 for the original file you already have + 20 for the temp file + 8 for the final file). If you’re using disks with pre-allocated size, you will need 2 times extra the space (20 original + 20 temp + 20 final, in this example).

1 – Convert the VirtualBox VDI file into a RAW image.

$ VBoxManage clonehd --format RAW MyTestVM.vdi MyTestVM.raw

2 – Convert the RAW image into a QCOW file.

$ qemu-img convert -f raw MyTestVM.raw -O qcow2 MyTestVM.img

3 – Voila. Go into virt-manager, create the machine, and use your newly created image.

Written by netmask

março 3, 2010 at 01:20

Publicado em Uncategorized

Tagged with , , ,

Utilizando o controle remoto da PixelView Play TV Pro Ultra no Fedora 12

with 2 comments

Recentemente reorganizei meu escritório em casa, e no meio disso, coloquei um sofá, para que eu pudesse assistir filmes confortavelmente (apenas uma segunda opção, já que tenho um Popcorn Hour na sala de estar). Enquanto olhava nas coisas velhas, encontrei o controle remoto que veio com minha antiga PixelView Play TV Pro Ultra, que eu não utilizo há um bom tempo, mas que está instalada do mesmo jeito. Já que eu tenho isso, decidi usar o controle remoto, para fica ainda mais confortável vendo meus filmes do sofá.

Itens utilizados nesse tutorial:

Visão rápida da instalação do hardware: espete a placa no slot PCI, conecte o receptor de infra-vermelho no pluge certo da placa, inicie o sistema. Você consegue… 🙂

Aparentemente o Fedora irá detectar a placa de TV, mas não vai reconhecer o modelo correto, portanto você precisa dizer exatamente qual placa está sendo utilizada. Você faz isso criando um arquivo que irá passar o modelo para o driver:

# cat /etc/modprobe.d/cx88xx.conf
options cx88xx card=27

Agora você tem duas opçẽos: reiniciar o sistema, ou recarregar o módulo. Para recarregar o módulo, execute os seguintes comandos:

# rmmod cx8800
# rmmod cx88xx
# modprobe cx88xx
# modprobe cx8800

Agora instale os pacotes necessários:

# yum install lirc totem-lirc

E aqui estão os passes de mágica: o controle remoto não funciona de primeira, então precisei dizer ao lirc onde encontrar o dispositivo correto, e criar um novo arquivo de configuração explicando a ele o que cada botão faz (bom, pelo menos a maioria deles).

Primeiro você precisa dizer ao lirc onde encontrar o dispositivo. Para isso edite o arquivo /etc/sysconfig/lirc e modifique-o conforme abaixo:


Em seguida salve o text desta página para um arquivo chamado /etc/lirc/lircd.conf. Agora habilite o serviço do controle remoto:

# chkconfig lirc on
# service lirc restart

Depois disso, tudo o que você precisa fazer é abrir o Totem, ir para o menu Editar -> Plug-ins e habilitar o “Controle remoto infra-vermelho”.

Infelizmente não dá para abrir um arquivo novo, nem pular para o próximo arquivo na sua lista de reprodução, mas ao menos você pode executar, parar, finalizar, adiantar ou voltar o vídeo. Talvez depois eu dedique um tempo para habilitar mais recursos do controle (ou, se você já o fez, por favor fale como nos comentários dessa página).

Divirta-se! 🙂

Written by netmask

fevereiro 14, 2010 at 21:43

Publicado em Uncategorized

Tagged with , , , , ,

Using PixelView Play TV Pro Ultra remote control on Fedora 12

leave a comment »

I recently reorganized my home office, and when doing so, I added a couch so I could watch movies more comfortable (it’s a second option, since I already have a Popcorn Hour at the living room). While looking at some old stuff, I found the remote control that came with my ancient PixelView Play TV Pro Ultra, which I don’t use for a long while, but it’s still installed anyway. Since I have that, I decided to make the RC available, so I could be even more comfortable while pausing/fast-forwarding my movies from the couch.

Items used in this tutorial:

Quick overview about the hardware install part: place the card on the PCI slot, connect the IR receiver on the proper plug on the board, boot the system. You’ll find your way… 🙂

Apparently Fedora will detect the TV card, but it won’t recognize the proper model, so you need to tell it exactly which card is in use. You do so by creating a file telling the driver about it:

# cat /etc/modprobe.d/cx88xx.conf
options cx88xx card=27

Now you have two options: reboot, or reload the module. To reload the module, run the following commands:

# rmmod cx8800
# rmmod cx88xx
# modprobe cx88xx
# modprobe cx8800

Now install the necessary packages:

# yum install lirc totem-lirc

And here are the magic tricks: this remote control does not work out of the box, so I had to tell lirc where to find the IR input device, and create a new config file to make it understand what each button does (well, at least most of them).

First you need to tell lirc where to find the IR input device. You do so by editing /etc/sysconfig/lirc and editing the device line like this:


Next, save the text of this page to a file named /etc/lirc/lircd.conf. Now enable the remote control daemon:

# chkconfig lirc on
# service lirc restart

After that, all you need to do is open Totem, go to menu Edit -> Plug-ins and enable the “Infra-red remote control” plug-in.

Unfortunately you can’t open a new file, neither skip to the next file on your play list, but at least you can play, pause, stop, fast forward and rewind. Maybe I’ll take some time later to enable more of the IR features (or, if you have done so, please add to the comments of this page).

Have fun! 🙂

Written by netmask

fevereiro 14, 2010 at 21:21

Publicado em Uncategorized

Tagged with , , , , ,