Wednesday, April 27, 2022

Create a GIHUB Project Clone on your local machine using https

Some times you may want to download a copy of a github project to play around with the code. You may also be working on the project and need a fresh copy to make a change. Below are the commands to create a local copy of a project repo.

1) Make the project directory where you are going to work on the code.

2) Install GIT on your machine.

Command Prompt commands to use with in the project directory to create a fresh clone of our Repo on a new machine.

2) git init 


3) git remote add origin https://<user id you have on github>@github.com/<patch to project>


4) git config --global --add safe.directory <full project path>


5) git clone https://<user id you have on github>@github.com/<patch to project>

Example commands I used for a project:

git init

git remote add origin https://jfarrell423@github.utk.edu/oit/archibus_24.git


If you are not the author of the project you may need to execute this command below.

git config --global --add safe.directory E:/Work/archibus-dev


git clone https://jfarrell423@github.utk.edu/oit/archibus_24.git


Friday, March 25, 2022

Install CYGWIN and GNU COBOL

 First I downloaded the GYGWIN installed from the website.

https://cygwin.com/

For my purposes I installed every package available from the CYGWIN installer as I want as much functionality as I can get from my CYGWIN installation. But is you just want to install GNU COBOL here are the dependencies you need to install as of 12-29-2021. 

Watch my installation here: https://www.youtube.com/watch?v=vU0wpLtnMkY

I have time stamps for each the install steps. 

Current dependencies can be found here: https://sourceforge.net/projects/gnucobol/files/dependencies/

GnuCOBOL REQUIRES one of the following external libraries to be installed

for implementation of decimal arithmetic:


    BOTH runtime AND development components required.


  o GNU MP (libgmp) 4.1.2 or later

    https://gmplib.org


  OR


  o MPIR (libgmp - MPIR gmp-compat) 1.3.1 or later

    (preferred when compiling on Windows with other compilers than GCC)

    http://mpir.org


    GNU MP and MPIR are distributed under GNU Lesser General Public License.


    NOTE

    Please ALWAYS use the distro package whenever possible !!

    See NOTE above.



GnuCOBOL MAY require the following external libraries to be installed:


    ***

    NOTE - libltdl is NOT needed when installing on Linux,

    SUN Solaris, MAC OS, CentOS or Windows

        (including Cygwin, MingW and native windows).

    It is also NOT needed with later versions of AIX and HP-UX.

    (AIX >= 5.1 and HP-UX >= 11.1 are known to NOT require this).

    (Check if you have the "dlopen" function).

    ***


  o GNU Libtool (libltdl)

    https://www.gnu.org/software/libtool/libtool.html


    libltdl is used to implement dynamic CALL statements.


    GNU Libtool is distributed under GNU Lesser General Public License.



The following libraries ARE required WHEN :


1) Indexed-Sequential file I/O (ISAM) is used


    BOTH runtime AND development components required.


    One of the following:


  o Berkeley DB (libdb) 4.1 or later

    https://www.oracle.com/

    https://www.oracle.com/technology/products/berkeley-db/db/index.html


    Berkeley DB is distributed under Oracles own open-source license.

    Note that if you linked your software with Berkeley DB,

    you must distribute the source code of your software along with your

    software, or you have to pay royalty to Oracle.


  o VBISAM - ISAM file handler (libvbisam) 2.0 or later

    https://sourceforge.net/projects/vbisam/


    VBISAM is distributed under GNU Lesser General Public License.


  o DISAM File handler (libdisam)

    http://www.isamcentral.com


    DISAM is distributed under the proprietary License

    "Byte Designs Ltd. DISAM Software License".


2) SCREEN SECTION and/or extended ACCEPT/DISPLAY is used


    BOTH runtime AND development components required.


    One of the following:


  o Ncurses (ncurses or ncursesw) 5.2 or later

    https://www.gnu.org/software/ncurses/ncurses.html


    Ncurses is distributed under a BSD style license.


  o PDCurses (pdcurses) for MinGW/native windows ports

    https://pdcurses.org/ or https://github.com/Bill-Gray/PDCurses/


    PDCurses is distributed as Public Domain.


  o Unix curses


3) XML runtime support is used


    BOTH runtime AND development components required.


    libxml2 - http://xmlsoft.org


    libxml2 is distributed under MIT License.


4) JSON runtime support is used


    BOTH runtime AND development components required.


    One of the following:


  o cJSON >= 1.3.0 - https://github.com/DaveGamble/cJSON

    Note: As an alternative of an installed version you may place

    cJSON.c and cJSON.h under "libcob" to include the used functions

    directly in the COBOL runtime.


    cJSON is distributed under MIT License.


  o JSON-C >= 0.12 - https://github.com/json-c/json-c


    JSON-C is distributed under Expat License.

Create a installation directory:
I use C:\COBOL as my installation which is different from C:\OC as most people use.

After CYGWIN is installed you may want to edit C:\cygwin\home\<xyz>\.bashrc

Comment out these lines in the file

# export HISTCONTROL=ignoredups

...   .

# alias rm='rm -i'

# alias cp='cp -i'

# alias mv='mv -i'

     ...

#alias less='less -r'        # raw control characters

# alias whence='type -a'     # where, of a sort

# alias grep='grep --color'                    

     ...

# alias ls='ls -hF --color=tty'  # classify files in colour

# alias dir='ls --color=auto --format=vertical'

# alias vdir='ls --color=auto --format=long'

# alias ll='ls -l'                              # long list

# alias la='ls -A'                              # all but . and ..

# alias l='ls -CF'                             


Add these lines to the end of the file


# some additional commands to enter

alias c:='cd /cygdrive/c'

alias grep='grep --color'

alias cls='clear'

alias lla='ls -la'

alias d2u='dos2unix'

 

# only add the following if you have your programs

#   in c:/OC/pgms

alias mypgms='cd /cygdrive/c/OC/pgms'

 

# set a nice looking prompt:

PS1='\h:\W\$ '