fork() and stdin behaviour

I've stumpled upon this: if we fork() a process, its standard input and output file descriptors remain the same for both processes. It means that the forked process can read() from stdin, and then the read data is taken away, and the original process can't read it.

Let's see what happens if the fork()-ed process reads all the data it can (and then displays the throughput):

As output we get:

Playing audio with gr-ha5kfu if Audio Sink fails

I've got continuous underruns and overruns, clicks with Audio Sink in GNU Radio, so I used the Execute External Process Sink in gr-ha5kfu, with csdr, and the mplayer command line tools.

I used the following command line:

csdr convert_f_i16 | mplayer -cache 1024 -quiet -rawaudio samplesize=2:channels=1:rate=48000 -demuxer rawaudio -

Now I've got smooth playback.

Calculate the value of Pi with three lines of python

This is based on Newton's method on root finding:

from math import *
d=lambda x:x-sin(2*x)/2

Now you can try this:

>>> d(3)
>>> d(d(3))
>>> d(d(d(3)))
>>> d(d(d(d(3))))
>>> d(d(d(d(d(3)))))

Installing WSPR on Linux Mint 17

First I tried to compile it from the source at the official SVN repo, but I ran into difficulties.

The easiest way to go is to add the following PPA to /etc/apt/sources.list:

deb trusty main
deb-src trusty main

The next step is to install wspr with apt-get:

sudo apt-get update
sudo apt-get install wspr

Then run wspr by typing:

GNU Radio on the Raspberry Pi 2

Having followed the instructions over here, everything worked except that the FFT plot diagrams were blank. I've got the following error message:

libGL error: failed to load driver: swrast

It was solved by:

sudo apt-get install libgl1-mesa-swx11

rtl_sdr in VirtualBox

The screenshot was made of a VirtualBox VM running Ubuntu 14.04 on a Linux MINT 17 host.
rtl_sdr tool works inside the guest OS, after sharing the USB dongle with the guest under the Devices, USB Devices menu.

Quick setup instructions for OpenWebRX on Ubuntu 14.04.2 LTS

This is an absolute quick guide to install OpenWebRX, an SDR receiver software with a web UI. If you need more information or have a problem, please look at the GitHub page of the project.

Headless first boot with Odroid-C1

It was quite easy, but I'd like to highlight some information:


Subscribe to RSS - blogs