Pages

21 January 2014

MiniDLNA on a raspi

One of the best things in life is that you never stop learning and/or discovering new and exciting things. Today was a great day in that sense. I discovered the set -u builtin which warns you if a variable is not set and also that it is good to talk to people to share ideas. (I've been talking to a cousin of mine for a long, long while this afternoon, interesting things).
But in respect to software, the discovery of the day/week/month and probably the whole year (hmm) was MiniDLNAminidlna is a streaming server that can serve your files across the network to any device that supports the UPnP (Universal Plug and Play) protocol.
I was looking for a way to stream media from my raspi. Since I had only tried to do it once and it was with vlc, I installed vlc in my raspi and tried to stream video with it but it was almost impossible. It turned out to be a too resource intensive method.
Then I used a clever way of streaming media from my raspi to my network. I copied the files that I wanted to stream to /var/www and accessed the contents of that directory over http, either using vlc or just a web browser. But no matter how clever this idea is, it is not very handy. You have to do a lot of manual work.
Today I asked on irc and a friend of mine said he used minidlna. I installed and configured it follwowing a tutorial I found on the web. Basically what I did was to edit/etc/minidlna.conf with several settings that apply to my device. It is pretty simple and straightforward, and in case you do not know what to put in there, you can always use the default settings.
Then from another computer I launched vlc and went to View --> Playlist --> Local Network --> Universal Plug n' Play and there I could see all the files that I wanted to share. Impressive, huh?
And the best thing yet to come, minidlna does not stress your raspi cpu at all. While working, it only used 0.3% of the cpu power.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2966 minidlna 20 0 37332 5824 552 S 0.3 1.3 0:00.22 minidlna

18 January 2014

weechat's relay plugin

Most irc people I know use either one of these combinations:
screen + irssi
or
tmux + weechat
I'm not an expert at all in any of them, but I have used both of them for several years now. And after configuring screen + irssi to get my perfect setup (combination of scripts, utf-8 support and so on and so forth). I decided it was time to make the switch to tmux + weechat.
I'm not going to talk about the advantages and disadvantages of them because everyone has their own preferences and that is fine by me.
One feature that I'm really interested in is the proxy/relay feature of both irssi and weechat. I already wrote about irssi proxy a while ago. So I decided to explore both weechat relay plugins named irc and weechat. I wrote a complete tutorial on how to configure them, but specifically for sdf-eu users. Here is the link:
I hope you find it useful.

07 January 2014

pharc flowchart

This it the flowchart for pharc, my 'phlog archiver'. It is my first flowchart. I started drawing it with dia but I ended up using google docs. You can see an up-to-date version here


28 December 2013

pa i crosto

There is a saying in my village that goes: "Pa i crostó, l'esmorzar d'Altorricó." Which roughly translates as: "This is the traditional breakfast that people used to eat a long time ago, but not anymore." Well, things change over time. I doubt many people still continue the tradition of preparing pa i crostó for breakfast. I do sometimes. I really love to eat it, especially in the winter.
It is not really difficult to prepare, rather on the contrary, it is easy, but to tell you the truth the secret of a good pa i crostó preparation lies in the coordination of the steps. You want to eat it hot (if one of the ingredients, either the toast or the eggs gets cold, you will definitely not enjoy eating it.)
Since a picture is worth a million words, I took several pictures.

You need:



  • A frying pan
  • Olive oil
  • Salt
  • Garlic
  • A cup of boiling water
  • Two eggs (or alternatively anything else you like, eg. sausages)
  • A thick toast

Preparation:

Heed that the coordination of the steps is crucial! You have been warned :p
Cut a thick slice of bread, the thickest the better. You will have to pour the boiling water over the toast but you still want it to keep part of its consistence. If the toast is too thin, it will turn into a mash. Then toast it.
Heat the water until it starts to boil.
Meanwhile rub the garlic over the toast, on both sides. The flavour and the taste of the garlic cloves is the key to success.
Put the frying pan with oil to heat.
Pour the boiling water over the toast until it is soft, add salt and olive oil. Then, immediately fry the eggs. When they are ready put the eggs on top of the toast.
Do you want my special recommendation? Eat with a spoon ;)
Enjoy!


23 December 2013

Screenshot of the week 7

A few days ago I wrote a tutorial on how to configure weechat's relay plugin through a single port for all servers. I published it on my phlog, so I'm not unnecessarily going to repeat the information here. The link is here in case you are interested: (Warning: gopher link!)
gopher://sdf-eu.org:70/1/users/chals/phlog/2013/./12-15-13
Since the relay is working so fine, I decided to take a screenshot of the weechat instance running 24/7 with the configured relay running in a remote server and the other one of my local instance running in my raspi.
Just in case somebody is wondering why I run two instances of the same program both locally and remotely, the answer is plain simple. In my local instance I can configure and use as many plugins and scripts as I like whereas things are not so easy on the remote server. For example the aspell plugin which is really handy when typing fast or the buffersscript, just to name a few.


18 December 2013

pharc v.3.0 released

I have been procrastinating a bit about publishing version 3.0 because I wanted to do two things:
1.- Add functionality to choose the year of the archive, this would only be useful for people who are new to pharc but still, it would be a nice feature.
2.- Rewrite it in python, but unfortunately I'm still not proficient enough with python to do it (even though this is a simple script).
These things will have to wait for a later release someday :)
My initial idea was to publish one new release each year, i.e pharc1 saw the light in 2011, pharc2 in 2012, pharc3 in 2013 and so on and so forth, but to tell you the truth, gopher stuff is rather stagnant so I do not anticipate to see many changes in how things work form now on.
Anyway, the changelog for v.3.0 is:
 - Added option -a to specify current year of archive (redundant).

 - Added -v (version information option).

 - Added -h (help menu).

 - Added -y (year of the archive).

 - Help function (usage).

 - Improve coding style.

 - Leave a backup of gophermap > gophermap~ (in case things break).

 - Test before echoing "You're done now. Thanks for using pharc."
You can find all pharc versions here (gopher link):
gopher://sdf-eu.org:70/1/users/chals/downloads
There is also a .deb package available here:
And as usual, the git repository is hosted at gitorious:
pharc git repo

The wiki is located here:

17 December 2013

Screenshot of the week 6


This is a tiny screenshot of a corner of my sid desktop. It was taken with scrot -s to select a region.
The story behind these "weird" icons is as follows:
  1. never use desktop icons. I love clean desktops and I get rid of any default icons. So this exception is a remarkable thing.
  2. These icons are a quick, dirty hack to halt and/or reboot the laptop. The reason being that the logout button does not allow me to perform those actions. I haven't been able to fix it so I added those icons which execute/sbin/halt and /sbin/reboot respectively.
In order to create those icons I browsed to the Desktop directory with pcmanfm then right click on the mouse and select Create New/Shortcut.