A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
ABX test of audio files
abx original.wav lossy.wavAllow user access to block device
setfacl -m u:pmart:rw /dev/sdxSet default ACL on directory allowing world write access for created objects (ignore umask)
setfacl -d -m o:rwx DIRPackage android-sdk-platform-tools-common contains udev rules allowing to work with adb as regular user.
Clear log buffers (main, system, crash)
adb logcat -cPrint entries with VLC tag and minimum level of priority Error. Available levels from lowest to highest V/D/I/W/E/F/S
adb logcat -s VLC:EPrint entries with message matching Perl regex
adb logcat -e '(?i)vlc'Print entries originating from PID
adb logcat --pid 14092Pull SeedVault backup directory
adb pull /sdcard/.SeedVaultAndroidBackup/ SeedVaultAndroidBackupInspect ICC profile
iccdump profile.icm
List available hardware devices/PCMs
aplay -l
aplay -L
Test speakers
speaker-test -D hw:0,1 -c 2
aplay -D sysdefault /usr/config/ppsspp/assets/sfx_confirm.wavStore/restore volume levels in /var/lib/alsa/asound.state file
alsactl store
alsactl restoreList loaded profiles and confined processes
aa-statusCreate an ad-hoc basic profile
include <tunables/global>
profile basic {
include <abstractions/base>
}
Load profile manually (add to /etc/apparmor.d for autoload)
apparmor_parser -r basicRun program confined with basic profile
aa-exec -p basic <prog> <args>Refresh component metadata cache
appstreamcli refresh-cacheGet information about a component by its ID
appstreamcli get org.kde.kwrite.desktopAdd PPA
echo 'deb http://ppa.launchpad.net/krisives/applet-window-buttons/ubuntu focal main' > /etc/apt/sources.list.d/applet-window-buttons.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 79A48A5F7C81C1A2E8715D1D5CB890A3B37F5DD2
apt updateRemove PPA
rm /etc/apt/sources.list.d/applet-window-buttons.list
apt-key del 79A48A5F7C81C1A2E8715D1D5CB890A3B37F5DD2
apt updateAdd GPG key
wget -qO - https://example.com/key.gpg | sudo apt-key --keyring /etc/apt/trusted.gpg.d/example.gpg add -Search patterns
man 7 apt-patternsPurge all packages with residual config
apt purge '~c'Put package on hold
apt-mark hold grepMark all libs as automatically installed
apt-mark auto '~s^libs$'gpg --no-default-keyring --keyring /usr/share/keyrings/foo-archive-keyring.gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys <keyid>
echo 'deb [signed-by=/usr/share/keyrings/foo-archive-keyring.gpg] http://repository.foo.com stable main' > /etc/apt/sources.list.d/foo.list/etc/apt/preferences.d/foo.pref:
Package: *
Pin: origin repository.foo.com
Pin-Priority: 100
Print URL of acquired deb
apt download -o Debug::pkgAcquire=true <package>Show dependencies that will be installed for a package recursively
apt-rdepends --state-follow=NotInstalled --state-show=NotInstalled fdroidserver| Pattern | Description |
|---|---|
~i !~M !~prequired !~pimportant |
manually installed non-essential packages |
!~i (~prequired | ~pimportant | ~pstandard) !~ri386 |
missing standard priority packages |
List upgradeable packages grouped by source package:
aptitude versions --group-by=source-package -F '%c %p %d' '~U (~V CURRENT | ~V CANDIDATE)'apt install asciidoctor ruby-nokogiri
gem install asciidoctor-epub3 --preDownload kindlegen from Amazon.
asciidoctor-epub3 -D output -a ebook-format=kf8 -a epub3-stylesdir=$HOME/Documents/asciidoctor-epub3/styles -a ebook-extract <index.adoc>Print the status of the indexer
balooctl statusSupspend/resume indexer
balooctl suspend
balooctl resumeRemove index database
balooctl purgeShow indexing information about file
balooshow -x ~/Downloads/download.pdfList key bindings for keymap (emacs, vim-command, vim-insert)
bind -p -m <keymap>HISTSIZE, HISTFILESIZE
Extract .iso/.wav tracks from BIN/CUE image
bchunk -w image.bin image.cue imageLookup domain name foobar by querying server at 192.168.1.1
host -v foobar 192.168.1.1curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | apt-key --keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add -
echo 'deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main' > /etc/apt/sources.list.d/brave-browser-release.listDump in canonical format (hexdump -C or hd)
$ printf SLUS-00152 | hexdump -C
00000000 53 4c 55 53 2d 30 30 31 35 32 |SLUS-00152|
0000000a
Dump in plain hexadecimal format
$ printf SLUS-00152 | hexdump -v -e '/1 "%X"'; echo
534C55532D3030313532
Send a message to other user on the system
$ write <user>
Hello, world!
^D
Install local root CA certificate
install my.crt /usr/local/share/ca-certificates
update-ca-certificatesInstallation
curl -O https://ftp.gnu.org/gnu/ccd2cue/ccd2cue-0.5.tar.gz
./configure
make
install src/ccd2cue /usr/local/binUsage
for f in *.ccd; ccd2cue -o (basename $f .ccd).cue $f || break; endPassword generation requires sync
- Use snap or VAAPI capable version from PPA
- For snap run
./widevine-for-chromium-snap
If snap interfaces get disconnected after system upgrade run
snap disable chromium
snap enable chromium
snap connect chromium:password-manager-serviceDisable automatic database updates
systemctl disable clamav-freshclam.serviceScan a file
clamscan ~/Downloads/mp3tagv303setup.exeHas problem with more restrictive 0007 umask. Add to /etc/apt/apt.conf.d/50command-not-found
chmod o+r /var/lib/command-not-found/commands.db*git clone --depth=1 https://review.coreboot.org/corebootcd coreboot/util/ifdtool
makePrint information about Intel firmware
ifdtool -d firmware.bincd coreboot/util/intelmetool
makeCheck Intel ME status
intelmetool -mCheck Intel Boot Guard status
intelmetool -bOverwrite and remove file
shred -vu -n 1 archive.tar.gzOverwrite block device with zeros
shred -vz -n 0 /dev/sdXRead random byte from block device at regular intervals
set device /dev/sdx
set max (math (blockdev --getsize64 $device) - 1)
while :
dd if=$device of=/dev/null bs=1 count=1 skip=(random 0 $max) status=none
sleep 180
endFormat numbers in human-readable form
numfmt --to=iec 2048
ls -l | numfmt --header --field 5 --to=iecJobs in /etc/cron.* not available as systemd timers: aptitude dpkg bsdmainutils
Show info about LUKS volume
cryptsetup luksDump DEVICEBackup LUKS header to file
cryptsetup luksHeaderBackup DEVICE --header-backup-file <file>Convert LUKS1 volume to LUKS2. It is reccommended to create backup of LUKS header before attempting conversion.
cryptsetup convert DEVICE --type luks2Change label of LUKS2 volume
cryptsetup config DEVICE --label <label>TRIM support for SSD Disable workqueue for increased SSD performance
Unlocking scripts lack i18n (Please unlock disk XXX)
Download using proxy
curl --proxy socks5://127.0.0.1:1234 http://httpbin.org/ip
Generate byte sequence
printf "$(printf '\\%o' $(seq 0 127))"Probe I2C devices to find monitor buses
ddccontrol -pPower on/off monitor
dccontrol dev:/dev/i2c-6 -r 0xd6 -w 1
dccontrol dev:/dev/i2c-6 -r 0xd6 -w 5Run deadbeef under firejail
cd /opt/deadbeef/bin
mv deadbeef{,.real}./deadbeef:
#!/bin/sh
exec firejail --profile=/etc/firejail/deadbeef.profile /opt/deadbeef/bin/deadbeef.realchmod 755 ./deadbeef
ln -s /opt/deadbeef/bin/deadbeef /usr/local/bin
Debian Installation Guide
Debian Installer internals
Debian testing images:
- debian-installer page
- weekly installer builds
- daily installer builds (version of the installer that will install testing but uses the latest d-i build from the porters for each architecture)
- weekly live builds
Download and verify image
wget https://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-cd/{debian-testing-amd64-netinst.iso,SHA512SUMS{,.sign}}
gpg --keyserver keyring.debian.org --recv-keys F41D30342F3546695F65C66942468F4009EA8AC3
gpg --verify SHA512SUMS{.sign,}
sha512sum -c --ignore-missing SHA512SUMSBoot/preseed parameters (change at runtime or edit /boot/grub/grub.cfg on installation media)
| Name | Shorthand | Value |
|---|---|---|
| debconf/priority | priority | critical/high/medium/low medium offers more control over installation |
| base-installer/install-recommends | recommends | true/false |
| base-installer/includes | ||
| base-installer/excludes | cron ifupdown isc-dhcp-client isc-dhcp-common nano rsyslog tasksel-data |
|
| base-installer/debootstrap_variant | Use minbase to install only required packages |
|
| debian-installer/language | language | en |
| debian-installer/country | country | PL |
| debian-installer/locale | locale | C |
| keyboard-configuration/xkb-keymap | keymap | pl |
Use Alt+Fx to switch VTs (1: menu, 2-3: shell, 4: syslog)
Load additional d-i components (udebs)
anna-install fdisk-udeb cryptsetup-udebAfter partitioning to continue installation without having /boot on unencrypted partition (#849400) switch to console and remove the check at the end of
/lib/partman/check.d/07crypto_check_mountpoints
file (after Is there a /boot partition for encrypted root? comment)
nano /lib/partman/check.d/07crypto_check_mountpointsManually install some of the standard and optional packages
apt-install bash-completion ca-certificates dbus file libpam-systemd man-db manpages wget
apt-install aptitude firmware-iwlwifi intel-microcode kbd
apt-install --with-recommends iwd # wireless-regdbInstall bootloader manually (encrypted root on /dev/sda2)
in-target cat & # Setup /target for chroot
chroot /target bash
SYSTEMD_RELAX_ESP_CHECKS=1 bootctl install # Don't check for GPT: https://github.com/systemd/systemd/issues/1125
install -d -m 700 "/boot/efi/$(cat /etc/machine-id)"
echo 'root=/dev/mapper/sda2_crypt quiet' > /etc/kernel/cmdline
kernel-install -v add 5.10.0-6 /vmlinuz /initrd.img # Adjust version
exit # Exit chroot
kill %1 # Cleanup /target (should remove policy-rc.d file)Setup minimal Debian bullseye system (use --include/--exclude to adjust installed packages)
debootstrap --verbose --variant minbase --include iproute2 ./bullseye-chroot http://deb.debian.org/debianVariants:
minbase:requiredpackages + apt- default:
requiredandimportantpackages + apt
Run without root privileges (requires fakechroot and fakeroot packages)
fakechroot fakeroot sh -x /usr/sbin/debootstrap --verbose --variant=fakechroot ...Check available package versions
rmadison syncthingCreate package to satisfy build-dependencies
printf '%s: %s\n' Source intelemetool Build-Depends 'libpci-dev, zlib1g-dev' > intelemetool.control
mk-build-deps intelmetool.controlShow server info
dict -IInstall server and databases for local access
apt install dictd dict-{foldoc,freedict-{eng-pol,pol-eng,pol-rus},gcide,jargon,vera,wn}Compare contents of two directories
diff -q --ignore-file-name-case dir1/ dir2/Check if file is zero-filled
cmp file /dev/zeroCreate a FAT32 filesystem with label MYVOLUME (up to 11 characters)
mkdosfs -v -F 32 -n MYVOLUME /dev/sdXupdate-alternatives --set iptables /usr/sbin/iptables-nft
update-alternatives --set ip6tables /usr/sbin/ip6tables-nftList packages with specified format
dpkg-query -Wf '${Priority;9} ${binary:Package;20} ${Version;10} ${Architecture;5} ${binary:Summary}\n'Local backport of fscrypt package
sudo apt install {debian,ubuntu}-keyring
dget 'https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/fscrypt/0.2.9-1/fscrypt_0.2.9-1.dsc'
cd fscrypt-0.2.9/
dch -l '~local' 'Mark as local'
mk-build-deps
sudo apt install fscrypt-build-deps_0.2.9-1~local_all.deb
dpkg-buildpackage -bSimpleBackportCreation
CreatePackageFromPPA
BuildingFormalBackports
Print information about DVD-Video
dvdbackup -I -i /path/to/dvdBackup main title
dvdbackup -F -n name -i /path/to/dvdDisplay information about filesystem
dumpe2fs -h DEVICECreate ext4 filesystem suitable for long-term storage of large files. Alternatively specify bytes-per-inode with -i or set number of inodes directly with -N. Set journal size with -J size=<megs> option.
mkfs.ext4 -v -T largefile4 -m 0 DEVICEChange filesystem UUID to random one
tune2fs -U random DEVICECheck fragmentation of extent based files on ext4 filesystem
e4defrag -c /mnt/point Search for encrypted files
lsattr -Ra <dir> 2> /dev/null | grep -E '^.{9}E'Build and install
git clone https://github.com/alucryd/ecm-tools.git
make
make DESTDIR=out installDecode to BIN format
for f in *.bin.ecm; ecm2bin "$f"; endList boot entries
efibootmgr --verboseCreate boot entry
efibootmgr --verbose --create --disk /dev/sdX --part Y --loader '\EFI\systemd\systemd-bootx64.efi' --label 'Linux Boot Manager'Delete boot entry
efibootmgr -b 0005 -BRead values of EFI secure variables
efi-readvarBackup EFI secure variable
efi-readvar -v PK -o PK.eslShow information about EPUB document
einfo ~/Downloads/book.epubValidate EPUB file
epubcheck ~/Downloads/book.epubCreate package with dependencies
cd /tmp
equivs-control whdd-control
editor whdd-control
eqivs-build whdd-control
sudo apt install whdd-deps_1.0_all.debmkexfatfs -n <label> /dev/sdd2Automatically rotate images based on Exif orientation tag
exiftran -a -i *.jpgDump exiv data
exiftran -d image.jpgRemove image metadata
exiv2 rm foo.jpggit clone --depth 1 https://gitlab.com/pmartycz/fdroiddata
cp /usr/share/doc/fdroidserver/examples/config.py fdroiddataEdit config.py
sdk_path = "/home/pmart/Android"
gradle = "gradle"
Build app
fdroid build -l -v -W warn com.zeapo.pwdstoreCreate key and sign
fdroid update --create-key -W ignore
fdroid publish -W ignore com.zeapo.pwdstoreConvert Blu-ray playlist to Matroska:
- copy video stream
- downmix first audio stream to stereo and encode with Opus
- copy two subtitle streams
- add language tag for audio and subtitle streams
ffmpeg -playlist 348 -i bluray:BLADE_RUNNER_2049_EUR_BLUEBIRD -map 0:v -map 0:a:0 -metadata:s:a:0 language=eng -map 0:s:#4609 -metadata:s:s:0 language=eng -map 0:s:#4623 -metadata:s:s:1 language=rus -c copy -ac 2 -c:a libopus -b:a 128k blade-runner-2049.mkvCheck files video codec
for f in *.mp4; printf %s "$f: "; ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 -- "$f"; endGrab top of the screen
ffmpeg -f x11grab -video_size 1600x400 -framerate 59.98 -i $DISPLAY screen.webmCreate slow motion effect (x2)
ffmpeg -i input.mkv -filter:v 'minterpolate=fps=48000/1001:mi_mode=mci:mc_mode=aobmc:me_mode=bidir:vsbmc=1,setpts=2*PTS' -c:v ffv1 -r 24000/1001 -an out.mkvCreate video loop by reversing and concatenating with original (different ways)
ffmpeg -i file.mkv -filter_complex "reverse[r]; [0:v][r]concat" -c ffv1 loop.mkv
ffmpeg -i file.mkv -filter_complex "select='gt(n,0)',reverse,select='gt(n,0)'[r]; [0:v][r]concat" -c ffv1 loop.mkv
ffmpeg -i file.mkv -filter_complex "reverse,tpad=start=1:stop=1:start_mode=clone:stop_mode=clone[r]; [0:v][r]concat" -c ffv1 loop.mkvReorder streams and change default audio stream disposition
ffmpeg -i input.mkv -c copy -map v -map a:1 -map a:0 -disposition:a:0 default -disposition:a:1 0 out.mkvAnalyze volume
ffmpeg -i file.wav -af volumedetect -vn -dn -sn -f null /dev/nullIncrease volume of more silent audio sections
ffmpeg -i input.wav -af dynaudnorm=m=100 out.wavCreate a music WebM. b:v needs to be set along with crf and specifies maximum bitrate.
ffmpeg -i Cyprian_Kamil_Norwid_foto.jpg -i 02-aerumnarum-plenus.flac -c:v libvpx -crf 10 -b:v 2M -c:a libvorbis -q:a 5 -t 3:00 aerumnarum-plenus.webmCompress LPCM track with FLAC
ffmpeg -i lpcm.mkv -compression_level 12 lpcm.flacBurn picture-based subtitles into video
ffmpeg -i input.mkv -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -map 0:a <output options> output.mkvfindimagedupes --recurse --prune --fingerprints fingerprints --threshold 85% --program $(which feh) .Print files with sizes
find -type f -exec du --apparent-size -h {} +about:config tweaks
| Name | Value | Comment |
|---|---|---|
| identity.fxaccounts.enabled | false | Disable Sync |
| extensions.pocket.enabled | false | Disable Pocket |
| layers.acceleration.force-enabled | true | Enable OpenGL compositor |
| gfx.webrender.all | true | Enable WebRender compositor |
| media.ffmpeg.vaapi.enabled | true | Enable VA-API |
| mousewheel.default.delta_multiplier_y | 200 | Increase scroll wheel sensitivity |
| image.http.accept | */* | Do not advertise WebP support in Accept header |
Environment variables
| Name | Value | Comment |
|---|---|---|
| MOZ_LOG | PlatformDecoderModule:5 | Log VA-API information |
| MOZ_X11_EGL | 1 | Needed for VA-API under Xorg |
Run program without WAN/Internet access. For non-root this requires disabling restricted-network setting in /etc/firejail/firejail.config
firejail --noprofile --net=eth0 --netfilter=only-local.net PROGRAMwhere only-local.net contains following netfilter configuration
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
# Accept loopback
-A INPUT -i lo -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
# Keep State for already stablished traffic
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow LAN
-A INPUT -s 192.168.1.0/24 -j ACCEPT
-A OUTPUT -d 192.168.1.0/24 -j ACCEPT
COMMIT
Restrict users who are allowed to run firejail by listing them in /etc/firejail/firejail.users file
Set as login shell
chsh -s /usr/bin/fish xubuntuDisable prompt
set -U fish_greetingChange umask for interactive shell
~/.config/fish/config.fish
if status --is-interactive
umask 022
endList contents of metadata blocks of type VORBIS_COMMENT and PICTURE
metaflac --list --block-type=VORBIS_COMMENT,PICTURE audio.flacSetup encryption
tune2fs -O encrypt /dev/sda2
fscrypt setup
fscrypt setup /
jq '.options.policy_version = "2"' < /etc/fscrypt.conf > /etc/fscrypt.conf.tmp && mv /etc/fscrypt.conf{.tmp,}Create user with encrypted home directory
adduser foo
mv /home/foo{,.old}
mkdir /home/foo
fscrypt encrypt /home/foo --user=foo
cp -aT /home/foo.old /home/foo
rm -rf /home/foo.old
fscrypt lock /home/foo --user=fooIncrease priority of fscrypt PAM profile in /usr/share/pam-configs so that
its module loads before systemd one
editor /usr/share/pam-configs/fscrypt
pam-auth-updateRemove unused policy
mkdir test-fscrypt
fscrypt encrypt test-fscrypt
fscrypt status test-fscrypt
rmdir test-fscrypt
fscrypt metadata destroy --policy=/:f563fb488794fe85302878cec58e73e1Optional dependencies: gir1.2-gsound-1.0 (sounds)
Useful plugins: gajim-omemo, gajim-urlimagepreview
Install debugging symbols for package foo
apt install ubuntu-dbgsym-keyring/etc/apt/sources.list.d/ddebs.list:
deb http://ddebs.ubuntu.com focal main restricted universe multiverse
apt update && apt install foo-dbgsymRequires org.freedesktop.secrets service provider in order to start (i.e. gnome-keyring)
Disable global menu
env UBUNTU_MENUPROXY= gimp
Create dotfiles repo
git init --bare ~/.dotfiles
alias dotfiles='git --git-dir="$HOME/.dotfiles" --work-tree="$HOME"'
dotfiles config status.showUntrackedFiles no
Cleanup unnecessary files and optimize the local repository
git gc --prune=now
Count unpacked number of objects and their disk consumption
git count-objects -vH
Verifies the connectivity and validity of the objects in the database
git fsck
Prune all unreachable objects from the object database
git prune -v
Restore deleted file: first search for commit id with deletion then restore from its parent
git log -n 1 -- file.txt
git restore --source <id>^ file.txt
To build and run with Mono install mono-complete package
xbuild GK6X.sln
Cleanup
xbuild /target:clean
Run
cd Build
mono ./GK6X.exe
head /sys/class/hidraw/hidraw?/device/uevent
setfacl -m u:pmart:rw /dev/hidraw{4,5,6}
MP4Box -splits 8192 <file>
List keys
gpg --list-keys
gpg -k
List secret keys
gpg --list-secret-keys
gpg -K
Import key
gpg --import public.asc
Import key from keyserver
gpg --keyserver keyring.debian.org --recv-keys 'F41D30342F3546695F65C66942468F4009EA8AC3'
Verify signature
gpg --verify twrp-3.5.0_9-0-dipper.img.asc twrp-3.5.0_9-0-dipper.img
Export encryption subkey to password-protected file
$ gpg --list-secret-keys --with-subkey-fingerprint
/home/pmart/.gnupg/pubring.kbx
------------------------------
sec ed25519 2020-04-15 [SC] [expires: 2021-04-15]
0299FB2433E2E333B77DA58FD3A55548FACF8DDE
uid [ultimate] pmart
ssb cv25519 2020-04-15 [E] [expires: 2021-04-15]
CC7F2A9640625059632031F2B5B6FFB5A6326A93
$ gpg --armor --gen-random 1 20
o9kMBpIvzy3e9OQFUbhpKlDk9vE=
$ gpg --armor --export-secret-subkeys CC7F2A9640625059632031F2B5B6FFB5A6326A93! | GPG_TTY=(tty) gpg --armor --symmetric --output mykey.asc
Renew key
$ gpg --list-keys
$ gpg --edit-key KEYID
gpg> expire
gpg> key 1
gpg> expire
...
gpg> save
Relax password TTL in ~/.gnupg/gpg-agent.conf
default-cache-ttl 14400
max-cache-ttl 86400
Install upstream distributed version
cd /opt
unzip ~pmart/Downloads/gradle-6.3-bin.zip
ln -s gradle-6.3 gradle
ln -s /opt/gradle/bin/gradle /usr/local/bin/gradle
Resize image to fit into 1080 box (only shrink larger images)
gm convert -resize '1080x1080>' original.png small.png
Draw some text
gm convert -size 400x100 xc:yellow -fill black -pointsize 72 -gravity Center -draw 'text 0,0 "some text"' image.png
Package gsfonts needs to be installed or else above will result in error
gm convert: Unable to read font (/usr/share/fonts/type1/gsfonts/n019003l.pfb) [No such file or directory].
Install from live USB on a system with broken EFI
grub-install --target x86_64-efi --efi-directory /mntInstall with no Secure Boot support and without changing NVRAM variables. Log verbosely to file.
grub-install --no-nvram --no-uefi-secure-boot --verbose 2> grub-install.log
Inspect GStreamer plugins/elements
gst-inspect-1.0 video4linux2
Needed for ASF video
| Option | Description | Value |
|---|---|---|
| -B | Get/set Advanced Power Management feature | 1-127 permit spindown 128-254 no spindown 255 off |
| -C | Check drive power mode status | |
| -I | Show drive information | |
| -M | Get/set Automatic Acoustic Management setting | 0 off 128 quiet 254 fast |
| -S | Set standby (spindown) timeout | 0 disabled 1-240 multiples of 5 seconds (5 seconds to 20 minutes) 241-251 1 to 11 units of 30 minutes (30 minutes to 5.5 hours) 252 21 minutes 253 vendor-defined timeout period between 8 and 12 hours 254 reserved 255 21 minutes plus 15 seconds |
| -y | Put drive in standby mode | |
| -Y | Put drive to sleep | |
| -z | Re-read partition table |
Change default APM value (254) for second ATA disk in /etc/hdparm.conf to allow spindown and set spindown timeout to 10 minutes
/dev/disk/by-path/pci-0000:00:1f.2-ata-2 {
apm = 127
spindown_time = 120
}
Benchmark read performance
hdparm -Tt /dev/sdX
List security options
hdparm --security-help
Check if security is not frozen
hdparm -I /dev/sdX # Security: not enabled, not frozen
Set user password (use --security-prompt-for-password to prompt for password)
hdparm --user-master u --security-set-pass PasSWord /dev/sdX
hdparm -I /dev/sdX # Security: enabled
Security erase
hdparm --user-master u --security-erase PasSWord /dev/sdX
Enhanced security erase
hdparm --user-master u --security-erase-enhanced PasSWord /dev/sdX
After erase security should be automatically set to disabled
hdparm -I /dev/sdx # Security: not enabled
Implementation of Lenovo ThinkPad HDD password algorithm
Monitor GPU performance
intel_gpu_top
List firmware partition contents
ipodpatcher <device> -l
Install using method 3) OSOS contains only the Rockbox bootloader
ipodpatcher <device> -wf ~/Downloads/bootloader-ipodvideo.ipod
Update to new version (clean install)
wget -P ~/Downloads 'https://download.rockbox.org/release/3.15/rockbox-ipodvideo-3.15.zip' 'https://download.rockbox.org/release/3.15/rockbox-fonts-3.15.zip'
tar czf rockbox-old.tar.gz .rockbox/
rm -rf .rockbox/
unzip ~/Downloads/rockbox-\*.zip
tar xf rockbox-old.tar.gz .rockbox/apple_os.ipod
Enable network interface
ip link set enp0s25 up
Manually add a static IP address
ip address add 192.168.1.177/24 broadcast + dev enp0s25
Set default gateway
ip route add default via 192.168.1.1 dev enp0s25
Display listening TCP/UDP sockets with processes using them
ss -lutp
Use unique MAC address per SSID
[General]
AddressRandomization=network
Install from upstream repository
curl https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add -
echo 'deb [arch=amd64] https://repo.jellyfin.org/ubuntu/stable main' > /etc/apt/sources.list.d/jellyfin.list
Start server
jellyfin --webdir=/usr/share/jellyfin/web --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg
| Media library content type | Type in options.xml | Additional files |
|---|---|---|
| Movies | Movie | movies.collection |
| Photos | Video | homevideos.collection |
| Others | Series, Season, Episode, Movie | - |
Test gamepad (Joystick API)
jstest /dev/input/js0
Test force feedback (evdev API)
fftest /dev/input/by-id/usb-8Bitdo_SF30_Pro_8BitDo_SN30_Pro+_SF30_Pro-event-joystick
Rename keys of objects in array
jq 'map(with_entries(.key |= if . == "a" then "id" elif . == "b" then "title" elif . == "c" then "isDone" else . end))'
Client configuration settings.json in Settings > Application > LSP Client > Server Configuration
Available language servers:
clangd: C/C++javascript-typescript-langserver: JavaScript/TypeScriptbash-language-server: Bash"bash": { "command": ["bash-language-server", "start"], "url": "https://github.com/bash-lsp/bash-language-server", "highlightingModeRegex": "^Bash$" }- More at langserver.org
Document Preview Plugin configuration
KParts:
Print scancodes or keycodes sent by the keyboard
showkey -s
showkey
Dump keyboard translation table (keymap)
dumpkeys
Swap Caps Lock with Escape (swapcapsesc.kmap)
keycode 1 = Caps_Lock
keycode 58 = Escape
Load keyboard translation table
loadkeys swapcapsesc.kmap
Show console font
showconsolefont -v
Adjust typematic delay and rate to 200 ms and 30 Hz
kbdrate -d 200 -r 30
Restart Plasma
kquitapp5 plasmashell && kstart5 plasmashell
Workaround bug with /usr/local/bin/sshfs wrapper
#!/bin/sh
exec /usr/bin/sshfs -oKexAlgorithms=+diffie-hellman-group14-sha1 "$@"
thumbnail.so processes do not close
Convert EPUB to Kindle format (MobiPocket + KF8 + source)
kindlegen ~/Downloads/book.epub -c2 -o book.mobi
Extract KF8 (.azw3) with KindleUnpack
python3 ~/src/KindleUnpack-082/lib/kindleunpack.py -s book.mobi out/
Disable UAS protocol for device
echo 'options usb-storage quirks=152d:a561:u' > /etc/modprobe.d/uas.confTo inhibit sleep while open change launcher command to
systemd-inhibit --what=sleep --why 'Using IRC' konversation ...
Error when playing sound
[00007fe980005810] cache_read stream error: AStreamSeekStream: hard seek failed
Desktop Effects video previews in Ogg/MP4 format require installing Qt 5 Multimedia plugins and GStreamer.
Required GStreamer elements:
httpsource is part ofgstreamer1.0-plugins-goodvideo/oggandvideo/x-theoradecoders are part ofgstreamer1.0-plugins-basevideo/mpeg, mpegversion=(int)4decoder is part ofgstreamer1.0-libav
apt install libqt5multimedia5-plugins gstreamer1.0-plugins-good gstreamer1.0-libav
apt markauto libqt5multimedia5-plugins
Show Bluray disc info
bd_info <dir>
Convert file from Windows-1250 code page
iconv -f cp1250 -o instrukcja.txt instrukcja.txt
Find installed NSS modules
find /lib/x86_64-linux-gnu -name 'libnss_*' -type f
Install GTK+ modules to automatically hook toolkit events to sounds, PulseAudio backend and canberra-gtk-play test utility
apt install libcanberra-gtk{,3}-module libcanberra-pulse gnome-session-canberra
~/.xessionrc:
export NO_AT_BRIDGE=1
export GTK_MODULES=canberra-gtk3-module:canberra-gtk-module
dbus-update-activation-environment --verbose --systemd GTK_MODULES NO_AT_BRIDGE
Dynamic users are currently not used for systemd-* services (#902971)
Additional KDE integration
apt install libreoffice-{kf5,plasma,style-breeze}
Additional GTK3 integration (Xfce)
apt install libreoffice-gtk3
For Intel Gen8+ graphics (Broadwell and newer) install both old and new drivers (non-free versions)
apt install i965-va-driver-shaders intel-media-va-driver-non-free
Select driver with environment variable (defaults to newer)
LIBVA_DRIVER_NAME=i965 vainfo
LIBVA_DRIVER_NAME=iHD vainfo
Workaround XML namespaces
xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' pom.xml
Attribute predicates
xmllint --xpath '/datafile/game[starts-with(@name, "Tomb Raider") and contains(@name, "Chronicles") and contains(@name, "USA")]' *.dat
Display user list and enable autologin for user john in /etc/lightdm/lightdm.conf
[Seat:*]
autologin-user=john
greeter-hide-users=false
Change greeter language
systemctl edit lightdm.service
[Service]
Environment=LANG=pl_PL.utf8
Broken language selection:
- Language selection is broken (again)
- Default layout no longer has "language" in indicators
- Change the text "en-US.utf8" in the login screen with a real name of the languages
- sets the locale to the first available one instead of keeping the system one
Workaround by setting environment variable in ~/.xsessionrc
export LANG=pl_PL.utf8
dbus-update-activation-environment --verbose --systemd LANG
Change default set of indicators and clock format. Disable user image (because it requires accountservice).
[greeter]
indicators = ~host;~spacer;~clock;~spacer;~session;~power
clock-format = %a %d %b, %H:%M
hide-user-image = true
Disable Turbo Boost
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
Rebind USB
echo 0000:00:13.0 > /sys/bus/pci/drivers/ohci-pci/unbind
echo 0000:00:13.0 > /sys/bus/pci/drivers/ohci-pci/bind
Avoid flickering on boot with Intel graphics
Download and verify ISO image
wget https://cdimage.debian.org/cdimage/weekly-live-builds/amd64/iso-hybrid/{debian-live-testing-amd64-standard.iso,SHA512SUMS{,.sign}}
gpg --keyserver keyring.debian.org --verify SHA512SUMS.sign SHA512SUMS
sha512sum --ignore-missing -c SHA512SUMSOptional: allow user write access to USB stick block device (/dev/sdc)
sudo setfacl -m "u:$(id -u):rw" /dev/sdc*Partition USB stick into two partitions
printf '%s\n' '- '(math (stat -c %s debian-live-testing-amd64-mate.iso) '* 1.01 / 1024')'K U *' '- - L -' | sfdisk --no-reread /dev/sdcSetup live partition:
- create FAT32 filesystem with label
live - copy files from ISO image
- add
persistenceparameter to grub.cfg
mkdosfs -v -F 32 -n live /dev/sdc1
mkdir /mnt/{iso,usb}
mount /dev/sdc1 /mnt/usb
mount debian-live-testing-amd64-mate.iso /mnt/iso
cp -rT /mnt/iso /mnt/usb
edit /mnt/usb/boot/grub/grub.cfg # Add 'persistence' boot parameter
umount /mnt/{iso,usb}
rmdir /mnt/{iso,usb}Setup persistence partition:
- create ext4 filesystem (without journal) with label
persistence - add
persistence.confconfiguration file
mke2fs -v -t ext4 -O '^has_journal' -m 0 -L persistence /dev/sdc2
mount /dev/sdc2 /mnt
echo '/ union' > /mnt/persistence.conf
umount /mntChange UMASK value to 027 in /etc/login.defs
Use nc (normal cut) option.
Create LUKS-on-LVM volume
lvcreate -L 20G vg0 -n lv0
Increase logical volume size
lvresize -L +60G --resizefs vg0/lv0
Print information about DVD-Video titles
lsdvd /path/to/dvd
lsdvd -t 6 -x /path/to/dvd
Allow removable media access
snap connect makemkv:removable-media
Reinstall
snap remove --purge makemkv
snap install makemkv
Convert BIN/CUE images into CHD format
ext=cue for f in *.$ext; chdman createcd -i $f -o (basename $f .$ext).chd || break; echo; end
Extract BIN/CUE from CHD file
chdman extractcd -i file.chd -o file.cue
Convert MDF images into BIN/CUE format
for f in *.mdf; mdf2iso --cue $f || break; end
Show infromation about ME image in firmware
python me_cleaner.py -c firmware.bin
Neutralize Intel ME
python me_cleaner.py -S -O modified_firmware.bin original_firmware.bin
Remux DVD-Video to Matroska
mencoder dvd://2/kanal -ovc copy -oac copy -o out.mkv
List UPnP IGD redirections
upnpc -l
Like above but bypass discovery process by providing the XML root description url
upnpc -u http://192.168.1.1:60000/b54ecc90/gatedesc1.xml -l
Add external TCP port 4777 redirect to internal 192.168.1.10:4777
upnpc -a 192.168.1.10 4777 4777 tcp
Remove external TCP port 4777 redirect
upnpc -d 4777
Segfaults when trying to browse videos
Thread 1 "minitube" received signal SIGSEGV, Segmentation fault.
0x00007ffff65821f4 in QString::operator=(QString const&) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
When remuxing bluray it doesn't properly support seamless branching link
Remux DVD-Video to Matroska (no subpicture support)
mkvmerge -v -o out.mkv --title Kanal --chapters kanal:2 kanal/VIDEO_TS/VTS_02_1.VOB
Show information about Matroska file
mkvmerge --identify kanal.mkv
mkvinfo kanal.mkv
Add title and unset default flag for subtitle tracks
mkvpropedit --set 'title=Kanał' --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=0 kanal.mkv
Show information about Bluray playlists
for f in ../hitchcock/rear-window/BDMV/PLAYLIST/*.mpls; mkvmerge --identify $f; echo; end
Extract chapters to chapters.xml file
mkvextract paths-of-glory.mkv chapters chapters.xmlInsert chapter names stored one per line in names file
#!/usr/bin/fish
# Configuration
set lang eng
set chapters_file chapters.xml
set names_file names
set i 1
set ed_args
while read name
set el (mktemp -u ChapterDisplay.XXXXXX)
set ed_args $ed_args \
-s //ChapterAtom[$i] -t elem -n $el \
-s //$el -t elem -n ChapterString -v $name \
-s //$el -t elem -n ChapterLanguage -v $lang \
-r //$el -v ChapterDisplay
set i (math $i + 1)
end < $names_file
xmlstarlet --inplace ed $ed_args $chapters_fileAdd modified chapters back
mkvpropedit paths-of-glory.mkv --chapters chapters-new.xmlPlay multiple Blu-ray titles with
mpv bd://mpls/{338,347,102} --bluray-device /pathPlay two videos stacked
mpv --external-file=bottom.mkv --lavfi-complex='[vid1] [vid2] vstack [vo]' top.mkvBuild new upstream version
apt source mpv
cd mpv-0.32.0
uscan
uupdate ../mpv_0.33.0.orig.tar.gz
cd ../mpv-0.33.0
dpkg-source --before-build # or quilt push -a
edit debian/rules
edit debian/control
dch -l '~pmart' 'Mark as local'
mk-build-deps --install --remove -s sudo debian/control
dpkg-buildpackage -T binary
sudo apt install ../mpv_0.33.0-0ubuntu1~pmart1_amd64.debShow properties on OSD
mpv --osd-msg1='${video-frame-info/interlaced}' interlaced.mp4Test video tearing
mpv --no-config --video-sync=display-resample --hwdec=vaapi http://www.oc-burner.de/ftp/Videos/juddertest/juddertest_60.mp4Use a partition inside a file
# losetup --find --show --read-only --partscan EmuELEC-Amlogic-ng.arm-3.8-Generic.img
/dev/loop0
# ls /dev/loop0*
/dev/loop0 /dev/loop0p1 /dev/loop0p2
# mount /dev/loop0p1 /mnt
# umount /dev/loop0p1
# losetup --detach /dev/loop0
Unnecessary dependency to software-proprties-qt in Ubuntu
Allow members of sudo group access to wpa_supplicant's socket
systemctl edit netplan-wpa-wlp3s0.service
netplan apply[Service]
ExecStart=
ExecStart=/sbin/wpa_supplicant -c /run/netplan/wpa-wlp3s0.conf -iwlp3s0 -O 'DIR=/run/wpa_supplicant GROUP=sudo'
List tables
nft list tablesShow inet table filter chains
nft list table inet filterAdd rule to inet table filter to chain output
nft add rule inet filter output ip daddr 8.8.8.8 dropInstall in /opt
cd /opt
tar --no-same-owner -xf ~pmart/Downloads/node-v12.16.1-linux-x64.tar.xz
ln -s node-v12.16.1-linux-x64 node
ln -s /opt/node/bin/{node,npm,npx} /usr/local/binAllow installing modules globally without root
npm config set prefix ~/.localBackends for additional formats support (CHM, DjVu, EPUB, Markdown, TIFF)
apt install okular-extra-backends
apt-mark auto okular-extra-backendsCreate new key, authorise login on remote host with it, create config entry for that host
ssh-keygen -t ed25519 -f ~/.ssh/id_n5max
ssh-copy-id -i ~/.ssh/id_n5max [email protected]~/.ssh/config:
Host n5max
HostName 192.168.1.21
User root
IdentitiesOnly yes
IdentityFile ~/.ssh/id_n5max
Find/remove entries for a hostname in known_hosts file
ssh-keygen -F 192.168.1.21
ssh-keygen -R 192.168.1.21Fetch and store public SSH key for a host (dangerous)
ssh-keyscan -t ecdsa -H 192.168.1.21 >> ~/.ssh/known_hostsShow information about X.509 certificate (add -inform der for DER format)
openssl x509 -noout -text -in public.crtView content of RSA private key
openssl rsa -noout -text -in private.keyCreate a self-signed X.509 certificate for subject CN = foobar containing RSA public key in public.crt PEM file valid for 1 year and corresponding RSA private key in private.key file stored without encryption
openssl req -x509 -newkey rsa:2048 -subj '/CN=foobar' -days 365 -nodes -out public.crt -keyout private.keyStore key and certificate in PKCS#12 format
openssl pkcs12 -export -inkey private.key -in public.crt -out key.pfxPrint info about PKCS#12 file
openssl pkcs12 -in key.pfx -info -nooutTest TLS client/server
openssl s_client -connect www.paypal.com:443
openssl s_server ...- Create root CA private key and self-signed certificate
- Create server private key and CSR
- Create server certificate from CSR with signature from root CA
openssl req -newkey rsa:4096 -x509 -days 3650 -config ca.cnf -subj '/CN=pmart' -out root.crt -keyout root.key
openssl req -new -config ca.cnf -subj '/CN=myserver' -out myserver.csr -keyout myserver.key
openssl x509 -req -in myserver.csr -CA root.crt -CAkey root.key -CAcreateserial -days 365 -extfile ca.cnf -out myserver.crt
rm myserver.csrContents of ca.cnf file
extensions = server_exts
[ req ]
distinguished_name = subject
x509_extensions = root_exts
[ subject ]
commonName = Common Name (e.g. server FQDN or YOUR name)
commonName_default = Example Company
[ root_exts ]
basicConstraints = critical, CA:TRUE, pathlen:0
keyUsage = critical, keyCertSign
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid
[ server_exts ]
basicConstraints = critical, CA:FALSE
keyUsage = critical, digitalSignature
extendedKeyUsage = serverAuth
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always
subjectAltName = @alt_names
[ alt_names ]
DNS.1 = foobar
openssl req -nodes -subj '/CN=N\/A' -newkey rsa:2048 -keyout nick.key -x509 -days 3650 -out nick.cer
cat nick.cer nick.key > nick.pem
chmod 400 nick.pem
rm nick.cer nick.keyTranscode to Opus
set ext flac; for f in **.$ext; opusenc --bitrate 128 --discard-picture $f (string replace -r "\.$ext\$" .opus $f); or break; endDecode opus to wav (without resampling back to 44100)
opusdec --rate 48000 audio.opus audio.wavVerify Microsoft Authenticode digital signature on file
osslsigncode verify ~/Downloads/mp3tagv303setup.exeExtract multiple archives (keep original files)
p7zip -d -k *.7zor
7zr x '*.7z'Fix symlinks broken by Android app
for f in ~/.password-store/**; if [ 'text/plain' = (file -b --mime-type $f) ]; echo ln -sf -- (cat $f) $f; end; endGenerate new password (replace first line of password file)
PASSWORD_STORE_CHARACTER_SET='[:alnum:]_' pass generate -i example.comRename user from foo to bar and move his home directory. Additionaly rename its primary group (with the same name).
usermod --login bar --home /home/bar --move-home foo
groupmod --new-name bar fooConfigure pbuilder in /etc/pbuilderrc:
- make build results available as dependencies for subsequent builds
- enable
eatmydatausage for additional performance
HOOKDIR=/etc/pbuilder/hooks
BINDMOUNTS=/var/cache/pbuilder/result
OTHERMIRROR='deb [trusted=yes] file:/var/cache/pbuilder/result ./'
EATMYDATA=yesCreate a hook script /etc/pbuilder/hooks/D70results:
#!/bin/sh
cd /var/cache/pbuilder/result
dpkg-scanpackages . > Packages
apt updatechmod +x /etc/pbuilder/hooks/D70results
touch /var/cache/pbuilder/result/PackagesCreate/update chroot image base.tgz for focal release
pbuilder create --distribution focal
pbuilder updateInspect chroot (for debugging)
pbuilder loginDownload and verify dino-im source package
dget -d 'http://archive.ubuntu.com/ubuntu/pool/universe/d/dino-im/dino-im_0.2.0-3.dsc'Build dino-im package using pbuilder
pbuilder build dino-im_0.2.0-3.dscInstall build results
apt install /var/cache/pbuilder/result/dino-im_0.2.0-3_amd64.deb /var/cache/pbuilder/result/dino-im-common_0.2.0-3_all.deb
apt-mark auto dino-im-commonEnable global menu support for GTK apps and Intellij IDEA
apt install appmenu-gtk{2,3}-module libdbusmenu-glib4Fails to log in without libsasl-modules, yet does not depend on them
apt install libsasl2-modulesCompile *.py to *.pyc (recursively)
python3 -m compileall .List file ID3 tags
mid3v2 -l fonoteka-1/01-profesjonalizm.mp3Get monitor EDID from i2c bus 6 (Also available from xrandr --verbose)
get-edid -b 6 | parse-edidConfiguration in ~/.inputrc (or /etc/inputrc).
Run bind -f ~/.inputrc or type ^X ^R to reload.
set completion-ignore-case on
#set show-all-if-unmodified on
set show-all-if-ambiguous on
set editing-mode vi
set show-mode-in-prompt on
$if term=linux
set vi-ins-mode-string \1\e[?0c\2
set vi-cmd-mode-string \1\e[?8c\2
$else
set vi-ins-mode-string \1\e[6 q\2
set vi-cmd-mode-string \1\e[2 q\2
$endif
"\C-x\C-r": re-read-init-file
- Create
~/.config/redshift/redshift.conf cp /usr/share/applications/redshift.desktop ~/.config/autostartsed -i /^Terminal=/d ~/.config/autostart/redshift.desktopsystemctl --user --now enable redshift.service
Lowercase, replace spaces with dashes
rename -v 'y/A-Z/a-z/; s/ /-/g' *.mp3Search database
libretrodb_tool ~/.config/retroarch/database/rdb/Sony\ -\ PlayStation.rdb find '{"name": glob("Tomb Raider Chronicles *USA*")}'
libretrodb_tool ~/.config/retroarch/database/rdb/Atari\ -\ 2600.rdb find '{"crc": b"42AD47BF"}'Copy roms to TV box
rsync -rlt --progress --delete --filter={'P */','P gamelist.xml','P *.srm','P *.state'} -n ~/roms n5max:Option summary
--verbose, -v increase verbosity
--checksum, -c skip based on checksum, not mod-time & size
--archive, -a archive mode is -rlptgoD (no -A,-X,-U,-N,-H)
--recursive, -r recurse into directories
--update, -u skip files that are newer on the receiver
--dirs, -d transfer directories without recursing
--links, -l copy symlinks as symlinks
--perms, -p preserve permissions
--owner, -o preserve owner (super-user only)
--group, -g preserve group
-D same as --devices --specials
--times, -t preserve modification times
--preallocate allocate dest files before writing them
--dry-run, -n perform a trial run with no changes made
--existing skip creating new files on receiver
--ignore-existing skip updating files that exist on receiver
--delete delete extraneous files from dest dirs
--partial keep partially transferred files
--ignore-times, -I don't skip files that match size and time
--size-only skip files that match in size
--compress, -z compress file data during the transfer
--progress show progress during transfer
-P same as --partial --progress
Enroll Secure Boot keys in firmware
mkdir -p /etc/secureboot/keys/{db,dbx,KEK,PK}
# Copy .auth files into directories
sbkeysync --verbose --pk --dry-run # Previev changes
sbkeysync --verbose
sbkeysync --verbose --pkList/verify image signatures
sbverify --list linux.efi
sbverify --cert db.crt linux.efiInstall with Breeze theme
apt install sddm sddm-theme-breezeSwitch user without session lock
busctl call org.freedesktop.DisplayManager /org/freedesktop/DisplayManager/Seat0 org.freedesktop.DisplayManager.Seat SwitchToGreeterUnable to run Xorg as non-root (Fixed after 0.19 release)
Add PREGAP to each track in cuesheet
sed -i '/INDEX 01/i \ \ \ \ PREGAP 00:02:00' album.cueDetect eSATA drive on sd 3:0:0:0
rescan-scsi-bus.sh -a --hosts=3 --channels=0 --ids=0 --luns=0Split album by cuesheet to Vorbis files (requires flac for decoding and vorbis-tools for encoding)
shnsplit -f album.cue -o 'cust ext=ogg oggenc -q 5 -o %f -' -t '%n. %t' album.flac
cuetag album.cue *.oggSplit album by cuesheet to Opus files (requires mac for decoding and opus-tools for encoding)
shnsplit -f album.cue -o 'cust ext=opus opusenc --bitrate 128 - %f' -t '%n. %t' album.apeFirst switch Secure Boot into Setup Mode. Then generate keys and copy them to ESP for enrollment with KeyTool.
sicherboot setupMake sure KeyTool is lauched on next boot
bootctl set-oneshot <uuid>-keytool.confPrint a large amount of SMART information for drive /dev/sda.
smartctl -a /dev/sdaBegin an extended self-test of drive /dev/sdc. You can issue this command on a running system. The results can be seen in the self-test log visible with the '-l selftest' option after it has completed.
smartctl -t long /dev/sdcFor live installation add apparmor_parser /var/lib/snapd/apparmor/profiles to /etc/rc.local
Inspect confinement of snap
snap run --shell <name>Generate audio spectrogram
sox file.mp3 -n spectrogram -o spectrogram.pngInstallation
git clone https://github.com/abba23/spotify-adblock-linux.git
cd spotify-adblock-linux
wget -O cef.tar.bz2 http://opensource.spotify.com/cefbuilds/cef_binary_80.0.8%2Bgf96cd1d%2Bchromium-80.0.3987.132_linux64_minimal.tar.bz2
tar -xf cef.tar.bz2 --wildcards '*/include' --strip-components=1
make
cp spotify-adblock.so /usr/local/lib/Usage
env LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotifySet hostname
hostnamectl set-hostname foobarSet timezone
timedatectl set-timezone Europe/WarsawInhibit sleep while downloading
systemd-inhibit --what=sleep wget <url>Run command without Internet access (doesn't work with user units #12327)
systemd-run -p IPAddressDeny=any -p IPAddressAllow=localhost -p IPAddressAllow=192.168.1.0/24 <cmd>Make bootctl accept ESP on MBR (/usr/local/bin/bootctl)
#!/bin/sh
SYSTEMD_RELAX_ESP_CHECKS=1 /usr/bin/bootctl "$@" Enable DHCPv4 on enp0s25 interface (/etc/systemd/network/20-enp0s25.network)
[Match]
Name=enp0s25
[Network]
DHCP=ipv4
Enable DHCP with privacy options for all wireless interfaces when connecting to SSID foobar
[Match]
Type=wlan
SSID=foobar
[Network]
DHCP=ipv4
[DHCPv4]
Anonymize=true
List links
networkctl
networkctl listShow general status or infromation about specified links
networkctl status
networkctl status 1Bring devices up/down
networkctl up|down <device>Reload .network and .netdev files
networkctl reloadShow TCP packets on port (including headers)
tcpdump -i lo -X tcp port 3321Show flow of data on TCP port
tcpflow -i lo -c tcp port 3321 or tcp portrange 5000-5003Creating date and time format requires Thunderbird 91 or higher
LC_TIME problems
Correct and cleanup HTML/XML document
tidy -i file.xml > clean.xmlsystemctl edit thinkfan.service[Service]
ExecStartPre=/usr/local/sbin/update-thinkfan-conf
Run a stress test with monitoring
apt install linux-tools-generic lm-sensors
tmux new-session fish \; \
split-window -h watch -xtn 1 cpupower -c all frequency-info --freq --human \; \
split-window -v -p 66 watch -xt sensors \; \
select-pane -t 0Symlink ~/.gnupg directory for Browserpass extension
ln -s ~/.gnupg ~/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/BrowserTrace path to network host discovering MTU along this path
tracepath wikipedia.plcp /usr/lib/udev/rules.d/60-cdrom_id.rules /etc/udev/rules.d/- remove
RUN+="cdrom_id --eject-media $devnode"from rule in the copied file
SUBSYSTEM=="block", KERNEL=="dm-[0-9]*", ENV{ID_FS_UUID}=="e3f91257-7e81-419d-bbdd-8e0862ff9085|49792991-f58d-4bdf-b17e-e4288b0fe756", ENV{UDISKS_SYSTEM}="0"
But this results in udiskd checking for org.freedesktop.udisks2.filesystem-mount-other-seat
Create /etc/polkit-1/localauthority/50-local.d/10-udisks.pkla instead
[Allow user mounting]
Identity=unix-group:users
Action=org.freedesktop.udisks2.filesystem-mount-system;org.freedesktop.udisks2.encrypted-unlock-system
ResultActive=yes
$ udisksctl loop-setup -f foo.iso
Mapped file foo.iso as /dev/loop15.
$ udisksctl mount -b /dev/loop15
Mounted /dev/loop15 at /media/user/FOO.
$ udisksctl unmount -b /dev/loop15
Unmounted /dev/loop15.
$ udisksctl loop-delete -b /dev/loop15
echo 'deb http://download.opensuse.org/repositories/home:/ungoogled_chromium/Ubuntu_Focal/ /' > /etc/apt/sources.list.d/ungoogled-chromium.list
curl -s 'https://download.opensuse.org/repositories/home:/ungoogled_chromium/Ubuntu_Focal/Release.key' | apt-key add -
apt update
apt install ungoogled-chromiumUnrar multiple files
unrar x '*.rar'Unzip multiple files
unzip '*.zip'Reset USB device (by product and vendor id, by bus and device number, by product name)
usbreset 21b4:0083
usbreset 001/029
usbreset 'AudioQuest DragonFly Black v1.5'Verify TRIM support: DISC-GRAN (discard granularity) and DISC-MAX (discard max bytes) columns
lsblk --discardDiscard all blocks on device
blkdiscard /dev/sdXUse vim.tiny as regular vim
ln -s /usr/bin/vim.tiny /usr/local/bin/vimConfiguration (~/.vimrc or /etc/vim/vimrc.local). vim-tiny requires commenting out vimrc.local existance check in /etc/vim/vimrc (no scripting support)
set softtabstop=4 shiftwidth=4 expandtab autoindent
Increase verbosity (check which configuration files are sourced)
vim -Voggenc -q 5 *.wavEncode in parallel
find -name '*.flac' -print0 | xargs -0 -P 4 -n 5 oggenc -q 5 --quietDoesn't work with certificate generated by ssl-cert package. Instead generate new one
openssl req -x509 -nodes -out /etc/ssl/certs/vsftpd.pem -keyout /etc/ssl/private/vsftpd.key -days 3650 -newkey rsa:2048Add config file ~/.config/vsftpd/conf
run_as_launching_user=YES
listen=YES
listen_address=127.0.0.1
listen_port=3321
pasv_min_port=5000
pasv_max_port=5003
anonymous_enable=YES
anon_root=/home
anon_world_readable_only=NO
secure_email_list_enable=YES
email_password_file=/home/<user>/.config/vsftpd/email_passwords
use_localtime=YES
log_ftp_protocol=YES
Generate email password for anonymous user
pwgen 16 > ~/.config/vsftpd/email_passwordsRun server
vsftpd -oxferlog_enable=YES -ovsftpd_log_file=(tty) ~/.config/vsftpd/confAdd client credentials to ~/.netrc
machine localhost login ftp password ahke5Ba8caer3eux
Test connection
pftp -v localhost 3321Encode audio into WavPack files
wavpack -x3 *.wavDownload file in background (continue)
wget -bc --content-disposition http://example.comInstall stable version of Wine on amd64
dpkg --add-architecture i386
apt update
apt install wine wine32
apt-mark auto wine32Disable DBus enabled service when using Netplan
systemctl disable --now wpa_supplicant.serviceTray icon
wpa_gui -t -m 10Show current settings
xset qSwitch to DPMS state (standby, suspend, off)
xset dpms force MODEInactivity period for before the three modes are activated
xset dpms 600 900 1200Create and use custom modeline
cvt 2560 1440 72
xrandr --newmode "2560x1440_72.00_rb" 291.75 2560 2608 2640 2720 1440 1443 1448 1490 +HSync -Vsync
xrandr --addmode DP-1 2560x1440_72.00_rb
xrandr --output DP-1 --above LVDS-1 --mode 2560x1440_72.00_rbCheck default application associatied with MIME type
xdg-mime query default application/pdfSet default application (~/.config/mimeapps.list)
xdg-mime default org.kde.okular.desktop application/pdf
xdg-mime default org.kde.gwenview.desktop image/jpeg image/pngSymlink legacy default applications file to simplify maintenance
ln -s ~/.config/mimeapps.list ~/.local/share/applications/mimeapps.listXubuntu theme (uses Noto Sans Regular 9 for GTK and Noto Sans Bold 9 for window titles)
apt install greybird-gtk-theme elementary-xfce-icon-theme fonts-noto-coreThunar's file copy dialog uses systray plugin
Suspend fails (requests authentication in order to suspend)
Delete elements matching XPath expression
xml ed -d "/xml/table/rec[@id='2']" xml/table.xmlInstall with libinput for input and modesetting for video using Mesa for hardware acceleration. On Debian package insists on having xorg-video-driver (#813964) so install a dummy one.
apt install xserver-xorg xserver-xorg-input-libinput xserver-xorg-video-dummy libgl1-mesa-driInstall server with libinput input driver
apt install xserver-xorg-core xserver-xorg-input-libinputCalculate VESA CVT modeline
cvt -v 2560 1440 75
cvt -v -r 1920 1080In case of ERROR: Multiple of 60Hz refresh rate required for reduced blanking error use other implementation 1
2
Enable tap to click in /etc/X11/xorg.conf.d/libinput.conf
Section "InputClass"
Identifier "libinput touchpad"
MatchDriver "libinput"
MatchIsTouchpad "on"
Option "Tapping" "on"
EndSection
pip3 install -U youtube-dlDownload audio playlist in Opus format (to get additional metadata from title add --metadata-from-title '%(artist)s - %(title)s')
youtube-dl -x -o '%(playlist)s/%(playlist_index)s. %(title)s-%(id)s.%(ext)s' -f 'bestaudio[acodec=opus]' --add-metadata 'https://youtube.com/watch?v=ZNdbmQP82E4&list=OLAK5uy_nHz-GyXaPVbf6elpOMYgWbq_U-tyfpVJA'Archive current directory to ../out.zip file
zip -r ../out .Create an EPUB file. mimetype must be first file in the archive.
zip -rX ../my.epub mimetype META-INF/ EPUB/