tag:blogger.com,1999:blog-36343213242342978552024-03-20T06:08:31.575-04:00Programming: Tips, Problems, Solutions...Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.comBlogger22125tag:blogger.com,1999:blog-3634321324234297855.post-22802499422464850882018-11-01T05:50:00.003-04:002018-11-01T05:50:51.652-04:00Gitlab Runner Register: x509: certificate signed by unknown authority Error<div dir="ltr" style="text-align: left;" trbidi="on">
For Gitlab CI/CD, I was trying to register a runner using "gitlab-runner register" command; but I was continuously getting error " x509: certificate signed by unknown authority". After trying to fix the issue by SSL certificates path, I finally solved it using CURL. Here is the command I used.<br />
<br />
curl --cacert <cert_name_fullchain>.crt --request POST "https://<domain>/api/v4/runners/" --form "token=<the_token>" --form "description=test" --form "tag_list=test".</div>
Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-25430250970042685122014-04-14T11:01:00.000-04:002014-04-14T11:01:04.288-04:00Creating PDF file from DVI with Embedded Fonts<div dir="ltr" style="text-align: left;" trbidi="on">
These instructions are valid for Ubuntu. It may also work in Windows with ghostscript installed.<br />
<br />
Use the following commands in order.<br />
<br />
<ol style="text-align: left;">
<li>dvips -Ppdf -G0 -tletter your_file.dvi </li>
<li>ps2pdf -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress your_file.ps </li>
</ol>
In case you get a segmentation fault. Use the following steps. <br />
<ol style="text-align: left;">
<li>dvips -Ppdf -G0 -tletter your_file.dvi</li>
<li>ps2ps your_file.ps your_new_file.ps</li>
<li>ps2pdf -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress your_new_file.ps </li>
</ol>
</div>
Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-84040287122389794572014-03-17T13:20:00.000-04:002014-03-17T13:20:28.277-04:00Latex Tips & Tricks<div dir="ltr" style="text-align: left;" trbidi="on">
<u><b>Setup Page Margins</b></u><br />
<br />
<div style="text-align: left;">
\newcommand{\CLASSINPUTinnersidemargin}{0.5in} % left side margin<br />
\newcommand{\CLASSINPUToutersidemargin}{0.5in}% right side margin<br />
\newcommand{\CLASSINPUTtoptextmargin}{1.0in} % top text margin<br />
\newcommand{\CLASSINPUTbottomtextmargin}{1.0in}% bottom text margin</div>
<div style="text-align: left;">
\documentclass {your_class}</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
** Change the number as necessary. </div>
<div style="text-align: left;">
<br />
<u><b>Solving italic-underline Problem</b></u><br />
<br />
Problem definition: all the italic words are automatically underlined<br />
Solution: Add the following line after \begin{document}<br />
<br />
<i>\normalem</i><u></u><br />
<u><b></b></u><br />
<u><b></b></u><br /></div>
</div>
Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-80946016197123429402013-10-31T10:39:00.001-04:002013-10-31T10:39:22.828-04:00Matlab Reshape Matrix<div dir="ltr" style="text-align: left;" trbidi="on">
Recently I faced a problem with reshaping a matrix. Here is how I solved it.<br />
<br />
Input: x = n*1 matrix<br />
Output: y = a*b matrix where a*b = n<br />
<br />
Example:<br />
<br />
[1<br />
2<br />
x = 3<br />
4<br />
5<br />
6 ]<br />
<br />
[ 1 2<br />
y = 3 4<br />
5 6] <br />
<br />
Code:<br />
<br />
y = reshape(x, 2, 3)<br />
y = transpose(y) <br />
</div>
Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-5185298103677555572013-02-05T11:38:00.001-05:002013-04-01T07:15:01.093-04:00Make a Micro SIM from a Regular SIM<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Recently I needed a micro SIM card for using in a Nexus 4 phone. Since AT&T wanted me to get a data plan for getting a micro SIM (which is ridiculous!), I made the micro SIM from the regular SIM card I have. Here is how to do it.<br />
<br />
<ul style="text-align: left;">
<li>Download and print the following image. Use original image size while printing. </li>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNSylxa1iyaPmzVfplT4odN7rULKdrKKHp5LNJ21RDQVYKFnhV0pNXnoLToFQE3M4uUf8Uj4Zwzs9xlgztnF4AVdbxIS2G4Bkf9mYOr8FSnEXbHrUXhnRPQsYZwCKuO5haSVmSFcPMF1o/s1600/nanosim.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="202" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNSylxa1iyaPmzVfplT4odN7rULKdrKKHp5LNJ21RDQVYKFnhV0pNXnoLToFQE3M4uUf8Uj4Zwzs9xlgztnF4AVdbxIS2G4Bkf9mYOr8FSnEXbHrUXhnRPQsYZwCKuO5haSVmSFcPMF1o/s320/nanosim.png" width="320" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<li>Use a ruler and ruler to extend the lines of micro SIM</li>
<li>Place the SIM card on the paper so that it fits in the border of Mini SIM in the image.</li>
<li>Use pencil and ruler to draw lines over the SIM card using the extended lines of micro SIM as reference.</li>
<li>Use a sharp scissor to cut the SIM.</li>
<li>Don't worry if does fit in the phone after the first try. Just trim it as necessary.</li>
<li>Make sure that the golden part is not cut in any way. </li>
</ul>
</div>
Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-81182463086459272082013-01-19T14:27:00.002-05:002013-05-17T11:09:14.617-04:00Samsung Nexus S: Flush Jelly Bean Factory Image<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
I have been waiting for OTA for several months with no luck. So finally decided to flush my Samsung Nexus S with Jelly Bean 4.1.2 factory image. Here is how I did it. </div>
<ol>
<li>(PC) Download <b>Nexus Root Toolkit</b> from <a href="http://www.wugfresh.com/nrt/" target="_blank">here</a> (don't worry. I did not root my phone, just unlocked it for flushing!). </li>
<li>(PC) Install the software. When prompted, choose your device. In my case, it was Samsung Nexus S, 850MHz, i9020a. Allow the software to download necessary files for your phone.</li>
<li>(PC) Connect your phone to the PC with a USB cable. Run the 'Nexus Root Toolkit' software and click on 'Unlock'. Follow the on screen instructions to unlock your phone.</li>
<li>(PC) Download Nexus S factory image from <a href="https://developers.google.com/android/nexus/images" target="_blank">here</a>. </li>
<li>(PC) Unzip the downloaded image in the installation directory of <b>Nexus Root Toolkit. </b>In my case the path was <b>C:\Program Files\WugFresh Development\data</b></li>
<li>(Phone) Turn off your device </li>
<li>(Phone) Go to Bootloader (press&hold volume up button then press&hold power button) </li>
<li>(PC) Go to the folder where you unzipped the factory image. Make sure that the folder contains adb.exe and fastboot.exe.</li>
<li>(PC) Double click on <b>flash-all.bat </b>file. This will flush the factory image in the phone.</li>
<li>(PC) When done, click on '<b>OEM Lock</b> in the<b> Nexus Root Toolkit </b>to lock bootloader again.</li>
</ol>
<div>
Enjoy your Jelly Bean:)</div>
<br /></div>
Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com2tag:blogger.com,1999:blog-3634321324234297855.post-58403241077319560252012-12-14T15:42:00.002-05:002012-12-14T15:42:39.696-05:00Installing R in Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
To install R <a href="http://cran.r-project.org/">(http://cran.r-project.org</a>) and desired packages in Ubuntu, follow the steps:<br />
<ol style="text-align: left;">
<li>sudo apt-get install r-base</li>
<li>R (this will open R command window)</li>
<li>To add a package, e.g., signal, run the following</li>
</ol>
<ul style="text-align: left;"><ul>
<li>install.packages("signal")</li>
<li>packageStatus()</li>
<li>update.packages()</li>
</ul>
</ul>
That's it!<br />
<br />
** Adding R repository paths to package manager may be necessary.</div>
Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-51385660244267507902012-08-08T12:29:00.000-04:002012-08-08T12:29:18.179-04:00Latex: Multirow Example<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Recently, I found it difficult to create a table with multi-row and multi-column combination. Here is an simple example.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguaz5UI0jeyUNVeqtsK7NNHEMOswD21pkYhVcT6iaUMtibCzfEWjP0zFLeaLId8dx9KJcxftpzuDqLm76Sr8BB8ooBAHX1cEF4m-Jw9fn15UCYkF-rvs2X2StsAhhZtrWd68jhUXJN13s/s1600/multirow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguaz5UI0jeyUNVeqtsK7NNHEMOswD21pkYhVcT6iaUMtibCzfEWjP0zFLeaLId8dx9KJcxftpzuDqLm76Sr8BB8ooBAHX1cEF4m-Jw9fn15UCYkF-rvs2X2StsAhhZtrWd68jhUXJN13s/s320/multirow.png" width="293" /></a></div>
The latex code to create above table.<br />
<br />
\begin{tabular}<br />{|c|c|c|c|}<br />\hline<br />\multirow{1}{*}{{1}} & \multirow{2}{*}{{2}} & \multirow{3}{*}{{3}} & \multirow{6}{*}{{6}} \\<br />\cline{1-1} \multirow{1}{*}{{1}} & & & \\<br />\cline{1-2} \multirow{1}{*}{{1}} & \multirow{2}{*}{{2}} & & \\<br />\cline{1-1} \cline{3-3} \multirow{1}{*}{{1}} & & \multirow{3}{*}{{3}}& \\<br />\cline{1-2} \multirow{1}{*}{{1}} & \multirow{2}{*}{{2}} & & \\<br />\cline{1-1} \multirow{1}{*}{{1}} & & & \\<br />\hline<br />\end{tabular}</div>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-49095967243107244202012-07-25T15:12:00.003-04:002012-08-08T11:54:08.156-04:00Samsung Nexus S i9020a: OTA Update to JB 4.1.1 from 4.0.4<div dir="ltr" style="text-align: left;" trbidi="on">
Several user have reported the following procedure as successful, but some failures were also reported. Try at your own risk:)<br />
<br />
<ol style="text-align: left;">
<li>Connect your charger! This is a prerequisite</li>
<li>Go into airplane mode</li>
<li>Under settings->apps->all (scroll the page to the left), </li>
<ol style="text-align: left;"><ul>
<li>select 'Google Services framework'</li>
<li>force stop it and </li>
<li>then delete
its data</li>
</ul>
</ol>
<div>
<br />
<br />
<li>Enable wifi only (don't leave airplane mode)</li>
<li>Settings->about->system updates->check for update. </li>
</div>
</ol>
<br />
Repeat this several
times if it doesn't work at first. There is no need to remove the sim
card or reboot.</div>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com4tag:blogger.com,1999:blog-3634321324234297855.post-36275636586742681672012-04-09T09:59:00.000-04:002013-01-09T07:57:12.918-05:00Samsung Nexus S i9020a: Update to ICS 4.0.4 from 2.3.4/2.3.6 (without rooting)<div dir="ltr" style="text-align: left;" trbidi="on">
<u><b>Update from 2.3.4 (GTJ61)/</b></u><u><b>2.3.6 (GRK39C)</b></u><u><b> to 2.3.6 (GRK39F)</b></u><br />
<br />
<ol>
<li>Download <a href="http://android.clients.google.com/packages/ota/google_crespoa/0b9c8148de0d.signed-sojua-ota-189904.0b9c8148.zip" target="_blank">this file</a></li>
<li>Rename the downloaded file to update.zip</li>
<li>Put it update.zip you have downloaded on your sd card. </li>
<li>Turn off your device </li>
<li>Go to Bootloader (press&hold volume up button then press&hold power button) </li>
<li>When in Fastboot mode navigate to <b>Recovery</b> using volume up/down buttons </li>
<li>Press the power key to select <b>Recovery</b> </li>
<li>If you see a warning logo, press the power button and then press volume up button then release both to go to the Main Recovery menu</li>
<li>From the menu, select <b>Apply update from /sdcard</b>, and choose update.zip from the list. </li>
<li>When update is finished go back and select <b>reboot system now</b>. </li>
</ol>
<u><b>Update from 2.3.6 (GRK39F) to 4.0.4 (IMM76D)</b></u><br />
<br />
<ol>
<li>Download <a href="http://android.clients.google.com/packages/ota/google_crespoa/IEzMw3FU.zip" target="_blank">this file</a> </li>
<li>Use the above steps again to update.</li>
</ol>
<div>
*** The same procedure should work for other devices as well but the file would be different. You will have to find the right update file.</div>
</div>
Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com306tag:blogger.com,1999:blog-3634321324234297855.post-17895157874869270652011-12-10T21:27:00.001-05:002011-12-10T21:46:09.764-05:00HowTo: Root HTC Droid Incredible || Android PhoneFollow the steps to get root access of a HTC droid incredible phone and install CyanogenMode Android OS using windows PC.<br />
<br />
<ol>
<li>Install HTC USB Drivers on your PC. Driver can be found <a href="http://api.viglink.com/api/click?format=go&drKey=1359&loc=http%3A%2F%2Fforum.xda-developers.com%2Fshowthread.php%3Ft%3D1298990&v=1&libid=1323570435592&out=http%3A%2F%2Fdownloads.unrevoked.com%2FHTCDriver3.0.0.007.exe&title=%5BTool%5D%20Downgrade%20VivoW%20with%20hboot%200.98%20-%20xda-developers&txt=http%3A%2F%2Fdownloads.unrevoked.com%2FHTCDriver3.0.0.007.exe&jsonp=vglnk_jsonp_13235706865621"><b>here</b></a>.</li>
<li>Download <a href="http://api.viglink.com/api/click?format=go&drKey=1359&loc=http%3A%2F%2Fforum.xda-developers.com%2Fshowthread.php%3Ft%3D1298990&v=1&libid=1323570435592&out=http%3A%2F%2Fdroid.neolobster.com%2Froms%2Fvwhk-12102011-c.zip&title=%5BTool%5D%20Downgrade%20VivoW%20with%20hboot%200.98%20-%20xda-developers&txt=vwhk-12102011-c.zip&jsonp=vglnk_jsonp_13235707623682"><b>this kit</b></a> that contains <b>adb, fastboot and other necessary scripts.</b></li>
<li>Connect your phone with the PC via usb cable with <b>USB Debugging </b>enabled in the phone. (do not select file transfer mode for the sdcard).</li>
<li>Download revolutionary from <a href="http://revolutionary.io/">http://revolutionary.io/</a> and collect the <i>Beta Key.</i></li>
<li>Unzip the revolutionary-x.x.zip inside the folder where adb.exe is available.</li>
<li>Run revolutionary.exe from command line.</li>
<li>Then follow the steps from <b><a href="http://wiki.cyanogenmod.com/wiki/HTC_Incredible_2:_Full_Update_Guide">here</a> </b>to install CyanogenMode.</li>
</ol>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-37010786152129827852011-06-29T13:09:00.000-04:002011-06-29T13:09:32.199-04:00Creating EPS figure in Linux<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Use the following steps to create eps figure in linux. </div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"></div><ol><li>Use openoffice to draw the figure</li>
<li>Export the file as figure.pdf</li>
<li>Run <i>$pdftops -eps figure.pdf. </i>This will create a file figure.eps</li>
<li>Run <i>$cat figure.eps | ps2eps > MyFigure.eps. </i>This will fix the bounding box of the eps file.</li>
</ol>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-19026242329687938692011-06-23T15:28:00.002-04:002011-06-30T13:28:48.817-04:00HowTo: Build GNU RADIO with UHD<style type="text/css">
<!--
@page { margin: 0.79in }
P { margin-bottom: 0.08in }
PRE.cjk { font-family: "DejaVu Sans", monospace }
A:link { so-language: zxx }
-->
</style> <br />
<div style="font-weight: normal; margin-bottom: 0in; text-decoration: none;"> Platform: Ubuntu Lucid 10.04/10.10</div><div style="font-weight: normal; margin-bottom: 0in; text-decoration: none;"><br />
</div><div style="font-weight: normal; margin-bottom: 0in; text-decoration: none;">** All the following commands (in italic) are to be run at the shell.</div><ul><li><div style="margin-bottom: 0in;"><span style="text-decoration: none;"><b>CMAKE:</b></span><span style="text-decoration: none;"><span style="font-weight: normal;"> Check if CMAKE is installed (just try to execute command </span></span><i><span style="text-decoration: none;"><span style="font-weight: normal;">cmake</span></span></i><span style="text-decoration: none;"><span style="font-weight: normal;">). If not installed then do the following.</span></span></div><div style="margin-bottom: 0in;"><span style="text-decoration: none;"><span style="font-weight: normal;">1. Download from <a href="http://www.cmake.org/cmake/resources/software.html">http://www.cmake.org/cmake/resources/software.html</a></span></span></div><div style="margin-bottom: 0in;"><span style="text-decoration: none;"><span style="font-weight: normal;">2. Unzip</span></span></div><div style="margin-bottom: 0in;"><span style="text-decoration: none;"><span style="font-weight: normal;">3. Goto the folder by </span></span><i><span style="text-decoration: none;"><span style="font-weight: normal;">$cd ~/cmake-X.X.X</span></span></i></div><div style="margin-bottom: 0in;"><i><span style="text-decoration: none;"><span style="font-weight: normal;">4. </span></span></i><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">Run commands $./bootstrap; make; sudo make install</span></span></span></div></li>
<li><div style="margin-bottom: 0in;"><span style="font-style: normal;"><span style="text-decoration: none;"><b>GIT:</b></span></span><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;"> Check if GIT is installed (just try to execute command </span></span></span><i><span style="text-decoration: none;"><span style="font-weight: normal;">git</span></span></i><span style="font-style: normal;"><span style="text-decoration: none;"><span style="font-weight: normal;">). If not then install it from </span></span></span><span style="font-style: normal;"><span style="text-decoration: none;"><b>Applications->Ubuntu Software Center</b></span></span></div></li>
<li><div style="font-weight: normal; margin-bottom: 0in;"><span style="font-style: normal;"><span style="text-decoration: none;"><b>LibUSB:</b></span></span><span style="font-style: normal;"><span style="text-decoration: none;"> If LibUSB is not installed...</span></span></div><div style="font-weight: normal; margin-bottom: 0in;"><span style="font-style: normal;"><span style="text-decoration: none;">1. Download LibUSB from <a href="http://sourceforge.net/projects/libusb/">http://sourceforge.net/projects/libusb/</a>.</span></span></div><div style="font-weight: normal; margin-bottom: 0in;"><span style="font-style: normal;"><span style="text-decoration: none;">2. Unzip</span></span></div><div style="margin-bottom: 0in;"><span style="text-decoration: none;"><span style="font-weight: normal;">3. Goto the folder by </span></span><i><span style="text-decoration: none;"><span style="font-weight: normal;">$cd ~/libusb-X.X.X</span></span></i></div><div style="font-weight: normal; margin-bottom: 0in;"><span style="font-style: normal;"><span style="text-decoration: none;">4</span></span><i><span style="text-decoration: none;">. </span></i><span style="font-style: normal;"><span style="text-decoration: none;">Run commands $./configure; make; sudo make install</span></span></div></li>
<li><div style="margin-bottom: 0in;"><b><span style="font-style: normal;"><span style="text-decoration: none;">GNURADIO Pre-Requisites:</span></span></b></div><pre class="western" style="font-weight: normal;"><span style="font-family: Verdana, sans-serif;"><span style="font-size: x-small;"><i><span style="text-decoration: none;">$sudo apt-get -y install libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev \</span></i></span></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 12px;"><i>libcppunit-dev libboost-all-dev libusb-dev fort77 sdcc sdcc-libraries \</i></span><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 12px;"><i> </i></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 12px;"><i>libsdl1.2-dev python-wxgtk2.8 git-core guile-1.8-dev \</i></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 12px;"><i>libqt4-dev python-numpy ccache python-opengl libgsl0-dev \</i></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 12px;"><i>python-cheetah python-lxml doxygen qt4-dev-tools \</i></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 12px;"><i>libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4</i></span></pre></li>
</ul><ul><li><div style="margin-bottom: 0in;"><b><span style="font-style: normal;"><span style="text-decoration: none;">Download and Install UHD</span></span></b></div><pre class="western" style="font-style: normal; font-weight: normal;"><span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;"><span style="text-decoration: none;">$</span><i><span style="text-decoration: none;">git clone git://ettus.sourcerepo.com/ettus/uhd.git</span></i></span></span></span>
<span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;"><i><span style="text-decoration: none;">$cd ~/uhd/host/</span></i></span></span></span></pre><pre class="western" style="font-style: normal; font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$mkdir build</i></span></pre><pre class="western" style="font-style: normal; font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$cd build</i></span></pre><pre class="western" style="font-style: normal; font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$cmake ../</i></span></pre><pre class="western" style="font-style: normal; font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$make</i></span></pre><pre class="western" style="font-style: normal; font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$make test</i></span></pre><pre class="western" style="font-style: normal; font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$sudo make install</i></span></pre><pre class="western" style="font-style: normal; font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$sudo ldconfig</i></span></pre></li>
</ul><ul><li><div style="margin-bottom: 0in;"><b><span style="font-style: normal;"><span style="text-decoration: none;">Download and Install GNURADIO</span></span></b></div><pre class="western" style="font-weight: normal;"><span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;"><i><span style="text-decoration: none;">$git clone git://gnuradio.org/gnuradio.git</span></i></span></span></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$cd ~/gnuradio</i></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$git branch --track next origin/next</i></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$git checkout next </i></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$./bootstrap</i></span></pre><pre class="western" style="font-weight: normal;"><i><span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;"><span style="font-weight: normal;">$PKG_CONFIG_PATH=~/uhd/host/build/</span></span></span></span></i></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$export PKG_CONFIG_PATH</i></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$./configure --enable-gr-uhd</i></span></pre><pre class="western" style="font-weight: normal;"><i><span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;"><span style="font-weight: normal;">$make</span></span></span></span></i></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$make check</i></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$sudo make install</i></span></pre><pre class="western" style="font-weight: normal;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif; font-size: 12px;"><i>$sudo ldconfig</i></span></pre></li>
</ul><ul><li><div style="margin-bottom: 0in;"><b><span style="font-style: normal;"><span style="text-decoration: none;">Configure USRP Support</span></span></b></div><pre class="western" style="font-weight: normal;"><span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;"><i><span style="text-decoration: none;">$</span><span style="font-family: Verdana, sans-serif;"><span style="text-decoration: none;">sudo addgroup usrp</span></span></i></span></span></span>
<i><span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;"><span style="font-weight: normal;">$sudo usermod -G usrp -a <YOUR_USERNAME></span></span></span></span></i>
<span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;"><i>$echo 'ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe", SYSFS{idProduct}=="0002", GROUP:="usrp", MODE:="0660"' > tmpfile</i></span></span></span>
<i><span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;">$sudo chown root.root tmpfile</span></span></span></i>
<i><span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;">$sudo mv tmpfile /etc/udev/rules.d/10-usrp.rules</span></span></span></i>
<i><span style="color: black;"><span style="font-family: 'Lucida Grande', verdana, arial, helvetica, sans-serif;"><span style="font-size: x-small;">$sudo udevadm control --reload-rules</span></span></span></i></pre></li>
</ul><pre class="western" style="font-style: normal; font-weight: normal; margin-bottom: 0.2in; orphans: 2; text-align: left; widows: 2;"></pre><ul><li><b>Configure UHD USRP2</b><br />
1. Download the latest FPGA driver and FIRMWARE from <a href="http://www.ettus.com/download">http://www.ettus.com/download</a><br />
2. Write the fpga and firmware on USRP2 SD card using usrp2_card_burner.py and usrp2_card_burner_gui.py scripts. The scripts are available at <a href="http://ettus-apps.sourcerepo.com/redmine/ettus/projects/uhd/repository/revisions/master/changes/host/utils/">http://ettus-apps.sourcerepo.com/redmine/ettus/projects/uhd/repository/revisions/master/changes/host/utils/</a><br />
3. Connect SD card with USRP2 and boot USPR2. Now the USRP2 should be accessible at ip address 192.168.10.2.<br />
</li>
</ul>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com2tag:blogger.com,1999:blog-3634321324234297855.post-76567380437025477382011-06-02T16:56:00.000-04:002011-06-02T16:56:12.138-04:00USPR2 and Boost ProblemUSRP2 requires boost package for installation. As of today (2nd June, 2011) USPR2 is supposed to work with Boost 1.36 or greater but it doesn't for 1.45. After trying several versions, I got it working with Boost 1.41.Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-26882097086189943502011-05-23T16:01:00.000-04:002011-05-23T16:01:16.050-04:00NS3: Generate Statistical ResultBy default, NS3 generates exactly same result when you run a simulation. If you want to collect statistical behavior by running the simulation multiple times, you need to avoid this default setting of NS3. One way to do this is using different seed for every simulation. Just add the following line before calling the run() method.<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SeedManager::SetSeed(time(0));<br />
Here the current system time is used as the seed which ensures that seed will be different for every simulation and hence the simulation result.Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-55074095466974599812011-05-14T14:37:00.000-04:002011-05-14T14:37:47.473-04:00NS3: Apply a Patch to SourceSometimes it is necessary to apply patch to update NS3 source. Use the following steps to apply patch.<br />
<br />
<ul><li>Download desired patchFile</li>
<li>Open shell</li>
<li>Goto ns3 root directory (cd /...path to .../ns-3***)</li>
<li>run the command '<span class="Apple-style-span" style="font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 16px; white-space: pre;"><b><i>patch -p1 < /...path to ../patchFile'</i></b></span></li>
</ul>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-65126328594719486452011-05-13T15:20:00.000-04:002011-05-13T15:23:16.900-04:00Add Header, Footer, Page Numbers to a PDF FileThere are many software that can add header/footer/pageNumber in a pdf files but many of the software need license. Here is a link to do it in linux for free!.<br />
<br />
<a href="http://forums.debian.net/viewtopic.php?t=30598">http://forums.debian.net/viewtopic.php?t=30598</a>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-57242363490705633542011-05-11T10:45:00.000-04:002011-05-11T10:45:47.788-04:00Bangla Font Problem in FirefoxSome versions of firefox web browser has problem in showing Bangla font properly. It generally occurs after an update of firefox to the next version. Please follow the following steps if you have this problem.<br />
<br />
<ul><li>Download UTF-8 compliant bangla font (ex., Siyam Rupali) if you already don't have</li>
<li>In the firefox menu, go to option->option ->content</li>
<li>Select the tab 'Font & Color'</li>
<li>Select the Bangla font and save.</li>
</ul>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com5tag:blogger.com,1999:blog-3634321324234297855.post-56101755032647507952011-05-09T13:03:00.000-04:002011-05-09T13:04:35.254-04:00Android: UDP ReceiverFor my android app, I needed a UDP receiver which can receive broadcast packets. So I tried to create a UDP socket using the following.<br />
<br />
<i>mySocket = new DatagramSocket(PORT, ADDRESS);</i><br />
<i><br />
</i><br />
But this socket could only receive unicast packets not the broadcast ones. I had to change it as follows to make it work for broadcast.<br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><i>mySocket = new DatagramSocket(PORT);</i></div><div><br />
</div>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-7175552534684304442011-05-09T01:19:00.000-04:002011-05-09T13:23:22.170-04:00NS3: Wireless Jamming ModelThe basic implementation of NS3 does not include anything for wireless jamming but wireless jamming is interesting research topic for wireless network security. Good news is <b>Network Security Lab, University of Washington </b>is working on a jamming model for NS3. Use the following link for more information.<br />
<br />
<a href="http://www.nsnam.org/wiki/index.php/NS-3_wireless_jamming_model">http://www.nsnam.org/wiki/index.php/NS-3_wireless_jamming_model</a>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com1tag:blogger.com,1999:blog-3634321324234297855.post-87650661400082436722011-05-05T12:49:00.000-04:002011-05-05T12:49:30.119-04:00Latex: Italic Underline ProblemSome Latex compiler underlines the the italic text, more precisely the text inside \emph{your text}. If you don't want the text underlined, just add "<b>\normalem</b>" after the line "<b>\begin{document}</b>" !<br />
Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com0tag:blogger.com,1999:blog-3634321324234297855.post-39324748633963603732011-05-04T15:44:00.000-04:002011-05-04T15:44:28.970-04:00NS3: Constant Speed MobilityNS3 does not support constant speed mobility but it has a very good class <i style="font-weight: bold;">RandomWalk2dMobilityModel </i>which supports random speed and direction based on defined time or distance. If you need to simulation constant speed mobility, use the following steps:<br />
<br />
<ol><li>Open file '<i>..../ns-3-dev/src/mobility/random-direction-2d-mobility-model.cc</i>'</li>
<li>In function <b>DoStartPrivate()</b></li>
<ul><li>comment the line '<i>double speed = m_speed.GetValue ();'</i></li>
<li>add a line '<i>double speed = your_constant_speed_value</i>'</li>
</ul><li>Recompile ns-3 and you are done.</li>
</ol>Hossen Mustafahttp://www.blogger.com/profile/11598970255074757621noreply@blogger.com2