Ετήσια αρχεία: 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/;
./configure;
make;
make check;
sudo make install;
cd ..;
#Finally, we can proceed with compiling openbts-umts
./autogen.sh;
./configure;
make;
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(*)
FROM
(
  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;