LinuxBBQ Academy

Forum rules
Share your brain ;)
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

LinuxBBQ Academy

Unread post by machinebacon » Mon May 04, 2015 4:28 pm

The following lessons are designed for users of the LinuxBBQ Academy release. I'll try to be as verbose as necessary, keeping the beginners or new users in mind. Users with some knowledge of Linux can safely skip these.

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
and then the password, which is not echoed:

Code: Select all

root
As next, you want to change the root password to something more complex than just 4 letters. Enter

Code: Select all

passwd
and then type your new password. You will have to repeat it again.

You want to create a user account. Your desired username is, for example, 'stanislaus':

Code: Select all

adduser stanislaus
You will be asked a few questions. Answer at least those for the password, everything else can be skipped by pressing [Enter] a few times.

Now, you want to switch to the user account. First, leave the login shell for root:

Code: Select all

exit
You see the login prompt again, but this time you enter your username, press [Enter] and then your password, followed by [Enter].

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
You can see a welcome message and some help about how to use wmii. Read it, play around with it, make sure you understand the basic principles of the window manager, because in the next lessons you will always need one or more terminal windows open.

To turn off the computer, don't just press the red button. Open a terminal and type

Code: Select all

poweroff
Sometimes, the computer does not power off, it just leaves the graphical environment, prints a few messages on the screen, and then remains idle. This is usually due to ACPI. In this case, you can temporarily press the power button for a few seconds after the computer has tried to shut down. We'll fix this later.
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
Have a try, suspend your box. In the worst of all cases, it doesn't do anything.

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
Pro tip: Make use of the bash-completion feature for longer filenames
The file is quite easy to understand. You can set background and foreground colors, or change the modifier Mod1 (which is 'Alt') to Mod4 (which is 'Super' or 'Windows'). When you made your changes, press [Ctrl] [o] and hit [Enter]. To close the editor, press [Ctrl] [x]. To see any changes you made, use the three-finger salute: [Ctrl] [Alt] [Backspace]

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
Use the arrow keys up and down to select your device, the [Tab] key to jump through the fields, and the [Enter] key to go to the next screen. Try to get only one of the devices to work, preferably the wired one (eth0), because some wireless devices refuse to work without further hacking.
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
On a side note, 'ping' is the command, '-c' is an option which tells the ping command to stop after '3' times, and the last part of the command is the IP address or domain name to 'ping'. If you wonder what 'ping' actually is, enter in your terminal:

Code: Select all

man ping
You can read through the manual, use the arrow keys to scroll line by line, or hit [Space] to scroll page by page, [h] to get some help and [q] to quit the manual page.
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
You can also try the newer frontend of APT itself:

Code: Select all

sudo apt update && sudo apt full-upgrade
or - if you are lazy - use a shorter command called

Code: Select all

upg
which is only found in LinuxBBQ releases and which does the update (the fetching of a file that contains all the changes) and upgrade (the download of the packages that are newer on the server than on your system) in one.
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
and indeed, there is 'ninvaders' that looks pretty much like what we want to have: a game using ncurses. Ncurses is nothing bad, it's actually something related to the text user interface. But before we can install this program, we should double-check if APT, our package manager, has finally finished its job of updating and upgrading the system -- it's not possible to interrupt an ongoing APT process, and it's not possible to start another APT process as long as the previous one hasn't finished. As soon as both terminals greet you patiently with your username, you can finally grab yourself the Space Invaders clone:

Code: Select all

ins ninvaders
or if you love to type long commands:

Code: Select all

sudo apt-get install ninvaders
It should be installed quite quickly, if we consider its download size of 20.6 kBytes. Let's start it:

Code: Select all

ninvaders
201505051430832813534x370.png
201505051430832813534x370.png (5.98 KiB) Viewed 11862 times
And if you finally decide to get rid of ninvaders again (because 'it sucks!' or 'it is bloat!') try this command:

Code: Select all

sudo apt-get autoremove --purge ninvaders
or, if you are lazy like us,

Code: Select all

purge ninvaders
Pro tip: The shorter commands are called 'aliases' and will be covered in Lesson 10
Now that you know how to download and install programs, you can actually set up your own system. I do recommend you to wait until you reach Level Lesson 7 ;) Or at least, keep your system as clean as possible until then. And yes, you can now already surf the internet and even listen to the radio:

Code: Select all

tinyradio
plays some radio streams for you

Code: Select all

alsamixer
helps you to set the volume,

Code: Select all

wikien Some_search_term_you_like
opens a wikipedia article of your choice, and

Code: Select all

links www.google.com
is your gate to the world.

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
As we can see, it first tries to find a file named ~/.bashrc and then -- after testing for a set of environment parameters -- it executes a command named startx. It probably has a manual page:

Code: Select all

man startx
Let's browse down to the bottom of the manual, where it says "FILES". It seems that startx executes a script named ~/.xinitrc amongst some others. Let's leave the manpage (press 'q') and check this infamous xinitrc file:

Code: Select all

cat ~/.xinitrc
The really important line is the last one that starts with 'exec'. In LinuxBBQ 'Academy' it should read:

Code: Select all

exec x-window-manager
This is a very general term: x-window-manager could be actually any window manager that has been installed so far. And in fact, if we install the window manager "openbox", it would (probably) be set as x-window-manager, while wmii (the one that was used before) slips down to spot 2. How can we check which window manager is now set to the 'active' one?

Code: Select all

sudo update-alternatives --display x-window-manager
is the command, and it should show /usr/bin/wmii as our one and only window manager here. It also means that if you:
- 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
to

Code: Select all

exec wmii
So, do this if you like. Just remember that later, when you install another window manager, you have to alter this line in ~/.xinitrc again.
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
Why do we put a "sleep" command there? Well, when starting X it sources a few files, and this takes a moment. If our terminal is fired up before X has done its job you will notice that the terminal uses a white background and very ugly default colours. To give xrdb a chance to source our Xcolors, we just delay opening the terminal for a few seconds, then with the '&&' instruction we tell the script to proceed when the 5 seconds are finished. Remember the "&" at the end of the line! This one is needed to make the command continue running in the background.
Now you can save and exit GNU nano.
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
Now that you know about the startup of X, you maybe want to add some other cool programs to pop up after logging in. Maybe the alsamixer? In this case, the line in ~/.xinitrc would read

Code: Select all

x-terminal-emulator -e alsamixer &
Or you want to have music playing after logging in?

Code: Select all

playstream &
will do this for you. The difference is: alsamixer is a terminal program, so the x-terminal-emulator has to execute ("-e") the program alsamixer. Playstream, on the other hand, does not need a terminal to play, so no "x-terminal-emulator -e" needed there.

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
We add the "|more" because the output will be longer than one screen height, and "|more" (pipe to more) will pause the scrolling. So, should we add a new font? You probably will like Terminus:

Code: Select all

ins xfonts-terminus
Let APT do its work. When finished, we can actually change the fonts in our terminal.
You will need to edit a file named ~/.Xresources

Code: Select all

nano ~/.Xresources
You see the mention of fonts there. With a strange, long name behind it. Don't just edit it randomly, you need a correct name there, which you find out with xfontsel. But first, make it easy for yourself. Move the cursor onto the line starting with "*font:" and press [Ctrl] [k] and then twice [Ctrl] . You have just successfully copied and inserted a line. One of these two identical lines you prepend with a ! (exclamation mark). This is our backup line. Move the cursor to the line without the exclamation mark, and remove the long string that is there behind "*font: " -- this long string, FYI, is called X Logical Font Description. Nevermind, I had to look it up too.
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-*-*-*-*-*-*-*
You can do the same for your bold font, too. Little hint: everything stays the same, except 'wght' which should read "bold". Have a try ;)
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
After this, open a new terminal (don't close the old one yet), and see the changes you made. If there is no new terminal opening, you seriously fucked the ~./Xresources file up. Nevermind!

Code: Select all

cp /etc/skel/.Xresources ~/.Xresources
will save some serious ass. Again, remember to re-read the ~/.Xresources file:

Code: Select all

xrdb -merge ~/.Xresources
This should be enough for a start.
Pro tip: if you edit the ~/.wmii/wmiirc_local file, you will see that the fonts can be changed there, too.
Forums threads: http://linuxbbq.org/bbs/viewtopic.php?f=4&t=833
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
then press Ctrl-a | (yes, that's a pipe, not an l or I). You'll notice that your screen is split. Ctrl-a Tab will jump to the next region, Ctrl-a c will give you a bash prompt. Ctrl-a X (a big one) will kill this region. A bit complicated? Well, Ctrl-a x and you will be kicked out from GNU Screen.
Let's try tmux instead. Start your tmux session by simply entering

Code: Select all

tmux
To find out how to split windows, take a look at the configuration file:

Code: Select all

less ~/.tmux.conf
You can change the bindings if you like, but usually the defaults there are quite sane. You don't even need to split too much, you can run several windows and switch between them. Have a try:
Ctrl-a c creates a new window, let's show the manpage here:

Code: Select all

man tmux
and then create another new window (Ctrl-a c) and open some random website:

Code: Select all

links en.wikipedia.org
So, we have now actually 3 windows, right? Zero, One and Two. So, let's switch to Zero: Ctrl-a 0 and you see the bash prompt. Ctrl-a 1 will bring the window with the manual. You have enough of looking at it? Press Ctrl-a x and it will get killed.
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 ;)
Note: you can not issue a startx command inside of tmux or Screen. Remember to 'exit' first, and then run startx. Framebuffer sessions won't start inside tmux or Screen either.
Further reading:
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
So we search for packages that have 'file' in the description or package name. The "|grep" will filter out results that contain the word 'manager' additionally. Let's add a "|more" because we'll get a huge list, and we prefer to scroll through it. Damned, still too much choice, there's everything inside, from nautilus to ytree. But the BBQ is a nice place, so here's a list of file managers for the console, to save you from installing bullshit:

Code: Select all

clex
fdclone
gnuit (gitfm)
lfm
mc
ranger
vifm
vfu
ytree
Well, what's the difference between clex and fdclone, or vifm and vfu, for example? Firstly, they look and work different - you can have file managers with a single pane, some with two panes, others have a preview mode, some can be navigated with the 'home row'. But most importantly, they have different dependencies. Dependencies are packages that are needed by the (main) program to run. For example, 'ranger' (a very nice file browser with on-the-fly preview of images and file contents) depends on Python. If you program in Python anyway, this would be an OK choice as file manager. If you want to keep your system lean and clean, you would rather prefer to install a file manager that does not depend on extra packages. How to find out? Use apt-cache depends:

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
And now let's compare it with one of the lightest file managers that is in the repos, clex:

Code: Select all

user@grill:~$ depends clex
clex
  Depends: libc6
  Depends: libncurses5
Quite a difference. That's how clex looks like:
clex.png
A nice file manager is vfu. It's similarly lean, and it's a bit easier to use.
vfu.png
And this is ytree - with a nice layout and shortcut help in the bottom row.
ytree.png
Now just to continue the terminal brainwash, here is the dependency count of one of the lightest graphical (!) file managers, using GTK2 and depending on policykit and more:

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
And hey, there's more. One of the dependencies is libgtk2.0-0. And guess what, this package has another bunch of dependencies that have to be satisfied:

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
...and so on, and so on. So, before you bloat up your system with dependencies of dependencies, check the repositories first if there is a CLI program that can do what you actually want to do. See also the most important article of every LinuxBBQ user

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
and gets a nice representation of the running processes. Count the lines!
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
Didn't hurt much. But maybe it hurts when you check your running processes again:

Code: Select all

pstree
Count the lines again! Did you notice anything? Yup, there is 'lpd', and it wasn't there before. "But I only installed it and didn't even start it!" - that's absolutely right. You didn't start it, but the system automatically added lpd (a line printer daemon) to the processes. A daemon is usually a process that is waiting for a request. Even if this request never happens, the daemon sits there, farts into your sofa, eats your snacks and flirts with your wife. And disgustingly, most daemons have a 'd' as last letter, like lpd. Or systemd ;)
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
kills the daemon, and guess what...

Code: Select all

sudo service lprng start
brings it back to life. By the way, lprng is the name of the package or the service, lpd the name of the daemon. In doubt, use [Tab]-completion after typing 'sudo service ' to find what services are running.
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
The framebuffer is not set up yet, so you have to install a handful of tools to make it happen:

Code: Select all

ins fbterm v86d libjpeg62 libjpeg8
And for once, you will also have to issue this command:

Code: Select all

sudo setcap 'cap_sys_tty_config+ep' /usr/bin/fbterm
The best thing about the framebuffer is: you can even watch videos, PDFs, photos (if you know what I mean!) here. So, for looking at photos (cough cough!) you want to install fbi and directly point to the image:

Code: Select all

fbi ~/images/linuxbbq.png
Press 'q' to quit. By the way, fbi also includes a PDf viewer named fbgs (which stands for framebuffer ghostscript, I guess). Again, point it to a PDF file directly.
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
where fbdev stands for framebuffer device. If you are brave, replace fbdev with caca...
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
We need gpm because xlinks2 (that's how you call the browser from the command line) uses the mouse as pointing device.

Code: Select all

sudo service gpm start
xlinks2 en.wikipedia.org
Not a real beauty, but you can change the default looks by clicking on the top row, and choosing the relevant menu items. You can edit ~/.links2/links.cfg and add or replace the relevant lines with these:

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
And finally, if you want to run your tmux session in a framebuffer, issue the command:

Code: Select all

fbterm
until you want to exit it again.
Pro Tip: Maybe you have a nice wallpaper somewhere. Save it as /usr/local/share/wall.jpg and start your framebuffer session by using the command fb

Lesson 12 - System Administration II: Fix the borkage
Attachments
xfontsel.png
xfontsel.png (5.37 KiB) Viewed 11752 times
..gnutella..

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: LinuxBBQ Academy

Unread post by rhowaldt » Mon May 04, 2015 4:41 pm

nooo this idea is fucking insane! by which i mean: genius. thanks so much for this Jules, absolutely wonderful. will tag along as best i can!
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: LinuxBBQ Academy

Unread post by wuxmedia » Mon May 04, 2015 4:50 pm

neat - excellent resource!
"Seek, and Ye shall find"
"Github | Chooons | Site"

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: LinuxBBQ Academy

Unread post by machinebacon » Mon May 04, 2015 4:57 pm

I'll add new "lessons" to the OP as I find time, so if any of you Dev team members see a mistake, want to add something or remove bullshit, feel free to edit the post. Thanks :)
..gnutella..

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: LinuxBBQ Academy

Unread post by dkeg » Mon May 04, 2015 5:19 pm

Yeah, that's really great Jules.

Work hard; Complain less

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

Re: LinuxBBQ Academy

Unread post by GekkoP » Mon May 04, 2015 5:33 pm

Fantastic work indeed.

User avatar
simgin
Meme Fodder
Posts: 1167
Joined: Sun Jan 06, 2013 12:07 am
Location: Bradford-on-Avon, UK

Re: LinuxBBQ Academy

Unread post by simgin » Mon May 04, 2015 5:34 pm

This is fantastic Jules :) Count me in as a pupil!

cheers
simon

PS. Still haven't tried wmii so even better :)
Someone told me that I am delusional, I almost fell off my unicorn.

User avatar
paolo
Head Banger
Posts: 275
Joined: Mon Nov 12, 2012 11:08 am
Location: Milano,Italy

Re: LinuxBBQ Academy

Unread post by paolo » Mon May 04, 2015 9:55 pm

Very interesting !
Dell Latitude C640 - CPU P4 2GHz - RAM 1,5 GB - made in 2002 - I'm in the Manjaro-i3 land now :)

User avatar
Dr_Chroot
Alfalfa
Posts: 1100
Joined: Mon Jun 09, 2014 9:49 pm
Location: among the sagebrush
Contact:

Re: LinuxBBQ Academy

Unread post by Dr_Chroot » Mon May 04, 2015 10:49 pm

Fantastic idea!
Fight internet censorship.
EFF | Tor Project | Bitcoin

"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden

User avatar
ivanovnegro
Minister of Truth
Posts: 5448
Joined: Wed Oct 17, 2012 11:12 pm

Re: LinuxBBQ Academy

Unread post by ivanovnegro » Tue May 05, 2015 12:07 am

Just wow. Fantastic topic and post. And who thinks we are not newb friendly? :)

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: LinuxBBQ Academy

Unread post by machinebacon » Tue May 05, 2015 4:54 pm

Added 'Level 3' ;)

If there's something missing or unclear or bullshit, please feel free to edit.
..gnutella..

User avatar
ivanovnegro
Minister of Truth
Posts: 5448
Joined: Wed Oct 17, 2012 11:12 pm

Re: LinuxBBQ Academy

Unread post by ivanovnegro » Tue May 05, 2015 5:54 pm

Perfect.

Code: Select all

sudo apt update && sudo apt full-upgrade
I use

Code: Select all

apt dist-upgrade
I guess it does the same thing.

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

Re: LinuxBBQ Academy

Unread post by GekkoP » Tue May 05, 2015 5:56 pm

^^ Looks good to me.
You are really shaping the practical BBQ philosophy.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: LinuxBBQ Academy

Unread post by machinebacon » Tue May 05, 2015 8:29 pm

ivanovnegro wrote:Perfect.

Code: Select all

sudo apt update && sudo apt full-upgrade
I use

Code: Select all

apt dist-upgrade
I guess it does the same thing.
I guess so, too.
The alias in BBQ releases is also "apt dist-upgrade" (still), so I just wanted to give the reader all three possibilities (he will see when he reads the Lesson 10, when we edit the .bash_rc and .bash_aliases files). Not sure why the manpages don't cover this part yet.

Thanks Ivan and Gekko.
..gnutella..

anticapitalista
Honorary Member
Posts: 70
Joined: Fri Feb 28, 2014 5:12 pm

Re: LinuxBBQ Academy

Unread post by anticapitalista » Tue May 05, 2015 11:32 pm

Absolutely fucking awesome mb! You really are taking things to a new level. Lotsa kudos!
I

User avatar
nova
applies for custom title
Posts: 49
Joined: Tue Dec 09, 2014 6:55 pm
Location: Planet 892-IV

Re: LinuxBBQ Academy

Unread post by nova » Wed May 06, 2015 8:41 am

Awestruck MB!!!
difficile est saturam non scribere. nam quis iniquae
tam patiens urbis, tam ferreus, ut teneat se...

User avatar
bones
Clooney
Posts: 2385
Joined: Fri Jun 28, 2013 11:47 pm
Location: Cascadia

Re: LinuxBBQ Academy

Unread post by bones » Wed May 06, 2015 1:02 pm

BBQ School is cool. :D

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: LinuxBBQ Academy

Unread post by machinebacon » Thu May 07, 2015 3:19 pm

Lesson 4 and 5 added, if somebody feels very bored: please check for bullshit :) Thank you!
..gnutella..

User avatar
kexolino
Common Boob
Posts: 557
Joined: Sun Jun 16, 2013 1:57 pm

Re: LinuxBBQ Academy

Unread post by kexolino » Thu May 07, 2015 4:00 pm

Thanks for this, my knowledge is full of holes (insert dick joke here, maybe), so this will come in handy.

User avatar
ivanovnegro
Minister of Truth
Posts: 5448
Joined: Wed Oct 17, 2012 11:12 pm

Re: LinuxBBQ Academy

Unread post by ivanovnegro » Thu May 07, 2015 4:13 pm

Everything in shape. Great lesson.

Post Reply