User Tools

Site Tools


computers:tricksandtips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computers:tricksandtips [2024/11/18 16:09] – [Sort Text File By Second Column] davidcomputers:tricksandtips [2026/01/15 15:30] (current) – [Directory Sync with Unison] david
Line 194: Line 194:
 user    0m29.380s user    0m29.380s
 sys     33m49.240s sys     33m49.240s
 +</code>
 +
 +==== Using tar Compress ====
 +
 +=== Specific File Types ===
 +
 +<code>
 +find /path/to/directory -type f -name "*.extension" -print0 | tar -cvf archive_name.tar --null -T -
 +</code>
 +
 +
 +Add compression
 +
 +<code>
 +find /path/to/directory -type f -name "*.txt" -print0 | tar -cv --null -T - | pigz --best > archive_name.tar.gz
 </code> </code>
 ====== BIOS Upgrade ====== ====== BIOS Upgrade ======
Line 327: Line 342:
 ====== Networking ====== ====== Networking ======
  
 +===== Directory Sync with Unison =====
 +
 +  - Install on both machines<code>
 +sudo apt install unison
 +</code>
 +  - Set up Passwordless SSH <code>
 +ssh-keygen -t rsa -b 4096
 +ssh-copy-id user@remote_host
 +</code>
 +  - Command to sync directories <code>
 +unison /home/user/local_dir/ ssh://user@remote_host//home/user/remote_dir/
 +</code>
 +  - Creating a Sync Profile <code>
 +# Root directories to sync
 +root = /home/user/my_code
 +root = ssh://user@remote_host//home/user/my_code
 +
 +# Automatic settings
 +auto = true      # Skip prompts for non-conflicting changes
 +batch = true     # Do not ask any questions at all
 +times = true     # Preserve modification times
 +
 +# Paths to ignore (supports globs)
 +ignore = Name {.git,node_modules,*.tmp}
 +ignore = Path build
 +</code>
 ===== rsync limiting bandwidth ===== ===== rsync limiting bandwidth =====
  
Line 372: Line 413:
 </code> </code>
  
 +===== rsync Windoze Files =====
  
 +You need to expand the time stamp difference for Windoze to not re-copy everything;
 +
 +<code>
 +# always have vP for verbose and progress
 +rsync --modify-window=5 -vPrltD NORMAL THING
 +# NO LUCK for me like this, but adding this does only check file size
 +
 +rsync --size-only -vaP FROM/ TO/
 +
 +# try this
 +rsync --size-only -vPrltD # OR remove -t
 +
 +# doing this on windows backup drive:
 +rsync --size-only -vPrlD 
 +</code>
 ===== sshd Piping ===== ===== sshd Piping =====
  
Line 696: Line 753:
 # pipe to less if you want to page up / page down have a look (and reverse to so newest at top) q to exit less # pipe to less if you want to page up / page down have a look (and reverse to so newest at top) q to exit less
 find /pool/media/video/hd -xdev -type f -exec stat --format="%Y %n" {} \; | sort -k 1,1nr | less find /pool/media/video/hd -xdev -type f -exec stat --format="%Y %n" {} \; | sort -k 1,1nr | less
 +
 +# AI suggested this for nice file formatting 2025
 +# Alternative using printf for better formatting
 +find /path/to/search -type f -printf '%T+ %p\n' | sort -r | head -10
 +
 </code> </code>
 ==== Find and Copy Files Between Two Dates ==== ==== Find and Copy Files Between Two Dates ====
Line 989: Line 1051:
  
 After upgrading from 10.04 to 11.04, grub2 got broken.  Found the answer quickly here:  [[http://www.webupd8.org/2010/05/fix-symbol-grubputs-not-found-when.html]] After upgrading from 10.04 to 11.04, grub2 got broken.  Found the answer quickly here:  [[http://www.webupd8.org/2010/05/fix-symbol-grubputs-not-found-when.html]]
 +
 +==== Grub Boot Parameters ====
 +
 +  - mount your partition to /mnt (assuming /dev/sda5 is the drive) <code>
 +sudo mount /dev/sda5 /mnt
 +</code>
 +  - Then mount a few more directories that are needed <code>
 +sudo mount --bind /dev /mnt/dev
 +sudo mount --bind /sys /mnt/sys
 +sudo mount --bind /proc /mnt/proc
 +</code>
 +  - Also, if you have a separate Ubuntu boot partition (pretty uncommon these days, but it may be the case) <code>
 +sudo mount /dev/sdaX /mnt/boot
 +</code>
 +  - make your /root drive /mnt <code>
 +sudo chroot /mnt
 +</code>
 +  - make any changes to etc/default/grub <code>
 +sudo nano /etc/default/grub
 +</code>
 +  - run update grub (already chroot, when i tried sudo it gave me some lookup error) <code>
 +update-grub
 +</code>
 +  - exit
 +  - check that /etc/grub/grub.cfg is updated (recent file time)
 +  - reboot
 +  - profit
  
 ==== KDE ==== ==== KDE ====
computers/tricksandtips.1731946162.txt.gz · Last modified: by david