for file in *; do
if [ -f "$file" ]; then # Skip to include directories
echo "$file"
fi
donels -ld- {read, write, execute} by {user, group, other}
- Read=4, Write=2, Execute=1; combination=sum.
lsblk -flists available filesystems.udisksctl mount -b /dev/Xmounts specified block device.
NixOS note: make sure "ntfs" is listed under boot.supportedFilesystems in OS config.
pgrep -il "keyword"- OR -
ps aux | grep "keyword"(ignore grep itself as it'll be included in the ps aux results).
- Gracefully by PID:
kill <pid> - Forcefully by PID:
kill -9 <pid> - Suspended process in the current shell:
kill %1
- File description:
file - Hex dump:
xxd(best piped throughless).
Fix Windows timezone:
timedatectl set-local-rtc 1- (?)
sudo chmod 000 /usr/bin/update-manager sudo chmod 000 /usr/bin/update-notifier- Reboot
-
sudo apt install samba smbclient [for Ubuntu/Nautilus] sudo apt install nautilus-share - Grant firewall permissions.
sudo ufw allow 'Samba' - Create a network password for your user.
sudo smbpasswd -a <username> - Reboot.
- (Optional) Verify SMB service is running.
systemctl status smbd - Access via
smb://<ip-address>and use the fullusername@hostnamecombination as username when connecting.
route -n get <any-ip> | grep interface
# e.g.
route -n get 1.1.1.1 | grep interfacenetworkqualityWhen ssh-ing from ghostty into a machine that is unaware of ghostty's metadata, an Error opening terminal: xterm-ghostty. may occur. To fix, once in the remote shell:
export TERM=xterm-256colorReference: https://ghostty.org/docs/help/terminfo
On the example of nix and nixos-rebuild from the unstable repo:
nix shell github:NixOS/nixpkgs/nixpkgs-unstable#{nix,nixos-rebuild}Assume container name "image".
Build the container from Dockerfile in the current dir:
docker build -t image .Run the built container, assume port 1337:
docker run [--rm] [-d] [--privileged] -p 1337:1337 [--name nickname] image--rmremoves the container once it's stopped.-druns it detached and gives back control over the shell.--privilegedlifts capability limitations on the container (can do virtually everything that the host can).--namegives the container a nickname, for convenient referencing.
List existing (running and stopped) containers:
docker ps -aFrom the listed containers in the step above, take the reference (hash or nickname) of the given container.
docker exec -it <reference> /bin/bashWhen done:
docker stop <reference>If --rm was not passed when running a container, to remove it after stopping:
docker rm <reference>- Grand Theft Focus brings popup windows to focus instead of "is ready" notification.
GRUB Customizer is a GUI for GRUB configuration.
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt install grub-customizerAssume 24k output bitrate.
ffmpeg -i <audio-input> -c:a libopus -b:a 24k -ar 24k -ac 1 -application voip <audio-output.ogg>Assume 1920x1080 output res, Avenir font @ size 16.
ffmpeg -i <video-input> -vf "scale=1920:1080:flags=lanczos:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,subtitles=<subtitle-input>:force_style='Fontname=Avenir,Fontsize=16'" -ss <start timestamp hh:mm:ss> -t <duration hh:mm:ss> <video-output>Manual: link
cpdf input1.pdf input2.pdf [inputN.pdf] -o output.pdfTODO