setup workspace for bizapps-dev-box - installation

How to set up a workspace for bizapps-dev-box and reference in a common way across macOS, Windows and Linux

In Terminal
$ cd $HOME
$ mkdir -p $HOME/workspace
$ cd $HOME/workspace
$ git clone <repo_url>
$ cd <repo_url>
Spike Test: For querying from the Terminal

Related

Why does the ls instruction in gitbash not show me my c drive?

iamth#DESKTOP-TQE8AEJ MINGQ64 ~ (master)
$ cd ..
iamth#DESKTOP-TQE8AEJ MINGQ64 /c/Users
$ cd ../..
iamth#DESKTOP-TQE8AEJ MINGQ64 /
$ ls
LICENSE.txt cmd/ git-bash.exe* proc/ unins000.exe*
ReleaseNotes.html dev/ git-cmd.exe* tmp/ unins000.msg
bin/ etc/ mingwt64/ unins000.dat usr/
iamth#DESKTOP-TQE8AEJ MINGQ64 /
$ cd c
iamth#DESKTOP-TQE8AEJ MINGQ64 /c
$
I have tried other things, like doing ls *, but it will not show up anywhere.
Note, I can navigate to my c drive, but the ls instruction does not list it. Why is this, and what can I do about it?
The Git Bash terminal in Windows is a Unix-style shell and does not directly support accessing Windows drives. To access the C drive from Git Bash, you need to mount the C drive in the Git Bash file system. You can do this by running the following command:
mount -t drvfs C: /c.
After running this command, you should be able to access the C drive by running ls /c.

Golang: How to build deterministic in github ci actions and local on m1 mac

I am trying to build deterministic go executables. My build script is really simple:
#!/bin/bash
BASEPATH=$(git rev-parse --show-toplevel)
cd "$BASEPATH/lambda"
GOOS=linux GOARCH=amd64 GOFLAGS="-trimpath" GOPROXY=https://proxy.golang.org,direct go build
ls -la cdk-sops-secrets
touch -t 202002020000 cdk-sops-secrets
chmod 755 cdk-sops-secrets
shasum cdk-sops-secrets
ls -la cdk-sops-secrets
this runs fine, but produces different binarys/executables on my m1 mac and in the github actions run. They differ in size and shasum. Even if I use the same docker image (apart from that one is arm and the other is amd64).
Is it possible to build a shasum / byte-by-byte identical version of my code?
This script builds the same versions in CI and locally
#!/bin/bash
echo "GOROOT: $GOROOT / GOPATH: $GOPATH"
BASEPATH=$(git rev-parse --show-toplevel)
cd "$BASEPATH/lambda"
export GOOS=linux
export GOARCH=amd64
export GOPROXY=https://proxy.golang.org,direct
export CGO_ENABLED=0
go build -trimpath -buildvcs=false -ldflags="-s -w -buildid="
ls -la cdk-sops-secrets
shasum cdk-sops-secrets
touch -t 202002020000 cdk-sops-secrets
chmod 755 cdk-sops-secrets
ls -la cdk-sops-secrets
shasum cdk-sops-secrets

Messed up terminal after installing Angular [altered my zsh $PATH?]

I just installed Angular and after the default installation (as set out here: https://angular.io/guide/setup-local). After running the standard commands my terminal would not recognise ng (so I could not use ng new my-app).
To solve this problem I did the following based on a stackoverflow answer:
echo -e "export PATH=$(npm prefix -g)/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
ng --version
(I had no knowledge of what PATH was when doing this, or what the command I was running did...)
This worked, and my ng --version returned a result and I was able to build and run an Angular app.
However when I opened a new tab in my terminal all my normal terminal 'styles' (I use zsh) had gone.
My friend and I tried to resolve the problem, which he felt might be related to my terminal settings (his 'Command (complete path)' read: /usr/local/bin/zsh, and mine was /bin/zsh). So we tried a few things but none have worked and it might be worse - this included resetting my $PATH based on another stackoverflow answer to /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin.
We also switched back and forth from /bin/zsh to /bin/bash to try and resolve things, but this did not do anything.
The current state of things is that I cannot run rails commands where I normally could (for example), also things like ll (which returns zsh: command not found: ll).
This is my .zsh_history file:
which zsh
which bash
cd code
cd
ls
lsa
ls -a
cat .aliases
vi .aliases
sudo v
sudo vi .aliases
npm install -g angular
npm list
npm install -g #angular/cli
cd code
ls
cd JoshInLisbon
cd ..
JoshInLisbon
ls
mkdir Angular
mkdir Rails
cd rails
ls
cd ..
open
open .
cd WALD
ls
ll
lll
ls -a
cat .git
.git
ls
ls -a
cd ..
..
JoshInLisbon
..
JoshInLisbon
ls
cd Angular\ Projects
ng new my-first-app
which ng
which angula
which angular
echo $path
npm -v
which node
node -v
npm install -g #angular/cli
ng --version
brew install node
node -v
brew postinstall node
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
npm install -g n
sudo npm install -g n
sudo n stable
brew doctor
npm -v
which brew
which npm
brew -v
brew update
npm -v
npm install npm
npm -v
npm install -g npm
npm install -g #angular/cli
ng --version
npm ls --global --depth 0
npm install -g #angular/cli#latest
echo -e "export PATH=$(npm prefix -g)/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
ng --version
cat ~/.bashrc
echo $PATH
ng new my-app
ls
my-app
npm outdated
..
npm install --save core-js#^3
my-app
npm install --save core-js#^3
npm install --save-dev "jasmine-core#>=3.5"
ng serve --open
exit
ls
cd code
ls
codesign
code
ls
cd code
ls
cd JoshInLisbon
ls
cd an
cd Angular\ Projects
ls
cd my-app
code
ng
code
code --
ls
cd ..
cd taaalk
cd ..
cd taaalk_edge
echo $PROMPT
zsh --version
chsh -s
ls
cd code
ls
cd JoshInLisbon
chsh -s /bin/bash
ls
zsh --version
ls -a
cat .zshrc
cd .zshrc
echo $PATH
echo $PATH
vim
cat
ls -a
vim .zshrc
vim .bash_profile
~/.MacOSX/environment.plist
echo $PATH
plutil -lint ~/.MacOSX/environment.plist
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
ls
ls -a
cat .zshrc.backup
cd code
cd JoshInLisbon
cd Rails\ Projects
rails new thing
rails new thing
echo $PATH
..
ls ..
cd ..
cd ..
cd
ls -a
cat .zshrc.backup
ls -a
cat .zsh_history
vim .bash_profile
ls -a
vim .zcompdump-jmpb-5.7.1
vim zshrc.backup
cat .zshrc
.zsh_history
vim .zshrc
vim .shell.pre-oh-my-zsh
ll
ll -a
I can see my .zshrc file when I do ls -a, however it is empty.
This is my .bash_history
ls
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
history
which zch
which zsh
echo path
echo $PATH
cd code
cd JoshInLisbon/
rails new project
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
echo $PAtH
echo $PATH
rails new
npm -version
which zsh
cd ..
cd ~
ls
ls -a
cat .szhrc
cat .zshrc
cat .zshrc
ls -a
cat .bash_profile
echo $PATH
cat .zsh_history
cat .bashrc
export PATH=/Users/joshua/.npm-global/bin:./bin:./node_modules/.bin:/Users/joshua/.rbenv/shims:/Users/joshua/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/usr/local/sbin
echo $PATH
which ruby
which zsh
cd code/
cd JoshInLisbon/
cd Rails\ Projects/
rails new thing
ls
rm -R thing
ls
which brew
which zsh
cd ..
cd
ls
ls -a
cat .zshrc
cat .zshrc
cat .bash_profile
cat .oh-my-zsh/
cd .oh-my-zsh/
ls
cat .oh-my-zsh.sh
cd
ls
ls -a
cat .zshrc.backup
echo $ZSH
export ZSH="/Users/joshua/.oh-my-zsh"
echo $ZSH
which rails
ll
This might be my old path? export PATH=/Users/joshua/.npm-global/bin:./bin:./node_modules/.bin:/Users/joshua/.rbenv/shims:/Users/joshua/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/usr/local/sbin
Anyway, you are a hero if you made it this far and if you have any idea what I should do I would be very grateful.
This was resolved by moving my dotfiles (which contains all my zsh settings) back to the original location. The change was caused by the re-ordering of many folders.
I also restored my PATH back to the old one pasted at the bottom of the question.

facing issues while installing Golang

I am facing some issues while installing go lang, have used below approach to install it.
sudo apt update
$ sudo curl -O https://storage.googleapis.com/golang/go1.10.1.linux-amd64.tar.gz
$ sudo tar -xvf go1.10.1.linux-amd64.tar.gz
$ sudo mv go /usr/local
everything went fine till the above step.
But when I am giving below command, I am getting a message
$ echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
Message: bash: export: '/usr/local/go/bin': not a valid identifier
$ source ~/.profile
Try this script:
git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh
Full details: https://github.com/udhos/update-golang

error when switching to directory: "perl version 5.12.3 can't run /usr/bin/shasum"

I installed rvm 1.9.3 and now whenever I switch to a directory containing a .rvmrc, I get a perl error message:
~/example$ cd .. && cd example
perl version 5.12.3 can't run /usr/bin/shasum. Try the alternative(s):
/usr/bin/shasum5.10.0 (uses perl 5.10.0)
Run "man perl" for more information about multiple version support in
Mac OS X.
You may try this dirty approach. This approach will skip those check and directly use shasum in your binary directory
$ cd /usr/bin
$ ls shasum*
shasum shasum5.10.0
$ mv /usr/bin/shasum /usr/bin/your_backup_shasum
$ ln -s shasum5.10.0 shasum

Resources