Skip to content
Emerson Knapp edited this page Apr 7, 2022 · 2 revisions

Random notes for dev tools

Git

Compare a specific version of a file

git diff origin/mainline:file.py file.py

Colcon

Run a specific C++ test

colcon test --ctest-args -R <TESTNAME>

Run a specific Python test

colcon test --pytest-args -s -k <REGEXP>

Workspace sync

OSX

fswatch -o ./ | xargs -n1 -I{} \
  rsync -avz --exclude-from 'exclude-list.txt' ./* remotehost:~/myworkspace/ --delete

Exclude-list.txt

package-lock.json
build/
build
node_modules/
coverage/
exclude-list.txt
sync.sh
*.swp
.tags
.tags1

Docker

Remove stopped containers

docker rm $(docker ps -a -q)

Remove dangling/untagged images

docker images -q --filter dangling=true | xargs docker rmi
 docker rmi $(docker images | grep "^<none>" | awk "{print $3}")

Ubuntu

So you messed up your encrypted disk... https://feeding.cloud.geek.nz/posts/recovering-from-unbootable-ubuntu-encrypted-lvm-root-partition/

Capslock repeat

xset r 66

Read only file system!!!

mount -o remount,rw /
apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends <your-package-here> | grep "^\w" | sort -u

See all files a package installed:

dpkg-query -L <package_name>

regrubbing

# need efi grub! not bios pc grub
apt install grub-efi-amd64

https://askubuntu.com/questions/53578/can-i-install-in-uefi-mode-with-the-alternate-installer/57380#57380

NMCLI

nmcli device wifi rescan
nmcli device wifi list
nmcli device wifi connect <SSID> password <password>

nmcli c mod <con_name> connection.autoconnect yes
nmcli c mod <con_name> connection.autoconnect-priority <X>

nmcli c add type wifi con-name <connect name> ifname wlp3s0 ssid <ssid>
nmcli con modify <connect name> wifi-sec.key-mgmt wpa-psk
nmcli con modify <connect name> wifi-sec.psk <password>
nmcli con up <connect name>

nmcli connection delete id <connection name>

Vim

:w !sudo tee %

BASH

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

VirtualBox

vboxmanage modifyhd /location-of-your-virtual-disk --resize size-in-MB

Clone this wiki locally