Don't forget page




 Devuan Restart Plasmashell
    Alt-F2     Will launch krunner
    kwin kstart     kwin occasionally hangs and this is the way to fix it.
    plasmashell --replace     this shuld fix disappearing panel problem


Gentoo Hardened PaX Utilities Information

    scanelf -x -p -e -n /



 Feh
    feh -Z -FD6 -z -s --draw=exif -d -f /home/jacek/list.txt     show all pics from list.txt go next 6 sconds after
    feh -U -f /home/jacek/list.txt /home/jacek/Pictures     Create list
    feh -U -r -f /home/jacek/lista.txt /3TB/Pictures    


 Find why out of space
   
 sudo du / 2>/dev/null | sort -g -r | head -n 100 
    show 100 largest in sorted order
   
 sudo find / -type f -size +1M -exec stat -c '%s %n' "{}"\; | sort -g -r 
    this does not work - missing argument to exec ... fix it
   
 find / -type f -size +1M
    this will find large files
       


 Devuan printing
   lpstat -p -d    find printers
   lpoptions -d MFC9130CW    set as default
   lpq    to see if it is default
   lp /home/hd.txt    to print hd.txt

_____________________________________________________________________________

 
tmux 
ctrl-b
" horizontal split
% vertical split
left/right arrow switch right/left
Ctrl-b x y close current pane
up/down arrow switch up/down
Alt+right+right arrow key resize ?
: command mode
d detach
c create
p or n previous / next
w choose session regardless of
    terminal session

_____________________________________________________________________________

_____________________________________________________________________________



_____________________________________________________________________________


_____________________________________________________________________________

_____________________________________________________________________________

_____________________________________________________________________________

______________________________________________________________________________


Mount, unmount, check disk for errors etc.

____________________________________________________________________________


DD write image to sd card

dd if=/home/image.img of=/dev/sdd bs=4096 conv=noerror,sync status=progress


DD backup image from SD to file in /12TB/images folder


dd if=/12TB/images/my_image.img of=dev/dev/sdd bs=4096 conv=noerror,sync status=progress

____________________________________________________________________________

Esc+i or Fn+i -----> insert on in VIM on MAC

To display Canvas border properly in IE10 had to add meta tag to force it to ie10


Apache restart etc

___________________________________________________________________________

__________________________________________________________________________


_________________________________________________________________________


_________________________________________________________________________

_________________________________________________________________________

    
    

_________________________________________________________________________

>TR>
VIM
search/replace all instances of string: %s/mystring/mynewstring/g
Search/replace: %s/swiki trzy/pieprzone swinki trzy/g
Search forward :/pattern ... press 'n' for next
Search backward :/pattern ... press 'N' for previous
Disable highlight last search :nohl
Go to EOL $
Delete to the end of lined$
Jump to next word w
Jump back one word b
Jump half page down or up Ctrl-d or Ctrl-b
:e space Ctrl-Dlist file names in current dir
 
Create Fold zf
open zo
close zc
delete zd
Fold from current 20 lines down :,+20fo
Fold 10 lines down zf10j
Fold 5 lines up zf10k
Fold from current up 4 lines :,-5fo
Disable/Enable highlight matched braces :NoMatchParen or DoMatchParen
/usr/share/vim/vim81/syntax contains available color files
syntax on
:color ... and press tab to see
    what colors are available
<

__________________________________________________________________________



 
 
Find all groups on the system more /etc/group
Delete user userdel user-name
Add user Adduser user-name
Delete user userdel user-name
Set user password passwd user-name
Assign to group usermod -G group1 group2 group3 user-name
List groups user is assigned to groups user-name
Add to groups user is assigned to usermod -a -G group-name user-name
Assign to group usermod -G primary-group, sambashare, sales, service, sarahh user-name
  comma separated no spaces
Set Samba password smbpasswd -a user-name
List users cut -d: -f1 /etc/passwd
change ownership of the file to another group chgrp group-name /1TBdisk2/sales/doc.txt
Test smb.conf for errors testparm
Secure Copy scp -rC user@192.168.1.23:/home/somedirectory/* /home/currentlocation/   
Vim copy/paste v, V - visual line y-copy p-paste
service --status-all      + means running
     - means it is not
     ? no status provided by service
Remove directory rm -rf folder-name
Truncate file end of file truncate some.log --size 4



Find Command
find /user /home -name "*.txt" -type file in directories /user and /home
find / -type d -iname 'WoJtek*' >> /home/jacek/mylist.txt all directories names with string WoJteki - send output to
  mylist.txt -name = not case sensitive
find . -name "*.py" -ctime -2 in current directory all .py created in the last two days
find . -mmin +0 -mmin -50 in current directory modified in the last 50 min
find . -type f -name "badfile" -exec rm {} \; remove after find
find / -name "*.gz"i -exec zgrep "myString" {} \; look for all gz files and find myString
find . -name "*.html" -exec grep -l w3 {} \; look for string w3 in all html files in current directory
find . -name "*.html" -exec grep -l mytext {} \; find all files one at a time containing mytext string
    -exec requires an argument .... space after {} is missing
<
Package Management
List Installed sorted by sizedpkg-query -Wf'${Installed-Size}\t${Package}\n' | sort -nr | more
Clean after removingapt-get clean and apt-get autoremove
List all installed by packagedpkg -L alsa=utils
List installeddpkg --get-selections
Create list of installeddpkg --get-selections > /home/package-selection-list
list can be moved to another wkst. and installed there with the following
apt install $(cat /home/package-selection-list | awk '{print $1}' )
above will run install and feed the content of list but only use first column from it.

_________________________________________________________________________

_________________________________________________________________________