Linux Spick

apache2
  • sudo /etc/init.d/apache2 stop oder start
  • logs sieht man mit tail /var/log/apache2/error.log
  • /etc/apache2/httpd.conf enthält die primäre Config
Disk Cleanup
  1. synaptic package manager → settings → files: delete cached package files (und Anpassen, dass er nicht mehr solange cache'd) ⇒ 1GB
  2. update manager → view → linux kernels: alte löschen (ausser letzem und aktivem) ⇒ 4GB (400MB pro Kernel)
  3. ~/.gimp2-8/swap.. gelöscht &rARR; 1.1GB
hardware
  • sudo lshw -html > hardware.html ganze config
interrupts statistic: while true ; do { { date; cat /proc/interrupts ; } >>int.txt ; sleep 60 ; } done
log tail /var/log/syslog
mount
  • mount | grep windows
  • cat /etc/fstab
  • sudo mount -o remount,rw /windows windows rw mounten (oder ro
  • mount wlkl.ch ftps sftp://wlkl.ch@wlkl.ch:5544/
    • sshfs 'wlkl.ch@login-97.hoststar.ch:' /media/walter/wlklSftp -p 5544 -o sshfs_debug -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -d -d=debug switches to foreground mode
    • ftp curlftpfs ftp://web15:pw@wlkl.ch/ /wlklFtp
  • mount spwallisellen ftps
    • sshfs 'spwallisellen.ch@login-2.hoststar.ch/:' /media/walter/spwSftp -p 5544 -o sshfs_debug -d -d=debug switches to foreground mode
      • sudo umount /media/walter/spwSftp
      • mkdir /media/walter/spwSftp
    • ftp: curlftpfs 'ftp://spwallisellen.ch:pw@login-2.hoststar.ch/' /spwFtp
NTFS flicken
  • sudo fdisk -l und device Namen merken
  • sudo ntfsfix /dev/<device name>!
rdiff-backup
  • rdiff-backup -l /wkArchive/backupData/pc/cmp.php list increment (timestamps) for given file/directory
  • sudo rdiff-backup -r 2019-02-19T11:11:28+01:00 /wkArchive/backupData/pc tmp restore source dir/file from given time to tmp
rsync
  • sudo rsync -rlptD --del /media/walter/Seagate1805/fromElements/backupAll/ /media/walter/Element0805/backupAll/
    • -a abbreviates -rlptgoD however gives chown or chgrp Operation not permitted (1) errors (although sudo, but reason is probably that destination is Fat32, which has neither owner nor group), thus without -og
  • test to synchronize directories (only files and directories, ignore links) ==> cd /wkData/pc; rm -r tstC/*; cp -ar tstOri/cmp1 tstOri/cmp2 tstC/
    • update cmp1 to equal cmp2 rsync -niir --del tstC/cmp2/ tstC/cmp1/ (-n == --dry-run)
  • test to create a directory cmpD, with only the updates from cmp1 to cmp2 rm -r tstC/cmpD
    • rsync -ndiir --prune-empty-dirs --del --compare-dest=../cmp1/ tstC/cmp2/ tstC/cmpD/ but we get two problems
      • the things to delete art not even mentioned
      • empty dirs are created, inspite of --prune-empty-dirs
shell
  • Man:bash
  • fc -e xed -999 0 edit history - contents of file will be executed at exit! (or set FCEDIT=xed in bash .profile)
sudo sysctl vm.swappiness=0 swap ausschalten
top display of current system usage, cpu% per task etc, with many configuration and manipulation commands
  • top -b -d5 > top5 batchmode, delay=5sec ouput to file
USB
  • lsusb nur USBs anzeigen
  • sudo lshw -html > hardware.html ganze config
  • seatools auf windows für Seagate USB External drive diagnostics
wk13
uname -a current kernel version etc.