- Helpful commands
dpkg --get-selections | grep hold
Or cleaner:
apt-mark showhold
helm ls -A
This shows all releases in the monitoring
namespace, even those releases normally not shown, like those that have the pending-upgrade
status:
helm ls -n monitoring --all
Print the manifests currently applied with the loki
release in the monitoring
namespace:
helm get -n monitoring manifest loki
convert -resize '600' original.jpeg resized.jpeg
convert -resize 'x1024' original.jpeg resized.jpeg
convert original.jpeg -define jpeg:extent=150kb output.jpeg
git rev-parse --short HEAD
# or
git submodule status repo-name-here | grep -Eo '[0-9a-f]{40}' | cut -c 1-7
jq '.engines.node = "12.20.0"' package.json
export NODE_VERSION=12.20.0
jq '.engines.node = env.NODE_VERSION' package.json
-a
show all files
-h
show hidden files
-l
list
-r
reverse order
-S
sort by size
-t
sort by modified date, most recent first
lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
mysqldump -u dbuser -p dbname > descriptive-name-dbname-db-2017.07.19.sql
mysql -u dbuser -p dbname < descriptive-name-dbname-db-2017.07.19.sql
mysql_config_editor set --login-path=backup --host=localhost --user=backup --password
Now you can run mysql
or mysqldump
like this:
mysql --login-path=backup
You can also list all of the saved login paths saved for the current logged-in user:
mysql_config_editor print --all
sudo nix-env --profile /nix/var/nix/profiles/system --delete-generations 7d
nix-store --gc
Scan the subnet without a complete port scan, then pipe it into grep to search for a partial name.
nmap -sn 192.168.10.0/24 | grep -i c551
qemu-system-x86_64 -cpu host -enable-kvm -m 4096 -smp 4 -drive file=~/Downloads/windows-server.vhd
Then Ctrl + Alt + G to release QEMU's hold on your mouse.
rsync -avP source destination
-a
archive mode (recursive, preserves permissions)
-v
verbose
-P
shows progress and keeps partially transferred files
--bwlimit=
bandwidth limit, in kBps
ssh-keygen -t ed25519
ssh -D 12345 -p 4022 user@host.domain.com
sshfs -o allow_other david@FQDNhere:/source/path /mnt/localpath
Add this to your /etc/fstab
:
david@FQDNhere:/source/path /mnt/localpath fuse.sshfs defaults,_netdev 0 0
tar -cvzf the-file.tar.gz /var/www/folder-to-compress
cd /var/www/folder-to-extract-to
tar -xvzf the-file.tar.gz
wp core download --path=/var/www/blog.company.com
cd /var/www/blog.company.com
wp config create --dbname=blogdb --dbuser=blog --dbpass="royalty translation visit end"
# Create user in the database if necessary before continuing
wp db create
wp core install --url=blog.company.com --title="Company Blog" --admin_user=dbirks --admin_password="blue engineer passage nor" --admin_email=dbirks@company.com
zpool import -d /dev/disk/by-id/ tank