Posts

Showing posts from July, 2025

give ubuntu mac keystrokes

Add this to your .bashrc at least for one login, especially as root so it installs the packages # install dependencies sudo apt-get install -y dbus-x11 // required for below sudo apt install gnome-sushi // file preview with spacebar # disable capslock and insert setxkbmap -option caps:none // I hate capslock xmodmap -e "keycode 118 = NoSymbol"   # Insert key (usually keycode 118) disabled # enable command q, command h, command m and command-tab gsettings set org.gnome.desktop.wm.keybindings close "['<Control>q', '<Super>q']" gsettings set org.gnome.desktop.wm.keybindings minimize "['<Control>h', '<Super>h']" gsettings set org.gnome.desktop.wm.keybindings minimize "['<Control>h', '<Super>h', '<Control>m', '<Super>m']" gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>Tab', '<Control...

Suspicious behaviour: Script requesting root password on login to X11 on Ubuntu with Dropbox installed

Image
  Dropbox Executing Suspicious Root Script in /tmp After a recent system update, I began seeing a sudo prompt at login asking for permission to run a mysterious shell script from  /tmp . The prompt looked like this: Screenshot from 2025-07-23 06-05-39.png It referred to a temporary file,  /tmp/tmp8peqse64 , which no longer existed by the time I checked. I managed to capture the content of a similar script later: #!/bin/bash chown -h -R 1000 "/home/john/Dropbox" chmod -R u+rwX "/home/john/Dropbox" This script forcibly resets ownership and permissions on the Dropbox folder. It executes with root privileges and deletes itself after running — a classic signature of a transient payload. Journal Evidence I captured journal output showing the script was run immediately after Dropbox launched: IMG_3B4C8212-2B88-40BC-9C19-4E0E569DB0E1.jpeg Community Reports Searching online, I found other users reporting the same issue. For example,  this Ask Ubuntu thread  describes Dro...

script to create an EFI partition on a target bootdrive if none exists

After rsyncing your OS to the external drive, run this to create a boot partition. You MUST copy the OS first. #!/bin/bash # Ensure script is run as root if [ "$(id -u)" -ne 0 ]; then   echo "Please run this script as root (e.g. via sudo)."   exit 1 fi # Load USB device detection source /scripts/find_usb.sh || {   echo "Failed to load /scripts/find_usb.sh"   exit 1 } mountpoint="/media/$(logname)/$usb_uuid" efi_partition="${usb_disk}2" echo "This will FORMAT and INSTALL EFI SYSTEM PARTITION on $efi_partition" echo df -h | grep "$usb_disk" || echo "Warning: device not mounted yet." echo read -rp "Continue with formatting and EFI install on $efi_partition? (y/n): " confirm if [[ "$confirm" != "y" ]]; then   echo "Aborted."   exit 1 fi # Create EFI partition if it doesn't exist if ! lsblk "$efi_partition" &>/dev/null; then   echo "Creating EFI p...

script to backup entire drive and make it bootable

The script will: Auto-detect the USB device and UUID. Prompt you for confirmation after showing df -h . Run rsync , update the cloned /etc/fstab , bind-mount essential filesystems, Then chroot and auto-run grub-install and update-grub — all without further input. once you have run this script, run the efi installer script in another post. #!/bin/bash # Step 1: Detect USB disk usb_devs=() for dev in /sys/block/sd*; do     devname=$(basename "$dev")     [[ "$devname" =~ [0-9]$ ]] && continue     if ls -l /dev/disk/by-path/ | grep -w "$devname" | grep -q usb; then         usb_devs+=("/dev/$devname")     fi done # Step 2: Verify only one USB drive is connected if [ "${#usb_devs[@]}" -ne 1 ]; then     echo "Error: Found ${#usb_devs[@]} USB drives. Please ensure only one external USB drive is connected."     exit 1 fi usb_device="${usb_devs[0]}" usb_partition="${usb_device}1" usb_uuid=$(blki...

script to list drives by hardware name, type and mountpoint

 #!/bin/bash echo "Brand/Model - Device - Mountpoint - Connection" echo "-----------------------------------------------" for dev in /sys/block/sd*; do     devname=$(basename "$dev")     [[ "$devname" =~ [0-9]$ ]] && continue     model=$(cat "$dev/device/model" 2>/dev/null)     vendor=$(cat "$dev/device/vendor" 2>/dev/null)     devpath="/dev/$devname"     mountpoint=$(lsblk -no MOUNTPOINT "$devpath" 2>/dev/null | grep -v '^$' | head -n1)     # check if any symlink to this device exists in by-path with 'usb' in path     if ls -l /dev/disk/by-path/ | grep -w "$devname" | grep -q usb; then         connection="USB"     else         connection="ATA"     fi     echo "$vendor $model - $devpath - ${mountpoint:-not mounted} - $connection" done