User:Wuseman/Templates

From Gentoo Wiki
Jump to:navigation Jump to:search


Note
All examples in this cheatsheet are for demonstration purposes only and may not reflect actual usage. Please modify them according to your needs.

Columns

  • Level 1
    • Level 2
      • Level 3

Text

Italic Text

Bold Text

Bold Italic Text

Headers

Level 2

Level 3

Level 4

Level 5

FileBox

FILE /tmp/file
only one line
FILE /tmp/fileThis is just a title
only one line
FILE /tmp/fileTwo Lines
#!/bin/bash 
echo "Hello, world!"
FILE /tmp/fileDmesg Log
[    0.000000] 486DX2 detected, running at 66MHz
[    0.000000] Memory: 32MB detected, 4MB extended memory
[    0.000000] BIOS detected: Award Modular BIOS v4.51PG, 06/15/1998
[    0.000000] Floppy disk(s) found: 1.44MB, 3.5"
[    0.000000] Serial ports: COM1, COM2
[    0.000000] Parallel port(s): LPT1
[    0.000000] Keyboard controller: i8042 detected
[    0.000000] PS/2 mouse port(s) detected
[    0.000000] VGA: Detected SVGA graphics card, 256 colors
[    0.000000] IDE controller(s): Primary: 2 drives, Secondary: none
[    0.000000] Primary IDE master: Conner Peripherals 850MB
[    0.000000] Primary IDE slave: Quantum Bigfoot 2.1GB
[    0.000000] Sound card detected: Sound Blaster 16, DMA 1, IRQ 5
[    0.000000] CMOS battery low, replace battery soon
[    0.000000] USB controller(s): none detected
FILE /etc/fstabSet the following as the only uncommented lines
UUID=AFVC-A323                                                        /boot           vfat            noauto,noatime  1 2
UUID=fafaafra-0f4e-4548-89e0-41fd3f774811             /               ext4            noatime         0 1
#UUID=                                                                           none            swap            sw              0 0
FILE /mnt/gentoo/root/.bashrcSetting up MAKEOPTS and EMERGE_DEFAULT_OPTS
export NUMCPUS=$(nproc)
export NUMCPUSPLUSONE=$(( NUMCPUS + 1 ))
export MAKEOPTS="-j${NUMCPUSPLUSONE} -l${NUMCPUS}"
export EMERGE_DEFAULT_OPTS="--jobs=${NUMCPUSPLUSONE} --load-average=${NUMCPUS}"

CodeBox

CODE Python Script Example
#!/usr/bin/env python3

def greet(name):
    print("Hello, " + name + "!")

greet("World")
CODE JavaScript Script Example
console.log("Hello, World!");
CODE Bash Script Example
#!/bin/bash

echo "Hello, World!"

DiffBox

DIFF DiffBox
Old
Old
New
New

Kernelbox

KERNEL Linux Kernel Options
General Options  --->
    <*> Enable support for your hardware
    <*> Enable support for your filesystem
    <*> Enable kernel debugging
 Security Options  --->
    <*> Enable secure computing features
    <*> Enable security modules
 Networking Options  --->
    <*> Enable network protocols
    <*> Enable wireless networking
 Filesystem Options  --->
    <*> Enable support for various filesystems
    <*>

 Enable disk quota support
    <*> Enable encryption support


Colors

everything's fine

warning: proceed with caution

critical error: system malfunction

information: please read carefully

important notice: take immediate action

attention required: urgent task

note: additional information

suggestion: consider this idea

Emerge

root #emerge --ask sys-apps/portage
root #emerge --ask portage
root #emerge --info
Portage ... USE_PYTHON

Unmerge

root #emerge --ask --depclean --verbose sys-apps/portage
root #emerge --ask --depclean --verbose sys-apps/portage sys-apps/portage2 sys-apps/portage3
root #emerge --ask --depclean --verbose sys-apps/portage
 Some output 


user $a command
user $a command with = and |
user $a command
 Some output 
user $mkdir --help
Usage: mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.

Mandatory arguments to long options are mandatory for short options too.
  -m, --mode=MODE   set file mode (as in chmod), not a=rwx - umask
  -p, --parents     no error if existing, make parent directories as needed,
                    with their file modes unaffected by any -m option.
  -v, --verbose     print a message for each created directory
  -Z                   set SELinux security context of each created directory
                         to the default type
      --context[=CTX]  like -Z, or if CTX is specified then set the SELinux
                         or SMACK security context to CTX
      --help        display this help and exit
      --version     output version information and exit

GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report any translation bugs to <https://translationproject.org/team/>
Full documentation <https://www.gnu.org/software/coreutils/mkdir>
or available locally via: info '(coreutils) mkdir invocation'
 


user $1. command
user $...
user $10. command

GenericCmd

command output
  this
    that
command 1
command 2
command 3
$ echo $AWESOME
Tomorrow's Just Your Future Yesterday 

RootCmd

(chroot) livecd / #mkdir -p -v /etc/portage/package.use
(chroot) livecd / #emerge --ask --verbose dev-vcs/git
... additional output suppressed ...
Would you like to merge these packages? [Yes/No] <press y, then Enter>
... additional output suppressed ...

Entering the chroot

  1. Enter the chroot, using bash as the shell;
  2. Reload some settings, using source; and
  3. Redefine the console prompt (to remind us we are in a chroot).

Then in that new console (which is back outside the chroot, to begin with) enter:

livecd ~ #chroot /mnt/gentoo /bin/bash

followed by

livecd / #source /etc/profile
livecd / #export PS1="(chroot:2) $PS1"


(1) koneko ~ #zgrep 'CONFIG_DRM.*=' /proc/config.gz
CONFIG_DRM=y
CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_KMS_HELPER=y
CONFIG_DRM_KMS_FB_HELPER=y
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_DRM_I915=y
CONFIG_DRM_I915_USERPTR=y
CONFIG_DRM_PANEL=y
CONFIG_DRM_BRIDGE=y