Setting up Dev Env in linux

Posted on October 2, 2012
Tags: hackhard

1 While in disk installation

2 While in terminal of newly installed OS

2.1 SSH into root

We cannot SSH immediately into root

  1. login as root
  2. go to /etc/ssh/sshd_config
  3. Change PermitRootLogin without-password to PermitRootLogin yes
  • #"PermitRootLogin prohibit-password" => "PermitRootLogin yes"
  1. sudo service ssh restart

2.2 Give sudo command to user

  1. RHEL makes 2 accounts, the root and your default user which is named rhel.
  2. by default rhel has no sudo privilege so first login to root then give sudo to rhel.

2.2.1 Give sudo access

su -
apt install sudo
usermod -aG sudo debian
  • If the above doesnt work try below
su -
nano /etc/sudoers

under root ALL=(ALL) ALL
add rhel ALL=(ALL) ALL

3 Theory and Network

nmcli con add con-name example ifname eno1 type ethernet ip4 192.168.1.86/24 gw4 192.168.1.1 nmcli con mod example ipv4.dns “8.8.8.8” nmcli -p con show example nmcli connection up example

nmcli connection delete example

4 Updating

4.1 package update

  • note dnf is called “dandified yum” aka better yum
  • instead of apt-get, use dnf
  • Search for package using dnf search bleh, dnf search --all bleh
  • dnf list --installed
  • dnf update

5 Mounting drives and transferring files

6 Setup

6.1 Code-server

Remember to change the configs following https://userjy.github.io/posts/2021-11-10-CodeServer.html

6.2 firewalld

  • code-server wont work because of firewall
  • sudo firewall-cmd --set-default-zone trusted

7 Install zshrc

apt-get install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

8 bashrc zshrc

#lean prover
export PATH="$PATH:$HOME/.elan/bin"
export NEXT_TELEMETRY_DISABLED=1

source ~/.zprofile
alias kubectl="minikube kubectl --"
export SAM_CLI_TELEMETRY=0
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/kali/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/kali/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/home/kali/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/kali/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

export PATH="$PATH:/home/kali/.local/bin"
export PATH="$HOME/.elan/bin:$PATH"

9 install node

Install node via installing nvm

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
nvm install node

10 Install docker

sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf remove runc
sudo dnf install docker-ce
sudo dnf install docker-compose-plugin
sudo systemctl enable docker
sudo groupadd docker
sudo usermod -aG docker $USER
sudo chmod 666 /var/run/docker.sock

11 Install golang

Get linux download link from golang website

sudo rm -rf /usr/local/go
cd /usr/local
sudo wget https://go.dev/dl/go1.19.3.linux-amd64.tar.gz
tar -xvzf https://go.dev/dl/go1.19.3.linux-amd64.tar.gz
sudo rm -rf https://go.dev/dl/go1.19.3.linux-amd64.tar.gz

either in .zshrc or .bashrc, or .zprofile .profile add the lines

export GOBIN=/usr/local/go/bin
export PATH=$PATH:$GOBIN
export GOPATH=$(go env GOPATH)
export PATH=$PATH:$GOPATH

12 Wolfram

sudo dnf install alsa-lib

13 TroubleShooting

13.1 Failure in apt update

  • vi /etc/apt/sources.list

14 Install ghcup

#for debian
sudo apt-get install libnuma-dev
#for redhat
dnf install numactl
ghcup tui
ghcup set ghc 8.10.7