[Solved] ERROR: An error occurred during the fetch of repository ‘io_bazel_rules_docker’

Problem :

  • Bazel can not locate bash.exe file.

Possible reasons:

  • Wrong msys environment variable setting.
  • Wrong installation file (i.e msys instead of msys2 or MSYS2 i686 instead of MSYS2 x86_64)

Solution :

    • Install the correct installation file
    • Set environment variable path:
      1. Right-click “This PC” –> Advanced system settings –> environment variables
      2. Look at the list on the top (“User variables for <username>”) –>  “New…” .
      3. “Variable name :” –> BAZEL_SH
      4. Click “Browse File…” –> select bash.exe from directory.  For example, this might be C:\msys64\usr\bin on your system.—> click OK
      5. “Variable value :” –> C:\msys64\usr\bin.
      6. Click OK

Enjoy !

fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include

[solution 1]
Here are some of the rules I use for #include files which might be helpful to you:

  • Use pre-compiled headers (“#include <stdafx.h>”). This must be the first include in your .cpp file. It should never be in a .h file. [I also routinely rename the file to something project-specific (eg. util_stdafx.h) in a multi-project environment so that the wrong file is not included somewhere. You can choose whether or not to do this…]
  • Immediately after the stdafx.h file include should be the #include corresponding to your .cpp file. This way, the .h file will #include anything it needs to work properly.
  • After these 2 includes in your .cpp file, include anything else needed for the .cpp file to run correctly.
  • Header files that come with the compiler are called “Stable headers”. These should be the only ones that appear in stdafx.h, along with #defines used by these headers (eg. WIN32_LEAN_AND_MEAN, _WIN32_WINNT etc.). If you are on windows, then stdafx.h is the only place you should see “#include <windows.h>”
  • The first non-blank non-comment lines in header files should be either “#pragma once” or guard block definition (or both)

[solution 2]

  • add the following lines to your codes in the header file

#ifdef __windows__
#undef __windows__
#endif

[solution 3]

  • Add the following lines to stafx.h header file

#include <afxwin.h>
#include <afxext.h> // MFC core and standard components

[solution 4]

  • Add the following line to the header file

#pragma once

How to add more disk space on /dev/mapper/centos-root

The default disk space for the / directory is mostly limited. In case of me, even though I had a disk size of 1TB, the /home directory was allocated 945 GB whereas the remaining amount about 20 GB was allocated to the / directory. This situation can be very frustrating when you run out of space on the webserver even though you have a lot of space on the /home directory.  In this tutorial, I will explain how to expand your /dev/mapper/centos-root to occur the entire disk space.

  •  check the partitions of the disk drive
# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   20G   20G  41M 100% /
devtmpfs                 7.8G     0  7.8G   0% /dev
tmpfs                    7.8G   84K  7.8G   1% /dev/shm
tmpfs                    7.8G  778M  7.0G  10% /run
tmpfs                    7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/sda1                497M  241M  257M  49% /boot
tmpfs                    1.6G   16K  1.6G   1% /run/user/42
tmpfs                    1.6G     0  1.6G   0% /run/user/0
/dev/mapper/centos-home  945G   20G  925G   4% /home

For this instance, /home has 945G whereas / has 20G. So, there is enough space to expand / directory.

  • Make a backup of /home directory to new directory /home-alt
# mkdir /home-alt
# df -h
# mv /home/USERNAME/ /home-alt
  • Umount home directory
 umount /dev/mapper/centos-home 
  • Remove home logical volume
lvremove /dev/mapper/centos-home
  • Run pvs command to see the volume to extend to
 PV VG Fmt Attr PSize PFree
/dev/sda3 centos lvm2 a 855.45g 64.00m 
  • Check the new partition and reboot
 # df -h 
  • Restore the /home directory
 # mv /home-alt/USERNAME/ /home/
# rmdir /home-alt

NB: In case after the reboot, you are unable to boot to default mode then follow these steps:
This command will mount all the disks and shows all the umounted mount points

 # mount -a 

Take note of the umounted points and comment them out in fstab.

 
# vi /etc/fstab
# reboot

Enjoy!

 

 

 

 

 

By Dr. NED Posted in OS

Unable to Install Android Development Tool (ADT) in Eclipse

Have you ever come across this error during your first ADT installation :
“Missing requirement: Android Development Tools 20.0.2.v201207191942-407447b (com.android.ide.eclipse.adt.feature.group 20.0.2.v201207191942-407447) requires ‘org.eclipse.wst.sse.core 0.0.0’ but it could not be found”
when you’re so ansures to run your first anxious app using eclipse ?, then I’m here to tell you, you’re not alone in this. I run into this problem with my first android setup . However, after a couple of google search,I found a solution to this problem.

Android Developer Tools


ADT (Android Developer Tools) is a plugin for Eclipse that provides a suite of tools that are integrated with the Eclipse IDE. It offers you access to many features that help you develop Android applications quickly. ADT provides GUI access to many of the command line SDK tools as well as a UI design tool for rapid prototyping, designing, and building of your application’s user interface.Because ADT is a plugin for Eclipse, you get the functionality of a well-established IDE, along with Android-specific features that are bundled with ADT.

Android apps are developed with Java—the world’s most widely used programming lan-
guage. Java was a logical choice for the Android platform, because it’s powerful, free and
open source. Java Development Environment (JDE) serves as the development platform for android application. Failure to set JDE for android development platform runs into the error message above.

RESOLVING ADT PROBLEM


This is the procedure for resolving the problem mentioned above.
1.Launch Eclipse -> Help -> Install New Software
2.Click Add -> Name :”Indigo” -> Location :”download/eclipse.org.release/indigo”
3. Select “WST Server Adapter” from “Web, XML, Java”
4. Accept Licensing agreement
4. Restart eclipse
5. Resume procedure to install ADT

REFERENCE


1. http://developer.android.com/tools/help/adt.html
2. http://www.eclipse.org/forums/index.php/m/874718/
3. Deital, P.,Deital, H., Deital,A., & Morgano, M.(2011).ANDROID FOR PROGRAMMERS AN APP-DRIVEN APPROACH (1st ed.).Indiana,USA: Deital & Associates

How to install andriod on htc HD2 (with sense)

About Andriod


Android is a software stack for mobile devices such as smartphones and tablet computers that includes an operating system, middleware and key applications. It is developed by the Open Handset Alliance led byGoogle .The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

Andriod version
The version history of the Android operating system began with the release of the Android 1.0 beta in November 2007.Since April 2009, each Android version has been developed under a codename based on a dessert item. These versions have been released in alphabetical order:CupcakeDonutEclairFroyoGingerbreadHoneycomb and Ice Cream Sandwich. The most recent update to the Android OS was v4.0.4, which was released in March 2012.

Andriod Architecture
Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.

By providing an open development platform, Android offers developers the ability to build extremely rich and innovative applications. Developers are free to take advantage of the device hardware, access location information, run background services, set alarms, add notifications to the status bar, and much, much more

About HTC HD2


The HTC HD2 (also known as the HTC T8585, HTC T9193 and HTC Leo),[3] is a smartphone belonging to the HTC Touch family, manufactured by HTC and running the Windows Mobile 6.5 operating system.

It is the first smartphone with a 4.3-inch touchscreen, the first Windows Mobile 6.5 phone with a multitouch capacitive screen and HTC Sense, and the second smartphone with a Qualcomm Snapdragon CPU (the first being the Toshiba TG01).The Snapdragon CPU is clocked at 1 GHz, but automatically underclocks itself to 553 MHz if extra processing power is not needed. Tweaks have been made however, to clock the processor dynamically from 96MHz to 1.61GHz Full phone specification

Installation procedure


There are different types of andriod installation for HTC HD2. These types include SD card Android, NAND Android in MAGLDR format, CWM format and cLK format. CWM NAND Android ROM is the most common ROM for HTC HD2. In this tutorial, I demonstrate the steps you need to take to have andriod OS on your htc Hd2 phone. So, get yourself a bottle of coca cola and a four season pizza, sit back and relax as I walk you through the installation processes.

Prerequisites
Before installing CWN NAND Andriod, there are a couple installation to be made in order to prepare the platform   for the Andriod OS. These installations include: SPL-2.08.HSPL , Radio, DFT MAGLDR Bootloader v1.13, ClockworkMod Recovery v1.3, and EXT3 partition on SD card.

  • SPL-2.08.HSPL
By Dr. NED Posted in OS

AVR Studio for Ubuntu 11.10

About AVR


The ATMEL AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to one-time programmable ROMEPROM, or EEPROM used by other microcontrollers at the time.The AVR is a modified Harvard architecture machine where program and data are stored in separate physical memory systems that appear in different address spaces, but having the ability to read data items from program memory using special instructions.

Atmel® AVR Studio® is the Integrated Development Environment (IDE) for developing and debugging embedded Atmel AVR® applications. The AVR Studio gives a seamless and easy-to-use environment to write, build, and debug your C/C++ and assembler code. The Studio is integrated with Compilers, assembler and a simulator, and interfaces seamlessly with in-system debuggers and programmers to make Windows code development easier.

In this post,I will demonstrate how to create your own version of Atmel AVR Studio for Ubuntu 11.10. The post explains two (2) different ways of compiling, simulating , debugging and burning of hex unto any AVR microcontroller without the use Atmel AVR Studio.

AVR Development Environment Setting


    1.  Repository index update
      sudo apt-get update
      
    2. *C Compiler installation
      sudo apt-get install gcc # c compiler download
      sudo apt-get install build-essential # Packages which are considered essential for building Debian packages
      

      *skip this section, if your gcc is the current one

    3.  AVR Packages Download
      sudo apt-get install gcc-avr   # A port of GCC to AVR target processor
      sudo apt-get install gdb-avr   # AVR GNU debugger
      sudo apt-get install binutils-avr #low-level utilities for building & manipulating object files
      sudo apt-get install avr-libc # AVR Library files
      sudo apt-get install avrdude # command-line program for programming AVR chips.
      

MakeFile Configuration


MakeFile is a utility for automatically building executable programs and libraries from source-code.

    1. AVR MakeFile Template Download                                                                 
      Download the make file for AVR microcontrollers from here.
      NB: The downloaded file should be saved into your project directory.The file should be as as “MakeFile” without extension.
    2. AVR MakeFile configurationAssumption: I’m assuming that The microcontroller is ATmega32 and programmers hardware is JTAG ICE. Then the following parameters commented in bold should be edited.
      MCU=atmega32 /*Add the name of the processor you are using */
      PROGRAMMER_MCU=m32 /* This is microcontroller id. see manual pages of avrdude. i.e gedit /etc/avrdude.conf */
      PROJECTNAME=myproject /* Project name , This could be anything you wish */
      AVRDUDE_PROGRAMMERID=jtagmki  /*Programmer ids are listed in /etc/avrdude.conf */
      AVRDUDE_PORT=/dev/ttyUSB0 /* Make sure that driver for parallel port is loaded and working and change permissions to 777 */
      

Sample code Testing


    1. Sample source code
      #include 
      int main(void)
      {
      // Set Port D pins as all outputs
      DDRD = 0xff;
      // Set all Port D pins as HIGH
      PORTD = 0xFF;
      return 1;
      }
      
      • Save file to the same directory as the MakeFile
      • Use your terminal and navigate to the file directory.
    2. Execution command
      $ make              /* Compile your project*/
      $ make hex        /* Generate hex file */
      $ make install    /* Burn hex file in microcontroller ( Make sure your board is switched on and programmer is connected )*/
      

Reference


    1. http://stringofthoughts.wordpress.com/2009/11/06/setting-up-avr-development-environment-in-ubuntu/
    2. http://www.ladyada.net/learn/avr/setup-unix.html
    3. http://www.atmel.com/microsite/avr_studio_5/default.aspx
    4. http://en.wikipedia.org/wiki/Atmel_AVR
By Dr. NED Posted in OS

Installing Java Development Tools in Aptana on Ubuntu 11.10

About Aptana


Aptana, Inc. is a company making web application development tools for Web 2.0 and Ajax for use with programming languages such as JavaScriptRubyPHP and Python. Aptana’s main products are Aptana StudioAptana Cloud and Aptana Jaxer. 

Aptana Studio is an open source integrated development environment (IDE) for building Ajax web   applications. It includes support for JavaScript, HTMLDOM, andCSS with code-completion, outlining, JavaScript debugging, error and warning notification and integrated documentation. Additional plugins allow Aptana Studio to be extended to support Java, Ruby on Rails, PHP, Python, Perl, Adobe AIR, Apple iPhone and Nokia WRT (Web Runtime). Aptana Studio is based on Eclipse and is available as standalone on Microsoft WindowsMac OS X and Linux, or as a plugin for Eclipse.

Aptana Installation on Ubuntu 11.10


        1.  Install Sun Java 
          sudo add-apt-repository ppa:ferramroberto/java
          sudo apt-get update
          sudo apt-get install sun-java6-jdk sun-java6-plugin
          

          **NB:Aptana Studio doesn’t currently work with OpenJDK

        2. Download & install xulrunner
          Ubuntu 32 bit use:

          wget -O xulrunner.deb http://launchpadlibrarian.net/70321863/xulrunner-1.9.2_1.9.2.17%2Bbuild3%2Bnobinonly-0ubuntu1_i386.deb
          

          Ubuntu 64 bit use:

          wget -O xulrunner.deb http://launchpadlibrarian.net/70321329/xulrunner-1.9.2_1.9.2.17%2Bbuild3%2Bnobinonly-0ubuntu1_amd64.deb
          
          sudo dpkg -i xulrunner.deb

          **NB: Ubuntu 11.10 doesn’t include xulrunner so it must be downloaded.

        3.  Download the Standalone version of Aptana Studio 3 from the Aptana Studio website
        4.  Unzip it to /opt/aptana-studio-3
          sudo unzip [name of Aptana Studio ZIP file here].zip -d /opt
          sudo mv /opt/Aptana\ Studio\ 3 /opt/aptana-studio-3

Aptana Running


        1. Create a shell file and paste these codes
          #!/bin/bash
          export MOZILLA_FIVE_HOME=/usr/lib/xulrunner
          /opt/aptana-studio-3/Aptana\ Studio\ 3/studio3
          
        2. Change the file permission
          chmod +filename.sh
        3. Run Apatana
          sudo sh filename.sh

Installing Java Development Tools


          1. Enable the proper software repository
            • select the Help / Install New Software… menu
            • under the top Work with drop-down menu, click the link in the phrase, Find more software by working with the Available Software Sites preferences
            • Enable the Eclipse Helios Update Site
            • Click the OK button
          2. Find and Install the Java Tooling
            • using the Work with drop-down menu, select Eclipse Helios Update Site
            • wait for the package list to be populated
            • select the Programming Languages / Eclipse Java Development Tools package from the list
            • click the Next button
            • click the Next button on the Install Details screen that follows
            • accept the license agreement
            • click the Finish button
            • once the installation is complete, click the Restart Now button

Reference


        1. http://www.samclarke.com/2011/11/how-to-install-aptana-studio-3-on-ubuntu-11-10-oneiric/
        2. Ingo M.,”Installing Java Development Tools”
        3. http://aptana.com/products/studio3/getting_started
        4. http://en.wikipedia.org/wiki/Aptana
By Dr. NED Posted in OS

C/C++ Compiler Installation on Ubuntu 11.10

About C/C++


Ubuntu 11.10 (Oneiric Ocelot) is one of the most popular operating system for programming because there are lot of great open source applications, tools, compilers, debuggers, IDEs which  are available free of cost.

One of these great compilers ia  – GCC – The greatest compiler for C language from Free Software Foundation(FSF) by Stallman. Most of the operating systems including Linux kernel by Torwalds was written in C language

C and C++ language is a low and level programming language respectively ( the term high or low basically describes the closeness with hardware).

This post has been written for beginners who just started learning C/C++ or the programmers who have migrated from Windows to Ubuntu (the same for other linux distributions)

Installation Procedure


By default, every ubuntu distribution such as Ubuntu 11.10 comes with gcc compiler already installed. However, if one is not sure about this, there could be another installation. There are basically two ways of installing C/C++ compiler on ubuntu 11.10.

  • The first approach is to use the “build-essential“. The “build-essential” contains a list of packages which are essential for building Ubuntu packages including gcc compiler, make and other required tools.To install using this approach, the following steps should be entered in the terminal.
    sudo apt-get install build-essential
  • The other approach is to install gcc and g++ compiler for C and C++ separately. To install C compiler, open the terminal and enter the command below.
    sudo apt-get install gcc

After a successful installation, you can check the version of your compiler by entering this command in the terminal. .

sudo gcc -v

.

Compilation and Execution of  C /C++ Program


  1. Write a C/C++ program
    Open a simple text editor (in this case gedit) type the following codes and save as hello.c (.c extension is used to indicate that it’s a c program). Or write a program and save it as hello.cpp( .cpp extension is used to indicate that the program is c++ program)
  2. To compile the program, open the terminal and move  to the target directory type the command for c program:
    gcc hello.c -o hello 

    For C++ program enter this in the terminal.

    g++ hello.cpp -o hello
  3. If there is no syntax/semantic error in you program then the compiler will successfully generate an executable file, otherwise fix the problem in your code.
    ./hello

Enjoy!

Ubuntu 11.10 Upgrade Errors

On October 13,2011, Ubuntu released yet another Os code name Oneiric Ocelot( I wonder where they got that name from.) also know as Ubuntu 11.10 six month after the release of Ubuntu 11.04(Natty Narwhal). In actual fact, Ubuntu release in every six month.

Like any other version of ubuntu, every release initially suffers from range of incompatibility errors and Ubuntu 11.10 is of no exceptions. Two major errors that confront people migrating from Ubuntu 11.04 to Ubuntu 11.10 are:

  1. Blank Screen error
  2. waiting for network configuration error

I encountered these problems when upgrading from 11.04 to the 11.10. And after 24 hours through a deep search on the internet, I arrived at a solution which I would like share with you.

The source of these problems mostly deepend on the machine display drivers. Incompatible drivers such as NViDia can lead to blank screen after a successful upgrade.In order to avoid this problem, uninstall all third party display drivers before doing the upgrade.In a situation where you failed to uninstall the drivers, you have to follow these steps in order to restore your desktop.

Boot your machine and Press Ctrl+Alt+F1 to enter into command line mode

change Permission

 Sudo -i
 

move the content of run to run.bak

mv /var/run /var/run.bak
 

create symbolic link in var

 ln -s /run /var
 

move the content of lock to lock.bak

 mv /var/lock /var/lock.bak

create symbolic link in var

ln -s /run/lock /var
reboot
 
By Dr. NED Posted in OS