Tuesday, June 3, 2014

fatal: unable to access 'https://github.com/me/project.git/': SSL certificate problem: unable to get local issuer certificate

git clone https://github.com/my/project.git
Cloning into 'project'...
fatal: unable to access 'https://github.com/me/project.git/': SSL certificate problem: unable to get local issuer certificate

Solution:

Try to replace https:// with git://

else

setenv GIT_SSL_NO_VERIFY true

Using clang with YouCompleteMe for IntelliSense auto-complete in Vim


Installing vim (must be 7.3.584 w/ python2 support):

If you have root:

https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source

If you don't have root:

http://www.vim.org/sources.php
Copy the version you want, extract and cd into it
./configure --with-features=huge --enable-multibyte --enable-rubyinterp --enable-pythoninterp --with-python-config-dir=/tools/devkits/lnx64/python-2.7.5/lib/python2.7/config/ --enable-perlinterp --enable-luainterp --enable-gui=gtk2 --enable-cscope --prefix=<install_dir>
# I used ~/vim74_install/
# Also I had some problems with ruby, so I removed --enable-rubyinterp

make
make install

# remember to setup paths to bin e.g. setenv PATH ~/vim74_install/bin:$PATH

gvim --version

Installing clang (only if your OS isn't supported here http://llvm.org/releases/download.html#3.3)

http://clang.llvm.org/get_started.html

Download llvm, clang, compiler rt, and clang tools extra, from:
http://llvm.org/releases/download.html#3.3
tar xzf llvm-3.4.1.src.tar.gz 
mv llvm-3.4.1.src llvm-3.4.1

cd llvm-3.4.1/tools/
tar xzf ../../cfe-3.4.1.src.tar.gz 
mv cfe-3.4.1.src clang
cd ../..

cd llvm-3.4.1/tools/clang/tools
tar xzf ../../../../clang-tools-extra-3.4.src.tar.gz 
mv clang-tools-extra-3.4/ extra/
cd ../../../..

cd llvm-3.4.1/projects/
tar xzf ../../compiler-rt-3.4.src.tar.gz 
mv compiler-rt-3.4/ compiler-rt/
cd ../..

mkdir llvm-3.4.1_build/
cd llvm-3.4.1_build/
../llvm-3.4.1/configure --prefix=~/llvm-3.4.1_install
make

#mkdir llvm-3.4.1_linstall/
# remember to setup paths to bin e.g. setenv PATH ~/llvm-3.4.1_linstall/bin:$PATH

Installing CMake

wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
tar xzf cmake-2.8.12.2.tar.gz
cd cmake-2.8.12.2
./configure --prefix=<install_dir>
# I used ~/cmake-2.8.12.2_install/

# ERROR: version `GLIBCXX_3.4.15' not found
# Luckily I had gcc-4.8.2 installed which has libstdc++.so.6 with the correct GLIBCXX.  To point to that I used:
setenv LD_LIBRARY_PATH /tools/devkits/lnx64/gcc-4.8.2/lib64:$LD_LIBRARY_PATH
# rerun config

gmake

# remember to setup paths to bin e.g. setenv PATH ~/cmake-2.8.12.2_install//bin:$PATH

cmake -version

Installing YouCompleteMe

Reference: https://github.com/Valloric/YouCompleteMe && http://valloric.github.io/YouCompleteMe/

cd ~/.vim/bundle/
git clone https://github.com/Valloric/YouCompleteMe
cd YouCompleteMe
git submodule update --init --recursive
#./install.sh --clang-completer << didn't work for me

Download the binary unless you built clang:
http://llvm.org/releases/download.html#3.3
Extract the archive and this path that you extract llvm to is used below as ~/ycm_temp/llvm_root_dircd

cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp

make ycm_support_libs


# -- If you get this:
#    Your C++ compiler does NOT support C++11, will compile in C++03 mode.
# You should get:
#    Your C++ compiler supports C++11, compiling in that mode.
# Then the c++/cpp/g++/cpp compile being used by cmake is incorrect.  This is represented by 
# CMAKE_CXX_COMPILER && CMAKE_C_COMPILER
# -- Then do this:
# You can override this with
setenv CC /tools/devkits/lnx64/gcc-4.8.2/bin/gcc
setenv CXX /tools/devkits/lnx64/gcc-4.8.2/bin/g++

# -- If you get this:
# Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
#   (Required is at least version "2.6")
# Call Stack (most recent call first):
#   ~/cmake-2.8.12.2_install/Modules/FindPackageHandleStandardArgs.cmake:315
# (_FPHSA_FAILURE_MESSAGE)
#   ~/cmake-2.8.12.2_install/Modules/FindPythonLibs.cmake:186
# (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
#   BoostParts/CMakeLists.txt:30 (find_package)
# -- Then do this:
# open third_party/ycmd/cpp/BoostParts/CMakeLists.txt
# open third_party/ycmd/cpp/ycm/CMakeLists.txt
# after cmake_minimum_required and before project:
set( PYTHON_LIBRARY /tools/devkits/lnx64/python-2.7.5/lib/ )
set( PYTHON_INCLUDE_DIR /tools/devkits/lnx64/python-2.7.5/include/python2.7/ )
# rerun ./install.sh --clang-completer





Thursday, January 16, 2014

Being Pragmatic

Intro

  1. Care about your craft
  2. Think! About your work
  3. Provide options, no excuses
  4. Don't live with broken windows
  5. Be a catalyst for change
  6. Remember the big picture
  7. Make quality a requirements issue
  8. Invest regularly in your knowledge
  9. Critically analyze what you read and hear
  10. It's both what you say and how you say it

Thinking
    What
    Interest
    Sophistication
    Detail
    Own
    Motivation

  • Know what you want to say
  • Know your audience
  • Choose your moment
  • Choose a style
  • Make it look good
  • Involve the audience
  • Be a listener
  • Respond
Tackling
  1. DRY - Don't Repeat Yourself
  2. Make it easy to reuse
  3. Eliminate effects between unrelated objects
  4. There are no final decisions
  5. Use tracer bullets to find the target
  6. Prototype to learn
  7. Program close to the problem domain
  8. Estimate to avoid surprises
  9. Iterate the schedule with the code
Tools
  1. Keep knowledge in plain text
  2. Use command shells
  3. Use a single editor well
  4. Always use source control management software
  5. Fix the problem not the blame
  6. Don't panic
  7. Take the signs for what they are
  8. Don't assume it - Prove it
  9. Learn a text manipulation language
  • Debugging steps
  1. Are you seeing a symptom, or the root cause?
  2. Write down the problem as in an email to a co-worker
  3. If we see problems and the tests are passing, then are the tests complete?
  4. Where else does this problem exist, or need to be checked?

Saturday, January 4, 2014

Qt ERROR: mainwindow.h:4:23: error: QMainWindow: No such file or directory

# generate make file
$ /opt/Qt5/5.2.0/gcc/bin/qmake -spec linux-g++ -o Makefile torii.pro




# generate ui_mainwindow.h from mainwindow.ui
$ /opt/Qt5/5.2.0/gcc/bin/uic ./mainwindow.ui -o ui_mainwindow.h

# build
$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/Qt5/5.2.0/gcc/mkspecs/linux-g++ -I. -I. -I/opt/Qt5/5.2.0/gcc/include -I/opt/Qt5/5.2.0/gcc/include/QtGui -I/opt/Qt5/5.2.0/gcc/include/QtCore -I. -o mainwindow.o mainwindow.cpp
In file included from mainwindow.cpp:1:
mainwindow.h:4:23: error: QMainWindow: No such file or directory
mainwindow.cpp:4:22: error: QStatusBar: No such file or directory
In file included from mainwindow.cpp:1:
mainwindow.h:12: error: expected class-name before ‘{’ token
mainwindow.h:13: error: ISO C++ forbids declaration of ‘Q_OBJECT’ with no type
mainwindow.h:15: error: expected ‘;’ before ‘public’
mainwindow.cpp:7: error: prototype for ‘MainWindow::MainWindow(QWidget*)’ does not match any in class ‘MainWindow’
mainwindow.h:12: error: candidates are: MainWindow::MainWindow(const MainWindow&)
mainwindow.h:12: error:                 MainWindow::MainWindow()
make: *** [mainwindow.o] Error 1

__fix__
The QMainWindow exists in the QtWidgets directory, so add the following to the Makefile (perhaps there's a way to add this to the .pro file):
-I/opt/Qt5/5.2.0/gcc/include/QtWidgets
 ...
 g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/Qt5/5.2.0/gcc/mkspecs/linux-g++ -I. -I. -I/opt/Qt5/5.2.0/gcc/include -I/opt/Qt5/5.2.0/gcc/include/QtGui -I/opt/Qt5/5.2.0/gcc/include/QtCore -I. -o mainwindow.o mainwindow.cpp

Sunday, December 29, 2013

Invalid MIT-MAGIC-COOKIE-1 key: cannot connect to X server :1.0 on CentOS 6

__error__
root@server:/home/admin
$ <file>
Invalid MIT-MAGIC-COOKIE-1 key<file>: cannot connect to X server :1.0

admin@server:/home/admin
$ su <file>
Invalid MIT-MAGIC-COOKIE-1 key<file>: cannot connect to X server :1.0

__fix__
the problem is associated with x window forwarding

I was in a vnc session initiated from user admin and the .run file I was trying to execute was not able to forward the window through the terminal to the vncserver I was using

root cause is still unknown

_workaround_
start a vnc session under root (not generally supported) and then execute the file

this correctly opened the GUI

Thursday, December 26, 2013

error package ... Requires: libstdc++.so.6(GLIBCXX_3.4.15) on CentOS 6

__error__

$ yum install google-chrome-stable
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror-centos.hostingswift.com
 * extras: mirrors.xmission.com
 * updates: centos.mirrors.hoobly.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package google-chrome-stable.i386 0:31.0.1650.63-1 will be installed
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15) for package: google-chrome-stable-31.0.1650.63-1.i386
--> Finished Dependency Resolution
Error: Package: google-chrome-stable-31.0.1650.63-1.i386 (google-chrome)
           Requires: libstdc++.so.6(GLIBCXX_3.4.15)

 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest


__to fix__


yum install gstreamer-plugins-base-devel

yum -y install glibc-devel.i686 glibc-devel

wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.2/gcc-4.6.2.tar.gz

su

tar xzf gcc-4.6.2.tar.gz
pushd gcc-4.6.2

./contrib/download_prerequisites
popd

mkdir staging
pushd staging

$PWD/../gcc-4.6.2/configure --prefix=/opt/gcc-4.6.2
make
make install
popd

unlink /usr/lib/libstdc++.so.6
cp /opt/gcc-4.6.2/lib/libstdc++.so.6.0.16 /usr/lib
pushd /usr/lib

ln -s libstdc++.so.6.0.16 libstdc++.so.6

popd

Matahari errors on CentOS 6 when running yum update

__error__
$ yum update
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror-centos.hostingswift.com
 * extras: mirrors.xmission.com
 * updates: centos.mirrors.hoobly.com
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package qpid-cpp-client.i686 0:0.12-6.el6 will be updated
--> Processing Dependency: libqpidclient.so.5 for package: matahari-service-0.4.4-11.el6.i686
--> Processing Dependency: libqpidclient.so.5 for package: matahari-host-0.4.4-11.el6.i686
--> Processing Dependency: libqpidclient.so.5 for package: matahari-sysconfig-0.4.4-11.el6.i686
--> Processing Dependency: libqpidclient.so.5 for package: matahari-agent-lib-0.4.4-11.el6.i686
--> Processing Dependency: libqpidclient.so.5 for package: matahari-network-0.4.4-11.el6.i686
--> Processing Dependency: libqpidcommon.so.5 for package: matahari-service-0.4.4-11.el6.i686
--> Processing Dependency: libqpidcommon.so.5 for package: matahari-host-0.4.4-11.el6.i686
--> Processing Dependency: libqpidcommon.so.5 for package: matahari-sysconfig-0.4.4-11.el6.i686
--> Processing Dependency: libqpidcommon.so.5 for package: matahari-agent-lib-0.4.4-11.el6.i686
--> Processing Dependency: libqpidcommon.so.5 for package: matahari-network-0.4.4-11.el6.i686
---> Package qpid-cpp-client.i686 0:0.14-22.el6_3 will be an update
---> Package qpid-cpp-client-ssl.i686 0:0.12-6.el6 will be updated
---> Package qpid-cpp-client-ssl.i686 0:0.14-22.el6_3 will be an update
---> Package qpid-cpp-server.i686 0:0.12-6.el6 will be updated
---> Package qpid-cpp-server.i686 0:0.14-22.el6_3 will be an update
---> Package qpid-cpp-server-ssl.i686 0:0.12-6.el6 will be updated
---> Package qpid-cpp-server-ssl.i686 0:0.14-22.el6_3 will be an update
---> Package qpid-qmf.i686 0:0.12-6.el6 will be updated
---> Package qpid-qmf.i686 0:0.14-14.el6_3 will be an update
--> Finished Dependency Resolution
Error: Package: matahari-host-0.4.4-11.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
           Requires: libqpidclient.so.5
           Removing: qpid-cpp-client-0.12-6.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
               libqpidclient.so.5
           Updated By: qpid-cpp-client-0.14-22.el6_3.i686 (base)
               Not found
Error: Package: matahari-service-0.4.4-11.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
           Requires: libqpidclient.so.5
           Removing: qpid-cpp-client-0.12-6.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
               libqpidclient.so.5
           Updated By: qpid-cpp-client-0.14-22.el6_3.i686 (base)
               Not found
Error: Package: matahari-agent-lib-0.4.4-11.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
           Requires: libqpidclient.so.5
           Removing: qpid-cpp-client-0.12-6.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
               libqpidclient.so.5
           Updated By: qpid-cpp-client-0.14-22.el6_3.i686 (base)
               Not found
Error: Package: matahari-host-0.4.4-11.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
           Requires: libqpidcommon.so.5
           Removing: qpid-cpp-client-0.12-6.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
               libqpidcommon.so.5
           Updated By: qpid-cpp-client-0.14-22.el6_3.i686 (base)
               Not found
Error: Package: matahari-agent-lib-0.4.4-11.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
           Requires: libqpidcommon.so.5
           Removing: qpid-cpp-client-0.12-6.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
               libqpidcommon.so.5
           Updated By: qpid-cpp-client-0.14-22.el6_3.i686 (base)
               Not found
Error: Package: matahari-service-0.4.4-11.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
           Requires: libqpidcommon.so.5
           Removing: qpid-cpp-client-0.12-6.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
               libqpidcommon.so.5
           Updated By: qpid-cpp-client-0.14-22.el6_3.i686 (base)
               Not found
Error: Package: matahari-sysconfig-0.4.4-11.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
           Requires: libqpidclient.so.5
           Removing: qpid-cpp-client-0.12-6.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
               libqpidclient.so.5
           Updated By: qpid-cpp-client-0.14-22.el6_3.i686 (base)
               Not found
Error: Package: matahari-network-0.4.4-11.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
           Requires: libqpidcommon.so.5
           Removing: qpid-cpp-client-0.12-6.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
               libqpidcommon.so.5
           Updated By: qpid-cpp-client-0.14-22.el6_3.i686 (base)
               Not found
Error: Package: matahari-sysconfig-0.4.4-11.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
           Requires: libqpidcommon.so.5
           Removing: qpid-cpp-client-0.12-6.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
               libqpidcommon.so.5
           Updated By: qpid-cpp-client-0.14-22.el6_3.i686 (base)
               Not found
Error: Package: matahari-network-0.4.4-11.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
           Requires: libqpidclient.so.5
           Removing: qpid-cpp-client-0.12-6.el6.i686 (@anaconda-CentOS-201112130233.i386/6.2)
               libqpidclient.so.5
           Updated By: qpid-cpp-client-0.14-22.el6_3.i686 (base)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

__to fix__
Matahari is deprecated, so run:
$ yum remove matahari*