for file in *; do
if [ -f "$file" ]; then # Skip to include directories
echo "$file"
fi
done
ls -ld
- {read, write, execute} by {user, group, other}
- Read=4, Write=2, Execute=1; combination=sum.
xxd
(best piped through less
).
lsblk -f
lists available filesystems.udisksctl mount -b /dev/X
mounts specified block device.
NixOS note: make sure "ntfs"
is listed under boot.supportedFilesystems
in OS config.
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@hostname
combination as username when connecting.
route -n get <any-ip> | grep interface
# e.g.
route -n get 1.1.1.1 | grep interface
When 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-256color
Reference: 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
--rm
removes the container once it's stopped.-d
runs it detached and gives back control over the shell.--privileged
lifts capability limitations on the container (can do virtually everything that the host can).--name
gives the container a nickname, for convenient referencing.
List existing (running and stopped) containers:
docker ps -a
From the listed containers in the step above, take the reference (hash or nickname) of the given container.
docker exec -it <reference> /bin/bash
When 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-customizer
Assume 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.pdf
TODO