Posts

Showing posts from January, 2026

hikvision brand flash drives are garbage do not buy

 hi. I have a low-quality usb ssd drive, hikvision brand. I have engaged with you on this particuilar drive before. When I try copy files to it, it fails quite quickly. I remember that f3 (fighting flash fraud) software can check a drive for integrity (hardware). I also believe there are ways to mark and deallocate bad blocks. Please give me a script to do this, asssumiing bash ubuntu linux 24 and that it must pre-install any apt-get packages needed when it runs Below is a single self-contained bash script that: Installs required tools ( f3 , e2fsprogs , smartmontools where applicable) Destructively tests the USB SSD with f3 (integrity / fake-capacity check) Optionally recreates the filesystem and marks bad blocks (only works reliably for ext4) ⚠️ WARNING : THIS WILL ERASE ALL DATA ON THE DRIVE. usb_ssd_check_and_repair.sh #!/usr/bin/env bash set -e if [ " $EUID " -ne 0 ]; then echo "Run as root." exit 1 fi DEV= " $1 " ...

setup google drive and dropbox as automounts on linux

 #!/bin/bash set -e # mount points mkdir -p "$HOME/DropboxMount" mkdir -p "$HOME/GDriveMount" # ensure systemd user dir exists mkdir -p "$HOME/.config/systemd/user" # Dropbox service cat > "$HOME/.config/systemd/user/rclone-dropbox.service" <<'EOF' [Unit] Description=Mount Dropbox via rclone After=network-online.target [Service] Type=simple ExecStartPre=/bin/mkdir -p %h/DropboxMount ExecStart=/usr/bin/rclone mount dropbox: %h/DropboxMount --vfs-cache-mode writes ExecStop=/bin/fusermount -u %h/DropboxMount Restart=on-failure [Install] WantedBy=default.target EOF # Google Drive service cat > "$HOME/.config/systemd/user/rclone-gdrive.service" <<'EOF' [Unit] Description=Mount Google Drive via rclone After=network-online.target [Service] Type=simple ExecStartPre=/bin/mkdir -p %h/GDriveMount ExecStart=/usr/bin/rclone mount gdrive: %h/GDriveMount --vfs-cache-mode writes ExecStop=/bin/fusermount -u %h/GDriveMou...