Browse Categories All Posts
Categories
K
Kai
Post Timeline
This PC
Timeline
Recycle Bin
fmpeg convert all files in foler

fmpeg convert all files in foler

 for i in *.avi; do ffmpeg -i "$i" "${i%.*}.mp4"; done

for i in *.gif; do ffmpeg -i "$i" "${i%.*}.mp4"; done


repair ffmpeg

ffmpeg -fflags +genpts -i input.mkv -c copy repaired.mkv

 

 fflags

‘discardcorrupt’

Discard corrupted packets. 


 


bash substring

bash substring

NAME=${MYVAR%:*}  # retain the part before the colon

NAME=${NAME##*/} # retain the part after the last slash

 
${MYVAR#pattern}     # delete shortest match of pattern from the beginning
${MYVAR##pattern}    # delete longest match of pattern from the beginning
${MYVAR%pattern}     # delete shortest match of pattern from the end
${MYVAR%%pattern}    # delete longest match of pattern from the end 
 
   

So # means match from the beginning (think of a comment line) and % means from the end. One instance means shortest and two instances means longest.

 

${MYVAR:3}   # Remove the first three chars (leaving 4..end)
${MYVAR::3}  # Return the first three characters
${MYVAR:3:5} # The next five characters after removing the first 3 (chars 4-9) 
 
${MYVAR/search/replace}
graphicsmagick / linux

graphicsmagick / linux

gm identify  Monterey.jpg

Monterey.jpg JPEG 1920x1080+0+0 DirectClass 8-bit 535.4Ki 0.000u 0m:0.000001s

display 

animate=show animation eg gif

composite=blend/merge image togather

conjure = interprets MSL


convert

import=read image from window

mogrify= image scaling, image rotation, color reduction etc overwrites original

montage =tiled image

options

-adjoin = join images into a single multi-image file

image%02d.miff

-affine <matrix>

This option provides a transform matrix {sx,rx,ry,sy,tx,ty} for use by subsequent -draw or -transform options.

-antialias

remove pixel aliasing

-append

 creates a single image where the images in the original set are stacked top-to-bottom.

 -asc-cdl <spec>

-authenticate <string>

password for pdf

-auto-orient 

-average

average a set of images

 -backdrop

 -colorspace <value>

              the type of colorspace


              Choices are: CineonLog, CMYK, GRAY, HSL, HWB, OHTA, RGB,

              Rec601Luma, Rec709Luma, Rec601YCbCr, Rec709YCbCr, Transparent,

              XYZ, YCbCr, YIQ, YPbPr, or YUV.


  -comment "%m:%f %wx%h"

  -compress <type>

              the type of image compression

              Choices are: None, BZip, Fax, Group3, Group4, JPEG, Lossless,

              LZW, RLE, Zip, LZMA, JPEG2000, JPEG2000, JBIG, JBIG2, WebP, or

              ZSTD.

 Use the -quality option to set the compression level to be used

              by the JPEG, JPEG-2000, PNG, MIFF, MPEG, and TIFF encoders. Use

              the -sampling-factor option to set the sampling factor to be

              used by the DPX, JPEG, MPEG, and YUV encoders for downsampling

              the chroma channels.


-density <width>x<height>

  horizontal and vertical resolution in pixels of the image This

              option specifies the image resolution to store while encoding a

              raster image or the canvas resolution while rendering (reading)

              vector formats such as Postscript, PDF, WMF, and SVG into a

              raster image. Image resolution provides the unit of measure to

              apply when rendering to an output device or raster image. The

              default unit of measure is in dots per inch (DPI). The -units

              option may be used to select dots per centimeter instead.

               The default resolution is 72 dots per inch, which is equivalent

              to one point per pixel (Macintosh and Postscript standard).

              Computer screens are normally 72 or 96 dots per inch while

              printers typically support 150, 300, 600, or 1200 dots per inch.

              To determine the resolution of your display, use a ruler to

              measure the width of your screen in inches, and divide by the

              number of horizontal pixels (1024 on a 1024x768 display).  If

              the file format supports it, this option may be used to update

              the stored image resolution. Note that Photoshop stores and

              obtains image resolution from a proprietary embedded profile. If

              this profile is not stripped from the image, then Photoshop will

              continue to treat the image using its former resolution,

              ignoring the image resolution specified in the standard file

              header.  The density option is an attribute and does not alter

              the underlying raster image. It may be used to adjust the

              rendered size for desktop publishing purposes by adjusting the

              scale applied to the pixels. To resize the image so that it is

              the same size at a different resolution, use the -resample

              option.

-depth <value>

              depth of the image

              This is the number of bits of color to preserve in the image.

              Any value between 1 and QuantumDepth (build option) may be

              specified, although 8 or 16 are the most common values. Use this

              option to specify the depth of raw images whose depth is unknown

              such as GRAY, RGB, or CMYK, or to change the depth of any image

              after it has been read.  The depth option is applied to the

              pixels immediately so it may be used as a form of simple

              compression by discarding the least significant bits. Reducing

              the depth in advance may speed up color quantization, and help

              create smaller file sizes when using a compression algorithm

              like LZW or ZIP.


-format <string>

              output formatted image characteristics

              When used with the identify utility, or the convert utility with

              output written to the 'info:-' file specification, use this

              option to print information about the image in a format of your

              choosing.  You can include the image filename, type, width,

              height, Exif data, or other image attributes by embedding

              special format characters:


    %b   file size

                   %c   comment

                   %d   directory

                   %e   filename extension

                   %f   filename

                   %g   page dimensions and offsets

                   %h   height

                   %i   input filename

                   %k   number of unique colors

                   %l   label

                   %m   magick

                   %n   number of scenes

                   %o   output filename

                   %p   page number

                   %q   image bit depth

                   %r   image type description

                   %s   scene number

                   %t   top of filename

                   %u   unique temporary filename

                   %w   width

                   %x   horizontal resolution

                   %y   vertical resolution

                   %A   transparency supported

                   %C   compression type

                   %D   GIF disposal method

                   %G   Original width and height

                   %H   page height

                   %M   original filename specification

                   %O   page offset (x,y)

                   %P   page dimensions (width,height)

                   %Q   compression quality

                   %T   time delay (in centi-seconds)

                   %U   resolution units

                   %W   page width

                   %X   page horizontal offset (x)

                   %Y   page vertical offset (y)

                   %@   trim bounding box

                   %#   signature

                   \n   newlin


                  \r   carriage return

                   %%   %


  -format "%m:%f %wx%h"

   Where "<tag>" may be one of the following:

                 *  (print all Exif tags, in keyword=data format)

                   !  (print all Exif tags, in tag_number format)

                   #hhhh (print data for Exif tag #hhhh)

                   ImageWidth

                   ImageLength

                   BitsPerSample

                   Compression

                   PhotometricInterpretation

                   FillOrder

                   DocumentName

                   ImageDescription

                   Make

                   Model

                   StripOffsets

                   Orientation

                   SamplesPerPixel

                   RowsPerStrip

                   StripByteCounts

                   XResolution

                   YResolution

                   PlanarConfiguration

                   ResolutionUnit

                   TransferFunction

                   Software

                   DateTime

                   Artist

                   WhitePoint

                   PrimaryChromaticities

                   TransferRange

                   JPEGProc

                   JPEGInterchangeFormat


                   JPEGInterchangeFormatLength

                   YCbCrCoefficients

                   YCbCrSubSampling

                   YCbCrPositioning

                   ReferenceBlackWhite

                   CFARepeatPatternDim

                   CFAPattern

                   BatteryLevel

                   Copyright

                   ExposureTime

                   FNumber1

                   IPTC/NAA

                   ExifOffset

                   InterColorProfile

                   ExposureProgram

                   SpectralSensitivity

                   GPSInfo

                   ISOSpeedRatings

                   OECF

                   ExifVersion

                   DateTimeOriginal

                   DateTimeDigitized

                   ComponentsConfiguration

                   CompressedBitsPerPixel

                   ShutterSpeedValue

                   ApertureValue

                   BrightnessValue

                   ExposureBiasValue

                   MaxApertureValue

                   SubjectDistance

                   MeteringMode

                   LightSource

                   Flash

                   FocalLength

                   MakerNote

                   UserComment

                   SubSecTime

                   SubSecTimeOriginal

                   SubSecTimeDigitized

                   FlashPixVersion

                   ColorSpace

                   ExifImageWidth

                   ExifImageLength

                   InteroperabilityOffset

                   FlashEnergy

                   SpatialFrequencyResponse

                   FocalPlaneXResolution

                   FocalPlaneYResolution

                   FocalPlaneResolutionUnit

                   SubjectLocation

                   ExposureIndex

                   SensingMethod

                   FileSource

                   SceneType


 JPEG specific information (from reading a JPEG file) may be

              obtained like this:


                   %[JPEG-<tag>]


              Where "<tag>" may be one of the following:


                   *                 (all JPEG-related tags, in

                                      keyword=data format)

                   Quality           IJG JPEG "quality" estimate

                   Colorspace        JPEG colorspace numeric ID

                   Colorspace-Name   JPEG colorspace name

                   Sampling-factors  JPEG sampling factors


-geometry <width>x<height>{+-}<x>{+-}<y>{%}{@}{!}{^}{<}{>}


              Specify dimension, offset, and resize options.

example 

gm convert -resize 300 image.png resize-300-image.png


gm convert -resize 300*300


gm convert -flop     =  mirror image 


gm convert -flip    = flip verticaly 


gm convert -monochrome 


gm convert input.jpg -resize 300x output.jpg = preserve aspect ratio

gm convert input.jpg -resize x200 output.jpg = same

gm convert input.jpg -thumbnail 300x200^ -gravity center -extent 300x200 output.jpg 

   

 convert -list format

sudo apt install libsixel-bin

img2sixel 

-7, -8: Selects the SIXEL graphics norm. -7 selects the VT level 3 norm (default), and -8 selects the VT level 4 norm.

-e: Enables relative color specification.

-I: Ignores delays in GIF animations.

-i: Inverts the color output.

-u: Uses built-in dithering instead of an external one.

-g: Enables gamma correction.

-v: Prints the version number and exits.

-S, -P, -D, -O, -V, -H: Various options for handling GIF animations.

-p colors: Specifies the number of colors to use.

-m file: Specifies a source file for color quantization.

-d diffusiontype: Specifies the type of error diffusion.

-f findtype: Specifies the method for finding the nearest color.

-s selecttype: Specifies the method for selecting representative colors.

-c geometory: Specifies the output device’s screen geometry.

-w width, -h height: Specifies the width and height of the output image.

-r resamplingtype: Specifies the method for resampling.

-q quality: Specifies the output quality.

-l loopmode: Specifies the loop mode for GIF animations.

-t palettetype: Specifies the type of palette to use.

-n macronumber: Specifies the macro number for DEC SIXEL.

-C score: Specifies the score for color matching.

-b palette: Specifies the palette file.

-E encodepolicy: Specifies the policy for encoding.

-B bgcolor: Specifies the background color.

-o outfile: Specifies the output file. If not specified, the output is written to standard output.

filename ...: Specifies the input file(s). If not specified, the input is read from standard input.


stty size

43 158

cat catimg

width=$(tput cols)

height=$(tput lines)

width=$((width * 16))

height=$((height * 16))

img2sixel -w $width -h $height $1

resampling  -r

 nearest  -> Nearest-Neighbor method

            gaussian -> Gaussian filter

            hanning  -> Hanning filter

            hamming  -> Hamming filter

            bilinear -> Bilinear filter (default)

            welsh    -> Welsh filter

            bicubic  -> Bicubic filter

            lanczos2 -> Lanczos-2 filter

            lanczos3 -> Lanczos-3 filter

            lanczos4 -> Lanczos-4 filter



lossless compression tools

https://imageoptim.com/versions.html

https://imageoptim.com/online


sudo apt-get install trimage

using optipng, pngcrush, advpng and jpegopti 

MozJPEG, pngquant, Pngcrush, 7zip, SVGO and Google Zopfli


 https://github.com/google/guetzli

A perceptual JPEG encoder, aiming for excellent compression density at high visual quality


sudo apt install guetzli 

https://www.kokkonen.net/tjko/projects.html#jpegoptim

JPEG optimization utility providing lossless and lossy compression.


sudo apt install jpegoptim 

https://optipng.sourceforge.net

optiPNG is a PNG optimizer that recompresses image files to a smaller size, without losing any information. This program also converts external formats (BMP, GIF, PNM and TIFF) to optimized PNG, and performs PNG integrity checks and corrections.  


sudo apt install optipng 

https://github.com/shssoichiro/oxipng

Multithreaded PNG optimizer written in Rust 


cargo install oxipng

 https://pmt.sourceforge.io/pngcrush/

sudo apt install pngcrush 

 

other

https://converseen.fasterland.net

sudo apt install converseen 

uses imagemagick


https://cairosvg.org/

pip3 install cairosvg

 

https://dechifro.org/dcraw/

 https://www.gmic.eu/

sudo apt install gmic

 

https://www.imagemagick.org/script/index.php

 https://github.com/nagadomi/waifu2x

 https://waifu2x.udp.jp/

 

 https://pngquant.org/

Lossy compression of PNG images. 

sudo apt install pngquant 


https://github.com/google/zopfli

Zopfli Compression Algorithm is a compression library programmed in C to

 perform very good, but slow, deflate or zlib compression. 

Highly efficient PNG optimisation tool using Google's zopfli library 

 sudo apt install zopfli 

 

https://github.com/Huluti/Curtail

 

gimp

gimp

 Basic

resolution, defined as the ratio between an image's size in pixels and its physical size (usually in inches) when it is printed on paper.

expressed as ppi—pixels per inch

The resolution is usually 72 or 96ppi

 

   Physical size: 340x190 mm

diag size=10 sqrt(1517) mm =389.487=15.3341 inch

   resolution: 1920x1080 px 

diag res  = 120 sqrt(337) = =2202.907 px

 

dpi = 120 sqrt(337) *25.4 /10 sqrt(1517) = 143.66 dpi 

for wolfarm  Sqrt[1920^2+1080^2]*25.4 /Sqrt[190^2+340^2]

1 inch=25.4 mm

 


dpi=diagonal res in px / diagonal physical size in inches

 

 windows > single-window Mode


file>new or ctrl+n

adjust:  width,height,unit

advance: x,y-res,colorspace,precision(bit),gamma,color-profile,fill with,comment


tools groups:

selection tools : rectangular(R),ellipse(E),free(F),foreground,fuzzy(U),by color select(shift+O),intelligent Scissors(I)

 

paint tools: bucket fill(shift+b),gradient(g),pencil(p),eraser(shift+e),airbrush(a)

ink(i),mypaintbrush(y),clone(c),heal(h),presprective colne,blur/sharpen(shift+u)

smudge(s),dodge/burn(shift+d)

 

transform tools: align(q),move(m),crop(shift+c),rotate(shift+r),scale(shift+s)

shear(shift+h),presprective(shift+p),3d transform(shift+w),unified transform(shift+t),handle transform(shift+l),flip(shift+f),cage transform(shift+g) wrap transform(w)

paths(b)

text(t)

GEGL operation..

color picker(o)

Measure(shift+m)

zoom(z)

toolbox (ctrl+b)

default colors (d)

swap colors (x)


move tool (m) : move layers,selection and other objects

alignment tool(q) : align or arrange layers or other objects

 

rectangle(r),ellipse(e) select tool 


free(f) : select hand drawn region with free or polygon segments

scissor(i) : select shape using intelligent edge-fittig

foreground select tool

 



https://docs.gimp.org/2.10/en/


nvim tutorial/cheatsheet

nvim tutorial/cheatsheet

vim

 :Tutor

modal editor = various modes

normal,visual 

normal=nav,comands


lesson 1

h=left  j=down k=up l=right

u=undo K=documendation :q=close :q!=quit without saving

x=delete character under cursor

i=insert a text before cursor

A=append text after line (end) / insert after cursor

:wq= write and exit


 lesson 2

dw=delete word (after cursor to space)

d$=delete to the end of line

d=delete operator with 

motions w=to start of next word ,  e=to end of current word, $=end of line,0=start of line

pressing just motions moves cursor as specified

typing number before motion repeats it that many times

2w=move 2 word forward 3e=end of third word 0=start of word

d2w=delete 2 word 

dd=delete and copy whole line

2dd= delete 2 line

u=undo last command

U=fix whole line to its original state/undo changes on line

<C-r>=redo


 lesson 3

p=put previously deleted text after cursor /line below cursor (paste)

P=put text before the cursor /line above cursor

r=replace text in cursor

ce=change until end of word , delete word and put in insert mode

cw=replace from cursor 


lesson 4

<C-g> show location in file and file status

G=move to bottom of file = last line

number G = move to that line number 

gg=move to start of file = 1G

/ = search  n= search for same phrase again N=search in opposite directioin

?=search in backwawrd direction

<C-o>=go back where you came from

<C-i> = go forward

%= find matching  braces ),],or }

:s/old/new = substitute first old with new

:s/old/new/g = substitute command to replace old by new

/g = flag : globally in line

:#,#s/old/new/g =  subst between lines #,# inclusive

:%s/old/new/g = whole file

:%s/old/new/gc = whole file with confirmation prompt 

:! cmd = executes  shell cmd1

:w filename = write to filename 

v : something w filename : write selected text to file

:r filename = retrive file

:r !ls 


lesson 5

o= insert  new line  below cursor

O= same as o but  ablove  line 

a= insert text after cursor

a,i and A all goes to same insert mode

R = replace more than one text / overwrite text

y= yank (copy) selected text

yy= copy line

p= put/paste

v=visual select

j$=end of next line

yw=yank word 

:set ic = set ignorecase

:set hls is = set hlsearch and incsearch

:set noic = disable  ignorecase

:set invic = invert value of setting

:set nohlsearch = remove highliting from search

/ignore\c = search with ignore case

<C-w><C-w> = jump from one window to another

:help w

:help c_CTRL-D

:e  filename = load file 

:saveas path/file 

:x  = only save if necessary

ZZ or :wq = write and quiot 

:bn , :bp = next and previous buffer

<C-d> <Tab> = command line completion in : option 


- *Learn Vim Progressively*:

  http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/

- *Learning Vim in 2013*:

  http://benmccormick.org/learning-vim-in-2014/

- *Vimcasts*:

  http://vimcasts.org/

- *Vim Video-Tutorials by Derek Wyatt*:

  http://derekwyatt.org/vim/tutorials/

- *Learn Vimscript the Hard Way*:

  http://learnvimscriptthehardway.stevelosh.com/

- *7 Habits of Effective Text Editing*:

  http://www.moolenaar.net/habits.html

- *vim-galore*:

  https://github.com/mhinz/vim-galore

. = repeat last command

Ncommand= repeat command n times

100ni am fine <CR> <ESC> = writes i am fine 100 times

NG= goto line N

*,# = goto next,previous word under cursor

<start position><command><end position>

0y$ = goto start and copy to end of line

y2/foo yank to second occurance of foo

^ = go to first character on the line

g_ → go to the last character on the line

fa → go to next occurrence of the letter a on the line. , (resp. ;) will find the next (resp. previous) occurrence.

t, → go to just before the character ,.

3fa → find the 3rd occurrence of a on this line.

F and T → like f and t but backward. 

dt" → remove everything until the "


visual mode

<action>a<object> and <action>i<object>

action = d (delete), y (yank), v(select in visual)

object can be: w a word, W a WORD (extended word), s a sentence, p a paragraph. But also, natural character such as ", ', ), }, ].

rectangular block

0<C-v><C-d>I-- [ESC]

<C-q> if clipboard is not empty

<C-p>, <C-n> completions

:qa = record macros in register a


@@= replay lasst executed macros

qaYp<C-a>q →

    qa start recording.

    Yp duplicate this line.

    <C-a> increment the number.

    q stop recording.

<C-a> increment number

visual selection  = v,V,<C-v>

    J → join all the lines together.

    < (resp. >) → indent to the left (resp. to the right).

    = → auto indent

:split :vsplit

:help split

        :split → create a split (:vsplit create a vertical split)

        <C-w><dir> : where dir is any of hjkl or ←↓↑→ to change the split.

        <C-w>_ (resp. <C-w>|) : maximise the size of the split (resp. vertical split)

        <C-w>+ (resp. <C-w>-) : Grow (resp. shrink) split   

gentoo test

gentoo test

 Gentoo install doc from handbook 

mount rootfs
mount /dev/sdaX /mnt/
 

dl stage 3  rootfs

https://www.gentoo.org/downloads/ 
https://distfiles.gentoo.org/releases/amd64/autobuilds/ 
to get list of tarballs from terminal only : 
curl https://distfiles.gentoo.org/releases/amd64/autobuilds/latest-stage3.txt 
20230917T164636Z/stage3-amd64-hardened-nomultilib-openrc-20230917T164636Z.tar.xz 239532616
 
curl https://distfiles.gentoo.org/releases/amd64/autobuilds/20230917T164636Z/stage3-amd64-hardened-nomultilib-openrc-20230917T164636Z.tar.xz > stage3.tar.xz
 
 

extract  rootfs

sudo tar xpvf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner -C /mnt
or
sudo tar xpvf stage3-amd64-hardened-nomultilib-openrc-20230917T164636Z.tar.xz  --xattrs-include='*.*' --numeric-owner -C /mnt 
 

nano -w /mnt/etc/portage/make.conf

COMMON_FLAGS="-march=native -O2 -pipe"
##our nproc is 4 so j4 
MAKEOPTS="-j4"
 
ACCEPT_LICENSE="*"
VIDEO_CARDS="intel "
INPUT_DEVICES="libinput" 
 
## -kmod for all modules built inside kernel
 USE="-kmod -dbus -elogind -gnome  -kde -consolekit  -polkit -introspection -vala -pulseaudio -llvm -X -vulkan wayland"

ACCEPT_LICENSE="*"
VIDEO_CARDS="intel "
INPUT_DEVICES="libinput"

LC_MESSAGES=C.utf8
FFTOOLS="aviocat ffescape ffeval fourcc2pixfmt"

PORTAGE_SCHEDULING_POLICY="idle"
L10N="en_US"
LINGUAS="en_US"
LUA_TARGETS="luajit"
 
 
 mkdir -p /mnt/etc/portage/repos.conf

 cp /mnt/usr/share/portage/config/repos.conf /mnt/etc/portage/repos.conf/gentoo.conf

 cat /mnt/etc/portage/repos.conf/gentoo.conf
 
cp --dereference /etc/resolv.conf /mnt/etc/ 
ls -la  /mnt/etc/resolv.conf 
-rw-r--r-- 1 root root 84 Sep 24 13:44 /mnt/etc/resolv.conf
  cat /mnt/etc/resolv.conf 
# Resolver configuration file.
# See resolv.conf(5) for details.
nameserver 1.1.1.1
 
 
 cat chroot.sh 
#!/bin/sh
mount --rbind /dev /mnt/dev && mount --make-rslave /mnt/dev
mount --rbind /dev/pts /mnt/dev/pts && mount --make-rslave /mnt/dev/pts
mount --rbind /proc /mnt/proc && mount --make-rslave /mnt/proc
mount --rbind /sys /mnt/sys && mount --make-rslave /mnt/sys
chroot /mnt /bin/sh

bash chroot.sh

 source /etc/profile
export PS1="(gentoo) ${PS1}"
 
 for first time

emerge-webrsync
eselect news list,read,purge
man news.eselect
 
eselect profile list
 
 
profile in gentoo has default USE,CFLAGS and other important vars and also locks sys to certain range of pkgs
 
 
after changing profile update @world set
emerge --ask --verbose --update --deep --newuse @world 
 
emerge --info | grep ^USE
less /var/db/repos/gentoo/profiles/use.desc
 
portage git sync
emerge -a app-eselect/eselect-repository  dev-vcs/git  
 eselect repository remove gentoo
eselect repository add gentoo git https://github.com/gentoo-mirror/gentoo.git
portageq repos_config /
 
rm -r /var/db/repos/gentoo
 
emaint sync -r gentoo
 

https://wiki.gentoo.org/wiki/Eix
mkdir /etc/portage/env/
/etc/portage/env/eix-extra-econf.conf 
   EXTRA_ECONF="--enable-security
--enable-new-dialect
--enable-strong-optimization" 
 
 /etc/portage/package.env/eix
app-portage/eix eix-extra-econf.conf
 
emerge --ask app-portage/eix
 
/etc/eixrc/01-cache
OVERLAY_CACHE_METHOD="assign" 
 
cat /etc/portage/package.use/all  
app-admin/doas persist
media-libs/mesa vaapi
sys-auth/seatd server
gui-wm/sway -swaynag
x11-misc/i3blocks -contrib
media-video/mpv -xv alsa vaapi alsa drm jpeg lcms
media-video/ffmpeg alsa libdrm vaapi alsa mp3 vorbis lcms
net-wireless/wpa_supplicant tkip wps wep
media-libs/freetype harfbuzz
sys-apps/util-linux udev
media-libs/libplacebo -vulkan
app-text/poppler -utils cairo
app-misc/jq -oniguruma
dev-libs/light udev
net-wireless/iwd standalone -monitor
sys-apps/openrc -netifrc
net-misc/socat -ssl -ipv6

 
 
 
 

Timezone and locale

ls /usr/share/zoneinfo/Asia

echo "Asia/Kathmandu" > /etc/timezone

rm /etc/localtime

emerge --config sys-libs/timezone-data 

[make symlink to /etc/localtime i.e ln -s /usr/share/zoneinfo/Asia/Kathmandu /etc/localtime  if no file is present]

 

nano /etc/locale.gen

en_US.UTF-8 UTF-8
 
locale-gen
eselect locale list
eselect locale set N
cat /etc/env.d/02locale 
env-update && source /etc/profile && export PS1="(chroot) ${PS1}" 

 

manually download firmware and put in /lib/firmware

 emerge --ask sys-kernel/gentoo-sources
 https://packages.gentoo.org/packages/sys-kernel/gentoo-sources

 

eselect kernel list
eselect kernel set 1
ls -l /usr/src/linux 
 

 emerge --ask sys-apps/pciutils

cd /usr/src/linux 
make menuconfig
make && make modules_install
make install 

blkid 
nano -w /etc/fstab
#/dev/sda3   /            ext4    noatime  0 1
/dev/sda4 /home ext4 rw,noatime 0 0 

emerge --ask app-portage/cpuid2cpuflags
cpuid2cpuflags
CPU_FLAGS_X86: aes avx avx2 avx512f avx512dq avx512cd avx512bw avx512vl avx512vbmi f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3
 
echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags
  
emerge --deselect gnumeric
emerge --update --deep @world
emerge --update --deep --newuse @world
emerge --ask --depclean 
 
 
for iwd 
https://iwd.wiki.kernel.org/gettingstarted
 
scripts/config --enable CONFIG_CRYPTO_USER_API_SKCIPHER
scripts/config --enable CONFIG_CRYPTO_USER_API_HASH
scripts/config --enable CONFIG_CRYPTO_HMAC
scripts/config --enable CONFIG_CRYPTO_CMAC
scripts/config --enable CONFIG_CRYPTO_MD4
scripts/config --enable CONFIG_CRYPTO_MD5
scripts/config --enable CONFIG_CRYPTO_SHA256
scripts/config --enable CONFIG_CRYPTO_SHA512
scripts/config --enable CONFIG_CRYPTO_AES
scripts/config --enable CONFIG_CRYPTO_ECB
scripts/config --enable CONFIG_CRYPTO_DES
scripts/config --enable CONFIG_CRYPTO_CBC
 
for systemd-utils
config:
* - BLK_DEV_BSG
* - DEVTMPFS
* - IDE
* - INOTIFY_USER
* - SYSFS_DEPRECATED
* - SYSFS_DEPRECATED_V2
* - SIGNALFD
* - EPOLL
* - FHANDLE
* - NET
* - UNIX 
 
for wps 
scripts/config --enable CONFIG_KEY_DH_OPERATIONS
 
usermod -a -G netdev <user> 
or wheel group to access iwctl dbus
  
firmware 
nano  /etc/portage/package.license 
 sys-kernel/linux-firmware @BINARY-REDISTRIBUTABLE
 emerge --ask sys-kernel/linux-firmware
 
or copy from linxu-firmware-git repo to /lib/firmware dir
 
 
media-libs/mesa 
 
https://packages.gentoo.org/packages/dev-libs/intel-compute-runtime
 
 manually running ebuild
ebuild /var/db/repos/gentoo/media-libs/mesa/mesa-23.1.6.ebuild compile
>>> Existing ${T}/environment for 'mesa-23.1.6' will be sourced. Run
>>> 'clean' to start with a fresh environment. 
ebuild /var/db/repos/gentoo/media-libs/mesa/mesa-23.1.6.ebuild install
ebuild /var/db/repos/gentoo/media-libs/mesa/mesa-23.1.6.ebuild qmerge
 
or 
 
 
emerge --resume 
 
nano /etc/portage/package.use/all
app-admin/doas persist
sys-auth/seatd server builtin
gui-wm/sway -swaynag
#x11-misc/i3blocks -contrib
dev-libs/light udev
net-wireless/iwd standalone -monitor
media-video/ffmpeg mp3 alsa libdrm x264 x265 vaapi
media-video/mpv alsa X drm -xv vaapi
emerge --ask app-portage/gentoolkit
https://wiki.gentoo.org/wiki/Equery
 
emerge -a wofi 
 ....
note version of adwaita-icon-theme and librsvg 
 
skip rust for now 
 nano /etc/portage/profile/package.provided
x11-themes/adwaita-icon-theme-44.0
gnome-base/librsvg-2.56.3
 

genpatches
https://gitweb.gentoo.org/proj/linux-patches.git/refs/heads
https://gitweb.gentoo.org/proj/linux-patches.git/tree/4567_distro-Gentoo-Kconfig.patch

REFCOUNT_FULL
PAGE_POISONING_ZERO
 

 

ffmpeg

AV1=webm,mkv ,ISOBMFF( MP4, 3GP, 3G2, .mj2, .dvb, .dcf, .m21, .f4v, HEIF),RTP

AV1, VP9, Theora, MPEG-5 Base profile= free

 VVC, HEVC, AVC, MPEG-5 Main profile= propi

GIF, MP3, MPEG-1, MPEG-2, MPEG-4 Part 2 = expired

 

AV1 implementation = Libaom , SVT-AV1, rav1e, dav1d, Cisco AV1

 

vaapi on mesa

https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/mesa/mesa-23.1.6.ebuild

ewarn "Ignoring USE=vaapi      since VIDEO_CARDS does not contain d3d12, r600, radeonsi, or nouveau"
 
emerge -a media-libs/libva-intel-media-driver
 
USE=vulkan now needs llvm for mesa
  
emerge -ap firefox-bin
 media-libs/libogg  media-libs/flac  media-libs/libvorbis  media-sound/mpg123  media-libs/speexdsp
  media-libs/webrtc-audio-processing  media-libs/libsndfile  media-libs/libpulse  media-plugins/alsa-plugins
 
 

priority portage

PORTAGE_SCHEDULING_POLICY="idle"
 
 portageq can be used to show the active features:
portageq envvar FEATURES | xargs -n 1
 
To find out what FEATURES are set by default 
emerge --info | grep ^FEATURES= 
 

Userfetch

 

FEATURES="userfetch"

chown --recursive --verbose portage:portage /var/db/repos/gentoo

sudo chmod -R g+rwX /var/db/repos/gentoo/

 

verify distfiles

To re-verify the integrity and (potentially) re-download previously removed/corrupted distfiles for all currently installed packages, run:

emerge --ask --fetchonly --emptytree @world  

 

 

localization 

L10N="en_US"
LINGUAS="en_US"    

 

LINGUAS="", most ebuilds would install only the packages' default language but none of the LC_MESSAGES files.  

USE_EXPAND variable called L10N decides which extra localization support will be installed.

complex entries have a different syntax because L10N uses IETF language tags (aka BCP 47). For example, pt_BR and sr@latin in LINGUAS become pt-BR and sr-Latn in L10N, respectively. 

 

 cat  /var/db/repos/gentoo/profiles/desc/l10n.desc

grep -i english /var/db/repos/gentoo/profiles/desc/l10n.desc

 

cat /etc/locale.gen

en_US.UTF-8 UTF-8
 

localedef --list-archive

eselect locale list

eselect locale set 1

 

/etc/conf.d/keymaps

keymap="us"

windowkeys="YES"

extended_keymaps="" 

dumpkeys_charset=""
fix_euro="NO"

    


systemd-utils

 * config:
 *  - BLK_DEV_BSG
 *  - DEVTMPFS
 *  - IDE
 *  - INOTIFY_USER
 *  - SYSFS_DEPRECATED
 *  - SYSFS_DEPRECATED_V2
 *  - SIGNALFD
 *  - EPOLL
 *  - FHANDLE
 *  - NET
 *  - UNIX


  /bin/systemd-hwdb
   /lib/udev/ata_id
   /bin/systemd-tmpfiles
   /bin/udevadm
   /lib/udev/cdrom_id
   /lib/udev/mtd_probe
   /lib/udev/fido_id
   /lib/udev/scsi_id
   /lib/udev/v4l_id
   /lib64/libudev.so.1.7.7

 module less system

make.conf

use="-kmod"

  cat  /var/lib/portage/world

app-admin/doas
app-editors/nano
app-editors/neovim
app-eselect/eselect-repository
app-misc/jq
app-misc/neofetch
app-misc/nnn
app-portage/cpuid2cpuflags
app-portage/eix
app-portage/gentoolkit
app-shells/bash-completion
app-text/zathura
app-text/zathura-pdf-poppler
dev-libs/dbus-glib
dev-libs/elfutils
dev-libs/light
dev-python/pip
dev-vcs/git
gui-apps/foot
gui-apps/grim
gui-apps/slurp
gui-apps/swaylock
gui-apps/wl-clipboard
gui-apps/wofi
gui-wm/sway
media-libs/libva-intel-media-driver
media-sound/alsa-utils
media-sound/apulse
media-video/mpv
net-misc/socat
net-misc/yt-dlp
net-wireless/iwd
net-wireless/wireless-regdb
sys-apps/ripgrep
sys-fs/ncdu
sys-fs/ntfs3g
sys-process/htop
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXcursor
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXrandr
x11-libs/libXtst
x11-misc/i3blocks
 

 

 

 refrences:

https://wiki.gentoo.org/wiki/GCC_optimization

https://wiki.gentoo.org/wiki/Safe_CFLAGS 
 
 
https://wiki.gentoo.org/wiki/Localization/Guide
 https://github.com/kzwkt/gentoo-dell-inspiron-3501 

https://wiki.gentoo.org/wiki/Portage_with_Git  

 https://wiki.gentoo.org/wiki/Recommended_applications  
https://wiki.gentoo.org/wiki/List_of_software_for_Wayland 
https://wiki.gentoo.org/wiki/FEATURES
 https://wiki.gentoo.org/wiki/Handbook:AMD64/Working/Features
 

 https://wiki.gentoo.org/wiki/Localization

https://wiki.gentoo.org/wiki/Localization/Guide#Locale_system

uninstall/upgrade pip pkg with dependencies

uninstall/upgrade pip pkg with dependencies

pip install pip-autoremove

pip-autoremove pkgname 


Src

http://stackoverflow.com/questions/7915998/ddg#27713702 

 

cat .config/pip/pip.conf 

[global]

break-system-packages = true

 

upgrade all

pip freeze --user | cut -d'=' -f1 | xargs -n1 pip install --user --upgrade