Comment on page
With this setup, you can open/view any
.pcdpoint cloud file by just double clicking the mouse.
- 1.Prepare a script that takes filename as the first argument.
- for example, running command
pcd_viewer.py example.pcdcan open the pcd file.
- remember to add executable permission
sudo chmod +x pcd_viewer.py.
- 2.Create a MIME type for
- open the file
/etc/mime.typesand add a line
- such that files with extension
.pcdcan be recognized as the MIME type
- 3.Create a
pcd-viewer.desktopfile to link/associate the program to the designated MIME type.
- set the execution path to the prepared python script, and add
%uto help pass the argument
- add a line
MimeType=application/x-pcdto declare that this app can handle this MIME type
- place this file in
/usr/share/applicationsif you plan to make it work for all users
- place this file in
~/.local/share/applicationsfor only the current user
- with this file set properly, you can see it in the "Open with" menu after right click (please verify this before moving forward; it would not show up if
%uis not added or the path is not valid)
- 4.Set this application as the default program for
- option one: right click an
.pcdfile and select PCD Viewer; it will remember the last program as the default one to open it in the future.
- option two: open the file
/usr/share/applications/defaults.listand add a line
application/x-pcd=pcd-viewer.desktop; this will force it to use PCD Viewer at all time.
- note: creating a
~/.local/share/applicationswould not work.
- To make it work immediately you can run
sudo update-desktop-databaseafter the changes.
# file: pcd_viewer.py
import open3d as o3d
if __name__ == "__main__":
if 'SVGA_VGPU10' in os.environ:
pcd = o3d.io.read_point_cloud(sys.argv)
# file: open3d_pcdviewer.desktop
Icon=python3.8 # full path is /usr/share/pixmaps/python3.8.xpm
The same approach can be applied to applications installed from Snap Store.
snap listto see all applications installed from Snap Store.
echo $XDG_DATA_DIRSto check the env path for all installed applications.
.desktopfiles are placed at
Just two steps needed:
- 1.Register .pcd as the MIME type if not done yet. (Similar to the Step 2 to set up a python script as the default program.)
- 2.Place the following .desktop file under
# file: cloudcompare_pcdviewer.desktop
sudoprivilege is required, we will need three files; otherwise two files. The usage is the following.
- 1.Prepare the script you plan to run as the system starts, named
- 2.If root privilege is needed, prepare a file named
root.shto run the
- 3.Prepare a
launch.desktopfile to run
root.shscript. Place this file in
- 4.Reboot the computer and you will see the program running automatically as the system starts.
# file: launch.sh
roslaunch cruiser cruiser_manifold.launch
# file: root.sh
echo "password" | sudo -S /home/ubuntu/Desktop/launch.sh
# file: launch.desktop
- When working on GUI desktop (with monitor, mouse and keyboard), if you plug in a USB flash drive or SD card, it will get mounted automatically and file manager will prompt out. The mounting point is at
- In remote login sessions (where you only have ssh terminals), if you plug in a USB flash drive, nothing happens. You have to mount it manually by the awkward
sudo. Furthermore, later you have to use
sudofor all write operations in this directory, because the owner is root rather than the current user. The solution is to mount it by
udiskscommand instead. (Actually in GUI desktop, nautilus file manager does this for you.)
udisks --mount /dev/sdb1
- For SanDisk SSD, there is an official software: SanDisk SSD Dashboard
- This software installer requires network connection to install. (~100MB)
- "Secure Erase is different from Sanitize because it only deletes the mapping table but will not erase all blocks that have been written to. Sanitize will delete the mapping table and will erase all blocks that have been written to. Therefore, Secure Erase is faster to complete than Sanitize."
- There may not be a secure erase option available for some models of SSD. (e.g., not available for my Extreme PRO 4TB)
- Secure Erase under Windows
- For HDD
- DBAN: Short for Darik’s Boot and Nuke, DBAN has been around for years and is a well-known and trusted drive wipe utility for HDDs. It does multiple pass rewrites (binary ones and zeros) on the disk. You’ll need to download it to a USB drive and run it from there.
- Disk Wipe: Disk Wipe is another free utility that does multiple rewrites of binary data. You can choose from a number of different methods for overwriting your disk. Disk Wipe is also portable, so you don’t need to install it to use it.
- Eraser: Eraser is also free to use. It gives you the most control over how you erase your disk. Like Disk Wipe, you can choose from different methods that include varying numbers of rewrites, or you can define your own.
- For SSD
- Parted Magic: Parted Magic is the most regularly recommended third-party erase tool for SSDs, but it does cost $13. It’s a bootable tool like some of the HDD erase tools—you have to download it to a USB drive and run it from there. (Note: there might be some executable available for download at 3rd party websites.)
- ATA Secure Erase: ATA Secure Erase is a command that basically shocks your SSD. It uses a voltage spike to flush stored electrons. While this sounds damaging (and it does cause some wear), it’s perfectly safe. It doesn’t overwrite the data like other secure erase tools, so there’s actually less damage done to the SSD.
- Secure Erase under Linux
- Option One: Using Parted Magic
- Download a ISO image from some 3rd party software website for free.
- Create a new VM in VMware using this image.
- Forward SSD to this Parted Magic VM and perform secure erase.
- Option Two: Command-line Simple Secure Erase
sudo hdparm -I /dev/sdXDisplays all information about a drive.
sudo hdparm ––security-erase PASS /dev/sdXSimple command to secure erase a drive with no hassle.
sudo hdparm ––user-master u ––security-set-pass PASS /dev/sdXSets a password.
sudo hdparm ––user-master u ––security-erase PASS /dev/sdXSecurely erases the SSD.
Normally, it is safe to increase your swap size to match the RAM size. For example, if you RAM size is 16GB, you can increase the swap size to be 16GB as well.
# Turn swap off
# This moves stuff in swap to the main memory and might take several minutes
sudo swapoff -a
# Create an empty swapfile
# Note that "1G" is basically just the unit and count is an integer.
# Together, they define the size. In this case 16GB.
sudo dd if=/dev/zero of=/swapfile bs=1G count=16
# Set the correct permissions
sudo chmod 0600 /swapfile
sudo mkswap /swapfile # Set up a Linux swap area
sudo swapon /swapfile # Turn the swap on