Differences

This shows you the differences between two versions of the page.

Link to this comparison view

etc [2012/11/04 21:01] (current)
Line 1: Line 1:
 +@related: [[Install]] [[Config]] [[Admin]] [[migrate]]
 +
 +
 +Here is a method  to administrate effeciently a [[Unix]] System :
 +
 +All this will end in a script shell feel free to ask it
 +
 +==== create ====
 +
 +  # install distro, once rebooted :
 +  apt-get install sudo aptitude mercurial lshw
 +  cd /etc && hg init && hg commit -m "Init HOSTNAME=${HOSTNAME}"
 +
 +==== track ====
 +
 +  DISK=hda # DISK=sda
 +  mkdir -p /etc/home
 +  date >> /etc/home/README.txt
 +  ln -fs home/README.txt /etc/
 +  ln -fs etc/README.txt /
 +
 +  DIR=/etc/home
 +  cd /etc/home
 +  parted /dev/$DISK -s "unit b print" > /etc/home/parted.txt
 +  fdisk -lu /dev/$DISK > ${DIR}/fdisk.txt
 +  lsmod > ${DIR}/lsmod.txt
 +  cat /proc/version ${DIR}/version.txt
 +  cp -va /boot/grub/menu.lst /etc/home/
 +  zcat  /proc/config.gz >  ${DIR}//linux.txt
 +  hdparm -t -T /dev/$DISK > ${DIR}//hdparm.txt
 +  glxinfo >${DIR}//glxinfo.txt
 +  cp -va /var/log/Xorg.0.log /etc/home/
 +  lspci >${DIR}//lspci.txt
 +  lspci -n > ${DIR}//lspci-n.txt
 +  lspci -vxn -vv > ${DIR}/lspci-v.txt
 +  lsusb > ${DIR}/lsusb.txt
 +  scanpci -v  > ${DIR}/scanpci.txt
 +  xdpyinfo  > ${DIR}/xdpyinfo.txt
 +  lshw > ${DIR}/lshw.txt
 +  cat /proc/interrupts > ${DIR}/interrupts.txt
 +
 +  sudo dpkg-query -W -f='${Package} ${VERSION}\n' > ${DIR}/packages.txt
 +
 +  DISK=sda # DISK=hda
 +  dd if=/dev/$DISK of=/etc/home/$DISK.mbr count=1 bs=1024
 +  L=$(fdisk -l /dev/${DISK} | grep "^/dev/${DISK}" | cut -d' ' -f 1 | xargs -n 1 basename )
 +  for t in $L ; do dd if=/dev/$t of=$t.mbr count=1 bs=1024 ; done
 +
 +
 +
 +==== commit ====
 +
 +  cd /etc/ && hg add && hg commit -m "New files in ${HOSTNAME}:/etc"
 +
 + cd /etc/ && hg add \
 +  || find . -type d \
 +        -iname '.hg' -prune -false \
 +        -o -type f | while read t ; do hg add "$t" ; done \
 +  hg commit -m "Add all new files in ${HOSTNAME}:/etc"
 +
 +==== install ====
 + t=mms ; sudo apt-get install $t && cd /etc/ && hg add && hg commit -m "Installed: $t"
 +
 +==== upgrade ====
 +
 +  cd /etc && hg add * # ...
 +  hg commit -m "About to upgrade"
 +  sudo aptitude upgrade
 +  cd /etc && hg add * # ...
 +  hg commit -m "Upgrade done"
  
etc.txt ยท Last modified: 2012/11/04 21:01 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki