To open URLs like: ssh://user@hostname.com Check to see if ssh protocol handler is already set: xdg-mime query default x-scheme-handler/ssh Create desktop entry (.desktop file) for ssh handler: cat ~/.local/share/applications/ssh-handler.desktop [Desktop Entry] Name=SSH Handler GenericName=SSH Handler Comment=Open ssh URLs – ssh://user@hostname Version=1.0 Exec=bash -c ‘(URL=”%U” HOST=”\${URL:6}”; ssh \$HOST); bash’ Terminal=true Type=Application Icon=utilities-terminal MimeType=x-scheme-handler/ssh; Keywords=ssh;protocol EOF Set […]
Category Archives: Tools 101
Grep – Useful expressions
Grep file size from du -sh Format (10K , 10.1M , 1000.21G) Or Grep IP address Grep upper or lower character
Tutorial: Disk Drive: Loop back device
Tools: losetup, gdisk, mkfs.ext4 File as a filesystem / Filesystem in a file create a file dd if=/dev/zero of=virt_fs.img bs=1024 count=10240 bytes=1024 (1KB) count=10240 total = 1024*10240 = 10485760 Bytes (10MB) or dd if=/dev/zero of=virt_fs.img bs=1M count=10 or truncate -s 10M virt_fs.img Setup loop-back device find first available loop-back device sudo losetup -f create loop […]
Tools 101: cryptsetup
Create a LUKS (Linux Unified Key Setup) formated, encrypted device: cryptsetup –verbose –verify-passphrase luksFormat /dev/sdb1 Display encrypted device info: cryptsetup luksDump /dev/sdb1 Open (unlock) encrypted device cryptsetup open –type luks /dev/sdb1 crypt Close (lock) encrypted device cryptsetup close –type luks crypt Add pass-phrase from key_file, total of eight are allowed cryptsetup luksAddKey /dev/sdb1 /home/xyz/key_file Remove […]
Tools 101: dd
Fill a device with zeros dd if=/dev/zero of=/dev/sdb Fill a device with 1024*10240 bytes of zeros dd if=/dev/zero of=/dev/sdb count=10240 bs=1024 Create a random key file: dd if=/dev/urandom of=key_file bs=1024 count=4 iflag=fullblock