I will cover the most important topics related to building a very minimal LinuxBBQ system with a focus on command-line tools, low resource usage, high productivity and keyboard focus.
These 'lessons' can also be applied to any other Debian-based distro, or Linux in general, with some modifications (especially in package management). Whenever possible, I will link to existing threads or wiki entries.
New users and beginners are encouraged to run the "LinuxBBQ Academy" remix in a live session or virtual machine first. There will be some 'lessons' in the future that deal with mounting internal and external partitions, moving files around, tweaking the processes and other partly destructive tasks.
Enough of the blah, blah, let's get started.
Table Of Contents
Lesson 1 - The First Boot
Lesson 2 - Editing Files
Lesson 3 - Package Management - Fill it up
Lesson 4 - X Startup Customization
Lesson 5 - Terminal I - Configuration
Lesson 6 - Terminal II - Tmux and Screen
Lesson 7 - Terminal III - Productivity without overhead
Lesson 8 - Package Management II - Housekeeping
Lesson 9 - System Administration I - The etc Folder
Lesson 10 - Terminal IV - Shell Massage
Lesson 11 - Terminal V - Framebuffer and TTY
Lesson 12 - System Administration II - Fix the borkage
Lesson 1 - The First Boot
After a successful installation and reboot, you are first greeted by GRUB (a blue/black menu in which you can choose a distro to boot) and then, usually, by a login prompt. This screen is also called a TTY, and we are usually in TTY1 after a successful boot. The default runlevel in LinuxBBQ, just for your information, is runlevel 2. We'll need it later, or never, depends on you.
You can switch between the TTYs by pressing [Alt] and the cursor keys left and right. Anyway, make sure you are in TTY1.
Enter
Code: Select all
root
Code: Select all
root
Code: Select all
passwd
You want to create a user account. Your desired username is, for example, 'stanislaus':
Code: Select all
adduser stanislaus
Now, you want to switch to the user account. First, leave the login shell for root:
Code: Select all
exit
If you are lucky, you find yourself in the graphical environment, also called X. On the bottom you see a bar, with some numbers and the actual date and time. This is your window manager, wmii.
Press [Alt] [a] and then enter
Code: Select all
welcome
To turn off the computer, don't just press the red button. Open a terminal and type
Code: Select all
poweroff
You can put the computer to sleep, so that it does not power off. It is called 'suspend' and activated through
Code: Select all
sudo pm-suspend
Further readings in our wiki:
root account: http://linuxbbq.org/wiki/index.php/Root
tty: http://linuxbbq.org/wiki/index.php/Tty
switching users: http://linuxbbq.org/wiki/index.php/Switching_users
wmii: http://linuxbbq.org/wiki/index.php/Wmii
shutdown issues: http://linuxbbq.org/bbs/viewtopic.php?f=6&t=2023
Lesson 2 - Editing files
By default, LinuxBBQ comes with the GNU nano editor. It is good enough for most of the tasks, quick enough for most of the users, and powerful enough to make even editing of multiple files possible. Let's edit the configuration file of wmii. Open a terminal, and type
Code: Select all
nano ~/.wmii/wmiirc_local
Further readings in our wiki:
Command-line interface: http://linuxbbq.org/wiki/index.php/Comm ... _interface
Terminal intro: http://linuxbbq.org/wiki/index.php/Terminal_Intro
CLI tricks: http://linuxbbq.org/wiki/index.php/CLI_tricks
GNU nano: http://linuxbbq.org/wiki/index.php/Nano
Config file: http://linuxbbq.org/wiki/index.php/Config_file
In the next part we'll take a look at the ~/.xinitrc file, we'll set up the terminal environment, and we'll install some software. Until then: move those terminals around, cowboy! ;)
Lesson 3 - Package Management I: Fill it up
You probably want to do more than looking at the prompt of your shell. Only a few tools are added to the "Academy" distro, one of them is 'Ceni', a very helpful little program that sets up the wired or wireless connection for you. It needs to be run as root, so open a terminal and enter
Code: Select all
sudo ceni
When you think your network is set up, you can try to ping some place on the internet, for example Google's DNS server and our website:
Code: Select all
ping -c 3 8.8.8.8
ping -c 3 linuxbbq.org
Code: Select all
man ping
What you always want to do before you add software, and generally every week once, is to update and upgrade your system. We at the grill use the Debian package manager called 'APT', which can also only be started as root:
Code: Select all
sudo apt-get update && sudo apt-get dist-upgrade
Code: Select all
sudo apt update && sudo apt full-upgrade
Code: Select all
upg
The command needs a few moments or even minutes to complete. In the meantime, you can open another terminal and browse through the repositories - let's see if we find some Space Invaders game:
Code: Select all
search space invaders
Code: Select all
ins ninvaders
Code: Select all
sudo apt-get install ninvaders
Code: Select all
ninvaders
Code: Select all
sudo apt-get autoremove --purge ninvaders
Code: Select all
purge ninvaders
Code: Select all
tinyradio
Code: Select all
alsamixer
Code: Select all
wikien Some_search_term_you_like
Code: Select all
links www.google.com
Further readings in our wiki:
Ceni: http://linuxbbq.org/wiki/index.php/Ceni
Manpage: http://linuxbbq.org/wiki/index.php/Manpage
APT: http://linuxbbq.org/wiki/index.php/APT
Lesson 4 - X: Startup Customization
Whenever you start your computer and boot into Linux, a series of files are read and executed in a certain order. We will cover the boot process a tad later in this document, but let us take a look at the part "where you enter your username and password" and everything thereafter. This is where the shell starts, as the first interactive environment of your system. After entering username and password, the files ~/.bash_profile and ~/.bashrc are read or sourced. Let's take a look at .bash_profile first:
Code: Select all
cat ~/.bash_profile
Code: Select all
man startx
Code: Select all
cat ~/.xinitrc
Code: Select all
exec x-window-manager
Code: Select all
sudo update-alternatives --display x-window-manager
- have more than one window manager installed
- always want to have exactly wmii starting up, and not the other one
you have to edit the ~/.xinitrc file, and change
Code: Select all
exec x-window-manager
Code: Select all
exec wmii
But don't just close ~/.xinitrc yet! Let's say, you want to have a terminal opening every time you start your X session. Nothing easier than this: add one line before the exec x-window-manager line, so that it looks exactly like this:
Code: Select all
sleep 5s && x-terminal-emulator &
exec x-window-manager
Wait a moment. x-terminal-emulator looks pretty much like x-window-manager, doesn't it? Well yes. There are dozens of terminal emulators in Debian, and x-terminal-emulator is the link to the program that is used as terminal emulator in X. Yeah okay but what terminal emulator do we actually use? Find it out yourself:
Code: Select all
sudo update-alternatives --display x-terminal-emulator
Code: Select all
x-terminal-emulator -e alsamixer &
Code: Select all
playstream &
Some info in our wiki:
Xinitrc: http://linuxbbq.org/wiki/index.php?title=Xinitrc
Window Managers: http://linuxbbq.org/wiki/index.php/Window_manager
Lesson 5 - Terminal I: Configuration
Just recently a fellow griller asked a very good question: "How can I change the colors of my terminal?" Read the answers here: http://linuxbbq.org/bbs/viewtopic.php?f=6&t=2079
We should mention, though, that this only works for the terminals xterm and rxvt and it's modifications. More about this later. We recommend to stay with the default terminal emulator (xterm in the Academy release), at least for a few days. It has it strengths, especially in size, speed, dependency count and customization. Now you ask yourself: how can I change the font, not just the colors?
First of all, you need a bit of choice in fonts. Let's ask out package manager what is there in the repositories:
Code: Select all
search xfonts|more
Code: Select all
ins xfonts-terminus
You will need to edit a file named ~/.Xresources
Code: Select all
nano ~/.Xresources
Let's get the name of the other font, so that we can paste it in there. Press [Alt] [p] and enter 'xfontsel', then hit [Enter]. In the field 'fmly', press the mouse button, keep it pressed, and select "terminus". Move over to "wght" and select 'medium', pick 'slant' and then 'r', then go over to 'pxlsz' and choose, for example, 12. This is usually enough. All changes are visible on the fly, so you can see how your selected font looks like.
[attachment=3]xfontsel.png[/attachment]
And when you found a pleasant looking set of fonts, click on "Select", then move over to GNU nano and press either the middle mouse button or [Alt] [Insert]. Be careful where your cursor is in GNU nano, the selection will be paste exactly there. Remember, we paste it behind "*font:", so that it looks like this:
Code: Select all
*font: -*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*
If you now save and exit GNU nano, remember to run a command that reads the ~/.Xresources file again:
Code: Select all
xrdb -merge ~/.Xresources
Code: Select all
cp /etc/skel/.Xresources ~/.Xresources
Code: Select all
xrdb -merge ~/.Xresources
External sources:
xterm configuration: https://unix4lyfe.org/xterm/
some notes about the xterm menu: http://scarygliders.net/2011/12/01/cust ... -terminal/
Lesson 6 - Terminal II: Tmux and Screen
Until now, you have spent most of the time in an X session, tiling or moving windows around using the WM-specific keybindings. You can, however, do the tiling in a terminal, too. There are two (actually four) of these window managers for terminals: the good, old and trusted GNU Screen, the very popular tmux, the lesser-known dvtm and byobu (which adds a few centimeters of convenience on top of Screen or tmux). Of course there are two more or less experimental window managers for the terminal (vwm and Twin) which we do not take into consideration - firstly, because they have to be compiled maually, and secondly, because they add very little enhancement to what you can get with Screen or Tmux. Before you proceed, you can install the package byobu and run your tmux or Screen session through it. This, however, will give you some additional keybinds that won't be covered in this section.
Okay, so firstly: let's get out from X! Press Ctrl-Alt-F2, and find yourself in TTY2.
If you are a neckbeard, you want to run GNU Screen. I'd pull down the manual as text file and read it in a separate window. Get the manual using
Code: Select all
screen
# you'll need to hit Enter or Space then
mkdir ~/manual
cd ~/manual
wget -c http://www.gnu.org/software/screen/manual/screen.txt
less screen.txt
Let's try tmux instead. Start your tmux session by simply entering
Code: Select all
tmux
Code: Select all
less ~/.tmux.conf
Ctrl-a c creates a new window, let's show the manpage here:
Code: Select all
man tmux
Code: Select all
links en.wikipedia.org
Tmux is an excellent tool, especially if you want to do more than one thing at the same time. Ctrl-a c and then enter 'playstream' will bring you music. If it's too loud, you press Ctrl-a - to split the screen and fire up alsamixer. Ctrl-a 2 and you are back in wikipedia, reading awesome stuff. Actually, you should have studied tmux' manpage ;)
Screen reference: http://aperiodic.net/screen/quick_reference
Tmux reference: http://tmuxcheatsheet.com/
Lesson 7 - Terminal III: Productivity without overhead
Most daily tasks, like reading and answering emails, listening to music, reading some RSS feeds, calculating the BMI, creating and extracting zip archives, surfing the internet, copying files from one computer to the other or checking the weather forecast can be accomplished in the terminal. Some of the people here at the BBQ even say, that this is the preferred way of doing something. Why? To answer this question, check the links at the end of this lesson. There are people who have written huge articles about the topic - and they are right :)
In this lesson you can lay back and relax. It's really just about choice now, and hopefully you will remember some of the tips when you build up your own productivity systems. Of course, we first have to know what your daily computer tasks are. Let's put the browsers aside for a moment, they are usually GUI applications and under the hood they really just render websites, plus or minus a few extras. Let's take a look at file managers instead. They can come handy when you want to move stuff around, in a more visual way than the core utilities. We fire up apt-cache search:
Code: Select all
search file|grep manager|more
Code: Select all
clex
fdclone
gnuit (gitfm)
lfm
mc
ranger
vifm
vfu
ytree
Code: Select all
user@grill:~$ depends ranger
ranger
Depends: python
Depends: python
Suggests: atool
Suggests: caca-utils
|Suggests: elinks
|Suggests: elinks-lite
|Suggests: lynx
Suggests: w3m
Suggests: highlight
Suggests: less
Suggests: poppler-utils
Recommends: file
Recommends: python-chardet
Recommends: sudo
sudo-ldap
Recommends: w3m-img
Code: Select all
user@grill:~$ depends clex
clex
Depends: libc6
Depends: libncurses5
Code: Select all
user@grill:~$ depends pcmanfm
pcmanfm
Depends: libatk1.0-0
Depends: libc6
Depends: libcairo2
Depends: libfm-gtk4
Depends: libfm4
Depends: libfontconfig1
Depends: libfreetype6
Depends: libgdk-pixbuf2.0-0
Depends: libglib2.0-0
Depends: libgtk2.0-0
Depends: libpango-1.0-0
Depends: libpangocairo-1.0-0
Depends: libpangoft2-1.0-0
Depends: libx11-6
Recommends: gvfs-backends
Recommends: gvfs-fuse
|Recommends: policykit-1-gnome
lxsession
mate-polkit
|Recommends: mate-polkit
Recommends: <lxpolkit>
|Recommends: lxde-icon-theme
|Recommends: gnome-icon-theme
|Recommends: oxygen-icon-theme
Recommends: tango-icon-theme
Code: Select all
user@grill:~$ depends libgtk2.0-0
libgtk2.0-0
Depends: libgtk2.0-common
Depends: libatk1.0-0
Depends: libc6
Depends: libcairo2
Depends: libcups2
Depends: libfontconfig1
Depends: libfreetype6
Depends: libgdk-pixbuf2.0-0
Depends: libglib2.0-0
Depends: libpango-1.0-0
Depends: libpangocairo-1.0-0
Depends: libpangoft2-1.0-0
Depends: libx11-6
Depends: libxcomposite1
Depends: libxcursor1
Depends: libxdamage1
Depends: libxext6
Depends: libxfixes3
Depends: libxi6
Depends: libxinerama1
Depends: libxrandr2
Depends: libxrender1
Depends: shared-mime-info
PreDepends: multiarch-support
Suggests: librsvg2-common
Suggests: gvfs
Recommends: hicolor-icon-theme
Recommends: libgtk2.0-bin
External sources:
K. Mandla's old blog: https://kmandla.wordpress.com/
K. Mandla's Inconsolation blog, a must read: https://inconsolation.wordpress.com/
Fellow griller DebianJoe's X11 Must Die: https://debianjoe.wordpress.com/
The UNIX toolbox: http://theunixtoolbox.com/
CommandlineFu: http://www.commandlinefu.com/commands/browse
Fellow griller GekkoP's blog (Italian): http://informatica.boccaperta.com/categ ... i-comando/
Lesson 8 - Package Management II: Housekeeping
Actually, this could be the continuation of the previous lesson. A real griller keeps his dependency count as low as possible. And of course a real griller also checks the number of processes running on his system. He or she enters:
Code: Select all
pstree
Good, but sometimes it happens that you grab yourself some shiny nice package -- for example, you want to print something quick and easy, and you install the lprng package. Let's just do it:
Code: Select all
ins lprng
Code: Select all
pstree
The good thing is: you can disable a daemon temporarily or permanently, and restart it again when needed.
Code: Select all
sudo service lprng stop
Code: Select all
sudo service lprng start
To permanently disable service, use the tool 'update-rc.d' which has to be run as root. Or, of course, remove the package that has installed the daemon :)
Further reading:
Debian Administrator's Handbook, Chapter UNIX Services: http://debian-handbook.info/browse/stab ... vices.html
Lesson 9 - System Administration I: A trip to /etc
Lesson 10 - Terminal IV: Shell Massage
Lesson 11 - Terminal V: Framebuffer and TTY
Whenever your CPU gets too hot or your mouse refuses to work, you can fall back to TTY or a framebuffer session. The former we have already covered a few lessons back (Lessons 6 and 7) - that's working with TUI tools or even command-line utilities whenever possible. The framebuffer adds a bit of beauty on top of your black-and-white TTY -- which colors you can change, by the way, using the command
Code: Select all
fbcolors
Code: Select all
ins fbterm v86d libjpeg62 libjpeg8
Code: Select all
sudo setcap 'cap_sys_tty_config+ep' /usr/bin/fbterm
Code: Select all
fbi ~/images/linuxbbq.png
To watch films, you can install mplayer2 from the repos (no, mpv does not support framebuffer devices /yet/), the typical command to play a video file would be:
Code: Select all
mplayer -vo fbdev filmname.mp4
Well, finally you can add a real lightweight framebuffer web browser. There are two to choose from - unfortunately one of them (netsurf) is not working without heavy modifications, so let's just get links2 and also the general mouse pointer:
Code: Select all
ins links2 gpm
Code: Select all
sudo service gpm start
xlinks2 en.wikipedia.org
Code: Select all
menu_font_size 12
background_color 2763306
foreground_color 13224393
scroll_bar_area_color 2763306
scroll_bar_bar_color 657930
scroll_bar_frame_color 2960685
Code: Select all
fbterm
Lesson 12 - System Administration II: Fix the borkage