Skip to content

Instantly share code, notes, and snippets.

@longyuxi
longyuxi / README.md
Last active May 16, 2024 18:58
Backing up with rclone in individually complete tar files

Description

tar full directories and back up with rclone.

  • This script improves the speed to regular rclone for backing up a directory, as a usual directory can contain many small files (talking about you, node_modules).
  • To ensure that each individual tar archive can be extracted, without the need to download all of the archives, this script incrementally adds directories to a tar archive until a given size is reached. A txt file is given for each tar file about the folders in that tar file.
  • Finally, the created tar files are uploaded to a given directory. The user can specify an upper bound on the number of version that are backed up. Each version is uploaded with its UNIX timestamp, and the oldest versions on the remote are deleted.
@longyuxi
longyuxi / pymol_view_adjuster.py
Last active September 23, 2023 20:37
Keybinds for adjusting PyMOL camera's front and back clipping plane
# Purpose: Adjusts the front and back clipping planes of the camera in pymol
# To use: Drag and drop this script into pymol, then use (CTRL-R, CTRL-F) and (CTRL-U, CTRL-J) to adjust the front and back clipping planes, respectively
from pymol import cmd
def adjust_front_view(amount=1):
view = list(cmd.get_view())
view[15] += amount
cmd.set_view(view)
print(f'New front plane distance: {view[15]}')