<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<title type="text">Yihenew</title>
<generator uri="https://github.com/jekyll/jekyll">Jekyll</generator>
<link rel="self" type="application/atom+xml" href="http://yihenew.com/feed.xml" />
<link rel="alternate" type="text/html" href="http://yihenew.com" />
<updated>2018-08-12T09:54:30+00:00</updated>
<id>http://yihenew.com/</id>
<author>
  <name>Yihenew beyene</name>
  <uri>http://yihenew.com/</uri>
  <email>yihenew.beyene@gmail.com</email>
</author>


<entry>
  <title type="html"><![CDATA[gr-SatelliteModem]]></title>
  <link rel="alternate" type="text/html" href="http://yihenew.com/blog/gr-SatelliteModem/" />
  <id>http://yihenew.com/blog/gr-SatelliteModem</id>
  <updated>2018-08-12 12:54:50 -0400T00:00:00-00:00</updated>
  <published>2018-08-12T00:00:00+00:00</published>
  
  <author>
    <name>Yihenew beyene</name>
    <uri>http://yihenew.com</uri>
    <email>yihenew.beyene@gmail.com</email>
  </author>
  <content type="html">
    &lt;h2 id=&quot;gr-satellitemodem---gnu-radio-based-satelltie-modem&quot;&gt;gr-SatelliteModem - GNU Radio-based satelltie modem&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;gr-SatelliteModem&lt;/strong&gt; is a GNU Radio module that offers single-carrier satellite communications capablility. The module contains GNU Radio blocks which can be used to transmit and/or receive data over the air (eg. over satellite frequencies). Currently, the module supports differential BPSK and QPSK modulation, rate-1/2, 3/4 and 7/8 convolutional coding rates. A range of data rates can be achieved through use of different combination of modulations, coding rates and sampling rates.&lt;/p&gt;

&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Before installing &lt;strong&gt;SatelliteModem&lt;/strong&gt;, make sure that you have already installed the latest version Gnuradio. The module has been tested against Gnuradio v3.7.9. Any radio front-end can be used as long as it is supported by Gnuradio and has both TX and RX antenna ports. UHD-based example can be found in &lt;code class=&quot;highlighter-rouge&quot;&gt;examples/&lt;/code&gt; folder. The module was created using Gnuradio templating engine called &lt;strong&gt;gr_modtool&lt;/strong&gt; which automates creation of out-of-tree modules. The installation process follows standard CMake project installation.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd gr\_SatelliteModem
$ mkdir build
$ cd build 
$ cmake ../ 
$ make
$ make test
$ sudo make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;transceiver-design&quot;&gt;Transceiver Design&lt;/h2&gt;

&lt;h3 id=&quot;modulation&quot;&gt;Modulation&lt;/h3&gt;
&lt;p&gt;Currently, supported modulation formats are Differencial BPSK (DBPSK) and Differential QPSK (DQPSK). The modulator converts data bytes (each byte contains 8 data-bits) into symbols. The number of bits per symbol is either 1 (for DBPSK) or 2 (for DQPSK). Then each of the symbols is mapped to one of the constellation points (complex symbols). Finally, the complex symbols are fed to a pulse-shaping filter. The filter is Root-Raised Cosine (RRC) filter, and exact replica of this filter is used at the receiver such that all the signal energy is coherently combined without causing Inter-Symbol interference (ISI). Figure below shows both the modulator and demodulator connected over a fading channel simulator. In practice, communication over a radio channel suffers from signal distortion caused by the propagation medium and hardware imperfections such as clock drift. For successful reception, the receiver has to compensate for such distortions. Oscillators used by the transmitter and the receiver are far from being ideal. A mismatch between these oscillators introduces carrier frequency offset and clock skew. Moreover, the receiver may receive multiple reflections of the transmitted signal each arriving at the receiver with slightly different delays and phases. Hence, the receiver has to adaptively compensate (equalize) for channel fading caused by such multi-path propagation. Once this is done, a matched-filter (RRC filter) is used to down-sample the signal and recover transmitted symbols. DPSK demodulator de-maps the complex symbols back to bits. Output of the demodulator is a stream of floating-point numbers, or &lt;strong&gt;soft-bits&lt;/strong&gt;, (instead of hard-decision 1’s and 0’s). The magnitude of a &lt;strong&gt;soft-bit&lt;/strong&gt; corresponds to the reliability of the demodulated bit.&lt;/p&gt;

&lt;figure&gt;
	&lt;img src=&quot;/images/blog/grsatellite-modulation.png&quot; alt=&quot;&quot; /&gt;
&lt;/figure&gt;

&lt;h3 id=&quot;synchronization&quot;&gt;Synchronization&lt;/h3&gt;
&lt;p&gt;Without a time-synchronization mechanism, the receiver is not able to identify the starting point of a data packet. Moreover, Viterbi decoder may not be able to decode the data. For example, assume that the coding rate is 3/4. This implies that, the channel encoder produces 4 bits for every 3 data bits where the 4 output bits are serial contatenated. The decoder, on the other hand, gropus received soft bits into a block of 4 consecutive soft bits. However, there are four possible starting points when grouping the soft bits. To solve these problems, a pseudo-random sequence of bits (&lt;strong&gt;preamble&lt;/strong&gt;) which is known by both the transmitter and the receiver is appended to each transmitted packet. The receiver correlates received soft bits against the preamble sequence and marks the frame boundaries by looking at places where correlation peak is detected. &lt;strong&gt;SatelliteModem&lt;/strong&gt; module comes with the following two blocks as shown in the figure below.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;SyncPreamble&lt;/code&gt; This block appends preamble bytes at the beginning of each encoded packet.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;PreambleDetector&lt;/code&gt; This block correlates soft bits against the preamble sequence. After detection of frame boundaries, &lt;strong&gt;PreambleDetector&lt;/strong&gt; block removes the preamble bits and passes soft bits which belong to an encoded packet.&lt;/li&gt;
&lt;/ul&gt;

&lt;figure&gt;
	&lt;img src=&quot;/images/blog/grsatellite-preamble.png&quot; alt=&quot;&quot; /&gt;
&lt;/figure&gt;

&lt;h3 id=&quot;forward-error-correcting-code-fec&quot;&gt;Forward Error-Correcting Code (FEC)&lt;/h3&gt;
&lt;p&gt;Error-correcting codes such as Viterbi (convolutional) encoding add extra redundancy to transmited data such that the receiver is able to correct errornous bits. The coding rate determines the maximum number of errornous bits that can be corrected. &lt;strong&gt;SatelliteModem&lt;/strong&gt;’s encoder supports two channel encoders: Viterbi and Low-Density Parity Check (LDPC) codes. Viterbi encoder can be configured to one of three coding rates: 1/2, 3/4 and 7/8. Currently, LDPC supports only one coding rate which is 0.42.&lt;/p&gt;

&lt;figure&gt;
	&lt;img src=&quot;/images/blog/grsatellite-fec.png&quot; alt=&quot;&quot; /&gt;
&lt;/figure&gt;

&lt;h3 id=&quot;packet-encoder&quot;&gt;Packet Encoder&lt;/h3&gt;
&lt;p&gt;Packet encoder serves two main functions. First, it packs stream of data bytes into blocks of fixed size. Secondly, each block, &lt;strong&gt;frame/packet&lt;/strong&gt; is prepended with a 6-byte header as shown in the figure below.&lt;/p&gt;

&lt;figure&gt;
	&lt;img src=&quot;/images/blog/grsatellite-packet.png&quot; alt=&quot;&quot; /&gt;
&lt;/figure&gt;

&lt;p&gt;A 16-bit CRC is added in order to detect errornous packets. &lt;strong&gt;SatelliteModem&lt;/strong&gt; has two alternative packet encoder/decoder blocks. One of them is &lt;strong&gt;Packetizer/Depacketizer&lt;/strong&gt;. These blocks are written in Python. The &lt;strong&gt;Packetizer&lt;/strong&gt; block reads bytes from a UDP port and encodes them into packets. The size of UDP packets should not exceed &lt;strong&gt;MTU&lt;/strong&gt;. In case, the size of a UDP packet is less than &lt;strong&gt;MTU&lt;/strong&gt;, padding bytes are appended at the end. However, the CRC is computed only for the payload part excluding padding bytes. The &lt;strong&gt;Depacketizer&lt;/strong&gt; block, on the other hand, validates the CRC header, and writes the payload into another UDP port.&lt;/p&gt;

&lt;figure&gt;
	&lt;img src=&quot;/images/blog/grsatellite-framing1.png&quot; alt=&quot;&quot; /&gt;
&lt;/figure&gt;

&lt;p&gt;Alternatively, C++ based implementations, &lt;strong&gt;Framer/Deframer&lt;/strong&gt;, can be used. These blocks do not access the UDP port directly. Instead, messaging blocks are used to connect &lt;strong&gt;Framer/Deframer&lt;/strong&gt; with &lt;strong&gt;UDP Source/UDP Sink&lt;/strong&gt; blocks. This isolation might help in reducing latency.&lt;/p&gt;

&lt;figure&gt;
	&lt;img src=&quot;/images/blog/grsatellite-framing2.png&quot; alt=&quot;&quot; /&gt;
&lt;/figure&gt;

&lt;p&gt;Note that both &lt;strong&gt;Packetizer&lt;/strong&gt; and &lt;strong&gt;Framer&lt;/strong&gt; have two modes of operation: &lt;strong&gt;blocking&lt;/strong&gt; and &lt;strong&gt;non-blocking&lt;/strong&gt;. In &lt;strong&gt;blocking&lt;/strong&gt; mode, the transmitter is suspended until data is available at the UDP port. In &lt;strong&gt;non-blocking&lt;/strong&gt; mode, a dummy packet is transmitted when there is no data transmit. This eliminates discontineous transmissions. During over-the-air operation, it is recommended to use &lt;strong&gt;non-blocking&lt;/strong&gt; mode such that the receiver stays synchronized to the transmitter’s clock.&lt;/p&gt;

&lt;h2 id=&quot;examples&quot;&gt;Examples&lt;/h2&gt;

&lt;p&gt;There are two example applications located in &lt;code class=&quot;highlighter-rouge&quot;&gt;examples/&lt;/code&gt; folder. The first one is &lt;strong&gt;transceiverLoopbackSimulator&lt;/strong&gt; which simulates both the transmitter and the receiver communicating over a fading channel. The second is &lt;strong&gt;transceiverLoopbackUHD&lt;/strong&gt; that implements a complete transceiver when connected to UHD-compatible frontend. This application requires a radio front-end that is supported by a UHD driver. Make sure to set both TX and RX freqeuencies appropriately. The transceiver can be tested in &lt;strong&gt;loopback&lt;/strong&gt; mode by using identical TX and RX frequencies.&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;http://yihenew.com/blog/gr-SatelliteModem/&quot;&gt;gr-SatelliteModem&lt;/a&gt; was originally published by Yihenew beyene at &lt;a href=&quot;http://yihenew.com&quot;&gt;Yihenew&lt;/a&gt; on August 12, 2018.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Creative art using Matlab]]></title>
  <link rel="alternate" type="text/html" href="http://yihenew.com/blog/matlab-creative-art/" />
  <id>http://yihenew.com/blog/matlab-creative-art</id>
  <updated>2017-12-04 14:17:50 -0400T00:00:00-00:00</updated>
  <published>2017-12-04T00:00:00+00:00</published>
  
  <author>
    <name>Yihenew beyene</name>
    <uri>http://yihenew.com</uri>
    <email>yihenew.beyene@gmail.com</email>
  </author>
  <content type="html">
    &lt;p&gt;While working with complex I/Q data captured from radio signals, some of the graphic plots ended up being pieces of art work by accident. So, it might be worth sharing it with you. Matlab is a powerful software that is used in various fields such as engineering, mathematics, economics, automation systems. It has a rich set of libraries for signal processing and data visualization. Though Matlab’s graphics engine is not meant for high quality artwork, it is fun to play with it. The script is available on &lt;a href=&quot;https://github.com/ydagne/Matlab-CreativeArt&quot;&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here are sample outputs.&lt;/p&gt;

&lt;figure&gt;
	&lt;img src=&quot;/images/blog/MatlabArt1.png&quot; alt=&quot;&quot; /&gt;&lt;img src=&quot;/images/blog/MatlabArt2.png&quot; alt=&quot;&quot; /&gt;
	&lt;img src=&quot;/images/blog/MatlabArt3.png&quot; alt=&quot;&quot; /&gt;&lt;img src=&quot;/images/blog/MatlabArt4.png&quot; alt=&quot;&quot; /&gt;
&lt;/figure&gt;

&lt;p&gt;If you are serious artist, however, I recommend you to check other softwares such as &lt;a href=&quot;https://processing.org/&quot;&gt;Processing&lt;/a&gt; and &lt;a href=&quot;https://libcinder.org/&quot;&gt;Cinder&lt;/a&gt; which are platforms for professional creative artwork design.&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;http://yihenew.com/blog/matlab-creative-art/&quot;&gt;Creative art using Matlab&lt;/a&gt; was originally published by Yihenew beyene at &lt;a href=&quot;http://yihenew.com&quot;&gt;Yihenew&lt;/a&gt; on December 04, 2017.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Youconduct (Virtual orchestra)]]></title>
  <link rel="alternate" type="text/html" href="http://yihenew.com/blog/youconduct/" />
  <id>http://yihenew.com/blog/youconduct</id>
  <updated>2017-12-04 14:18:26 -0400T00:00:00-00:00</updated>
  <published>2017-12-04T00:00:00+00:00</published>
  
  <author>
    <name>Yihenew beyene</name>
    <uri>http://yihenew.com</uri>
    <email>yihenew.beyene@gmail.com</email>
  </author>
  <content type="html">
    &lt;figure&gt;
	&lt;img src=&quot;http://www.trbimg.com/img-53e3e2cc/turbine/la-ca-0928-salonen-pg&quot; alt=&quot;&quot; /&gt;
&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;YouConduct&lt;/strong&gt; is a small python project that allows you to conduct an orchestra of virtual instruments. &lt;strong&gt;YouConduct&lt;/strong&gt; is based on two libraries: &lt;a href=&quot;http://www.fluidsynth.org/&quot;&gt;&lt;strong&gt;fluidSynth&lt;/strong&gt;&lt;/a&gt; and &lt;a href=&quot;https://opencv.org/&quot;&gt;&lt;strong&gt;OpenCV&lt;/strong&gt;&lt;/a&gt;. &lt;strong&gt;FluidSynth&lt;/strong&gt; is a software that synthesizes music in real-time from a soundfont file. &lt;strong&gt;OpenCV&lt;/strong&gt; (Open Source Computer Vision Library)  is known for its powerful real-time graphics processing capabilities. The code is available on &lt;a href=&quot;https://github.com/ydagne/youConduct&quot;&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In order to use youConduct, you need to install the following libraries first:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;fluidSynth&lt;/li&gt;
  &lt;li&gt;opencv2&lt;/li&gt;
  &lt;li&gt;python binding for opencv&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For debian distributions, you can install the above as follows:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get install libopencv-dev python-opencv fluidsynth
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;colorsoundpy&quot;&gt;colorSound.py&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;colorSound&lt;/strong&gt; lets you conduct a virtual orchestra using colors. It processes images captured from a webcamera and tracks three colors (Green, Blue, and Red). &lt;strong&gt;colorSound&lt;/strong&gt; uses the &lt;strong&gt;OpenCV&lt;/strong&gt; library for image processing and tracking of colors. When you run the script, it shows a video stream captured from your camera. Currently, &lt;strong&gt;colorSound&lt;/strong&gt; detects and tracks three colors. Only one instance of each color with largest size is tracked, and each color plays different instrument. The soundfont that comes with youConduct (&lt;code class=&quot;highlighter-rouge&quot;&gt;soundFont1.sf2&lt;/code&gt;) has three instrument presets.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Green - Yamaha Grand Piano&lt;/li&gt;
  &lt;li&gt;Blue - Violin&lt;/li&gt;
  &lt;li&gt;Red - Ahh Choir&lt;/li&gt;
&lt;/ul&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/zS5q4DHf4qs&quot; frameborder=&quot;0&quot; gesture=&quot;media&quot; allow=&quot;encrypted-media&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;Just grab anything that has at least one of the three colors and conduct the orchestra as professionals do. The software can play three instruments simultaneously if it sees all the three colors. Colors can be detected from your shirt too!&lt;/p&gt;

&lt;p&gt;You can play other/more instruments by modifying the script to use different soundfont file. If you use different soundfont, make sure that you select the appropriate &lt;code class=&quot;highlighter-rouge&quot;&gt;program&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;bank&lt;/code&gt; for each instrument.&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;http://yihenew.com/blog/youconduct/&quot;&gt;Youconduct (Virtual orchestra)&lt;/a&gt; was originally published by Yihenew beyene at &lt;a href=&quot;http://yihenew.com&quot;&gt;Yihenew&lt;/a&gt; on December 04, 2017.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[LAMP stack webserver]]></title>
  <link rel="alternate" type="text/html" href="http://yihenew.com/blog/LAMP-stack/" />
  <id>http://yihenew.com/blog/LAMP-stack</id>
  <updated>2017-12-04 16:11:53 -0400T00:00:00-00:00</updated>
  <published>2017-12-04T00:00:00+00:00</published>
  
  <author>
    <name>Yihenew beyene</name>
    <uri>http://yihenew.com</uri>
    <email>yihenew.beyene@gmail.com</email>
  </author>
  <content type="html">
    &lt;p&gt;After experimenting with the Amazon’s EC2 compute instance, I decided to setup a webserver on a CentOS machine and deploy a &lt;a href=&quot;https://wordpress.com/&quot;&gt;Wordpress&lt;/a&gt; website. While doing this, I documented the steps I followed from start to finish. Though there are plenty (and better) of online resources and tutorials, I will share with you what I did in case you find it useful.&lt;/p&gt;

&lt;p&gt;This is a quick guide for setting up LAMP stack and installing  &lt;a href=&quot;https://wordpress.com/&quot;&gt;Wordpress&lt;/a&gt; on a &lt;a href=&quot;https://www.centos.org/&quot;&gt;CentOS&lt;/a&gt; machine. If you are new to web technologies and do not know what LAMP stack is, check &lt;a href=&quot;/blog/web-application-101/&quot;&gt;this post&lt;/a&gt; for a brief introduction. In order to follow this guide, you need to have access to a CentOS machine either locally or remotely (for example, through &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh&lt;/code&gt; connection).&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.centos.org/&quot;&gt;CentOS&lt;/a&gt; has a long (10 years) release support. Each version of CentOS receives feature enhancements and new hardware support until 7 years, and security updates until 10 years after general availability. However, support for point releases (eg. CentOS 6.3) will no longer be available once a new point release (eg. CentOS 6.4) is available for the same version. At the time of this writing 7.3 is the latest version. However, 6.8 is the final point release for version 6. Hence, it is better use CentOS 6.8 since the final point release for version 7 is yet unknown. CentOS is available in two images: minimal and full DVD (contains all packages available for the respective version). The following instructions assume that you have installed the minimal version of CentOS.&lt;/p&gt;

&lt;h2 id=&quot;step-1-initial-server-setup&quot;&gt;STEP 1: INITIAL SERVER SETUP&lt;/h2&gt;
&lt;p&gt;After a fresh install of CentOS, it is recommended to install updates.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo yum update
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You may want to change the root password. To do that run the following command.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo passwd root
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The following instructions are optional. You can continue from &lt;em&gt;&lt;strong&gt;STEP 2&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If you want to create a new user account, eg. &lt;code class=&quot;highlighter-rouge&quot;&gt;john&lt;/code&gt;, then run this command.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo adduser john
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then you can set password for &lt;code class=&quot;highlighter-rouge&quot;&gt;john&lt;/code&gt; (eg 123456) as follows&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo passwd john 123456
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Even though you login with &lt;code class=&quot;highlighter-rouge&quot;&gt;john&lt;/code&gt;’s credentials, you still need the root password in order to run some commands (eg. installing packages and making changes to system configurations). You can avoid this by adding &lt;code class=&quot;highlighter-rouge&quot;&gt;john&lt;/code&gt; into the &lt;code class=&quot;highlighter-rouge&quot;&gt;sodoers&lt;/code&gt; group. The &lt;code class=&quot;highlighter-rouge&quot;&gt;sudoers&lt;/code&gt; group name in CentOS is &lt;code class=&quot;highlighter-rouge&quot;&gt;wheel&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo gpasswd -a john wheel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now every time you run commands with sudo, you will not be prompted for the root password. Make sure that you use a strong password for any user (especially the ones that are in &lt;code class=&quot;highlighter-rouge&quot;&gt;sudoers&lt;/code&gt; group).&lt;/p&gt;

&lt;h2 id=&quot;step-2-lamp-server-setup&quot;&gt;Step 2: LAMP SERVER SETUP&lt;/h2&gt;

&lt;p&gt;In this step we will install and configure &lt;a href=&quot;https://www.apache.org/&quot;&gt;Apache&lt;/a&gt; HTTP server, &lt;a href=&quot;http://www.php.net/&quot;&gt;PHP&lt;/a&gt; and &lt;a href=&quot;https://mariadb.org/&quot;&gt;MariaDB&lt;/a&gt; database server. MariaDB is an enhanced, drop-in replacement for &lt;a href=&quot;https://www.mysql.com/&quot;&gt;MySQL&lt;/a&gt; database server. From now on, all commands need to be executed as root (or with sudo privilege). If you don’t want to type sudo for ever command, then switch to the root user.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo su root
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now the command prompt sign changes from &lt;strong&gt;$&lt;/strong&gt; to &lt;strong&gt;#&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;First, install Apache server&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# yum install httpd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Start apache server&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# systemctl start httpd.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Enable apache to start on boot&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# systemctl enable httpd.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Configuration file for Apache is located at &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/httpd/conf/httpd.conf&lt;/code&gt;. Open this file and search for &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;DocumentRoot&quot;&lt;/code&gt;. By default, you will see the following&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;DocumentRoot &quot;/var/www/html/&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This means, Apache will serve websites that are hosted in &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/www/html&lt;/code&gt; directory. By default, if Apache doesn’t find an index file (eg. index.html), it will show directory listing of all files in &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/www/html&lt;/code&gt; directory. This will expose all the files in this director to the public. In order to disable directory listing, open &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/httpd/conf/httpd.conf&lt;/code&gt; file and within &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;Directory &quot;/var/www/html&quot;&amp;gt;&lt;/code&gt; directive, remove &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;Indexes&quot;&lt;/code&gt; from the list of &lt;code class=&quot;highlighter-rouge&quot;&gt;Options&lt;/code&gt;. Eg. If you find something like the following&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Options Indexes, FollowSymLinks
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;then change it to&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Options FollowSymLinks
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;i.e remove &lt;code class=&quot;highlighter-rouge&quot;&gt;Indexes&lt;/code&gt;. You need to restart apache in order to apply configuration changes&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# systemctl restart httpd.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The next step is to install &lt;a href=&quot;&amp;quot;https://mariadb.org/&amp;quot;&quot;&gt;MariaDB&lt;/a&gt; database server.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# yum install mariadb-server mariadb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Start the database server&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# systemctl start mariadb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;By default, MySQL has EMPTY root password and comes with a test database. Run the following script and follow the instructions to override dangerous DEFAULT and lock down access to the database.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Enable MariaDB to start on boot&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# systemctl enable mariadb.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, install PHP&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# yum install php php-mysql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Restart Apache&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# systemctl restart httpd.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;step-3-install-wordpress&quot;&gt;STEP 3: INSTALL WORDPRESS&lt;/h2&gt;

&lt;p&gt;First, create database for wordpress. To do that, login to mysql server as a root&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# mysql -u root -p
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then create a database. For example, the following command creates a database called &lt;strong&gt;wp&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;gt; CREATE DATABASE wp;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then create a user account which Wordpress will use to access the database. For example, the following command creates an account with username &lt;strong&gt;wpUser&lt;/strong&gt; and password &lt;strong&gt;wpPass123&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;gt; CREATE USER wpUser@localhost IDENTIFIED BY 'wpPass123';
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Grant the user access to the database we created earlier.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;gt; GRANT ALL PRIVILEGES ON wp.* TO wpUser@localhost IDENTIFIED BY 'wpPass123';
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Flush privileges and close the connection.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;gt; FLUSH PRIVILEGES;
&amp;gt; exit;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Install a module that allows wordpress to create tumbnails for uploaded images&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# yum install php-gd
# systemctl restart httpd.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Install &lt;em&gt;wget&lt;/em&gt; which is used to download files from the command line. This is a handy tool when you configure your server remotely.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# yum install wget
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then download and extract latest Wordpress source files&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# wget http://wordpress.org/latest.tar.gz
# tar xzvf latest.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Extracted files are located at &lt;code class=&quot;highlighter-rouge&quot;&gt;wordpress&lt;/code&gt; folder in the current working directory. Copy files from &lt;code class=&quot;highlighter-rouge&quot;&gt;wordpress/*&lt;/code&gt; to a directory where you want to host your website. By default, Apache serves files that are hosted in&lt;code class=&quot;highlighter-rouge&quot;&gt;/var/www/html&lt;/code&gt; directory. In order to keep this directory clean, create a sub directory &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/www/html/wp&lt;/code&gt; and copy Wordpress files to this directory. Use &lt;code class=&quot;highlighter-rouge&quot;&gt;rsync&lt;/code&gt;to copy the files. This is because &lt;code class=&quot;highlighter-rouge&quot;&gt;rsync&lt;/code&gt; keeps file permissions.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# mkdir /var/www/html/wp
# rsync -avP wordpress/ /var/www/html/wp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Create folder in &lt;em&gt;wp&lt;/em&gt; to store uploaded files.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# mkdir /var/www/html/wp/wp-content/uploads
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Grant ownership of all files in &lt;em&gt;wp&lt;/em&gt; to Apache’s user and group.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# chown -R apache:apache /var/www/html/wp/*
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Create wordpress configuration file (Copy from the sample).&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# cd /var/www/html/wp
# cp wp-config-sample.php wp-config.php
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Open &lt;em&gt;wp-config.php&lt;/em&gt; and change &lt;code class=&quot;highlighter-rouge&quot;&gt;DB_NAME&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;DB_USER&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;DB_PASSWORD&lt;/code&gt; accordingly.&lt;/p&gt;

&lt;p&gt;Now change Apache’s document root directory to the one we created. To do that, open &lt;em&gt;/etc/httpd/conf/httpd.conf&lt;/em&gt; and change Apache’s document root as follows&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;DocumentRoot &quot;/var/www/html/wp&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, open a browser and type the server’s IP address. If you have local server, then type http://localhost to the URL. Then finish the installation of WordPress throught the web browser.&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;http://yihenew.com/blog/LAMP-stack/&quot;&gt;LAMP stack webserver&lt;/a&gt; was originally published by Yihenew beyene at &lt;a href=&quot;http://yihenew.com&quot;&gt;Yihenew&lt;/a&gt; on December 04, 2017.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[Web Application 101]]></title>
  <link rel="alternate" type="text/html" href="http://yihenew.com/blog/web-application-101/" />
  <id>http://yihenew.com/blog/web-application-101</id>
  <updated>2017-12-03 14:11:53 -0400T00:00:00-00:00</updated>
  <published>2017-12-03T00:00:00+00:00</published>
  
  <author>
    <name>Yihenew beyene</name>
    <uri>http://yihenew.com</uri>
    <email>yihenew.beyene@gmail.com</email>
  </author>
  <content type="html">
    &lt;p&gt;In order to deploy a dynamic web site on a server machine, one needs an operating system, an HTTP server, a database, and a server-side engine that interacts with the database and processes requests that come from clients (web browsers). There are three commonly used alternative protocol stacks (combination of web servers, frameworks and platforms). These stacks are based on the three most popular HTTP servers:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.apache.org&quot;&gt;Apache&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://nodejs.org/en/&quot;&gt;Node.js&lt;/a&gt; and&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://rubyonrails.org/&quot;&gt;Rails&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;lamp-stack&quot;&gt;LAMP Stack&lt;/h2&gt;

&lt;p&gt;LAMP is an acronym for &lt;strong&gt;L&lt;/strong&gt;inux operating system, &lt;a href=&quot;https://www.apache.org&quot;&gt;&lt;strong&gt;A&lt;/strong&gt;pache&lt;/a&gt; HTTP Server, &lt;a href=&quot;https://www.mysql.com/&quot;&gt;&lt;strong&gt;M&lt;/strong&gt;ySQL&lt;/a&gt; relational database and &lt;a href=&quot;http://www.php.net/&quot;&gt;&lt;strong&gt;P&lt;/strong&gt;HP&lt;/a&gt; programming language. Since Apache, MySQL and PHP can run on other platforms such as Windows, there are also some variants LAMP stack. WAMP stack, which is based on Windows operating system, is one of them. PHP powers back-end (server-side) functionalities such as handling HTTP requests, and iteracting with MySQL database. The front-end is mainly implemented using HTML and javascript.&lt;/p&gt;

&lt;h2 id=&quot;mean-stack&quot;&gt;MEAN Stack&lt;/h2&gt;

&lt;p&gt;MEAN stands for &lt;a href=&quot;https://www.mongodb.com/&quot;&gt;&lt;strong&gt;M&lt;/strong&gt;ongoDB&lt;/a&gt; database, &lt;a href=&quot;http://expressjs.com/&quot;&gt;&lt;strong&gt;E&lt;/strong&gt;xpress&lt;/a&gt; javascript-based web framework, &lt;a href=&quot;https://angularjs.org/&quot;&gt;&lt;strong&gt;A&lt;/strong&gt;ngularJS&lt;/a&gt; front-end framework, and &lt;a href=&quot;https://nodejs.org/en/&quot;&gt;&lt;strong&gt;N&lt;/strong&gt;ode.js&lt;/a&gt; HTTP server. Node.js is a JavaScript runtime built on &lt;a href=&quot;https://developers.google.com/v8/&quot;&gt;Chrome’s V8 JavaScript engine&lt;/a&gt;. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Morever, since both the front-end and the back-end are powered by javascript, it simplifies web development process.&lt;/p&gt;

&lt;h2 id=&quot;ruby-on-rails&quot;&gt;Ruby on Rails&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://rubyonrails.org/&quot;&gt;Rails&lt;/a&gt; is a complete web application development framework written in &lt;a href=&quot;https://www.ruby-lang.org/en/&quot;&gt;Ruby&lt;/a&gt; language. It is designed to make programming of web applications easier by making assumptions about what every developer needs to get started. It abstracts routine works and allows you to write less code while accomplishing more than many other languages and frameworks.&lt;/p&gt;

    &lt;p&gt;&lt;a href=&quot;http://yihenew.com/blog/web-application-101/&quot;&gt;Web Application 101&lt;/a&gt; was originally published by Yihenew beyene at &lt;a href=&quot;http://yihenew.com&quot;&gt;Yihenew&lt;/a&gt; on December 03, 2017.&lt;/p&gt;
  </content>
</entry>


<entry>
  <title type="html"><![CDATA[SoftRadar]]></title>
  <link rel="alternate" type="text/html" href="http://yihenew.com/blog/soft-radar/" />
  <id>http://yihenew.com/blog/soft-radar</id>
  <updated>2016-12-04 14:17:50 -0400T00:00:00-00:00</updated>
  <published>2016-12-04T00:00:00+00:00</published>
  
  <author>
    <name>Yihenew beyene</name>
    <uri>http://yihenew.com</uri>
    <email>yihenew.beyene@gmail.com</email>
  </author>
  <content type="html">
    &lt;p&gt;SoftRadar is a software defined radio that can transmit and receive (synchronoulsy) radar waveforms. Currently, it targets Universal Software Radio Peripheral (USRP) based hardwares only that support simultaneous Tx and Rx. The main streaming program is written in C++ and is responsible for configuring the hardware, transmitting and receiving radar signals. Some of the hardware settings (frequency, gain, bandwidth,…) are configured via a configuration file. Other real-time controls are handled through a UDP socket for possible remote control. You can download the source code from &lt;a href=&quot;https://github.com/yDagne/softRadar.git&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;SoftRadar can be run from the commnand-line or through a web-interface that can be accessed remotely. Remote access is possible only when the host computer is connected to the network and is visible from the other side where one want to access the radar. Picture below shows snapshot of the graphical interface.&lt;/p&gt;

&lt;figure&gt;
	&lt;img src=&quot;/images/blog/softRadar1.png&quot; alt=&quot;&quot; /&gt;
&lt;/figure&gt;

&lt;p&gt;The graphical interface is also used to upload new waveform file at any time even when the radar is streaming. The device manager records events that occur while streaming. The web interface has a tool that generates a python template code which can be downloaded and modified. The tool is designed as a basis for generating SMPRF radar waveforms. Picture below show snapshot of the interface.&lt;/p&gt;

&lt;figure&gt;
	&lt;img src=&quot;/images/blog/softRadar2.png&quot; alt=&quot;&quot; /&gt;
&lt;/figure&gt;

    &lt;p&gt;&lt;a href=&quot;http://yihenew.com/blog/soft-radar/&quot;&gt;SoftRadar&lt;/a&gt; was originally published by Yihenew beyene at &lt;a href=&quot;http://yihenew.com&quot;&gt;Yihenew&lt;/a&gt; on December 04, 2016.&lt;/p&gt;
  </content>
</entry>

</feed>