LINUXOPOLIS #10 • Debian
A short summary of building a personal Linux "habitat".
Published with SteemPeak
UPDATE #10
019 DEBIAN
Homepage : debian.org
Download : debian.org/distrib/netinst#smallcd
Tutorials : debiantutorials.com
DistroWatch : distrowatch.com/table.php?distribution=debian
w3Tech : w3techs.com
Debian News : debian.org/News
Debian Security : debian.org/security/#DSAS
Debian Version $ cat /etc/debian_version
Package Documentation : /usr/share/doc
Sources List Generator : debgen.simplylinux.ch
Debian Backports : backports.org
DOCUMENTATION
• Documentation : debian.org/doc
• Installation Guide : debian.org/releases/stable/amd64/
• Release Notes : debian.org/releases/stable/amd64/release-notes/
• FAQ : debian.org/doc/manuals/debian-faq/
• Wiki : wiki.debian.org/FrontPage
• Debian & Java : debian.org/doc/manuals/debian-java-faq/index.en.html
• Securing Debian : debian.org/doc/manuals/securing-debian-howto/index.en.html
• Menu System : debian.org/doc/packaging-manuals/menu.html/ch1.html
• Networking HowTo : tldp.org/HOWTO/NET3-4-HOWTO.html
• Gnome : help.gnome.org
• Reference Card # apt install debian-refcard
$ dpkg -L debian-refcard | less
$ w3m /usr/share/doc/debian-refcard/index.html
• Reference : debian.org/doc/manuals/debian-reference/
# apt install debian-reference-en
$ dpkg -L debian-reference-en
$ w3m /usr/share/doc/debian-reference/docs/index.en.html
• Handbook : debian.org/doc/manuals/debian-handbook/
# apt install debian-handbook
$ dpkg -L debian-handbook | less
$ w3m /usr/share/doc/debian-handbook/html/en-US/index.html
018 • SCREEN
# apt install screen
DOCUMENTATION
$ man screen
$ w3m gnu.org/software/screen/manual/screen.html
• ctrl a? : Keybindings
SESSIONS
$ screen -S firstsession glances
$ screen -X -S firstsession quit
$ screen -ls : List screen sessions
$ screen -r : Reattaching
$ screen -x : Attach to a not detached screen session
• ctrl ad : Detach session
• ctrl ax : Lock session
WINDOWS
• ctrl ac : Create window
• ctrl aA : Rename window
• ctrl aa : Toggle window
• ctrl a[0 .. 9] : Toggle window
• ctrl a| : Split window vertically
• ctrl aS : Split window horizontally
• ctrl aX : Kill pane
• ctrl an : Next window
• ctrl ap : Previous window
• ctrl ak : Kill window
• ctrl a\ : Kill all windows
• ctrl aw : Window bar
• ctrl a" : Window list
• ctrl ah : Hardcopy
EXAMPLE
$ screen -S firstsession
• ctrl aS
• ctrl a|
$ htop
• ctrl a<tab>
• ctrl ac
$ atop
• ctrl <tab>
• ctrl ac
$ df -hT
CONFIGURATION
# vim /etc/screenrc
$ vim ~/.screenrc
017 • SHORTCUTS
DAILY USE
• <ctrl>+z fg bg jobs <ctrl>+u <ctrl>+k <ctrl>+w <alt>+. <bash-vim-mode>
CHARACTER
• ctrl f : Move forward one character
• ctrl b : Move backward one character
• ctrl h : Generate a backspace character
• ctrl d : Delete one character
EDITOR
• ctrl xe : Editor
DESKTOP
• alt F2 : Run Command
HISTORY
• ctrl r : Search from history searching mode
• ctrl g : Escape from history searching mode
• alt . : Use the last word of the previous command
LINE
• esc # : Making the line a comment
• ctrl a : Go to the beginning of the line
• ctrl e : Go to the end of the line
• ctrl xx : Move between start of commandline and current position and back again
• ctrl eu : Clear the line
• ctrl k : Delete from cursor to the end of the line
• ctrl u : Delete from cursor to the start of the line
TERMINAL
$ gnome-terminal
• ctrl alt F3
• reset : Reset the terminal
• ctrl d or exit : Exit the terminal
• shutdown -h now : Shut down the system
SCREEN
• ctrl +- : Size
• ctrl l : Clear the screen
• ctrl s : Stop output to the screen
• ctrl q : Allow output to the screen
016 • LINUX-FROM-SCRATCH (LFS)
• Homepage : linuxfromscratch.org/lfs/index.html
• Download : linuxfromscratch.org/lfs/downloads/stable/
• Online-Book : linuxfromscratch.org/lfs/view/stable/
• DistroWatch : distrowatch.com/table.php?distribution=lfs
PROJECTS
• Linux From Scratch : linuxfromscratch.org/lfs/
• Beyond Linux From Scratch : linuxfromscratch.org/blfs/
• Automated Linux From Scratch : linuxfromscratch.org/alfs/
• Cross Linux From Scratch : trac.clfs.org/
STEPS
03 Virtualbox : # apt install virtualbox
02 Debian Live-CD : cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/
01 RTFM : linuxfromscratch.org/lfs/view/stable/
015 • TOOLBOX
# apt install ...
A - alacarte atop aview
B - backintime-qt4 bluefish boostnote
C - calcurse clipit cherrytree cmus
E - espeak
F - firmware-iwlwifi firmware-realtek focuswriter fzf
G - gdebi gkrellm glances gnome-clocks gnome-do gparted grsync guake
H - htop hwinfo
I - inxi i3-wm
K - kismet
L - libreoffice links lsd lvm2
M - mc menulibre
N - netcat net-tools nmap
P - powertop printer-driver-cups
R - ranger
S - screen sudo syncthing
T - taskwarrior terminator timeshift timewarrior tripwire
V - veracrypt* vim virtualbox vym
W - w3m
Y - youtube-dl
014 • EDITOR
# apt install vim ctags vim-doc vim-scripts
# update-alternatives --config editor
$ vim ~/.bashrc
> EDITOR=/usr/bin/vim
> VISUAL=$EDITOR
> export EDITOR VISUAL
013 • BASHRC
$ vim ~/.bashrc
> HISTCONTROL=ignoreboth:erasedups
> alias h='clear; echo; history 30; echo'
> set -o vi
> bind -m vi-insert "\C-l":clear-screen
> EDITOR=/usr/bin/vim
> VISUAL=$EDITOR
> export EDITOR VISUAL
012 • VIM
:call matchadd('colorColumn', '\%81v', 100)
011 • FUZZI FINDER
$ fzf -e --preview 'head -100 {}'
010 CRYPTOCURRENCIES
$ curl rate.sx
$ curl rate.sx/btc@3d
$ curl rate.sx/steem@3d
009 • /ETC/FSTAB
# blkid
# vim /etc/fstab
> #RAMDISK
> none /media/ramdisk tmpfs nodev,nosuid,noexec,nodiratime,size=1024M 0 0
008 • ALIASES
$ vim ~/.bashrc
> a='clear; echo; alias; echo'
> b='buku'
> c='clear; echo'
> cc='clear; ncal -3wy'
> cdh='\cd; clear; echo; lsd -l; echo'
> cdd='clear; \cd ~/Dropbox; echo; lsd -l; echo'
> cdp='clear; \cd ~/.phoenix; echo; lsd -l; echo'
> e='clear; cd ~/Apps; ./eclipse &'
> g='clear; glances'
> l='clear; echo; lsd -l; echo'
> ls='clear; echo; lsd -l; echo'
> p='(clear; \cd ~/.phoenix; java -jar phoenix.jar)'
> u='clear; sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade; sudo apt-get autoremove -y'
> h='clear; history 30'
> ra='clear; \cd ~/Dropbox; ranger'
> rs='clear; rsync -avzP --delete --stats --exclude-from "/home/user/.exclude.txt" /home/user/ /media/disk/'
> s='clear; curl rate.sx/steem@1d; gnome-screenshot -ac'
> t='clear; task; timew week; timew summary'
> tt='clear; task burndown.daily'
> ttt='clear; task calendar 2019'
> tw='timew'
> tm='clear; timew month'
> py='clear; python3'
007 • RAM-DISK PERMANENT
# mkdir -p /media/ramdisk
# vim /etc/fstab
> none /media/ramdisk tmpfs nodev,nosuid,noexec,nodiratime,size=1024M 0 0
# mount -a
$ mount | column -t
006 • RAM-DISK TEMPORARY
# mkdir -p /media/ramdisk
$ mount | column -t
# mount -t tmpfs -o size=1024M tmpfs /media/ramdisk
# mount -a
$ mount | column -t
005 • SOURCES.LIST FOR DEBIAN-STRETCH
• # vim /etc/apt/sources.list
• # Security updates
• deb http://security.debian.org/debian-security stretch/updates main contrib non-free
• deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free
• # Base repository
• deb http://ftp.de.debian.org/debian/ stretch main contrib non-free
• deb-src http://ftp.de.debian.org/debian/ stretch main contrib non-free
• # Stable updates
• deb http://ftp.de.debian.org/debian/ stretch-updates main contrib non-free
• deb-src http://ftp.de.debian.org/debian/ stretch-updates main contrib non-free
• # Stable backports
• deb http://ftp.debian.org/debian stretch-backports main contrib non-free
• deb-src http://ftp.debian.org/debian stretch-backports main contrib non-free
• # Virtualbox
• deb https://download.virtualbox.org/virtualbox/debian stretch contrib
004 • SYSTEM UPDATE AND UPGRADE
alias u='clear; sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade; sudo apt-get autoremove -y'
003 • TWEAK TOOL FOR GNOME
# apt install dconf-editor && apt show dconf-editor
/org/gnome/terminal/legacy/default-show-menubar
002 • TWEAK TOOL FOR GNOME
# apt install gnome-tweak-tool && apt show gnome-tweak-tool
Typing-Tab > Caps Lock key behaviour > Make Caps Lock an additional ESC|
001 • VIM-MODE in BASH
$ vim ~/.bashrc
• set -o vi
• bind -m vi-insert "\C-l":clear-screen