| 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 |
context.shadowColor = "colorname" //string
context.shadowOffsetX = 0; // interger
context.shadowOffsetY = 0; // integer
context.shadowBlur=15; //integer
dd if=/home/image.img of=/dev/sdd bs=4M conv=noerror,sync status=progress
ls -d pass* ... will list only local files prefix pass *
To display Canvas border properly in IE10 had to add meta tag to force it to ie10
GREP -FiR "searchterm" *
| 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 |
| Go to EOL | $ |
| Delete to the end of line | d$ |
| Jump to next word | w |
| Jump back one word | b |
| :e space Ctrl-D | list 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 |
Edit /etc/pam.d/common-session-noninteractive: Find line: session rquired pam_unix.so and before it add the following session [success=1 default=ignore] pam_succeed_if.so service in cron quiet use_uid service cron restart
|
| |
|---|---|
| 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 size | <dpkg-query -Wf'${Installed-Size}\t${Package}\n' | sort -nr | more |
| Clean after removing | apt-get clean and apt-get autoremove |
| List all installed by package | dpkg -L alsa=utils |
| List installed | dpkg --get-selections |
| Create list of installed | dpkg --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. | |
| PS Command |
|---|
| ps -eo comm,etime,user | grep cp |
| ps -eo comm,etime,%cpu,user | grep 2345 |
| ps -eo pid,cmd,%mem,%cpu,user --sort=-%mem | head |