Linux barebones quickstart: Difference between revisions

From Bitpost wiki
No edit summary
No edit summary
Line 9: Line 9:
  # for static IPs on centos work machines:  
  # for static IPs on centos work machines:  
   sudo emacs /etc/sysconfig/network-scripts/ifcfg-ens192  
   sudo emacs /etc/sysconfig/network-scripts/ifcfg-ens192  
   # ALSO change VM "LabNet8X" adapter if needed to match subnet
   # For VMs, change network adapter if needed to match subnet (eg "LabNet8X")


=== Set up hostname ===
=== Set up hostname ===
Line 24: Line 24:
  ln -s id_rsa_3072_nopswd id_rsa
  ln -s id_rsa_3072_nopswd id_rsa
  # also add any other private keys and run [chmod 400] on them
  # also add any other private keys and run [chmod 400] on them
=== Install git ===
sudo apt install git # ubuntu
sudo yum install git # centos
# etc


=== Set up scripts ===
=== Set up scripts ===
  cd && mkdir development && cd development
  cd && mkdir development && cd development
  git clone bitpost.com:development/scripts.git  
  git clone bitpost.com:development/scripts.git  
./scripts/setup_linux.sh # to continue bootstrapping
=== in progress: move this to setup_linux.sh ===
  cd && ln -s development/scripts scripts
  cd && ln -s development/scripts scripts
  mkdir scripts/[distro]/[new machine]
  mkdir scripts/[distro]/[new machine]

Revision as of 13:21, 9 November 2017

Install the distro

Set up Ubuntu or Centos or some small embedded whateverism...

Set up IP

DO THIS NOW, NEVER LET A CLONE USE THE SAME IP, you will tear your clothes and spit on the ground!

# on home lan, dnsmasq doles out the ips based on MAC, make sure you have it configured
# for static IPs on ubuntu work machines: 
  sudo emacs /etc/network/interfaces
# for static IPs on centos work machines: 
  sudo emacs /etc/sysconfig/network-scripts/ifcfg-ens192 
  # For VMs, change network adapter if needed to match subnet (eg "LabNet8X")

Set up hostname

sudo emacs /etc/hostname && sudo hostname newname  # use hostname cmd to set it right away
# NOTE that systemd can also be used: sudo hostnamectl set-hostname newname
# /etc/hosts changes should not be needed, if hostnames are properly configured (dnsmasq DNS -or- work DNS will provide resolution)

Set up ssh

# openssh-server defaults are ok but see /etc/ssh/sshd_config for details
cd ~/.ssh
scp [another-working-setup]:.ssh/authorized_keys .
scp [another-working-setup]:.ssh/id_rsa_3072_nopswd .
scp [another-working-setup]:.ssh/config .
ln -s id_rsa_3072_nopswd id_rsa
# also add any other private keys and run [chmod 400] on them

Install git

sudo apt install git # ubuntu
sudo yum install git # centos
# etc

Set up scripts

cd && mkdir development && cd development
git clone bitpost.com:development/scripts.git 
./scripts/setup_linux.sh # to continue bootstrapping



in progress: move this to setup_linux.sh

cd && ln -s development/scripts scripts
mkdir scripts/[distro]/[new machine]
emacs -nw .bashrc 
# export PATH=$HOME/scripts/[distro]/[machine]:$HOME/development/scripts/[distro]/i3:$HOME/development/scripts/[distro]:$PATH

Set up config

cd ~/development
git clone bitpost.com:development/config.git 
cd config
mkdir -p [distro] && cd distro
cp -rp [existing machine] [new machine]
# EDIT IT ALL
# WARNING - EDIT ACTUAL SYSTEM FILES, NOT repo files, as those will get clobbered when you stow
# BACK EVERYTHING UP AS YOU GO until we get really good at this :-)
git add [new machine]
git commit -a -m "new machine" && git push
cd && ln -s /home/m/development/config/  optional:[gig]/  [distro]/[new machine] config

TODO config distro machine migration

Start to revamp config from [machine]/[distro] to [distro]/[machine] to match scripts. It's not hard even though it's dangerous. You can do each machine separately from others. Get on it!

# DO THIS ALL IN ONE SESSION, do not log out
cd development/config
mkdir -p distro # prolly not needed
git mv machine/distro distro/machine
setup_stow.sh # repeat until it doesn't fail; check each failure to make sure it is a symlink, and simply rm them as you go