Things I miss on linux

Tips

Set hostname:

hostnamectl set-hostname <new_hostname>

Run gnome settings on i3:

env XDG_CURRENT_DESKTOP=GNOME gnome-control-center

Remove i386 architecture from linux

sudo apt-get purge `dpkg --get-selections | grep ":i386" | awk '{print $1}'`
dpkg --remove-architecture i386
dpkg --print-foreign-architectures

Format MBR and MBR/Partitions

dd if=/dev/zero of=/dev/sdX bs=446 count=1 # mbr only
dd if=/dev/zero of=/dev/sda bs=512 count=1 # mbr + partitions

Defining a raid1

# format partition with raid type 0xFD for raid autodetect arrays
mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sdd1 /dev/sde1
mkfs.ext4 /dev/md0
mount /dev/md0 /mnt/<mount_point>

passing /dev/stdout as parameter to a process

aws lambda invoke --function-name service-definition-dev-GithubFetch-DJD35X6DGSRS /dev/stdout

jq can be used to access inner json structure

aws lambda invoke --function-name service-definition-dev-GithubFetch-DJD35X6DGSRS /dev/stdout | jq '.body|fromjson|[.[].name]

OBS recording with compton causes flickering on the screen

imagemagick tricks

convert source.jpg -colorspace Gray destination.jpg (true grayscale only)
convert source.jpg -monochrome destination.jpg (true black and white)
convert source.jpg -separate destination.jpg (separate into gray channels

mogrify destructive

migrify -format jpg *png # convert all pngs into jpg

youtube-dl

save subtitle only

youtube-dl --all-subs --skip-download ... 

reduce PDF size

-dPDFSettings * /prepress (default) Higher quality output (300 dpi) but bigger size * /ebook Medium quality output (150 dpi) with moderate output file size * /screen Lower quality output (72 dpi) but smallest possible output file size

    gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

caja not mounting devices

/etc/polkit-1/localauthority/50-local.d/automount.pkla


[Allow Automount]
Identity=unix-group:plugdev
Action=org.freedesktop.udisks2.filesystem-mount*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Allow Eject]
Identity=unix-group:plugdev
Action=org.freedesktop.udisks2.eject-media*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Allow Mounting of fstab]
Identity=unix-group:plugdev
Action=org.freedesktop.udisks2.filesystem-fstab*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

analyze boot speed

systemd-analyze blame
systemd-analyze
systemd-analyze critical-chain