Daily Archives: 2 January 2018

Compiling openbts-umts on Ubuntu 15.04

Below are the steps we followed to compile OpenBTS-UMTS on Ubuntu 15.04.
There could be a chance that we installed a couple of extra system packages while troubleshooting the installation but it works and we did not include some heavy system service as well so it should be OK.

sudo apt-get install build-essential libuhd autoconf libtool libdevel libzmq-dev libzmq libzmq-dev libzmq-dev libosip2-dev libortp-dev libusb-dev libusb-1.0 libtool-bin libsqlite3-dev libboost-dev libreadline-dev;
git clone https://github.com/RangeNetworks/OpenBTS-UMTS;
cd OpenBTS-UMTS/;
git submodule init;
git submodule update;
#First we need to setup ASN1C compiler
tar -xf asn1c-0.9.23.tar.gz;
cd vlm-asn1c-0959ffb/;
make check;
sudo make install;
cd ..;
#Finally, we can proceed with compiling openbts-umts
sudo make install;


Perform diff on two folders

To perform a recursive diff on all the files of two folders we just need to add the -r (or --recursive) parameter that recursively compares any subdirectories found.

To avoid needless messages from the tool, we can also use the -q (or --brief) parameter that reports only when files differ.

Example of performing diff on two folders recursively while preventing needless messages.

diff -rq aFolder someOtherFolder;

Count how many submissions per score

Recently, we had access to a database that contained the scores of a programming competitions system.
The database contained several contests, each contest contained several challenges and any competitor could make multiple submissions.
We wanted to extract a couple of charts showing

  • how many submissions we had per score and
  • how many submissions we had per score while filtering out the best submission (max score) per contestant per challenge per contest

The following code will return the number of submissions per score per challenge per contest.

SELECT contest_id, challenge_id, TRUNCATE(score, 1), COUNT(*)
FROM submissions
GROUP BY contest_id, challenge_id, TRUNCATE(score, 1)
ORDER BY contest_id, challenge_id, TRUNCATE(score, 1);

The next one will return the number of submissions per score per challenge per contest while filtering out the best submission (max score) per contestant per challenge per contest:

SELECT contest_id, challenge_id, TRUNCATE(max_score, 1), COUNT(*)
  SELECT contest_id, challenge_id, competitor_id, MAX(score) AS max_score
  FROM submissions
  GROUP BY contest_id, challenge_id, competitor_id
) AS max_scores
GROUP BY contest_id, challenge_id, TRUNCATE(max_score, 1)
ORDER BY contest_id, challenge_id, TRUNCATE(max_score, 1);

Compiling gr-gsm on Ubuntu 14.04 LTS

Below are the steps that we followed to compile gr-gsm on Ubuntu 14.04 LTS.

sudo apt-get update;
sudo apt-get install build-essential python-dev git python-pip;
sudo pip install PyBOMBS;
sudo pybombs prefix init /usr/local -a default_prx;
sudo pybombs config default_prefix default_prx;
sudo pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git;
sudo pybombs recipes add gr-etcetera git+https://github.com/gnuradio/gr-etcetera.git;
sudo pybombs install gr-gsm;
sudo ldconfig;

Building wireshark-2.4.2 on CentOS 7 (64bit)

Recently we were trying to compile WireShark from source on a CentOS 7 (64bit) with GTK3 disabled (./configure --disable-gtk3;).

As seen in the truncated logs below we got some errors.
To resolve them we had to install a few packages using yum.
Specifically, our solution involved the installation of the following:

sudo yum install libgcrypt-devel qt5-qttools-devel libpcap-devel -y;

Truncated logs:

checking for libgcrypt-config... no
checking for LIBGCRYPT - version >= 1.4.2... no
configure: error: libgcrypt not found; install libgcrypt-devel package for your system
libgcrypt-devel.i686 libgcrypt-devel.x86_64 
[[email protected] wireshark-2.4.2]$ sudo yum install libgcrypt-devel -y

checking for lrelease-qt5... no
checking for lrelease... no
configure: error: I couldn't find lrelease-qt5 or lrelease; make sure it's installed and in your path
[[email protected] wireshark-2.4.2]$ sudo yum install qt5-qttools-devel

checking whether to use libpcap for packet capture... yes
checking for pcap-config... no
checking for extraneous pcap header directories... not found
checking pcap.h usability... no
checking pcap.h presence... no
checking for pcap.h... no
configure: error: Header file pcap.h not found; if you installed libpcap
from source, did you also do "make install-incl", and if you installed a
binary package of libpcap, is there also a developer's package of libpcap,
and did you also install that package?
[[email protected] wireshark-2.4.2]$ sudo yum install libpcap-devel

[[email protected] wireshark-2.4.2]$ ./configure --disable-gtk3