MyBashHistory v52

in #linux8 years ago (edited)

debian.png
Image source: Willi Glenz - MyDebianDesktop


INCUBATOR
20180801 $ dstat
20180731 # rkhunter --check --sk
20180731 # vim /etc/adduser.conf
20180730 # find / -uid 1000 -exec chown -v 1002:1002 {} \;
20180730 $ type echo 
20180730 $ type date
20180729 Debian Download     $ w3m https://www.debian.org/distrib/netinst#smallcd
20180728 $ w3m https://www.veracrypt.fr/en/Documentation.html


LIFECYLE MANAGEMENT
INSTALLATION
# apt-get install hwinfo espeak gkrellm powertop aview guake vim taskwarrior mc sudo vym backintime-qt4
# apt-get install libreoffice
$ apt-cache show vlc | less
$ lsb_release -a
# htop
# atop

CONFIGURATION
$ vim ~/.bashrc
> export PATH=$HOME/scripts:$PATH
> alias c='clear; ncal -3wy'        
$ . ~/.bashrc
# update-alternatives --config editor
$ w3m https://www.raspberrypi.org/documentation/configuration/
# raspi-config

UPDATE
# apt-get update && apt-get upgrade && apt-get dist-upgrade
# rpi-update

SECURITY & TROUBLESHOOTING & MONITORING
# rkhunter --check --sk
$ dstat
$ efibootmgr
# dmesg --level=err,warn -T
$ w3m https://www.debian.org/News/2018
$ w3m https://www.debian.org/security/#DSAS

BACKUP & RESTORE
$ archivemount archive.tar.gz ~/mnt/
# dd if=/dev/sdABC of=/dev/sdXYZ bs=64K conv=noerror,sync
$ tar -cvzf ~/backup/backup.tar.gz ~/java
$ tar -tvf backup.tar.gz 
$ rsync -avzh --stats /media/abc/ /media/xyz
$ ssh [email protected] "tar -zcf - /home/user/scripte" > scripte.tar.gz


HARDWARE MANAGEMENT
$ mount | column -t
# hwinfo --short | less
# hwinfo --disk
# lshw -short | less
# fdisk -l
$ cat /sys/devices/virtual/thermal/thermal_zone0/temp

SOURCES
* Linux on the Road     $ w3m http://www.tldp.org/LDP/Mobile-Guide/html/index.html
* Raspberry Pi          $ w3m https://www.raspberrypi.org/documentation


FILE MANAGEMENT
$ df -hT
$ du -h --max-depth=1 | sort -rh
$ du -b --max-depth 1 | sort -nr | perl -pe 's{([0-9]+)}{sprintf "%.1f%s", $1>=2**30? ($1/2**30, "G"): $1>=2**20? ($1/2**20, "M"): $1>=2**10? ($1/2**10, "K"): ($1, "")}e'
# find /home -user userxyz -size +1G
# find /home -user userxyz -mtime -3
$ find . -name "*.jpg" -exec convert {} -scale 50% +repage {} \;
# find / -user userxyz -type f -exec rm -f {} \;
# visudo
$ man hier
$ for x in *; do mv "$x" "${x,,}"; done
# chown userXYZ file.txt
$ java -jar filename.jar

SECURITY
* VeraCrypt     $ w3m https://www.veracrypt.fr/en/Documentation.html


USER MANAGEMENT
# adduser user2
# useradd -D
# usermod -c "TestUser" user2
# userdel -r user2
# find /home -uid 1000 | wc -l
# find /home -uid 1000 | tee 1000-files.txt
# find / -uid 1000 -exec chown -v 1002:1002 {} \;
$ ls -l /etc/skel
$ id -u user1
$ id -u root
$ id user1
# passwd user1
# chown -R user2:user2 /home/user1

TOOLS
* useradd - userdel - usermod - adduser 
* groupadd - groupdel - groupmod - addgroup

CONFIGURATION
$ vim $HOME/.bashrc
$ vim $HOME/.profile
# vim /etc/group
# vim /etc/passwd
# vim /etc/profile
# vim /etc/shadow
# vim /etc/adduser.conf
# vim /etc/default/useradd 


SYSTEM MANAGEMENT
$ history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
$ gnome-<tab><tab>
# ls<tab><tab>
# init 0
# shutdown -r now
# shutdown -c
# shutdown -h 1:00
$ cat /etc/shells
$ uptime
$ uname -v
$ unset HISTFILE

MONITORING
$ dstat
$ whowatch
$ w
$ w3m https://www.zabbix.com
# tail -f /var/log/messages
# less +F /var/log/messages
$ ps hax -o user | sort | uniq -c
$ free -h
$ xload -update 1 -nolabel &
# cat /var/log/messages | awk '{print substr($0,0,12)}' | uniq -c | sort -nr | awk '{printf("\n%s ",$0) ; for (i = 0; i<$1 ; i++) {printf("*")};}' | less

TIME
# vim /etc/crontab
$ ls -l /etc/cron* | less

KERNEL
$ w3m https://www.kernel.org
$ lsmod | wc -l

EDITOR
$ EDITOR=/usr/bin/vim
$ VISUAL=$EDITOR
$ export EDITOR VISUAL
# update-alternatives --config editor
$ w3m https://linux.die.net/man/1/vim
$ vimtutor
$ vim Main.java
$ Strg-x e

MULTIMEDIA
$ mpg123 -zvC /home/user/music/*
$ youtube-dl --list-formats https://a.b/XlytFabwHZs


NETWORK MANAGEMENT
# arp-scan 192.168.0.0/24
# iw dev wlan0 scan | egrep "SSID|signal" | awk -F ":" '{print $2}' | sed 'N;s/\n/:/' | sort
$ w3m myip.is
$ curl ifconfig.me
$ mtr --curses google.com
# netstat -tulpn
$ netstat -a | less
$ nmap --iflist
# ifconfig -a | grep -Po '\b(?!255)(?:\d{1,3}\.){3}(?!255)\d{1,3}\b' | xargs nmap -A -p0-
$ ssh -X [email protected]
$ python -m SimpleHTTPServer

CONFIGURATION
# vim /etc/ssh/ssh_config
# vim /etc/hosts

DOCUMENTATION
$ w3m http://www.linuxhowtos.org/Security/understandssh.htm
$ w3m https://linux.die.net/Intro-Linux/chap_10.html


TASKWARRIOR
INSTALLATION & CONFIGURATION
$ w3m https://linux.die.net/man/1/task
$ apt-cache search taskwarrior
$ apt-cache show taskwarrior
# apt-get install taskwarrior
$ vim ~.taskrc

BASIC TASK MANAGEMENT
$ task
$ task add Task1
$ task add Task2
$ task
$ task 1 modify priority:H
$ task 1 modify due:eow
$ task 1 start
$ task 1 stop
$ task 1 information
$ task
$ task 1 done
$ task 2 delete
$ task
$ task burndown
$ alias t='clear; task'
$ alias t1='clear; task burndown.daily'

DOCUMENTATION
$ man task
$ w3m https://taskwarrior.org
$ w3m https://taskwarrior.org/docs
$ w3m https://taskwarrior.org/docs/30second.html
$ w3m https://linux.die.net/man/1/task


SOURCES
LINUX
* TLDP                  $ w3m http://www.tldp.org
* Tecmint               $ w3m https://www.tecmint.com/linux-commands-cheat-sheet/
* LinuxLinks            $ w3m https://www.linuxlinks.com
* Intro to Linux        $ w3m http://www.tldp.org/LDP/intro-linux/html/index.html

DEBIAN
* Debian Homepage       $ w3m https://www.debian.org -dump | less
* Debian Download       $ w3m https://www.debian.org/distrib/netinst#smallcd
* Debian Handbook       # apt-get install debian-handbook
* Debian Reference      # apt-get install debian-reference-en
* Debian Wiki           $ w3m https://wiki.debian.org/FrontPage
* Distrowatch           $ w3m https://distrowatch.com/table.php?distribution=debian
* Refcard               # apt-get install debian-refcard
* Refcard               $ dpkg -L debian-refcard
* Refcard               $ w3m /usr/share/doc/debian-refcard/index.html

SHELL
* BBG                   $ w3m http://www.tldp.org/LDP/Bash-Beginners-Guide/html/index.html
* ABS                   $ w3m http://www.tldp.org/LDP/abs/html/index.html
* Die.net               $ w3m https://www.die.net
* Pure Bash Bible       $ w3m https://github.com/dylanaraps/pure-bash-bible
* Commandlinefu.com     $ w3m https://www.commandlinefu.com
* Command-Line-Tools    $ w3m http://www.tldp.org/LDP/GNU-Linux-Tools-Summary/html/index.html
* MAN Pages             $ man -t man | ps2pdf - man.pdf
* MAN Pages             $ man -k scanner
* MAN Pages             $ apropos . | shuf -n 1 | awk '{print$1}' | xargs man
* CheatSheet            $ curl cheat.sh

DESKTOP
* Gimp                  $ w3m https://www.gimp.org  
* LibeOffice            $ w3m https://www.libreoffice.org
* Scribus               $ w3m https://www.scribus.net

WEATHER
$ curl wttr.in/~wasserkuppe?lang=de
$ curl wttr.in/bad+kissingen?lang=de
$ curl wttr.in/fulda?lang=de
$ curl wttr.in/~odenwald+reichelsheim?lang=de
$ curl wttr.in/~valletta
$ curl wttr.in/:help

BITCOIN
$ curl rate.sx

Coin Marketplace

STEEM 0.05
TRX 0.32
JST 0.078
BTC 66831.29
ETH 1826.86
USDT 1.00
SBD 0.42