Linux
- https://www.youtube.com/watch?v=X8h304Jp9N8 Fedora Silverblue’s move to bootable OCI images: Linux will never be the same
- io_uring #async
- Alternatives to Apache Benchmark
- listening for codes sent by the keyboard:
sudo showkey - listening for codes sent by the mouse:
sudo apt install evtest && sudo evtest - How to transform
curltoab<curl>=<ab>-H=-H: headers--data-raw <json>=-p <file>.json: request body--data @file=-p <file>.json: request body
- How to print and redirect the stdout
<command> | tee <filename> - Converting images from webp (or jpg, png, etc.) to jpg (or webp, png, etc) (Tweet)
sudo apt install imagemagick convert <file>.webp <file>.jpg - How to resize images
sudo apt install imagemagick# Reducing quality convert <input> -quality <n>% <output># Keeping aspect ratio convert <input> -resize <w>x<h> <output># Ignoring aspect ratio convert <input> -resize <w>x<h>! <output> - List and sort directories by size
du -sh * | sort -hr - Open a terminal logged in as another user
su $OTHER_USER - Lorem Ipsum
sudo apt update && sudo apt install libtext-lorem-perl lorem -w 96 # 96 words lorem -s 8 # 8 sentences lorem -p 12 # 12 paragraphs - Captive Portals - Accessing WiFi that requires a browser authentication
ip --oneline route get 1.1.1.1 | awk '{print $3}' | xargs google-chrome - Format pendrive
df -h # find the pendrive to be formatted sudo umount /dev/sdXX sudo mkfs.vfat /dev/sdXX - Bootable pendrive
df -h # find the pendrive sudo umount /dev/sdXX cp image.iso /dev/sdXX sync - Reading the output of a process
less /proc/$PID/fd/1 #stdout less /proc/$PID/fd/2 #stderr - How to use SSH as SOCKS5 proxy
ssh -vCND localhost:9999 -i <path_to_id_rsa> <username>@<remote_server> - How to learn what type (DDR?) memory my computer uses?
sudo dmidecode -t 17 - Profiling zsh startup
# .zshrc zmodload zsh/zprof ... zprof - Run command skipping alias
\<command>
- Comando
time(POSIX)realé o tempo total do processo, do início ao fim;useré o tempo de CPU gasto em user-mode (fora do Kernel);sysé o tempo de CPU gasto no Kernel (ex.: syscalls, alocação de memória, I/O, etc.);user + sysé o tempo total de CPU do processo;
- Inverter o teclado - Símbolos serem primários e os números secundários (créditos ao Vítor)
xmodmap -pke | sed -nre 's/keycode (1[0-9]) = ([^ ]*) ([^ ]*)/keycode \1 = \3 \2/p' | xmodmap - - Ignoring lines in sed
# Ignore lines containing '# noqa' sed -i '/# noqa/! s|@pytest.mark.django_db(transaction=True)|@pytest.mark.django_db|'
Debian Link to heading
- How to validate a .desktop file
desktop-file-validate ~/.local/share/applications/<file>.desktop - How to load .desktop files
update-desktop-database ~/.local/share/applications/ - How to install Apache Benchmark Package
sudo apt install apache2-utils - Empty trash using terminal
sudo apt install trash-cli trash-empty - Headset Bluetooth failing to connect as A2DP profile - “Failed to change profile to a2dp_sink”
sudo apt remove bluez-alsa-utils
CPU Link to heading
- How to discover CPU model and version
lscpu | rg 'Model name'
GPU Link to heading
How to discover GPU. Options:
lspci | grep VGAsudo lshw -C displaysudo apt install mesa-utils glxinfo | grep "OpenGL vendor\|OpenGL renderer"sudo apt install inxi inxi -GHow to show Intel GPU usage
sudo apt install intel-gpu-tools sudo intel_gpu_top
Network Link to heading
- List used ports
nmap -p- --open localhost # or sudo netstat -tulpn | grep LISTEN - Lists all processes listening a specific port
sudo lsof -nP -iTCP:<port> -sTCP:LISTEN - How to see the WiFi network name (SSID):
iwgetid - How to test speed between two devices in a private network
- Install
iperfon both devices:sudo apt install iperf3 - Run the server in one device:
iperf -s - Run the test in the other device:
iperf -c <server-ip>
- Install
- How to discover devices in the same network
sudo apt update && sudo apt install nmap sudo nmap -sn 192.168.0.0/24 - How to discover the open ports of a specific device:
sudo nmap -p 1-65535 <ip>
Terminal Emulators Link to heading
ThinkPad Link to heading
- Fix keyboard to work
/(slash) key #troubleshooting - Sourcesudo dpkg-reconfigure keyboard-configuration
XFCE4 Link to heading
- Window top part (minimize, maximize, close, etc.) disappeared #troubleshooting :
xfwm4 - Desktop icons disappeared #troubleshooting:
xfdesktop - Dead keys stopped working #troubleshooting:
setxkbmap -option - Sending notification
notify-send "<title>" "<message>" - Customizing Keyboard shortcuts
xfconf-query --channel xfce4-keyboard-shortcuts --property <property> --set <command> --create --type 'string'- Examples of
<property>:'/commands/custom/<Super>d','/commands/custom/Print','/xfwm4/custom/<Primary><Shift><Alt>Left' - Example of
<command>:'thunar','xfce4-screenshooter --fullscreen','move_window_left_workspace_key' - More examples on https://github.com/lucasrcezimbra/dotfiles/blob/master/install.sh
- Examples of
- Reload panel configs without logging out
vim ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml # edit configs and save pkill xfconfd xfce4-panel -r