Setting up Dev Env in linux
Posted on October 2, 2012
Tags: hackhard
1 While in disk installation
- Select SSH server
- Deselect any desktop environment
- Webserver is just apache web server, not useful
2 While in terminal of newly installed OS
2.1 SSH into root
We cannot SSH immediately into root
- login as root
- go to
/etc/ssh/sshd_config
- Change
PermitRootLogin without-password
toPermitRootLogin yes
#"PermitRootLogin prohibit-password" => "PermitRootLogin yes"
- sudo service ssh restart
2.2 Give sudo command to user
- RHEL makes 2 accounts, the root and your default user which is named rhel.
- 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
- NetworkManager is the core hub
- nmcli is used to talk with NetworkManager
- Even if you connect ethernet physically, you still need to set-up the config connection to get internet
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
- RHEL requires we “register” our system with our account
subscription-manager register --username <username> --password <password> --auto-attach
- go to
https://www.redhat.com/wapps/tnc
and click agree subscription-manager attach --auto
- Cant update with
dnf
due to subscription error caused by NTP - go to “192.168.1.86:9090” >> Services >> NTP client/server chronyd.service , Enable
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
lsblk
-which show drives and partitions
sudo mount /dev/sdc2 /mnt
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
- follow the instructions
- also chmod -R 777 the wolfram engine
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