Skip to content

Instantly share code, notes, and snippets.

@dominiksalvet
dominiksalvet / shell-utilities.md
Last active January 30, 2026 07:49
List of all shell utilities with links to the POSIX standard
@dominiksalvet
dominiksalvet / fix-microphone-zenbook.md
Created August 4, 2020 10:05
Make internal microphone of a ZenBook working
@dominiksalvet
dominiksalvet / fix-slow-wifi-ubuntu-focal.md
Last active August 4, 2020 10:03
Fix slow Wi-Fi on Ubuntu 20.04
  1. Open /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf with root permissions.
  2. Replace wifi.powersave = 3 with wifi.powersave = 2 and save.
  3. Reboot.

Source: https://askubuntu.com/a/1240386

@dominiksalvet
dominiksalvet / install-packages.md
Created June 15, 2020 17:15
How to install packages in various Linux distributions

Install Packages

Debian

  • Also applies to Ubuntu, Linux Mint and elementary OS
sudo apt update &&
sudo apt install <package>
@dominiksalvet
dominiksalvet / riscv-extensions.md
Last active January 14, 2026 16:50
A list of RISC-V standard extensions

RISC-V Extensions

Base Description
RV32E Base 32-bit ISA with 16 registers
RV32I Base 32-bit ISA
RV64I Base 64-bit ISA
RV128I Base 128-bit ISA

| Extension | Description |

@dominiksalvet
dominiksalvet / mount-nfs.sh
Last active April 4, 2020 21:06
Mount NFS on Linux
#!/bin/sh
# $1 - url address of the NFS, $2 - directory to mount
sudo mount -t nfs "$1":/"$2" /mnt/"$2"
@dominiksalvet
dominiksalvet / count-syscalls.sh
Created April 1, 2020 19:08
Count system calls of a process on Linux
#!/bin/sh
# for each system call line, print its line number instead
strace -f -p "$1" 2>&1 | awk '{ print NR }' # PID should be in $1
@dominiksalvet
dominiksalvet / watch-syscalls.sh
Created April 1, 2020 19:06
Monitor system calls of a process on Linux
#!/bin/sh
# trace system calls of process and its forks
strace -f -p "$1" 2>&1 # PID should be in $1
@dominiksalvet
dominiksalvet / watch-interrupts.sh
Last active April 1, 2020 18:53
Monitor interrupts on Linux
#!/bin/sh
# show content of the file every second
watch -n 1 cat /proc/interrupts
@dominiksalvet
dominiksalvet / lastarg.sh
Last active November 13, 2019 14:05
Efficient POSIX way to get the last argument of a shell script.
#!/bin/sh
if [ "$#" -gt 0 ]; then # if any arguments
shift "$(($# - 1))" # shift to the last one
echo "$1" # print it
fi