Lots of new stuff

This commit is contained in:
lhark 2020-04-16 17:53:00 -04:00
parent 9c7cc94083
commit f67df10479

152
how_to
View file

@ -19,6 +19,7 @@ Usefull packages :
Desktop environment : Desktop environment :
dwm Dynamic Window Manager dwm Dynamic Window Manager
dmenu dmenu
sway
Office : Office :
sent Simple slides tool sent Simple slides tool
Misc : Misc :
@ -28,6 +29,72 @@ Usefull packages :
jedi-vim jedi-vim
Pretty log pager: Pretty log pager:
lnav lnav
Backlight management:
light # http://haikarainen.github.io/light/
System setup:
display/drivers:
xorg-server
xorg-xinit
xorg-xev
xf86-video-{intel,amdgpu,etc...}
xf86-input-libinput
mesa
lib32-mesa
xinput
light # backlight control
mesa-demos
desktop;
dwm
dmenu
dunst
libnotify
sound:
pulseaudio
pavucontrol
alsa-utils{,-runit}
tools:
kitty
zsh
git
vim
xsel
xclip
htop
ncdu
usbutils # contains lsusb
arch:
trizen
highlight
multimedia:
imagemagick
feh
mpv
mpd
ffmpeg
youtube-dl
qrencode
maim
gimp
security
keepassxc
connectivity:
wpa_supplicant
networkmanager{,-runit}
qutebrowser # With jblock
openssh{,-runit]
liferea
bluez{,-runit}
fonts:
ttf-Hack
mail:
neomutt
fdm
isync
msmtp
notmuch
misc:
miscfiles
keyboard : keyboard :
@ -224,6 +291,7 @@ Fix hardware clock (with chrony):
sudo hwclock --systohc sudo hwclock --systohc
Network Manager: Network Manager:
# Yes it is bloated, but it #JustWorks(TM)
nmtui : add/edit connections nmtui : add/edit connections
nmcli : informations nmcli : informations
Fix nm-applet/nmtui only working with root/sudo: Fix nm-applet/nmtui only working with root/sudo:
@ -235,6 +303,12 @@ Network Manager:
}); });
sudo usermod -aG network <user> sudo usermod -aG network <user>
Ethernet sharing:
install dnsmasq
Add new ethernet connection
Under IPv4:
select Shared
Power saving : Power saving :
echo "vm.dirty_writeback_centisecs = 6000" >> /etc/sysctl.d/dirty.conf echo "vm.dirty_writeback_centisecs = 6000" >> /etc/sysctl.d/dirty.conf
echo "vm.laptop_mode = 5" >> /etc/sysctl.d/laptop.conf echo "vm.laptop_mode = 5" >> /etc/sysctl.d/laptop.conf
@ -274,6 +348,24 @@ Video and audio editing:
Gif to mp4 for browsers/the web: Gif to mp4 for browsers/the web:
# https://unix.stackexchange.com/a/294892 # https://unix.stackexchange.com/a/294892
ffmpeg -i in.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4 ffmpeg -i in.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4
mp4 to gif:
# https://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality
ffmpeg -i in.mp4 -vf "fps=10,scale=320:-1:flags=lanczos,split[x][z];[z]palettegen[y];[x][y]paletteuse" -loop 0 out.gif
Convert video to YUV420 for the Web:
# https://stackoverflow.com/a/37969294
ffmpeg -i 1/25359.mp4 -vf "scale=2*trunc(iw/2):-2,setsar=1" -profile:v main -pix_fmt yuv420p out.mp4
Record screen:
# https://www.reddit.com/r/linux/comments/8n3ylp/screen_recording_in_x11_with_ffmpeg/
ffmpeg -video_size 702x779 -framerate 30 -f x11grab -i "$DISPLAY+0,19" out.mp4
# With some sound capture
ffmpeg -video_size 702x779 -framerate 30 -f x11grab -i "$DISPLAY+0,19" -f pulse -ac 2 -i default out.mp4
# How to get window geometry
xdotool selectwindow getwindowgeometry
# Awful one liner
# About the YUV420 conversion: https://stackoverflow.com/a/37969294
xdotool selectwindow getwindowgeometry | awk '/Position/{printf $2" "$4" "} /Geometry/{printf $2" "}' | sed 's/)//' | read OFFSET SCREEN SIZE; ffmpeg -video_size $SIZE -framerate 30 -f x11grab -i "$DISPLAY.$SCREEN+$OFFSET" -vf "scale=2*trunc(iw/2):-2,setsar=1" -pix_fmt yuv420p out.mp4
Filter doc:
# https://trac.ffmpeg.org/wiki/FilteringGuide
ImageMagick: ImageMagick:
crop to aspect ratio crop to aspect ratio
@ -714,6 +806,12 @@ Android diagnostic debug phone codes:
Android wpa_supplicant conf file path: Android wpa_supplicant conf file path:
/data/misc/wifi/wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf
Grub2 theme customization:
theme.txt reference:
http://wiki.rosalab.ru/en/index.php/Grub2_theme_/_reference#Main_file_syntax
Example theme:
https://github.com/shvchk/fallout-grub-theme
Limit bandwidth, download/upload speed of process: Limit bandwidth, download/upload speed of process:
Non-forking processes Non-forking processes
netbrake -r <bytes per sec> <program> [args] netbrake -r <bytes per sec> <program> [args]
@ -721,8 +819,52 @@ Limit bandwidth, download/upload speed of process:
Pacman -> /etc/pacman.conf Pacman -> /etc/pacman.conf
XferCommand = /usr/bin/wget --limit-rate 100K --passive-ftp -c -O %o %u XferCommand = /usr/bin/wget --limit-rate 100K --passive-ftp -c -O %o %u
Grub2 theme customization: Qutebrowser
theme.txt reference: Adblocking:
http://wiki.rosalab.ru/en/index.php/Grub2_theme_/_reference#Main_file_syntax https://gitlab.com/jgkamat/jblock
Example theme: Config:
https://github.com/shvchk/fallout-grub-theme :set auto-save.session true
Alsa set default card
Get list of cards:
$ aplay -l
In ~/.asoundrc:
pcm.!default {
type hw
card <name|id>
}
ctl.!default {
type hw
card <name|id>
}
Testing:
$ aplay -D default:PCH /usr/share/sounds/alsa/Front_Center.wav
mpc/mpc shuffle whole library and save as playlist
$ mpc crop && mpc listall | mpc add && mpc shuffle && (mpc rm all; mpc save all)
GNU miscfiles:
Dictionary wordlist
Airport codes
Chat abbreviations
Cities/countries list
Currency ISO code
list of connective words
phone country codes
north america area codes
C operator associativity
Imcomplete proper name list
Unicode characters
Dictionary:
sdcv # CLI stardict tool. Dictionaries not included
stardict-wornet # English dictionary (AUR)
miscfiles # GNU miscfiles project include a wordlist file
grep "word" /usr/share/dict/words
Gandi for server setup:
Dynamic DNS:
install gandi-automatic-dns (AUR)
Let's encrypt/letsencrypt:
install certbot-dns-gandi-git (AUR)
# Email address is kept private