nyk0

Linux notes

Files/Hardware

fzf


git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
  ~/.fzf/install
    

vim plugins


curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    

tmux plugins


git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
    

gogh (terminal colors)


bash -c "$(wget -qO- https://git.io/vQgMr)"
    

nordic wallpapers


cd Pictures
git clone https://github.com/linuxdotexe/nordic-wallpapers.git
    

yt-dlp


# get playlist	
yt-dlp -w --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 160K --output "%(title)s.%(ext)s" --yes-playlist 'https://music.youtube.com/playlist?list=PLZa1UYHdqvjDtp9f1P2enloz7ivuqGuFU'
    

mpv


# Playing a playlist with an mpv window showing album art
mpv --quiet --geometry=300x300+0+0 --shuffle https://music.youtube.com/playlist?list=PLZa1UYHdqvjBplPTAfU8kxA2LR4DGlt4t"

# Playing a playlist of album playlists
# albums.m3u contains playlist of youtube urls with EXIF info for titles

alias albums="mpv --quiet --no-terminal --geometry=300x300+15+140 ~/dotfiles/albums.m3u &"

    

light-dm

For remembering the last session a user logged in (that way each user can have a different preference)

edit /etc/lightdm/lightdm.conf

on section [Seat:*]

add or uncomment this: user-session=default

Create zip archive


# add -e flag to encrypt

zip -r /tmp/ziparchive.zip ~/Documents/

Deactivate and activate the build in camera


# deactivate :
  sudo modprobe -r uvcvideo
# activate:
  sudo modprobe uvcvideo
      

GPG/SSH setup - encrypt/decrypt files

General instructions for creating an idendity and encrypt/decrypt files
with it.

SSH keys

The SSH keys are used for secure connections using the SSH protocol.
Instructions for creating can be found on github help
pages

They can be copied to another computer using the scp command from one
~/.ssh folder to another but afterwards you still need to create an
identity with ssh-add (although it's not considered a good practice)

Image Magick

Resize images to another folder

mogrify -path "new" -resize 50% -format jpg *.jpg

Crop images to another folder

mogrify -path "new" -crop 320x320+0+0 -format jpg *.jpg

HD monitor resolution on Linux

copy this to /etc/X11/xorg.conf.d/10-monitor.conf

Section "Monitor"
    Identifier "VGA-1"
    Modeline "1920x1080R"  138.50  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync
    Option "PreferredMode" "1920x1080R"
EndSection

Correct time when dual booting Windows

Linux part commands

       sudo ntpdate pool.ntp.org
       sudo hwclock --systohc --utc
       sudo timedatectl set-local-rtc 1
     

Windows part Regedit .reg file

           Windows Registry Editor Version 5.00
           [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
           "RealTimeIsUniversal"=dword:00000001
         

Analyze boot time

from this reddit thread

systemd-analyze               # show total boot time
systemd-analyze blame         # show list from most slow services

Firefox

Autosave bookmarks when firefox is closed

about:config

  
browser.bookmarks.autoExportHTML = true
browser.bookmarks.file           = {full path to file}