computers:tricksandtips
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| computers:tricksandtips [2023/10/19 10:04] – [Working] david | computers:tricksandtips [2026/01/15 15:30] (current) – [Directory Sync with Unison] david | ||
|---|---|---|---|
| Line 194: | Line 194: | ||
| user 0m29.380s | user 0m29.380s | ||
| sys | sys | ||
| + | </ | ||
| + | |||
| + | ==== Using tar Compress ==== | ||
| + | |||
| + | === Specific File Types === | ||
| + | |||
| + | < | ||
| + | find / | ||
| + | </ | ||
| + | |||
| + | |||
| + | Add compression | ||
| + | |||
| + | < | ||
| + | find / | ||
| </ | </ | ||
| ====== BIOS Upgrade ====== | ====== BIOS Upgrade ====== | ||
| Line 327: | Line 342: | ||
| ====== Networking ====== | ====== Networking ====== | ||
| + | ===== Directory Sync with Unison ===== | ||
| + | |||
| + | - Install on both machines< | ||
| + | sudo apt install unison | ||
| + | </ | ||
| + | - Set up Passwordless SSH < | ||
| + | ssh-keygen -t rsa -b 4096 | ||
| + | ssh-copy-id user@remote_host | ||
| + | </ | ||
| + | - Command to sync directories < | ||
| + | unison / | ||
| + | </ | ||
| + | - Creating a Sync Profile < | ||
| + | # Root directories to sync | ||
| + | root = / | ||
| + | root = ssh:// | ||
| + | |||
| + | # 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, | ||
| + | ignore = Path build | ||
| + | </ | ||
| ===== rsync limiting bandwidth ===== | ===== rsync limiting bandwidth ===== | ||
| Line 367: | Line 408: | ||
| </ | </ | ||
| + | copy FROM a server back to yourself | ||
| + | < | ||
| + | bash-3.2$ ssh username@server "tar czf - --strip-components=PATHDEPTH / | ||
| + | </ | ||
| + | |||
| + | ===== rsync Windoze Files ===== | ||
| + | |||
| + | You need to expand the time stamp difference for Windoze to not re-copy everything; | ||
| + | |||
| + | < | ||
| + | # 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 | ||
| + | </ | ||
| ===== sshd Piping ===== | ===== sshd Piping ===== | ||
| Line 381: | Line 444: | ||
| ==== Working ==== | ==== Working ==== | ||
| + | |||
| + | NOTE: Verified today this works from South Africa between my servers. | ||
| On the machine you want to get connected to: (-N to not get a prompt, just create the tunnel) | On the machine you want to get connected to: (-N to not get a prompt, just create the tunnel) | ||
| Line 688: | 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 / | find / | ||
| + | |||
| + | # AI suggested this for nice file formatting 2025 | ||
| + | # Alternative using printf for better formatting | ||
| + | find / | ||
| + | |||
| </ | </ | ||
| + | ==== Find and Copy Files Between Two Dates ==== | ||
| + | |||
| + | Use **newermt** switch to **find** and copy files that are human readable times / dates from one place to another. | ||
| + | |||
| + | < | ||
| + | find / | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| ==== Sort Text File By Second Column ==== | ==== Sort Text File By Second Column ==== | ||
| Line 971: | Line 1051: | ||
| After upgrading from 10.04 to 11.04, grub2 got broken. | After upgrading from 10.04 to 11.04, grub2 got broken. | ||
| + | |||
| + | ==== Grub Boot Parameters ==== | ||
| + | |||
| + | - mount your partition to /mnt (assuming /dev/sda5 is the drive) < | ||
| + | sudo mount /dev/sda5 /mnt | ||
| + | </ | ||
| + | - Then mount a few more directories that are needed < | ||
| + | sudo mount --bind /dev /mnt/dev | ||
| + | sudo mount --bind /sys /mnt/sys | ||
| + | sudo mount --bind /proc /mnt/proc | ||
| + | </ | ||
| + | - Also, if you have a separate Ubuntu boot partition (pretty uncommon these days, but it may be the case) < | ||
| + | sudo mount /dev/sdaX /mnt/boot | ||
| + | </ | ||
| + | - make your /root drive /mnt < | ||
| + | sudo chroot /mnt | ||
| + | </ | ||
| + | - make any changes to etc/ | ||
| + | sudo nano / | ||
| + | </ | ||
| + | - run update grub (already chroot, when i tried sudo it gave me some lookup error) < | ||
| + | update-grub | ||
| + | </ | ||
| + | - exit | ||
| + | - check that / | ||
| + | - reboot | ||
| + | - profit | ||
| ==== KDE ==== | ==== KDE ==== | ||
| Line 1102: | Line 1209: | ||
| * This one converts video to the target format (mkv here) < | * This one converts video to the target format (mkv here) < | ||
| youtube-dl -f mkv | youtube-dl -f mkv | ||
| + | </ | ||
| + | |||
| + | ====== MacOs ====== | ||
| + | |||
| + | ===== Scripting ===== | ||
| + | |||
| + | ==== bash ==== | ||
| + | |||
| + | === Files in Order === | ||
| + | |||
| + | Sometimes I have noticed files do not happen in order when doing command line things. | ||
| + | |||
| + | < | ||
| + | ls -v j080_202405* | sort | xargs cat > j080_overnight.jps | ||
| </ | </ | ||
computers/tricksandtips.1697709866.txt.gz · Last modified: by david
