Difference between revisions of "User:Scott/02"

From FreekiWiki
Jump to navigation Jump to search
Line 1: Line 1:
<h1>Tech Support</h1>
+
    '''Tech Support'''
 
+
--------------------------------
 
  Home Page      [[user:scott]]
 
  Home Page      [[user:scott]]
 
  Tech Support  [[user:scott/02]]
 
  Tech Support  [[user:scott/02]]
Line 14: Line 14:
  
 
<h5>PRINTME - /var/lib/freegeek-extras/printme</h5>
 
<h5>PRINTME - /var/lib/freegeek-extras/printme</h5>
 +
 +
=Password=
 
==Backup Password==
 
==Backup Password==
 
*cp /etc/shadow /etc/shadow.bak - (hash of root + user)
 
*cp /etc/shadow /etc/shadow.bak - (hash of root + user)
  
===Change Password===
+
==Change Password==
 
  passwd [username]
 
  passwd [username]
 
  passwd –e [username] – (change on startup)
 
  passwd –e [username] – (change on startup)
  
===Add / Delete User===
+
=User Add-Delete=
 
  adduser [username]
 
  adduser [username]
 
  adduser [username] admin
 
  adduser [username] admin
 
  userdel [username]
 
  userdel [username]
  
==Updates & Broken Packages==
+
=Updates & Broken Packages=
 
  apt-get update
 
  apt-get update
 
  apt-get dist-upgrade
 
  apt-get dist-upgrade
Line 36: Line 38:
 
  apt-get purge xxx
 
  apt-get purge xxx
  
==File System Check==
+
=File System Check=
 
  fsidk -l
 
  fsidk -l
  
Line 43: Line 45:
 
  shutdown -rF now (reboot, forcing fsck on root filesystem)
 
  shutdown -rF now (reboot, forcing fsck on root filesystem)
  
===Mount & un-Mount===
+
==Mount & un-Mount==
  
 
  df -h          (show partition booted from)
 
  df -h          (show partition booted from)
Line 53: Line 55:
 
  umount /dev/sdb1 (sudo)
 
  umount /dev/sdb1 (sudo)
  
===Badblocks===
+
==Badblocks==
 
  badblocks -nvs /dev/sda1
 
  badblocks -nvs /dev/sda1
  
==Backup Home Directory==
+
=Backup Home Directory=
 
*date (e.g. 20121223 for Dec 23 2012)  
 
*date (e.g. 20121223 for Dec 23 2012)  
===ssh into tsbackup===
+
==ssh into tsbackup==
 
  ssh XC tsbackup@tsbackup.fglan nautilus
 
  ssh XC tsbackup@tsbackup.fglan nautilus
 
  ctrl-c (to back-out)
 
  ctrl-c (to back-out)
===Backup===
+
==Backup==
 
  sudo cp /etc/passwd /etc/shadow /etc/group /home/
 
  sudo cp /etc/passwd /etc/shadow /etc/group /home/
 
  dpkg --get-selections > dpkg.out
 
  dpkg --get-selections > dpkg.out
Line 75: Line 77:
 
  dpkg --get-selections --admindir=/mnt/sdb1/var/lib/dpkg >dpkg.out
 
  dpkg --get-selections --admindir=/mnt/sdb1/var/lib/dpkg >dpkg.out
  
===Restore===
+
==Restore==
 
  sudo rsync -avzh  tsbackup@tsbackup:/var/tsbackup/[date-ticketnumber]/ /home
 
  sudo rsync -avzh  tsbackup@tsbackup:/var/tsbackup/[date-ticketnumber]/ /home
 
  sudo dpkg --set-selections < /home/dpkg.out
 
  sudo dpkg --set-selections < /home/dpkg.out
Line 82: Line 84:
 
  copy (user passwd) hash from original /etc/shadow
 
  copy (user passwd) hash from original /etc/shadow
  
===Restore User Permissions===
+
==Restore User Permissions==
 
*Create a New User (oem or Bob or Mark) - with Admin. Privileges
 
*Create a New User (oem or Bob or Mark) - with Admin. Privileges
 
**drwxr-xr-x 23 1001 1001 4096 2011-07-07 13:28 oem
 
**drwxr-xr-x 23 1001 1001 4096 2011-07-07 13:28 oem
 
  chown –R oem:oem /home/oem (recursively for all sub directories)
 
  chown –R oem:oem /home/oem (recursively for all sub directories)
  
==File Permissions==
+
=File Permissions=
  
 
  chmod 774 dir-name (dir)  rwxrwxr--
 
  chmod 774 dir-name (dir)  rwxrwxr--
Line 95: Line 97:
 
  chmod ugo-rwx /dir/file
 
  chmod ugo-rwx /dir/file
  
==Stress Test==
+
=Stress Test=
 
* [http://wiki.freegeek.org/index.php/CPU_Temperature CPU Temperature]
 
* [http://wiki.freegeek.org/index.php/CPU_Temperature CPU Temperature]
  
Line 104: Line 106:
 
*(add --hdd 2 to stress the hard drive as well, though this shouldn't be necessary)
 
*(add --hdd 2 to stress the hard drive as well, though this shouldn't be necessary)
  
==Hardware & Resource ID==
+
=Hardware & Resource ID=
===lshw===
+
==lshw==
 
  sudo lshw (hardware config)
 
  sudo lshw (hardware config)
===CPU===
+
==CPU==
 
  cat /proc/cpuinfo or more /proc/cpuinfo
 
  cat /proc/cpuinfo or more /proc/cpuinfo
===Disk Usage===
+
==Disk Usage==
 
  du -sh (-s disk usage)
 
  du -sh (-s disk usage)
 
  du -sh /home/bob/Downloads/ (disk usage for Downloads)
 
  du -sh /home/bob/Downloads/ (disk usage for Downloads)
===Available Memory===
+
 
 +
==Available Memory==
 
  free –l (available memory)
 
  free –l (available memory)
  
 
  cat /proc/meminfo
 
  cat /proc/meminfo
  
==Devices==
+
=Devices=
 
To see a list of devices currently in use
 
To see a list of devices currently in use
 
  cat /proc/devices
 
  cat /proc/devices
  
===AlsaMixer===
+
==AlsaMixer==
 
  alsamixer
 
  alsamixer
===Printer Drivers===
+
 
 +
==Printer Drivers==
 
  http://www.linuxfoundation.org/
 
  http://www.linuxfoundation.org/
 
  Workgroups -> Open Printing -> Printers
 
  Workgroups -> Open Printing -> Printers
===HPLIP===
+
 
 +
==HPLIP==
 
  http://hplipopensource.com/hplip-web/downloads.html
 
  http://hplipopensource.com/hplip-web/downloads.html

Revision as of 21:15, 20 October 2011

   Tech Support
--------------------------------
Home Page      user:scott
Tech Support   user:scott/02
Dir & Files    user:scott/03
Network        user:scott/04
Troubleshoot   user:scott/05
Laptops        user:scott/06
Resources      user:scott/07
Notes          user:scott/08 

Template:TOC limit

PRINTME - /var/lib/freegeek-extras/printme

Password

Backup Password

  • cp /etc/shadow /etc/shadow.bak - (hash of root + user)

Change Password

passwd [username]
passwd –e [username] – (change on startup)

User Add-Delete

adduser [username]
adduser [username] admin
userdel [username]

Updates & Broken Packages

apt-get update
apt-get dist-upgrade
apt-get install --fix-broken
apt-get autoremove
apt-get install ubuntu-desktop
apt-get purge xxx

File System Check

fsidk -l
fsck -fyv /dev/sda1 (f=force y=fix)
shutdown -rF now (reboot, forcing fsck on root filesystem)

Mount & un-Mount

df -h          (show partition booted from)
ls /media      (mounted from GUI)
cat /etc/fstab (partitions and devices = mount on start-up)
mount /dev/sdb1 /mnt/xxx
umount /dev/sdb1 (sudo)

Badblocks

badblocks -nvs /dev/sda1

Backup Home Directory

  • date (e.g. 20121223 for Dec 23 2012)

ssh into tsbackup

ssh XC tsbackup@tsbackup.fglan nautilus
ctrl-c (to back-out)

Backup

sudo cp /etc/passwd /etc/shadow /etc/group /home/
dpkg --get-selections > dpkg.out
sudo mv dpkg.out /home/
sudo tar -czf /home/etc.backup.tar.gz /etc/
sudo rsync -avzh /home/ tsbackup@tsbackup:/var/tsbackup/[date-ticketnumber] 2>rsync.log
View error log less rsync.log
Note: on the '''data recovery box''' you will need to add /mnt/sdb1 in front of /home 
      this avoids the need to chroot.
dpkg --get-selections --admindir=/mnt/sdb1/var/lib/dpkg >dpkg.out

Restore

sudo rsync -avzh  tsbackup@tsbackup:/var/tsbackup/[date-ticketnumber]/ /home
sudo dpkg --set-selections < /home/dpkg.out
sudo apt-get -u dselect-upgrade
copy (user passwd) hash from original /etc/shadow

Restore User Permissions

  • Create a New User (oem or Bob or Mark) - with Admin. Privileges
    • drwxr-xr-x 23 1001 1001 4096 2011-07-07 13:28 oem
chown –R oem:oem /home/oem (recursively for all sub directories)

File Permissions

chmod 774 dir-name (dir)   rwxrwxr--
chmod 664 filename (files) rw-rw-r--
chmod ugo+rwx /dir/file
chmod ugo-rwx /dir/file

Stress Test

while  true  ; do uptime ; sensors ; sleep 30s; done | tee temp_load.log
stress --cpu 8 --io 4 --vm  2 --vm-bytes 128M  --timeout 4h
  • (add --hdd 2 to stress the hard drive as well, though this shouldn't be necessary)

Hardware & Resource ID

lshw

sudo lshw (hardware config)

CPU

cat /proc/cpuinfo or more /proc/cpuinfo

Disk Usage

du -sh (-s disk usage)
du -sh /home/bob/Downloads/ (disk usage for Downloads)

Available Memory

free –l (available memory)
cat /proc/meminfo

Devices

To see a list of devices currently in use

cat /proc/devices

AlsaMixer

alsamixer

Printer Drivers

http://www.linuxfoundation.org/
Workgroups -> Open Printing -> Printers

HPLIP

http://hplipopensource.com/hplip-web/downloads.html