MyBashHistory v62

in #linux6 years ago

debian.png
Image source: Willi Glenz - MyDebianDesktop


INCUBATOR
20180812 Introduction to R Programming $ w3m https://youtu.be/92zCRV3eQxw
20180812 $ tuptime
20180811 $ cut -d: -f1 < /etc/passwd | sort | xargs
20180811 $ w3m http://chortle.ccsu.edu/java5/index.html
20180811 $ w3m https://www.tutorialspoint.com/java/index.htm
~~~
20180809 $ vim ~/.vimrc
" GENERAL
syntax on
set number
set ruler
"set hls
set background=dark
set encoding=utf8
set mouse=a

" INDENT
set autoindent

" TABs
set tabstop=3
set softtabstop=3
set shiftwidth=3
set expandtab

" MAPs
nmap <leader>w :w!<cr>
map <F2> :echo 'Current time is ' . strftime('%c')<CR>
~~~
20180807 $ nmap -sP 192.168.1.0/24
20180806 # tail -fvn 25 /var/log/messages
20180806 $ w3m https://www.raspberrypi.org/downloads/raspbian/
20180805 $ sshfs name@server:/path/to/folder /path/to/mount/point
20180804 $ vmstat 2 10
20180804 # ifconfig eth0 down | up


LIFECYLE MANAGEMENT
INSTALLATION
* Raspberry Pi $ w3m https://www.raspberrypi.org/downloads/raspbian/
* Debian       $ w3m https://www.debian.org/distrib/netinst#smallcd
* Tools        # apt-get install hwinfo espeak gkrellm powertop aview guake vim taskwarrior mc sudo vym backintime-qt4
* Desktop      # apt-get install libreoffice
$ apt-cache show vlc | less
$ lsb_release -a

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

UPDATE & SECURITY
# apt-get update && apt-get upgrade && apt-get dist-upgrade
# rpi-update
# chkrootkit
# rkhunter --check --sk
$ w3m https://www.debian.org/News/2018
$ w3m https://www.debian.org/security/#DSAS
$ w3m https://www.veracrypt.fr/en/Documentation.html

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
TOOLS
* fdisk - hwinfo - lshw - mount

$ 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
TOOLS
* chown - df - du - find - veracrypt - vim

# chown userXYZ file.txt
$ 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 / -uid 1000 -exec chown -v 1002:1002 {} \;
$ find . -name "*.jpg" -exec convert {} -scale 50% +repage {} \;
# find / -user userxyz -type f -exec rm -f {} \;
# visudo
$ for x in *; do mv "$x" "${x,,}"; done
$ java -jar filename.jar
$ type echo 
$ type date
$ man hier

VIM
$ EDITOR=/usr/bin/vim
$ VISUAL=$EDITOR
$ export EDITOR VISUAL
# update-alternatives --config editor
$ vimtutor
$ vim Main.java
$ Strg-x e
$ w3m https://linux.die.net/man/1/vim
$ w3m https://www.vim.org
~/.vimrc
" GENERAL
syntax on
set number
set ruler
"set hls
set background=dark
set encoding=utf8
set mouse=a
" INDENT
set autoindent
" TABs
set tabstop=3
set softtabstop=3
set shiftwidth=3
set expandtab
" MAPs
nmap <leader>w :w!<cr>
map <F2> :echo 'Current time is ' . strftime('%c')<CR>

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
$ cut -d: -f1 < /etc/passwd | sort | xargs

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 

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


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$ uname -v
$ unset HISTFILE

MONITORING
$ uptime
$ tuptime
$ top
# atop
# htop
$ vmstat 2 10
$ dstat
$ whowatch
$ w
# tail -f /var/log/messages
# tail -fvn 25 /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
$ w3m https://www.zabbix.com
$ dstat -f 60 24
# dmesg --level=err,warn -T
$ efibootmgr

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

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

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


NETWORK MANAGEMENT
$ speedometer -r eth0
# arp-scan 192.168.0.0/24
# iw dev wlan0 scan | egrep "SSID|signal" | awk -F ":" '{print $2}' | sed 'N;s/\n/:/' | sort
$ curl ifconfig.me
$ mtr --curses google.com
# netstat -tulpn
$ netstat -a | less
# 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
$ w3m myip.is

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

HOSTS
$ sshfs name@server:/path/to/folder /path/to/mount/point
$ ip a
# ifconfig eth0 down | up
$ nmap --iflist
$ nmap -A -T4 192.168.0.199
$ nmap -sP 192.168.1.0/24

ROUTING
$ nmap --iflist
$ ip -r

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


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

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
TUTORIALS
* Java - Tutorialspoint      $ w3m https://www.tutorialspoint.com/java/index.htm
* Java - Bradley Kjell       $ w3m http://chortle.ccsu.edu/java5/index.html
* R - Introduction to R Programming $ w3m https://youtu.be/92zCRV3eQxw

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.30
TRX 0.12
JST 0.034
BTC 63688.35
ETH 3125.30
USDT 1.00
SBD 3.97