Skip to content

Personal Gentoo Index Page

I tried Gentoo once, and I fell in love!

How, why, when? Gentooooooooowiiie :)

When I told a friend that I would like to try Gentoo, the year was then 
2008 then the person said that I will go back to Debian because I 
will get tired of compiling code and doing everything from scratch all the time.

That person was wrong ;)

For 15 years I have been part of the Gentoo Community and in this part 
I have intended to post everything that I have created around gentoo 
and also various contributions from myself Gentoo

Respect to everyone that has been sharing your knowledge during the years, 
now im trying to give back what i've learned during the years :)
Print useflag description
quse -D  -pnet-misc/remmina
equery u net-misc/remmina
Rebuild modules everytime kernel was upgraded/downgraded
emerge @module-rebuild
Sync Portage Tree
if which eix &> /dev/null; then
  eix-sync
  eix-update
else
  emerge --sync
fi
Re-emerge all ebuilds with missing files
emerge -av1 `qlist --installed --nocolor | uniq \
| while read cp; do 
  qlist --exact $cp | while read file; do 
    test -e $file || { echo $cp; \
    echo "$cp: missing $file (and maybe more)" 1>&2; 
    break; 
  }; 
  done; 
done`
Print useflags NOT in use
eix --print-all-useflags | grep -o "\-.*" | grep -v "_" | grep -v "+"
Print last time emerge was used
grep "emerge on" /var/log/emerge.log | cut -d: -f2- | tr '[:upper:]' '[:lower:]' | sed 's/ started/Last used/g' | tail -n 1
Print all packages that is installed from custom overlays
eix -c --installed-overlay
Modules short with description
modinfo $(cut -d' ' -f1 /proc/modules) | sed '/^dep/s/$/\n/; /^file\|^desc\|^dep/!d'
Print current installed distro
awk -F= '/^NAME/{gsub(/[[:space:]]/, "", $2); print tolower($2); exit}' /etc/os-release
View emerge log by date in humand friendly time
awk -F: '{print strftime("%Y-%m-%d -> %X --> ", $1),$2}' /var/log/emerge.log
Find the right intel-ucode firmware for Intel GPU
iucode_tool -S -l /lib/firmware/intel-ucode/*

Genkernel

Configure dropbear in initramfs
  • Install net-misc/dropbear
emerge --ask net-misc/dropbear
  • Create/Copy authorized_keys file to /etc/dropbear/authorized_keys
cat ~/.ssh/authorized_keys > /etc/dropbear/authorized_keys
  • Set SSH Enable in /etc/genkernel.conf or use --ssh with genkernel command
sed -i 's/SSH="yes"/SSH="no"/g' /etc/genkernel.conf
Include Firmware files in /etc/genkernel.conf
FIRMWARE_INSTALL="yes"
FIRMWARE="yes"
FIRMWARE_DIR="/lib/firmware"
FIRMWARE_FILES="i915/skl_dmc_ver1_27.bin, rtlwifi/rtl8192eu_nic.bin, regulatory.db, regulatory.db.p7s, intel-ucode/06-5e-08"
Include microcode in /etc/genkernel.conf
MICROCODE="ALL"
MICROCODE_INITRAMFS="yes"
Print in percent of all available packages in tree we installed
installed_count=$(eix --only-names -I | wc -l)
total_count=$(eix --only-names | wc -l)
percentage=$(printf "%.2f" "$(bc <<< "scale=2; $installed_count / $total_count * 100")")
printf "%s%% of 100%% packages from Gentoo Linux is installed\n" "$percentage"
For view bluetooth percentage in bluetoothctl and plasma-desktop tray icon
sed -i 's/experimental=false/experimental=true' /etc/bluetooth/main.conf
bluetoothctl info
  Device 14:3F:A6:15:93:43 (public)
        Name: WH-1000XM4
        Alias: WH-1000XM4
        Class: 0x00240404
        Icon: audio-headset
        Paired: yes
        Bonded: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Vendor specific           (00000000-deca-fade-deca)
        UUID: Headset                   (00001108-0000-1000-8000)
        UUID: Audio Sink                (0000110b-0000-1000-8000)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000)
        UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000)
        UUID: Handsfree                 (0000111e-0000-1000-8000)
        UUID: PnP Information           (00001200-0000-1000-8000)
        UUID: Vendor specific           (81c2e72a-0591-443e-a1ff)
        UUID: Vendor specific           (8901dfa8-5c7e-4d8f-9f0c)
        UUID: Vendor specific           (931c7e8a-540f-4686-b798)
        UUID: Vendor specific           (96cc203e-5068-46ad-b32d)
        UUID: Vendor specific           (b9b213ce-eeab-49e4-8fd9)
        UUID: Vendor specific           (f8d1fbe4-7966-4334-8024)
        Modalias: usb:v054Cp0D58d
        Battery Percentage: 0x32 (50)
Enabling static-user for qemu-arm-static

Ensure that qemu is installed with the static-user flag to obtain the static component.

echo "app-emulation/qemu <other_usre_flags> static-user" >> /etc/portage/package.use/qemu

Mullvad Browser and Tor Browser requires

This will solve Couldn't load XPCOM. issues for those browsers
echo "x11-misc/appmenu-gtk-module wayland" > /etc/portage/package.use/appmeny-gtk-module
echo ">=x11-libs/gtk+-3.24.38 wayland\nx11-libs/gtk wayland" >> /etc/portage/package.use/gtk 
Video Editor
cat << "EOF" > /etc/portage/package.use/avidemux
media-libs/avidemux-plugins a52 aac alsa fontconfig gui lame libsamplerate nvenc opengl opus oss pulseaudio truetype twolame vdpau vorbis vpx x264 x265  xv xvidmedia-libs/avidemux-core nls nvenc sdl vaapi vdpau xc    
media-video/avidemux gui nls opengl sdl vaapi vdpau xv    
>=media-libs/avidemux-core-2.8.1-r1 vdpau vaapi nvenc
EOF   
emerge media-video/avidemux
It's possible to do the same operations using the command line
avidemux \ 
    --load input.avi \
    --vcd-res \
    --video-process \
    --video-codec VCD \
    --save /tmp/videocd.m1v \
    --audio-process \
    --audio-normalize \
    --audio-downample \
    --audio-codec MP2 \
    --audio-bitrate 224 \
    --save-uncompressed-audio \
    /tmp/video4you.mp2 \
    --quit
Bindfmt for Qemu
:python3.11:M::\xa7\x0d\x0d\x0a::/usr/bin/python3.11:
:qemu-aarch64:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/aarch64-binfmt-P:OCPF
:qemu-alpha:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/alpha-binfmt-P:OCPF
:qemu-arm:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/arm-binfmt-P:OCPF
:qemu-armeb:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/armeb-binfmt-P:OCPF
:qemu-cris:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x4c\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/cris-binfmt-P:OCPF
:qemu-hexagon:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xa4\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/hexagon-binfmt-P:OCPF
:qemu-hppa:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x0f:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/hppa-binfmt-P:OCPF
:qemu-loongarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x01:\xff\xff\xff\xff\xff\xff\xff\xfc\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/loongarch64-binfmt-P:OCPF
:qemu-m68k:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/m68k-binfmt-P:OCPF
:qemu-microblaze:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xba\xab:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/microblaze-binfmt-P:OCPF
:qemu-mips64:M::\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/mips64-binfmt-P:OCPF
:qemu-mips64el:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/mips64el-binfmt-P:OCPF
:qemu-mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20:/usr/libexec/qemu-binfmt/mips-binfmt-P:OCPF
:qemu-mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00:/usr/libexec/qemu-binfmt/mipsel-binfmt-P:OCPF
:qemu-mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20:/usr/libexec/qemu-binfmt/mipsn32-binfmt-P:OCPF
:qemu-mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00:/usr/libexec/qemu-binfmt/mipsn32el-binfmt-P:OCPF
:qemu-ppc64:M::\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/ppc64-binfmt-P:OCPF
:qemu-ppc64le:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00:/usr/libexec/qemu-binfmt/ppc64le-binfmt-P:OCPF
:qemu-ppc:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/ppc-binfmt-P:OCPF
:qemu-riscv32:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/riscv32-binfmt-P:OCPF
:qemu-riscv64:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/riscv64-binfmt-P:OCPF
:qemu-s390x:M::\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/s390x-binfmt-P:OCPF
:qemu-sh4:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/sh4-binfmt-P:OCPF
:qemu-sh4eb:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/sh4eb-binfmt-P:OCPF
:qemu-sparc32plus:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x12:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/sparc32plus-binfmt-P:OCPF
:qemu-sparc64:M::\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2b:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/sparc64-binfmt-P:OCPF
:qemu-sparc:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/sparc-binfmt-P:OCPF
:qemu-xtensa:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/xtensa-binfmt-P:OCPF
:qemu-xtensaeb:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/xtensaeb-binfmt-P:OCPF